3 Running under systemd
John Jarvis edited this page 3 weeks ago

Running under systemd

Note: yarn.social is actively developed. Please see the latest documentation to take advantage of all the latest command line switches and configuration file parameters. The following example will likely be dated (but working!).

sudo vi /lib/systemd/system/yarnd.service

[Unit]
Description=🧶Yarn.social is an open-source, self-hosted, de-centralised micro-blogging platform
Documentation=https://git.mills.io/yarnsocial/yarn
After=network.target

[Service]
Type=simple
Restart=on-failure
RestartSec=10
StartLimitBurst=5
StartLimitInterval=100
User=yarn.social
Group=yarn.social
ExecStart=/usr/local/bin/yarnd -OR
EnvironmentFile=/home/yarn.social/yarnd.config

[Install]
WantedBy=multi-user.target

Note: running under a separate account is not required. Also, the environment file could be hosted elsewhere (e.g., /etc).

:wq

sudo systemctl enable yarnd

sudo cat /home/yarn.social/yarnd.config

ADMIN_EMAIL=dog@heaven.above
ADMIN_USER=dog
API_SIGNING_KEY=not-for-m0rtal-eyes
BASE_URL=https://yarn.heaven.above
COOKIE_SECRET=also-not-for-m0rtal-eyes
DATA=/home/yarn.social/data
DESCRIPTION="🧶Yarn.social is a self-hosted, Twitter™-esque, de-centralised micro-blogging platform. No ads, no tracking; your content, your data!"
MAGICLINK_SECRET=definitely-not-for-m0rtal-eyes
SMTP_FROM=gabriel@heaven.above
SMTP_HOST=mail.heaven.above
SMTP_PASS=aaand-fo-ahem-not-for-m0rtal-eyes-either
SMTP_USER=gabriel@heaven.above
STORE=bitcask:///home/yarn.social/yarn.db

sudo systemctl restart yarnd