summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-06-02 17:58:53 -0400
committerAndrew Cady <d@jerkface.net>2023-06-02 17:58:53 -0400
commit91c503f309fb14cd969c6872ce180db08966dc8e (patch)
tree069264352e72884f5e5085f13341dd7913c82533
parentc272fb8c8baecf1caadfb270917f592c4c19b988 (diff)
use socket instead of port to expose fossil to apache
-rw-r--r--Makefile3
-rw-r--r--src/fossil.conf~template4
-rw-r--r--src/user/fossil-httpd.socket3
3 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 8451d26..6eed340 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,8 @@ dependencies = socat fossil ssh openssh-server fakeroot
54 54
55SSH_USERNAME != if [ "$$SUDO_USER" ]; then echo "$$SUDO_USER"; else id -u; fi 55SSH_USERNAME != if [ "$$SUDO_USER" ]; then echo "$$SUDO_USER"; else id -u; fi
56 56
57USER_HOME != getent passwd $(SSH_USERNAME) | (IFS=: read _ _ _ _ _ h _ && [ "$$h" ] && printf '%s\n' "$$h")
58
57default: install start follow 59default: install start follow
58install: 60install:
59 install -t "$(bindir)" -- $(executables) 61 install -t "$(bindir)" -- $(executables)
@@ -65,6 +67,7 @@ install:
65 systemctl daemon-reload 67 systemctl daemon-reload
66 systemctl reload ssh 68 systemctl reload ssh
67 systemctl start --wait fossil-disable-apache@- 69 systemctl start --wait fossil-disable-apache@-
70 ln -sf -t /var/lib $(USER_HOME)/.cache/fossil-httpd.S
68 install -m644 -t /etc/apache2/sites-available -- src/fossil.conf~template 71 install -m644 -t /etc/apache2/sites-available -- src/fossil.conf~template
69 systemctl start --wait fossil-enable-apache@- 72 systemctl start --wait fossil-enable-apache@-
70 make start 73 make start
diff --git a/src/fossil.conf~template b/src/fossil.conf~template
index 797f5e2..49fa7cd 100644
--- a/src/fossil.conf~template
+++ b/src/fossil.conf~template
@@ -5,6 +5,6 @@
5 CustomLog ${APACHE_LOG_DIR}/access.log combined 5 CustomLog ${APACHE_LOG_DIR}/access.log combined
6 DocumentRoot /var/www/html 6 DocumentRoot /var/www/html
7 ProxyPreserveHost on 7 ProxyPreserveHost on
8 ProxyPass / http://localhost:8079/ 8 ProxyPass / unix:/var/lib/fossil-httpd.S|http://%H
9 ProxyPassReverse / http://localhost:8079/ 9 ProxyPassReverse / unix:/var/lib/fossil-httpd.S|http://%H
10</VirtualHost> 10</VirtualHost>
diff --git a/src/user/fossil-httpd.socket b/src/user/fossil-httpd.socket
index e705ee5..93e92c4 100644
--- a/src/user/fossil-httpd.socket
+++ b/src/user/fossil-httpd.socket
@@ -1,5 +1,6 @@
1[Socket] 1[Socket]
2Accept = yes 2Accept = yes
3ListenStream = 8079 3ListenStream = %C/fossil-httpd.S
4SocketMode = 0666
4[Install] 5[Install]
5WantedBy = sockets.target 6WantedBy = sockets.target