git » gofer » commit ca86166

Add systemd configuration examples

author Alberto Bertogli
2020-04-25 12:42:57 UTC
committer Alberto Bertogli
2020-04-25 12:42:57 UTC
parent 515a4960c0e03daf699c2928180854ffec91ebbb

Add systemd configuration examples

etc/systemd/gofer-http.socket +5 -0
etc/systemd/gofer-https.socket +5 -0
etc/systemd/gofer.service +19 -0

diff --git a/etc/systemd/gofer-http.socket b/etc/systemd/gofer-http.socket
new file mode 100644
index 0000000..42c3009
--- /dev/null
+++ b/etc/systemd/gofer-http.socket
@@ -0,0 +1,5 @@
+[Socket]
+ListenStream=80
+FileDescriptorName=http
+Service=gofer.service
+
diff --git a/etc/systemd/gofer-https.socket b/etc/systemd/gofer-https.socket
new file mode 100644
index 0000000..7248a1e
--- /dev/null
+++ b/etc/systemd/gofer-https.socket
@@ -0,0 +1,5 @@
+[Socket]
+ListenStream=443
+FileDescriptorName=https
+Service=gofer.service
+
diff --git a/etc/systemd/gofer.service b/etc/systemd/gofer.service
new file mode 100644
index 0000000..f707de7
--- /dev/null
+++ b/etc/systemd/gofer.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=gofer proxy
+Requires=gofer-http.socket gofer-https.socket
+
+[Service]
+ExecStart=/usr/local/bin/gofer -configfile=/etc/gofer.conf
+
+Type=simple
+Restart=always
+
+User=gofer
+Group=gofer
+
+# Simple security measures just in case.
+ProtectSystem=full
+
+[Install]
+WantedBy=multi-user.target
+