From 09ceac4706caa32df37060f14b58bca5d88176e1 Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Sat, 31 Aug 2019 18:51:01 -0400 Subject: [PATCH] add syncthing & files mount --- .gitignore | 2 +- docker-fogcutter/airsonic/launch.sh | 1 + docker-fogcutter/minecraft/launch.sh | 2 ++ docker-fogcutter/nginx/launch.sh | 4 +++ .../nginx/site-confs/seaturtle.pw.enabled | 24 +++++++++++++++++ .../site-confs/syncthing.seaturtle.pw.enabled | 27 +++++++++++++++++++ docker-fogcutter/plex/launch.sh | 1 + docker-fogcutter/syncthing/launch.sh | 1 + 8 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 docker-fogcutter/nginx/site-confs/syncthing.seaturtle.pw.enabled diff --git a/.gitignore b/.gitignore index a88cf20..8545e1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -**/htpasswd +**/*htpasswd* docker-fogcutter/airsonic/config docker-fogcutter/minecraft/data docker-fogcutter/nginx/config diff --git a/docker-fogcutter/airsonic/launch.sh b/docker-fogcutter/airsonic/launch.sh index 93e98f6..f63ed5c 100755 --- a/docker-fogcutter/airsonic/launch.sh +++ b/docker-fogcutter/airsonic/launch.sh @@ -1,6 +1,7 @@ #!/bin/bash # Assumes pew-net exists +# Make config dir (as non-root) before launching docker run \ --name airsonic \ diff --git a/docker-fogcutter/minecraft/launch.sh b/docker-fogcutter/minecraft/launch.sh index 342553e..79eebca 100755 --- a/docker-fogcutter/minecraft/launch.sh +++ b/docker-fogcutter/minecraft/launch.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Make data dir (as non-root) before launching + docker run \ --name minecraft \ --detach \ diff --git a/docker-fogcutter/nginx/launch.sh b/docker-fogcutter/nginx/launch.sh index c8e475f..1862bf4 100755 --- a/docker-fogcutter/nginx/launch.sh +++ b/docker-fogcutter/nginx/launch.sh @@ -16,6 +16,10 @@ docker run \ --volume $PWD/config:/config:rw \ --volume $PWD/nginx.conf:/config/nginx/nginx.conf:ro \ --volume $PWD/site-confs:/config/nginx/site-confs:ro \ + --volume $PWD/../syncthing/sync:/sync-docker:ro \ + --volume /bigdata/files:/files-docker:ro \ + --volume $PWD/syncthing-htpasswd:/config/nginx/syncthing-htpasswd:ro \ + --volume $PWD/sync-htpasswd:/config/nginx/sync-htpasswd:ro \ --publish 10.42.0.203:80:80 \ --publish 10.42.0.203:443:443 \ --publish [2601:5c0:c100:6e65:96c6:91ff:feab:69e3]:80:80 \ diff --git a/docker-fogcutter/nginx/site-confs/seaturtle.pw.enabled b/docker-fogcutter/nginx/site-confs/seaturtle.pw.enabled index d4735bc..4126e05 100644 --- a/docker-fogcutter/nginx/site-confs/seaturtle.pw.enabled +++ b/docker-fogcutter/nginx/site-confs/seaturtle.pw.enabled @@ -31,4 +31,28 @@ server { location / { proxy_pass https://paulwalko.github.io; } + + # Proxy misc files + location /files { + alias /files-docker; + autoindex on; + } + + # Server syncthing files + location /sync { + auth_basic "nope definitely not today buddy"; + auth_basic_user_file /config/nginx/sync-htpasswd; + alias /sync-docker; + autoindex on; + } + + # Weechat relay + location /weechat { + proxy_pass http://172.17.0.1:9001/weechat; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_read_timeout 604800; + proxy_set_header X-RealIP $remote_addr; + } } diff --git a/docker-fogcutter/nginx/site-confs/syncthing.seaturtle.pw.enabled b/docker-fogcutter/nginx/site-confs/syncthing.seaturtle.pw.enabled new file mode 100644 index 0000000..af9bb42 --- /dev/null +++ b/docker-fogcutter/nginx/site-confs/syncthing.seaturtle.pw.enabled @@ -0,0 +1,27 @@ +server { + listen 80; + listen [::]:80; + server_name syncthing.seaturtle.pw; + + return 301 https://syncthing.seaturtle.pw$request_uri; +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + server_name syncthing.seaturtle.pw; + + # ssl conf + include /config/nginx/ssl.conf; + + # Proxy syncthing + location / { + auth_basic "not today buddy"; + auth_basic_user_file /config/nginx/syncthing-htpasswd; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://syncthing:8384; + } +} diff --git a/docker-fogcutter/plex/launch.sh b/docker-fogcutter/plex/launch.sh index 346937a..6595436 100755 --- a/docker-fogcutter/plex/launch.sh +++ b/docker-fogcutter/plex/launch.sh @@ -1,6 +1,7 @@ #!/bin/bash # Assumes pew-net exists +# Make config dir (as non-root) before launching docker run \ --name plex \ diff --git a/docker-fogcutter/syncthing/launch.sh b/docker-fogcutter/syncthing/launch.sh index db0856a..7c24bd3 100755 --- a/docker-fogcutter/syncthing/launch.sh +++ b/docker-fogcutter/syncthing/launch.sh @@ -1,6 +1,7 @@ #!/bin/bash # Assumes pew-net exists +# Make config dir (as non-root) before launching docker run \ --name syncthing \