From dfaf9ab24d1d4d61d40fa0fcb63a7e1e47c9c6dc Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Thu, 11 Jun 2026 22:13:27 +0200 Subject: [PATCH] be --- docs/20260610_SERVICES.md | 15 ++++++++------- .../backend/scripts/validate_be_services.sh | 12 ++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/docs/20260610_SERVICES.md b/docs/20260610_SERVICES.md index 88b55ea..6785612 100644 --- a/docs/20260610_SERVICES.md +++ b/docs/20260610_SERVICES.md @@ -330,25 +330,26 @@ Flow doc: [20260607-2FA-email-mobile-auth-flow.md](20260607-2FA-email-mobile-aut --- -## URL shortener (preview — not deployed) +## URL shortener -**Web:** [https://s.f0xx.org](https://s.f0xx.org) (dedicated vhost; FE TLS live) +**Web:** [https://s.f0xx.org](https://s.f0xx.org) (dedicated vhost; FE TLS + BE nginx **deployed 2026-06**) | Kind | Path | Notes | |------|------|--------| -| Health | `GET /api/v1/health` | Stub until PHP handlers deployed | -| Shorten | `POST /api/v1/shorten` | Bearer token; see SPEC | +| Health | `GET /api/v1/health` | Returns JSON when `backend/url-shortener/public` synced to BE | +| Shorten | `POST /api/v1/shorten` | Bearer token; **501 stub** until PHP impl | | QR | `GET /api/v1/qr/{slug}.png` | PNG | | Redirect | `GET /{slug}` | `302` → original URL | Spec: [specs/20100611_3_url_shortener.md](specs/20100611_3_url_shortener.md) · scaffold: [backend/url-shortener/](../backend/url-shortener/) ```bash -export BASE=https://s.f0xx.org -curl -sS "$BASE/api/v1/health" -# Full cookbook: backend/url-shortener/scripts/demo_curl.sh (needs BEARER when live) +curl -fsS https://s.f0xx.org/api/v1/health +# Full cookbook (when shorten live): backend/url-shortener/scripts/demo_curl.sh ``` +**Still TODO:** sync PHP tree to BE docroot, `schema.mariadb.sql`, bearer tokens, shorten/redirect handlers. + --- ## Non-HTTP services diff --git a/examples/crash_reporter/backend/scripts/validate_be_services.sh b/examples/crash_reporter/backend/scripts/validate_be_services.sh index da1882a..bb0bf59 100755 --- a/examples/crash_reporter/backend/scripts/validate_be_services.sh +++ b/examples/crash_reporter/backend/scripts/validate_be_services.sh @@ -11,6 +11,8 @@ HUB="${HUB_BASE:-${PUBLIC}/app/androidcast_project/}" BUILD="${BUILD_BASE:-${PUBLIC}/app/androidcast_project/build/}" OTA="${OTA_CHANNEL:-${PUBLIC}/v0/ota/channel/stable.json}" +SHORTENER="${URL_SHORTENER_BASE:-https://s.f0xx.org}" + fail=0 ok() { echo "OK $*"; } bad() { echo "FAIL $*"; fail=1; } @@ -71,6 +73,16 @@ else bad "ota $OTA HTTP $code" fi +# URL shortener (opt-in vhost — warn until PHP + MariaDB live) +code="$(http_code "$SHORTENER/api/v1/health")" +if [[ "$code" == "200" ]]; then + ok "url-shortener $SHORTENER/api/v1/health HTTP $code" +elif [[ "$code" =~ ^(000|502|503|504)$ ]]; then + note "url-shortener $SHORTENER/api/v1/health HTTP $code — nginx up? sync backend/url-shortener + php-fpm" +else + note "url-shortener $SHORTENER/api/v1/health HTTP $code (stub expects 200 when docroot synced)" +fi + # Device APIs (no session) — 403 on public edge is OK if upload/heartbeat work code="$(http_code "$CRASHES/api/diag.php")" if [[ "$code" == "200" ]]; then