mirror of
git://f0xx.org/ac/ac-be-hub
synced 2026-07-29 04:59:44 +03:00
125 lines
4.1 KiB
Markdown
125 lines
4.1 KiB
Markdown
# Landing + androidcast — BE only, port 80
|
|
|
|
**Full topology:** [docs/INFRA.md](../../docs/INFRA.md) — read after any agent/context reset.
|
|
|
|
Public: `https://apps.f0xx.org/app/androidcast_project/`
|
|
|
|
## Topology (no :8089)
|
|
|
|
```text
|
|
Browser → apps.f0xx.org (Gentoo FE, TLS)
|
|
→ http://artc0.intra.raptor.org:80 ← this vhost only
|
|
→ /etc/nginx/conf.d/apps.conf listen 80
|
|
```
|
|
|
|
**8089 is not this installation** (Janus/other). Do not point androidcast FE locations at :8089.
|
|
|
|
On FE, hub and (if you fix it) crashes should both target **`http://artc0.intra.raptor.org:80`**, same as `location /`.
|
|
|
|
## 1. Hub entry (`index.php`) + assets
|
|
|
|
Landing uses **`index.php`** (shared footer from `examples/platform/footer.config.php`). Copy **`index.html`** only as a redirect fallback.
|
|
|
|
**Multipage landing (2026-06):** sync `hub-landing.css`, `landing-pages.inc.php`, `assets/hub-landing.js`, `assets/hub-i18n.js`, `assets/i18n/hub-en.json`, `assets/i18n/hub-ru.json` with `index.php`.
|
|
|
|
**One-shot sync (recommended):**
|
|
|
|
```bash
|
|
# sshfs mount at tmp/BE_alpine/... OR pass BE path:
|
|
./examples/app_hub/scripts/sync-landing-to-be.sh
|
|
|
|
# Or direct to Alpine BE:
|
|
REMOTE=alpine-be ./examples/app_hub/scripts/sync-landing-to-be.sh
|
|
```
|
|
|
|
**Verify deploy actually landed** (old hub title is `Project hub`; new is `Landing`):
|
|
|
|
```bash
|
|
curl -sS 'https://apps.f0xx.org/app/androidcast_project/' | grep -E '<title>|hub-landing|landing-top'
|
|
curl -sS -o /dev/null -w '%{http_code}\n' 'https://apps.f0xx.org/app/androidcast_project/hub-landing.css'
|
|
```
|
|
|
|
Expect `Android Cast — Landing`, `hub-landing.css`, and HTTP **200** (not 404).
|
|
|
|
```bash
|
|
cp .../android_cast/examples/app_hub/index.php \
|
|
.../htdocs/apps/app/androidcast_project/index.php
|
|
cp .../android_cast/examples/app_hub/index.html \
|
|
.../htdocs/apps/app/androidcast_project/index.html
|
|
cp .../android_cast/examples/app_hub/hub.css \
|
|
.../htdocs/apps/app/androidcast_project/hub.css
|
|
cp .../android_cast/examples/app_hub/assets/overtime-01-alphabet.svg \
|
|
.../htdocs/apps/app/androidcast_project/assets/
|
|
# GA4 (optional): set measurementId in analytics.config.js before copy
|
|
cp .../android_cast/examples/app_hub/assets/analytics.config.js \
|
|
.../htdocs/apps/app/androidcast_project/assets/
|
|
```
|
|
|
|
Crash console ships `analytics.js` via `deploy-to-be-mount.sh` (under `crashes/assets/js/`).
|
|
|
|
## 2. BE nginx
|
|
|
|
Edit **`/etc/nginx/conf.d/apps.conf`** on Alpine (sshfs: `tmp/BE_alpine/etc/nginx/...`).
|
|
|
|
Replace the whole **`server { listen 80; ... }`** block with:
|
|
|
|
**`examples/crash_reporter/backend/nginx.apps-port80.fragment`**
|
|
|
|
That file has hub + crashes + build on **port 80**.
|
|
|
|
Or run (from repo, with write access to the mount):
|
|
|
|
```bash
|
|
sudo ./examples/crash_reporter/backend/scripts/apply-be-port80-nginx.sh
|
|
```
|
|
|
|
**FE** (`tmp/FE_gentoo/etc/nginx/apps.conf`): build must proxy to BE **:443** like hub/crashes:
|
|
|
|
```nginx
|
|
proxy_pass https://artc0.intra.raptor.org/app/androidcast_project/build/;
|
|
```
|
|
|
|
Do **not** use `http://artc0.intra.raptor.org:80` for build until BE `listen 80` includes the build block.
|
|
Copy from **`nginx.fe-apps.conf.fragment`** or run:
|
|
|
|
```bash
|
|
sudo ./examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh
|
|
```
|
|
|
|
**BE** `conf.d/apps_builder.frag` must use **full paths** (no `...` placeholders). Same script installs the repo fragment.
|
|
|
|
Use prefix location for the hub (not `alias` to a single file):
|
|
|
|
```nginx
|
|
location /app/androidcast_project/ {
|
|
alias /var/www/localhost/htdocs/apps/app/androidcast_project/;
|
|
index index.php index.html;
|
|
}
|
|
```
|
|
|
|
## 3. Reload BE
|
|
|
|
```bash
|
|
ssh alpine-be 'sudo nginx -t && sudo rc-service nginx reload'
|
|
```
|
|
|
|
## 4. Verify
|
|
|
|
```bash
|
|
curl -sS -o /dev/null -w "%{http_code}\n" -H "Host: apps.f0xx.org" \
|
|
"http://artc0.intra.raptor.org/app/androidcast_project/"
|
|
|
|
curl -sS -o /dev/null -w "%{http_code}\n" \
|
|
"https://apps.f0xx.org/app/androidcast_project/"
|
|
```
|
|
|
|
## FE (optional, not required if `location /` already proxies to :80)
|
|
|
|
If crashes on FE still say `proxy_pass https://artc0...:8089/.../crashes/`, change to:
|
|
|
|
```nginx
|
|
proxy_pass http://artc0.intra.raptor.org/app/androidcast_project/crashes/;
|
|
```
|
|
|
|
(same upstream as the hub — port **80**, no TLS to BE from FE)
|