Skip to content

Setup: Adding to systemd

Brian Graham edited this page Aug 15, 2021 · 2 revisions

If you wish to launch the service via systemd, the following config has been proposed by RaNd250

  1. Install the project at /opt/one-time-secret/
  2. Create /lib/systemd/system/ots.service
  3. Open your editor to configure the new ots.service file
$EDITOR /lib/systemd/system/ots.service
[Unit]
Description=OneTimeSecret Service
After=network.target

[Service]
Environment=PUBLISH_SECRET_URI='/'
Environment=KEY_NAME_RANDOM_BYTES=32
Environment=PORT=80
Environment=DOMAIN=ots.example.com
Environment=HTTP_TIMEOUT_MS=5000
Environment=MAX_UPLOAD_KB=128

Type=simple
ExecStart=/usr/bin/node /opt/one-time-secret/dist/bin/cli.js web:start
Restart=on-failure

[Install]
WantedBy=multi-user.target

Finally, restart systemd and start one-time-secret

systemctl daemon-reload
systemctl start ots
Clone this wiki locally