Fix: Changed syncthing access and auth scheme
This commit is contained in:
@@ -25,6 +25,23 @@ data:
|
||||
rewrite ^/nas$ /nas/ permanent;
|
||||
}
|
||||
|
||||
# NAS API endpoints
|
||||
location ~ ^/nas/(rest|meta)/ {
|
||||
rewrite ^/nas/(.*) /$1 break;
|
||||
proxy_pass http://syncthing-nas:8384;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
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;
|
||||
|
||||
# Handle websockets
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
location /nas/ {
|
||||
proxy_pass http://syncthing-nas:8384/;
|
||||
|
||||
@@ -49,30 +66,35 @@ data:
|
||||
sub_filter '"/vendor' '"/nas/vendor';
|
||||
sub_filter '"/theme-assets' '"/nas/theme-assets';
|
||||
sub_filter '"/syncthing' '"/nas/syncthing';
|
||||
# Add floating back button via JavaScript
|
||||
sub_filter '</body>' '<script>document.addEventListener("DOMContentLoaded", function() { var btn = document.createElement("a"); btn.href = "/"; btn.innerHTML = "← Back to Instances"; btn.style.cssText = "position: fixed; top: 70px; left: 10px; z-index: 10000; background: #0078e7; color: white; padding: 8px 16px; border-radius: 4px; text-decoration: none; display: block; box-shadow: 0 2px 4px rgba(0,0,0,0.2);"; document.body.appendChild(btn); });</script></body>';
|
||||
# Add floating back button via JavaScript before last script tag
|
||||
sub_filter '<!-- / gui application code -->' '<!-- / gui application code --><script>window.addEventListener("load", function() { var btn = document.createElement("a"); btn.href = "/"; btn.innerHTML = "← Back to Instances"; btn.style.cssText = "position: fixed; top: 70px; left: 10px; z-index: 10000; background: #0078e7; color: white; padding: 8px 16px; border-radius: 4px; text-decoration: none; display: block; box-shadow: 0 2px 4px rgba(0,0,0,0.2);"; document.body.appendChild(btn); });</script>';
|
||||
sub_filter_once off;
|
||||
sub_filter_types text/html text/css application/javascript;
|
||||
}
|
||||
|
||||
# NAS WebSocket events
|
||||
location /nas/rest/events {
|
||||
proxy_pass http://syncthing-nas:8384/rest/events;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
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_read_timeout 86400;
|
||||
}
|
||||
|
||||
# Master instance
|
||||
location /master {
|
||||
rewrite ^/master$ /master/ permanent;
|
||||
}
|
||||
|
||||
# Master API endpoints
|
||||
location ~ ^/master/(rest|meta)/ {
|
||||
rewrite ^/master/(.*) /$1 break;
|
||||
proxy_pass http://syncthing-master:8384;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
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;
|
||||
|
||||
# Handle websockets
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
location /master/ {
|
||||
proxy_pass http://syncthing-master:8384/;
|
||||
|
||||
@@ -93,30 +115,35 @@ data:
|
||||
sub_filter '"/vendor' '"/master/vendor';
|
||||
sub_filter '"/theme-assets' '"/master/theme-assets';
|
||||
sub_filter '"/syncthing' '"/master/syncthing';
|
||||
# Add floating back button via JavaScript
|
||||
sub_filter '</body>' '<script>document.addEventListener("DOMContentLoaded", function() { var btn = document.createElement("a"); btn.href = "/"; btn.innerHTML = "← Back to Instances"; btn.style.cssText = "position: fixed; top: 70px; left: 10px; z-index: 10000; background: #0078e7; color: white; padding: 8px 16px; border-radius: 4px; text-decoration: none; display: block; box-shadow: 0 2px 4px rgba(0,0,0,0.2);"; document.body.appendChild(btn); });</script></body>';
|
||||
# Add floating back button via JavaScript before last script tag
|
||||
sub_filter '<!-- / gui application code -->' '<!-- / gui application code --><script>window.addEventListener("load", function() { var btn = document.createElement("a"); btn.href = "/"; btn.innerHTML = "← Back to Instances"; btn.style.cssText = "position: fixed; top: 70px; left: 10px; z-index: 10000; background: #0078e7; color: white; padding: 8px 16px; border-radius: 4px; text-decoration: none; display: block; box-shadow: 0 2px 4px rgba(0,0,0,0.2);"; document.body.appendChild(btn); });</script>';
|
||||
sub_filter_once off;
|
||||
sub_filter_types text/html text/css application/javascript;
|
||||
}
|
||||
|
||||
# Master WebSocket events
|
||||
location /master/rest/events {
|
||||
proxy_pass http://syncthing-master:8384/rest/events;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
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_read_timeout 86400;
|
||||
}
|
||||
|
||||
# Iris instance
|
||||
location /iris {
|
||||
rewrite ^/iris$ /iris/ permanent;
|
||||
}
|
||||
|
||||
# Iris API endpoints
|
||||
location ~ ^/iris/(rest|meta)/ {
|
||||
rewrite ^/iris/(.*) /$1 break;
|
||||
proxy_pass http://syncthing-khv:8384;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
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;
|
||||
|
||||
# Handle websockets
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
location /iris/ {
|
||||
proxy_pass http://syncthing-khv:8384/;
|
||||
|
||||
@@ -137,24 +164,12 @@ data:
|
||||
sub_filter '"/vendor' '"/iris/vendor';
|
||||
sub_filter '"/theme-assets' '"/iris/theme-assets';
|
||||
sub_filter '"/syncthing' '"/iris/syncthing';
|
||||
# Add floating back button via JavaScript
|
||||
sub_filter '</body>' '<script>document.addEventListener("DOMContentLoaded", function() { var btn = document.createElement("a"); btn.href = "/"; btn.innerHTML = "← Back to Instances"; btn.style.cssText = "position: fixed; top: 70px; left: 10px; z-index: 10000; background: #0078e7; color: white; padding: 8px 16px; border-radius: 4px; text-decoration: none; display: block; box-shadow: 0 2px 4px rgba(0,0,0,0.2);"; document.body.appendChild(btn); });</script></body>';
|
||||
# Add floating back button via JavaScript before last script tag
|
||||
sub_filter '<!-- / gui application code -->' '<!-- / gui application code --><script>window.addEventListener("load", function() { var btn = document.createElement("a"); btn.href = "/"; btn.innerHTML = "← Back to Instances"; btn.style.cssText = "position: fixed; top: 70px; left: 10px; z-index: 10000; background: #0078e7; color: white; padding: 8px 16px; border-radius: 4px; text-decoration: none; display: block; box-shadow: 0 2px 4px rgba(0,0,0,0.2);"; document.body.appendChild(btn); });</script>';
|
||||
sub_filter_once off;
|
||||
sub_filter_types text/html text/css application/javascript;
|
||||
}
|
||||
|
||||
# Iris WebSocket events
|
||||
location /iris/rest/events {
|
||||
proxy_pass http://syncthing-khv:8384/rest/events;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
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_read_timeout 86400;
|
||||
}
|
||||
}
|
||||
|
||||
index.html: |
|
||||
|
Reference in New Issue
Block a user