+++ date = "2019-11-16" tags = ["mastodon"] title = "Dolphinというシングルユーザー用のActivityPub serverを立ててみた" slug = "dolphin" +++ activitypubというprotocolがあります。わかりやすく言うと、分散snsのprotocolです。このprotocolを使ったserverで有名なのはmastodonです。 今回、misskeyというmastodonに似たプロジェクトがあるのですが、その姉妹プロジェクトであるdolphinがシングルユーザー、つまり、お一人様インスタンスと呼ばれるサーバーに特化しているようなので、herokuで立ててみました。 以前、misskeyを触ったこともあり、ハマりどころは特になし。 https://github.com/syuilo/dolphin ```sh $ git clone -b master git://github.com/syuilo/dolphin.git $ cd dolphin $ cp .config/example.yml .config/default.yml $ npm i $ heroku create $APP_NAME $ ls -a ./.git $ heroku git:remote -a $APP_NAME $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs $ heroku addons:create heroku-postgresql:hobby-dev --version=10 $ heroku addons:create heroku-redis:hobby-dev $ heroku config $ vim .config/default.yml ``` ```yml:.config/default.yml # postgresql://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME} # redis://h:${REDIS_PASS}@${REDIS_HOST}:${REDIS_PORT} disableCache: true drive: storage: 'fs' disableHsts: true clusterLimit: 1 id: 'aid' ``` ```json:package.json "engines": { "node": "11.7.0", "npm": "6.13.0" } ``` ```sh $ vim Procfile web: NODE_ENV=production npm run init && npm start $ cat ~/.gitignore $ git add . $ git commit -m "first heroku" $ git push -u heroku master $ heroku logs # update $ git pull $ git push heroku master $ heroku run npm run migrate ``` ![](https://raw.githubusercontent.com/syui/img/master/old/misskey_dolphin_heroku_01.png) https://dolphin.syui.cf/@syui 上記アカウントは、heroku上で負荷テスト中なので、多分、そのうち消えます。