From 73055ccf2e27bb1b7600b55d64ac939f41990ea9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 20 Nov 2025 21:41:09 +0300 Subject: [PATCH] port --- .forgejo/workflows/deploy.yaml | 2 +- DEPLOY_GUIDE.md | 2 +- tools/ci/deploy.yaml | 2 +- tools/deploy/backend-build_app.sh | 4 ++-- tools/deploy/backend-build_app_webroot.sh | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 4e851fa..2eab163 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -93,7 +93,7 @@ jobs: run: | flutter pub get flutter build web --release \ - --dart-define=API_BASE_URL=https://api.mnemo-cards.online:8444 \ + --dart-define=API_BASE_URL=https://api.mnemo-cards.online \ --dart2js-optimization=O4 - name: Deploy Web App diff --git a/DEPLOY_GUIDE.md b/DEPLOY_GUIDE.md index ae476f9..dbd29d6 100644 --- a/DEPLOY_GUIDE.md +++ b/DEPLOY_GUIDE.md @@ -97,7 +97,7 @@ If you only made changes to the backend: - **Permission Denied (SSH)**: Check your SSH keys. Ensure you can login to `root@147.45.152.129` without a password prompt (using keys). - **Build Failed (Web)**: Run `flutter doctor` to ensure your local environment is correct. Try running `flutter build web --release` manually in `mnemo_cards_web_v2` to see detailed errors. - **Backend Not Restarting**: SSH into the server and check logs: `journalctl -u mnemo_cards_server -f`. -- **Port Conflicts**: The web app is configured to talk to the API on port `8444` (HTTPS). Ensure the backend is actually running on this port. +- **Port Conflicts**: The web app is configured to talk to the API on standard HTTPS port `443` via `https://api.mnemo-cards.online`. nginx handles SSL termination and proxies to backend on port `8081`. ## Configuration diff --git a/tools/ci/deploy.yaml b/tools/ci/deploy.yaml index 432ee89..bdbc2bc 100644 --- a/tools/ci/deploy.yaml +++ b/tools/ci/deploy.yaml @@ -68,7 +68,7 @@ jobs: run: | cd mnemo_cards_web_v2 flutter pub get - flutter build web --release --dart-define=API_BASE_URL=https://api.mnemo-cards.online:8444 --dart2js-optimization=O4 + flutter build web --release --dart-define=API_BASE_URL=https://api.mnemo-cards.online --dart2js-optimization=O4 - name: Deploy Web App run: | diff --git a/tools/deploy/backend-build_app.sh b/tools/deploy/backend-build_app.sh index 2364930..ab4f8ec 100644 --- a/tools/deploy/backend-build_app.sh +++ b/tools/deploy/backend-build_app.sh @@ -135,9 +135,9 @@ server { add_header Referrer-Policy "no-referrer-when-downgrade" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - # Proxy to HTTPS backend + # Proxy to HTTP backend (SSL termination in nginx) location / { - proxy_pass https://localhost:8443; + proxy_pass http://localhost:8081; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/tools/deploy/backend-build_app_webroot.sh b/tools/deploy/backend-build_app_webroot.sh index 2a629ad..0996af6 100755 --- a/tools/deploy/backend-build_app_webroot.sh +++ b/tools/deploy/backend-build_app_webroot.sh @@ -55,9 +55,9 @@ server { add_header Referrer-Policy "no-referrer-when-downgrade" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - # Proxy to HTTPS backend + # Proxy to HTTP backend (SSL termination in nginx) location / { - proxy_pass https://localhost:8443; + proxy_pass http://localhost:8081; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;