Add debian package configuration for deployment
This commit is contained in:
12
debian/bindctl
vendored
Normal file
12
debian/bindctl
vendored
Normal 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
|
4
debian/peach-dyndns-server.service
vendored
4
debian/peach-dyndns-server.service
vendored
@ -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
15
debian/postinst
vendored
Normal 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
2
debian/reloadbind
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
/bin/systemctl reload bind9
|
Reference in New Issue
Block a user