diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 81d08e9a..6a176eff 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,7 +30,7 @@ jobs: platforms: linux/amd64,linux/arm64 - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v4 + uses: useblacksmith/setup-docker-builder@v1 - name: Determine tags id: tags @@ -71,7 +71,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push multi-arch image - uses: docker/build-push-action@v7 + uses: useblacksmith/build-push-action@v2 with: context: . file: ./docker/Dockerfile diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b72467d5..1cd91279 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -138,7 +138,14 @@ nginx -c /tmp/nginx/nginx.conf # Inject runtime BASE_PATH into frontend if configured if [ -n "$BASE_PATH" ]; then echo "Injecting BASE_PATH: $BASE_PATH" - find /app/html -name "index.html" -exec sed -i "s|window.__TERMIX_BASE_PATH__ = \"\"|window.__TERMIX_BASE_PATH__ = \"$BASE_PATH\"|g" {} \; + # Strip trailing slash for use as a path prefix + CLEAN_BASE_PATH="${BASE_PATH%/}" + find /app/html -name "index.html" -exec sed -i "s|window.__TERMIX_BASE_PATH__ = \"\"|window.__TERMIX_BASE_PATH__ = \"$CLEAN_BASE_PATH\"|g" {} \; + # Patch sw.js static asset paths with the base path prefix + find /app/html -name "sw.js" -exec sed -i "s|__TERMIX_SW_BASE_PATH__|$CLEAN_BASE_PATH|g" {} \; +else + # No base path - replace placeholder with empty string so paths stay absolute from root + find /app/html -name "sw.js" -exec sed -i "s|__TERMIX_SW_BASE_PATH__||g" {} \; fi echo "Starting backend services..." diff --git a/docker/nginx-https.conf b/docker/nginx-https.conf index 907d03e3..ad7575ec 100644 --- a/docker/nginx-https.conf +++ b/docker/nginx-https.conf @@ -196,6 +196,24 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } + location ~ ^/open-tabs(/.*)?$ { + proxy_pass http://127.0.0.1:30001; + proxy_http_version 1.1; + proxy_set_header Host $http_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; + } + + location ~ ^/user-preferences(/.*)?$ { + proxy_pass http://127.0.0.1:30001; + proxy_http_version 1.1; + proxy_set_header Host $http_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; + } + location ~ ^/database(/.*)?$ { client_max_body_size 5G; client_body_timeout 300s; diff --git a/docker/nginx.conf b/docker/nginx.conf index 915b959c..35d7989d 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -185,6 +185,24 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } + location ~ ^/open-tabs(/.*)?$ { + proxy_pass http://127.0.0.1:30001; + proxy_http_version 1.1; + proxy_set_header Host $http_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; + } + + location ~ ^/user-preferences(/.*)?$ { + proxy_pass http://127.0.0.1:30001; + proxy_http_version 1.1; + proxy_set_header Host $http_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; + } + location ~ ^/database(/.*)?$ { client_max_body_size 5G; client_body_timeout 300s; diff --git a/electron/main.cjs b/electron/main.cjs index e3849ff4..674a5d10 100644 --- a/electron/main.cjs +++ b/electron/main.cjs @@ -933,6 +933,7 @@ function createWindow() { mainWindow.once("ready-to-show", () => { mainWindow.show(); + mainWindow.focus(); }); setTimeout(() => { @@ -2602,6 +2603,9 @@ app.on("window-all-closed", () => { app.on("activate", () => { if (BrowserWindow.getAllWindows().length === 0) { createWindow(); + } else if (mainWindow) { + mainWindow.show(); + mainWindow.focus(); } }); diff --git a/index.html b/index.html index 94725365..da71ea34 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@
- + @@ -12,8 +12,8 @@ content="black-translucent" /> - - + +