add config for systemd

This commit is contained in:
Jacob Lifshay 2024-04-09 22:01:48 -07:00
parent a5e75b3dca
commit 14f1c5addc
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c
3 changed files with 26 additions and 1 deletions

View file

@ -1,4 +1,4 @@
sqlite_db = "subscribe-list.db" sqlite_db = "/var/local/lib/subscribe-list.db"
server_base_url = "https://my-site/" server_base_url = "https://my-site/"
[oidc.google] [oidc.google]

14
subscribe-list.service Normal file
View file

@ -0,0 +1,14 @@
[Unit]
Description=web server for managing subscriptions
Requires=subscribe-list.socket
[Service]
Environment=RUST_LOG=info
Type=exec
ExecStart=!sh -c 'mkdir -p /var/local/lib; umask 007; touch /var/local/lib/subscribe-list.db; chown www-data:www-data /var/local/lib/subscribe-list.db'
ExecStart=/usr/local/bin/subscribe-list --config /etc/subscribe-list/config.toml serve --listen-fd
User=www-data
Group=www-data
[Install]
Also=subscribe-list.socket

11
subscribe-list.socket Normal file
View file

@ -0,0 +1,11 @@
[Unit]
Description=subscribe-list socket
[Socket]
ListenStream=/run/subscribe-list.socket
SocketMode=0660
SocketUser=www-data
SocketGroup=www-data
[Install]
WantedBy=sockets.target