diff options
author | Andrew Cady <d@jerkface.net> | 2023-06-02 17:58:53 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2023-06-02 17:58:53 -0400 |
commit | 91c503f309fb14cd969c6872ce180db08966dc8e (patch) | |
tree | 069264352e72884f5e5085f13341dd7913c82533 | |
parent | c272fb8c8baecf1caadfb270917f592c4c19b988 (diff) |
use socket instead of port to expose fossil to apache
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | src/fossil.conf~template | 4 | ||||
-rw-r--r-- | src/user/fossil-httpd.socket | 3 |
3 files changed, 7 insertions, 3 deletions
@@ -54,6 +54,8 @@ dependencies = socat fossil ssh openssh-server fakeroot | |||
54 | 54 | ||
55 | SSH_USERNAME != if [ "$$SUDO_USER" ]; then echo "$$SUDO_USER"; else id -u; fi | 55 | SSH_USERNAME != if [ "$$SUDO_USER" ]; then echo "$$SUDO_USER"; else id -u; fi |
56 | 56 | ||
57 | USER_HOME != getent passwd $(SSH_USERNAME) | (IFS=: read _ _ _ _ _ h _ && [ "$$h" ] && printf '%s\n' "$$h") | ||
58 | |||
57 | default: install start follow | 59 | default: install start follow |
58 | install: | 60 | install: |
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] |
2 | Accept = yes | 2 | Accept = yes |
3 | ListenStream = 8079 | 3 | ListenStream = %C/fossil-httpd.S |
4 | SocketMode = 0666 | ||
4 | [Install] | 5 | [Install] |
5 | WantedBy = sockets.target | 6 | WantedBy = sockets.target |