2019-11-16 / syui

mastodon

Dolphinというシングルユーザー用のActivityPub serverを立ててみた

activitypubというprotocolがあります。わかりやすく言うと、分散snsのprotocolです。このprotocolを使ったserverで有名なのはmastodonです。

今回、misskeyというmastodonに似たプロジェクトがあるのですが、その姉妹プロジェクトであるdolphinがシングルユーザー、つまり、お一人様インスタンスと呼ばれるサーバーに特化しているようなので、herokuで立ててみました。

以前、misskeyを触ったこともあり、ハマりどころは特になし。

https://github.com/syuilo/dolphin

$ 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
# 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'
  "engines": {
    "node": "11.7.0",
    "npm": "6.13.0"
  }
$ 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://dolphin.syui.cf/@syui

上記アカウントは、heroku上で負荷テスト中なので、多分、そのうち消えます。