Skip to content

Instantly share code, notes, and snippets.

@noellabo
Last active October 28, 2018 15:43
Show Gist options
  • Save noellabo/54b31685893862b49d80a8d340fba1da to your computer and use it in GitHub Desktop.
Save noellabo/54b31685893862b49d80a8d340fba1da to your computer and use it in GitHub Desktop.
pub-relayを立ててみたい方へ ref: https://qiita.com/noellabo/items/5510f85648b5fa6506bb
apt install dirmngr
apt-key adv --keyserver keys.gnupg.net --recv-keys 09617FD37CC06B54
echo "deb http://dist.crystal-lang.org/apt crystal main" > /etc/apt/sources.list.d/crystal.list
apt update
apt install crystal libgmp-dev libz-dev libssl1.0-dev
apt install redis-server
adduser pub-relay
sudo su - pub-relay
git clone https://source.joinmastodon.org/mastodon/pub-relay.git
cd pub-relay
git checkout a8891a43d7ca95fb7bdcae348b39e20c6acce74b
shards update
shards build --release
openssl genrsa 2024 > ~/.ssh/actor.pem
chmod 600 ~/.ssh/actor.pem
systemctl enable pub-relay-server
systemctl enable pub-relay-worker
[Unit]
Description=pub-relay-server
After=network.target
[Service]
Type=simple
User=pub-relay
WorkingDirectory=/home/pub-relay/pub-relay
Environment="RELAY_DOMAIN=relay.example.com"
Environment="RELAY_PKEY_PATH=/home/pub-relay/.ssh/actor.pem"
ExecStart=/home/pub-relay/pub-relay/bin/server
ExecReload=/bin/kill -SIGUSR1 $MAINPID
TimeoutSec=15
Restart=always
[Install]
WantedBy=multi-user.target
[Unit]
Description=pub-relay-worker
After=network.target
[Service]
Type=simple
User=pub-relay
WorkingDirectory=/home/pub-relay/pub-relay
Environment="RELAY_DOMAIN=relay.example.com"
Environment="RELAY_PKEY_PATH=/home/pub-relay/.ssh/actor.pem"
ExecStart=/home/pub-relay/pub-relay/bin/worker
TimeoutSec=15
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment