Last active
October 28, 2018 15:43
-
-
Save noellabo/54b31685893862b49d80a8d340fba1da to your computer and use it in GitHub Desktop.
pub-relayを立ててみたい方へ ref: https://qiita.com/noellabo/items/5510f85648b5fa6506bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl genrsa 2024 > ~/.ssh/actor.pem | |
chmod 600 ~/.ssh/actor.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl enable pub-relay-server | |
systemctl enable pub-relay-worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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