mirror of
git://f0xx.org/android_cast
synced 2026-07-29 06:18:42 +03:00
2.1 KiB
2.1 KiB
URL shortener — deploy (FE → BE)
Topology: same as INFRA.md — TLS on Gentoo FE, app on Alpine BE :80.
Prerequisites (confirmed)
| Item | Status |
|---|---|
DNS s.f0xx.org → FE |
PO |
| FE TLS cert | /etc/letsencrypt/live/s.f0xx.org/ |
| Git remote | git://f0xx.org/androicast_project/url-shortener |
MariaDB schema url_shortener |
sql/schema.mariadb.sql |
| DB app user | androidcast (shared with crash reporter; same password as androidcast_crashes in crashes config.php) |
MariaDB (BE)
Database: url_shortener
App user: androidcast @ localhost + 127.0.0.1 — same password as crash reporter (examples/crash_reporter/backend/config/config.php → db.mysql.password).
# 1) Schema (root)
mysql -u root -p < sql/schema.mariadb.sql
# 2) Grants for existing androidcast user (root) — skip if already granted
./scripts/init-mariadb-grants.sh
# 3) Config on BE
cp config/config.example.php config/config.php
# edit password to match crashes config (do not commit config.php)
# 4) Smoke
mysql -u androidcast -p -h 127.0.0.1 url_shortener -e 'SHOW TABLES;'
Template: config/config.example.php
FE (Gentoo)
Add deploy/nginx.fe-s.f0xx.org.snippet inside a new server { listen 443 ssl; server_name s.f0xx.org; } block
(mirror apps.f0xx.org TLS paths; cert paths above).
nginx -t && rc-service nginx reload
BE (Alpine)
- Sync this tree to docroot (suggested):
/var/www/localhost/htdocs/apps/s/ - Include
deploy/nginx.be-url-shortener.fragmentinapps.confor dedicatedserver_nameon BE - Apply SQL migration
rc-service php-fpm81 restartif needed
nginx -t && rc-service nginx reload
Alpine/nginx note: regex locations with {n,m} quantifiers must be double-quoted or nginx parses { as a block delimiter (nginx: [emerg] improper regexp).
Verify
curl -sSI https://s.f0xx.org/api/v1/health
./scripts/smoke_shorten.sh
Not added to validate_be_services.sh until first production deploy (SPEC).