From 0d9b0c19bd34770bdd894c37647a5b04ae6e6841 Mon Sep 17 00:00:00 2001 From: MagicalCodeMonkey Date: Sun, 1 Mar 2020 21:24:59 -0500 Subject: [PATCH 1/6] Initial commit for SyncLounge subfolder confs --- synclounge-server.subfolder.conf.sample | 29 +++++++++++++++++++++++++ synclounge.subfolder.conf.sample | 29 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 synclounge-server.subfolder.conf.sample create mode 100644 synclounge.subfolder.conf.sample diff --git a/synclounge-server.subfolder.conf.sample b/synclounge-server.subfolder.conf.sample new file mode 100644 index 0000000..30f9138 --- /dev/null +++ b/synclounge-server.subfolder.conf.sample @@ -0,0 +1,29 @@ +#******** Due to some bugs in SyncLounge, this config may conflict with others. ********* + +# SyncLounge defaults the server to `slserver` already +location /slserver { + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app synclounge; + set $upstream_port 8089; + set $upstream_proto http; + + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_pass $upstream_proto://$upstream_app:$upstream_port; +} + +# Due to a bug in SyncLounge, some websockets calls don't respect the base url (server root) setting +# TODO: Update when fixed +location /socket.io { + resolver 127.0.0.11 valid=30s; + set $upstream_app synclounge; + set $upstream_port 8089; + set $upstream_proto http; + + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_pass $upstream_proto://$upstream_app:$upstream_port/slserver/socket.io/; +} \ No newline at end of file diff --git a/synclounge.subfolder.conf.sample b/synclounge.subfolder.conf.sample new file mode 100644 index 0000000..bc433ae --- /dev/null +++ b/synclounge.subfolder.conf.sample @@ -0,0 +1,29 @@ +#******** Due to some bugs in SyncLounge, this config may conflict with others. ********* + +# Set `webroot` to `slweb` and restart the container +location /slweb { + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app synclounge; + set $upstream_port 8088; + set $upstream_proto http; + + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_pass $upstream_proto://$upstream_app:$upstream_port; +} + +# Due to a bug in SyncLounge, some requests like /config don't respect the web's base url setting (webroot) +# TODO: Update when fixed +location /config { + return 301 $scheme://$host/slweb$request_uri; +} + +# Invite links need to be rewritten to use the web's base url setting (webroot) +# The docker container currently sets `autoJoinUrl` ENV variable on build to `http://${DOMAIN}` +# overriding what the user has set. +# TODO: Update when fixed +location /invite/ { + return 301 $scheme://$host/slweb$request_uri; +} \ No newline at end of file From 0d9326f2a9a7b06ec88b6c96d7458c514507e2ea Mon Sep 17 00:00:00 2001 From: MagicalCodeMonkey Date: Wed, 18 Mar 2020 12:02:20 -0400 Subject: [PATCH 2/6] Update to working subfolder conf --- synclounge.subfolder.conf.sample | 45 ++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/synclounge.subfolder.conf.sample b/synclounge.subfolder.conf.sample index bc433ae..4912da3 100644 --- a/synclounge.subfolder.conf.sample +++ b/synclounge.subfolder.conf.sample @@ -1,6 +1,12 @@ -#******** Due to some bugs in SyncLounge, this config may conflict with others. ********* +# Use this if you are using the `latest` or `alpine` tags for the container, which contains both the web client and server applications. +# Make sure that you have set the web base url (webroot/WEB_ROOT setting) to '/slweb' or change all occurrences of `/slweb` below to match your settings. +# The server base url (serverroot/SERVER_ROOT) defaults to '/slserver'. If you change this setting, change all occurrences of '/slserver' below -# Set `webroot` to `slweb` and restart the container +### +# Client +### + +# Due to a bug in SyncLounge, some requests like /config don't respect the base url (web root) setting location /slweb { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; @@ -13,17 +19,28 @@ location /slweb { proxy_pass $upstream_proto://$upstream_app:$upstream_port; } - -# Due to a bug in SyncLounge, some requests like /config don't respect the web's base url setting (webroot) -# TODO: Update when fixed -location /config { - return 301 $scheme://$host/slweb$request_uri; +if ($http_referer ~* /slweb) { + rewrite ^/config /slweb/config redirect; + rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect; } -# Invite links need to be rewritten to use the web's base url setting (webroot) -# The docker container currently sets `autoJoinUrl` ENV variable on build to `http://${DOMAIN}` -# overriding what the user has set. -# TODO: Update when fixed -location /invite/ { - return 301 $scheme://$host/slweb$request_uri; -} \ No newline at end of file +### +# Server +### + +# Proxy for the server +location /slserver { + include /config/nginx/proxy.conf; + resolver 127.0.0.11 valid=30s; + set $upstream_app synclounge; + set $upstream_port 8089; + set $upstream_proto http; + + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_pass $upstream_proto://$upstream_app:$upstream_port; +} +if ($http_referer ~* /slserver) { + rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect; +} From bd690de36e1fff51cc4fd3a09e32cd8dcc2a73eb Mon Sep 17 00:00:00 2001 From: MagicalCodeMonkey Date: Sat, 21 Mar 2020 23:49:46 -0400 Subject: [PATCH 3/6] Remove unneeded file --- synclounge-server.subfolder.conf.sample | 29 ------------------------- 1 file changed, 29 deletions(-) delete mode 100644 synclounge-server.subfolder.conf.sample diff --git a/synclounge-server.subfolder.conf.sample b/synclounge-server.subfolder.conf.sample deleted file mode 100644 index 30f9138..0000000 --- a/synclounge-server.subfolder.conf.sample +++ /dev/null @@ -1,29 +0,0 @@ -#******** Due to some bugs in SyncLounge, this config may conflict with others. ********* - -# SyncLounge defaults the server to `slserver` already -location /slserver { - include /config/nginx/proxy.conf; - resolver 127.0.0.11 valid=30s; - set $upstream_app synclounge; - set $upstream_port 8089; - set $upstream_proto http; - - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - - proxy_pass $upstream_proto://$upstream_app:$upstream_port; -} - -# Due to a bug in SyncLounge, some websockets calls don't respect the base url (server root) setting -# TODO: Update when fixed -location /socket.io { - resolver 127.0.0.11 valid=30s; - set $upstream_app synclounge; - set $upstream_port 8089; - set $upstream_proto http; - - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - - proxy_pass $upstream_proto://$upstream_app:$upstream_port/slserver/socket.io/; -} \ No newline at end of file From 55592fa4e1985f016e6e0c3bcd4fd92e55a7c359 Mon Sep 17 00:00:00 2001 From: MagicalCodeMonkey Date: Sun, 22 Mar 2020 15:38:07 -0400 Subject: [PATCH 4/6] Add auth comments --- synclounge.subfolder.conf.sample | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/synclounge.subfolder.conf.sample b/synclounge.subfolder.conf.sample index 4912da3..8afe577 100644 --- a/synclounge.subfolder.conf.sample +++ b/synclounge.subfolder.conf.sample @@ -8,6 +8,14 @@ # Due to a bug in SyncLounge, some requests like /config don't respect the base url (web root) setting location /slweb { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable the next two lines for ldap auth, also customize and enable ldap.conf in the default conf + #auth_request /auth; + #error_page 401 =200 /login; + include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_app synclounge; From a95f4f355efb3f6008c6c24a6fb8c10cf82ec450 Mon Sep 17 00:00:00 2001 From: MagicalCodeMonkey Date: Sun, 22 Mar 2020 16:06:25 -0400 Subject: [PATCH 5/6] Update comments --- synclounge.subfolder.conf.sample | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synclounge.subfolder.conf.sample b/synclounge.subfolder.conf.sample index 8afe577..61ddbbd 100644 --- a/synclounge.subfolder.conf.sample +++ b/synclounge.subfolder.conf.sample @@ -6,7 +6,6 @@ # Client ### -# Due to a bug in SyncLounge, some requests like /config don't respect the base url (web root) setting location /slweb { # enable the next two lines for http auth #auth_basic "Restricted"; @@ -28,7 +27,9 @@ location /slweb { proxy_pass $upstream_proto://$upstream_app:$upstream_port; } if ($http_referer ~* /slweb) { + # Due to a bug in SyncLounge, some requests like /config don't respect the base url (web root) setting rewrite ^/config /slweb/config redirect; + # I think this is a bug as well rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect; } @@ -50,5 +51,6 @@ location /slserver { proxy_pass $upstream_proto://$upstream_app:$upstream_port; } if ($http_referer ~* /slserver) { + # Due to a bug in SyncLounge, some requests like socket.io don't respect the base url (server root) setting rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect; } From 05ee1f3bba6bbeb370d75a85b743f6bbcd4786a1 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 23 Mar 2020 15:14:28 -0500 Subject: [PATCH 6/6] Update synclounge.subfolder.conf.sample Reordering to keep in line with existing proxies --- synclounge.subfolder.conf.sample | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/synclounge.subfolder.conf.sample b/synclounge.subfolder.conf.sample index 61ddbbd..07b3ccc 100644 --- a/synclounge.subfolder.conf.sample +++ b/synclounge.subfolder.conf.sample @@ -20,11 +20,12 @@ location /slweb { set $upstream_app synclounge; set $upstream_port 8088; set $upstream_proto http; + + proxy_pass $upstream_proto://$upstream_app:$upstream_port; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_pass $upstream_proto://$upstream_app:$upstream_port; } if ($http_referer ~* /slweb) { # Due to a bug in SyncLounge, some requests like /config don't respect the base url (web root) setting @@ -45,10 +46,11 @@ location /slserver { set $upstream_port 8089; set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_pass $upstream_proto://$upstream_app:$upstream_port; } if ($http_referer ~* /slserver) { # Due to a bug in SyncLounge, some requests like socket.io don't respect the base url (server root) setting