about summary refs log tree commit homepage
path: root/examples
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-08-23 07:49:18 +0000
committerEric Wong <e@yhbt.net>2020-08-25 02:47:21 +0000
commit14451d6ce4a27e9fd5f16fa655f6745ca8c87920 (patch)
treee29b465d9441ad008382b3f9c7643a37389293ee /examples
parent68dc097dc9fed5affe5ffadc6decc3a4b11392a8 (diff)
downloadpublic-inbox-14451d6ce4a27e9fd5f16fa655f6745ca8c87920.tar.gz
We've got examples for all the other daemons, too!
Diffstat (limited to 'examples')
-rw-r--r--examples/public-inbox-imap-onion.socket12
-rw-r--r--examples/public-inbox-imapd.socket12
-rw-r--r--examples/public-inbox-imapd@.service43
-rw-r--r--examples/public-inbox-imaps.socket12
4 files changed, 79 insertions, 0 deletions
diff --git a/examples/public-inbox-imap-onion.socket b/examples/public-inbox-imap-onion.socket
new file mode 100644
index 00000000..76b4e7ca
--- /dev/null
+++ b/examples/public-inbox-imap-onion.socket
@@ -0,0 +1,12 @@
+# ==> /etc/systemd/system/public-inbox-imap-onion.socket <==
+# This unit is for the corresponding line in torrc(5):
+# HiddenServicePort 143 unix:/run/imapd.onion.sock
+[Unit]
+Description = public-inbox-imap .onion socket
+
+[Socket]
+ListenStream = /run/imapd.onion.sock
+Service = public-inbox-imapd@1.service
+
+[Install]
+WantedBy = sockets.target
diff --git a/examples/public-inbox-imapd.socket b/examples/public-inbox-imapd.socket
new file mode 100644
index 00000000..fcd924fd
--- /dev/null
+++ b/examples/public-inbox-imapd.socket
@@ -0,0 +1,12 @@
+# ==> /etc/systemd/system/public-inbox-imapd.socket <==
+[Unit]
+Description = public-inbox-imapd socket
+
+[Socket]
+ListenStream = 0.0.0.0:143
+BindIPv6Only = ipv6-only
+ListenStream = [::]:143
+Service = public-inbox-imapd@1.service
+
+[Install]
+WantedBy = sockets.target
diff --git a/examples/public-inbox-imapd@.service b/examples/public-inbox-imapd@.service
new file mode 100644
index 00000000..e0446ed3
--- /dev/null
+++ b/examples/public-inbox-imapd@.service
@@ -0,0 +1,43 @@
+# ==> /etc/systemd/system/public-inbox-imapd@.service <==
+# Since SIGUSR2 upgrades do not work under systemd, this service file
+# allows starting two simultaneous services during upgrade time
+# (e.g. public-inbox-imapd@1 public-inbox-imapd@2) with the intention
+# that they take turns running in-between upgrades.  This should
+# allow upgrading without downtime.
+
+[Unit]
+Description = public-inbox-imapd IMAP server %i
+Wants = public-inbox-imapd.socket public-inbox-imaps.socket \
+public-inbox-imap-onion.socket
+After = public-inbox-imapd.socket public-inbox-imaps.socket \
+public-inbox-imap-onion.socket
+
+[Service]
+Environment = PI_CONFIG=/home/pi/.public-inbox/config \
+PATH=/usr/local/bin:/usr/bin:/bin \
+PERL_INLINE_DIRECTORY=/tmp/.pub-inline
+
+LimitNOFILE = 30000
+ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
+ExecStart = /usr/local/bin/public-inbox-imapd -W0 \
+-1 /var/log/public-inbox/imapd.out.log \
+--cert /etc/ssl/certs/news.example.com.pem \
+--key /etc/ssl/private/news.example.com.key
+StandardError = syslog
+
+# NonBlocking is REQUIRED to avoid a race condition if running
+# simultaneous services
+NonBlocking = true
+
+Sockets = public-inbox-imapd.socket public-inbox-imaps.socket \
+public-inbox-imap-onion.socket
+
+KillSignal = SIGQUIT
+User = nobody
+Group = ssl-cert
+ExecReload = /bin/kill -HUP $MAINPID
+TimeoutStopSec = 86400
+KillMode = process
+
+[Install]
+WantedBy = multi-user.target
diff --git a/examples/public-inbox-imaps.socket b/examples/public-inbox-imaps.socket
new file mode 100644
index 00000000..b61cc742
--- /dev/null
+++ b/examples/public-inbox-imaps.socket
@@ -0,0 +1,12 @@
+# ==> /etc/systemd/system/public-inbox-imaps.socket <==
+[Unit]
+Description = public-inbox-imaps socket
+
+[Socket]
+ListenStream = 0.0.0.0:993
+BindIPv6Only = ipv6-only
+ListenStream = [::]:993
+Service = public-inbox-imapd@1.service
+
+[Install]
+WantedBy = sockets.target