Last active
February 6, 2025 18:13
-
-
Save curiousercreative/95e5efeb990c307a7750b3e8d8ecbb43 to your computer and use it in GitHub Desktop.
snikket behind reverse proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| snikket_proxy: | |
| container_name: snikket-proxy | |
| image: snikket/snikket-web-proxy:stable | |
| env_file: snikket.conf | |
| network_mode: host | |
| volumes: | |
| - snikket_data:/snikket | |
| restart: "unless-stopped" | |
| snikket_portal: | |
| container_name: snikket-portal | |
| image: snikket/snikket-web-portal:stable | |
| network_mode: host | |
| env_file: snikket.conf | |
| restart: "unless-stopped" | |
| snikket_server: | |
| container_name: snikket | |
| image: snikket/snikket-server:stable | |
| network_mode: host | |
| volumes: | |
| - snikket_data:/snikket | |
| - /some/abs/path/etc/prosody/certs/domain.tld.key:/etc/prosody/certs/domain.tld.key | |
| - /some/abs/path/etc/prosody/certs/domain.tld.crt:/etc/prosody/certs/domain.tld.crt | |
| - /some/abs/path/etc/sv/prosody/wait-for-certs:/etc/sv/prosody/wait-for-certs | |
| env_file: snikket.conf | |
| restart: "unless-stopped" | |
| volumes: | |
| snikket_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -e | |
| CERT_PATH_LE_LIVE="/snikket/letsencrypt/live/$SNIKKET_DOMAIN_ASCII" | |
| CERT_PATH="/etc/prosody/certs/$SNIKKET_DOMAIN.crt" | |
| check_cert_path() { | |
| if test -f "$CERT_PATH"; then | |
| exit 0; | |
| fi | |
| } | |
| check_cert_path_le_live() { | |
| if test -d "$CERT_PATH_LE_LIVE"; then | |
| prosodyctl --root cert import /snikket/letsencrypt/live | |
| check_cert_path | |
| fi | |
| } | |
| check_cert_path() | |
| check_cert_path_le_live() | |
| while sleep 10; do | |
| check_cert_path_le_live() | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a proposal for reverse proxied setup where certificates are handled out of band. As such, we no longer need the "certs" service and we need to update how we detect certs existence.
To explore further:
SNIKKET_DOMAINin compose file for certificate mount destinationwait-for-certsupstream or in Dockerfile?network-mode: hostfor portal and proxy and instead expose the one or two ports they require.