summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-07-01 19:59:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-07-01 19:59:30 -0700
commit4894c3be59143ea3178ba1cb66d46664c9b30985 (patch)
tree06681af66f558d6a8644ffb230dbc026c8c15fe6
parentce89a70d7adcba50e5ed543cb952808f13c638a1 (diff)
downloadtamarind-4894c3be59143ea3178ba1cb66d46664c9b30985.tar.gz
tamarind-4894c3be59143ea3178ba1cb66d46664c9b30985.tar.bz2
tamarind-4894c3be59143ea3178ba1cb66d46664c9b30985.zip
Add require-https option.HEADmaster
This is to allow the user to disable the mandatory https; like when using tamarind behind a reverse proxy.
-rw-r--r--config.txr1
-rw-r--r--startup.txr14
2 files changed, 9 insertions, 6 deletions
diff --git a/config.txr b/config.txr
index ca7c326..83ef4ac 100644
--- a/config.txr
+++ b/config.txr
@@ -1,4 +1,5 @@
@(bind debug-enable t)
+@(bind require-https t)
@(bind aliases-file "/etc/tamarind/aliases")
@(bind sessions-dir "/var/run/tamarind/sessions")
@(bind auth :imap)
diff --git a/startup.txr b/startup.txr
index 76e3d5e..9cf323a 100644
--- a/startup.txr
+++ b/startup.txr
@@ -6,13 +6,15 @@
@ (error-form "Configuration Missing" "Cannot read /etc/mailname file")
@ (fail)
@ (end)
-@ (cases)
-@ (next :env)
-@ (skip)
+@ (if require-https)
+@ (cases)
+@ (next :env)
+@ (skip)
HTTPS=on
-@ (or)
-@ (error-form "Security Problem" "Not redirected to HTTPS!")
-@ (fail)
+@ (or)
+@ (error-form "Security Problem" "Not redirected to HTTPS!")
+@ (fail)
+@ (end)
@ (end)
@ (do (umask #o007))
@(end)