about summary refs log tree commit homepage
path: root/examples
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-09-14 18:28:54 +0000
committerEric Wong <e@80x24.org>2019-09-14 18:31:13 +0000
commit46c79526fd34996605a97ce52437069aa6462cef (patch)
tree7adea1d0e78bd804032b4e7add16c70e71669a74 /examples
parent6c89cf6208dd4f5251faeec18dc76ac123335fed (diff)
downloadpublic-inbox-46c79526fd34996605a97ce52437069aa6462cef.tar.gz
NNTPS and STARTTLS seems to be working for several months
without incident on news.public-inbox.org, so consider it a
success and maybe others can try using it.

HTTPS technically works, too, but isn't documented at
the moment since I can't recommend production deployments
without varnish protecting it.
Diffstat (limited to 'examples')
-rw-r--r--examples/public-inbox-nntpd@.service13
-rw-r--r--examples/public-inbox-nntps.socket12
2 files changed, 20 insertions, 5 deletions
diff --git a/examples/public-inbox-nntpd@.service b/examples/public-inbox-nntpd@.service
index a879841e..4dd2f5d7 100644
--- a/examples/public-inbox-nntpd@.service
+++ b/examples/public-inbox-nntpd@.service
@@ -7,8 +7,8 @@
 
 [Unit]
 Description = public-inbox NNTP server %i
-Wants = public-inbox-nntpd.socket
-After = public-inbox-nntpd.socket
+Wants = public-inbox-nntpd.socket public-inbox-nntps.socket
+After = public-inbox-nntpd.socket public-inbox-nntps.socket
 
 [Service]
 Environment = PI_CONFIG=/home/pi/.public-inbox/config \
@@ -18,17 +18,20 @@ PERL_INLINE_DIRECTORY=/tmp/.pub-inline
 LimitNOFILE = 30000
 ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
 ExecStart = /usr/local/bin/public-inbox-nntpd \
--1 /var/log/public-inbox/nntpd.out.log
+-1 /var/log/public-inbox/nntpd.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-nntpd.socket
+
+Sockets = public-inbox-nntpd.socket public-inbox-nntps.socket
 
 KillSignal = SIGQUIT
 User = nobody
-Group = nogroup
+Group = ssl-cert
 ExecReload = /bin/kill -HUP $MAINPID
 TimeoutStopSec = 86400
 KillMode = process
diff --git a/examples/public-inbox-nntps.socket b/examples/public-inbox-nntps.socket
new file mode 100644
index 00000000..fa678196
--- /dev/null
+++ b/examples/public-inbox-nntps.socket
@@ -0,0 +1,12 @@
+# ==> /etc/systemd/system/public-inbox-nntps.socket <==
+[Unit]
+Description = public-inbox-nntps socket
+
+[Socket]
+ListenStream = 0.0.0.0:563
+BindIPv6Only = ipv6-only
+ListenStream = [::]:563
+Service = public-inbox-nntpd@1.service
+
+[Install]
+WantedBy = sockets.target