Add debian package configuration for deployment

This commit is contained in:
notplants
2021-05-19 14:14:26 +02:00
parent 5b7112645b
commit 88cc73eb2c
9 changed files with 60 additions and 12 deletions

12
debian/bindctl vendored Normal file
View File

@ -0,0 +1,12 @@
#
# Allow peach-dyndns to reload bind as sudo
#
# User alias for bind-ctl which can reload bind
User_Alias BIND_CTRL = peach-dyndns
# Command alias for reboot and shutdown
Cmnd_Alias RELOADBIND = /usr/bin/reloadbind
# Allow BIND_CTRL users to execute RELOADBIND command without password
BIND_CTRL ALL=(ALL) NOPASSWD: RELOADBIND

View File

@ -6,7 +6,9 @@ Type=simple
User=peach-dyndns
Group=bind
Environment="RUST_LOG=info"
ExecStart=/usr/bin/peach-dyndns-server
Environment="ROCKET_PORT=3002"
WorkingDirectory=/srv/peachcloud/peach-dyndns-server/prod-peach-dyndns
ExecStart=/usr/bin/peach-dyndns-server -vv
Restart=always
[Install]

15
debian/postinst vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
# create user which peach-dyndns-server runs as
adduser --quiet --system peach-dyndns
# add user to bind group
usermod -a -G bind peach-dyndns
# set permissions
chown peach-dyndns /usr/bin/peach-dyndns-server
chown peach-dyndns /usr/bin/reloadbind
# cargo deb automatically replaces this token below, see https://github.com/mmstick/cargo-deb/blob/master/systemd.md
#DEBHELPER#

2
debian/reloadbind vendored Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
/bin/systemctl reload bind9