summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-05-23 23:39:24 -0400
committerGalen Guyer <galen@galenguyer.com>2022-05-23 23:39:24 -0400
commitc76d607abc6487be8b7adc0e97ed18b6c0b46c13 (patch)
tree652eaf6e3613168a3db9cca2407a77d80a6da1d5 /pkg
parent35baab0ec5aaadcc37e3d0cd8cd9ec98f1cf5df9 (diff)
add debian packaging
Diffstat (limited to 'pkg')
-rw-r--r--pkg/DEBIAN/control9
-rwxr-xr-xpkg/DEBIAN/postinst6
-rw-r--r--pkg/usr/lib/systemd/system/fdns-api.service14
3 files changed, 29 insertions, 0 deletions
diff --git a/pkg/DEBIAN/control b/pkg/DEBIAN/control
new file mode 100644
index 0000000..3cb16c0
--- /dev/null
+++ b/pkg/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: fdns-api
+Version: {{ VERSION }}
+Architecture: amd64
+Essential: no
+Section: web
+Priority: optional
+Maintainer: Galen Guyer <galen@galenguyer.com>
+Installed-Size: 96
+Description: FDNS API binary
diff --git a/pkg/DEBIAN/postinst b/pkg/DEBIAN/postinst
new file mode 100755
index 0000000..226526e
--- /dev/null
+++ b/pkg/DEBIAN/postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ ! -f /etc/fdns.env ]; then
+ echo "DATABASE_URL=" >> /etc/fdns.env
+ echo "JWT_SECRET=" >> /etc/fdns.env
+fi
diff --git a/pkg/usr/lib/systemd/system/fdns-api.service b/pkg/usr/lib/systemd/system/fdns-api.service
new file mode 100644
index 0000000..502d5f8
--- /dev/null
+++ b/pkg/usr/lib/systemd/system/fdns-api.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=FDNS API
+After=network.target
+After=systemd-user-sessions.service
+After=network-online.target
+
+[Service]
+Type=simple
+Restart=always
+EnvironmentFile=/etc/fdns.env
+ExecStart=/usr/bin/fdns-api
+
+[Install]
+WantedBy=multi-user.target