Hosting Setup
Download and status
Current runnable source ZIP v4 includes full
HOSTING.md,
compose.yaml,
hosting/Caddyfile,
.env placeholder schema, init/backup/restore scripts, one-use pass CLI and tests.
Runnable locally now; NOT publicly deployed. No VPS/domain/DNS/account supplied, no cloud charges or public tunnel started. Build computer has no Docker binary/engine: Compose/Caddy runtime parsing, container permissions, actual TLS/ACME/firewall and HTTPS browser-cookie delivery remain unverified on real hosting.54 application/security tests passed; Compose YAML and security structure plus shell syntax checked. Local Chromium browser regression passed, not a public TLS deployment smoke test.
Local use in three steps
- Unzip; install Python3.10+; open terminal in extracted folder.
- Windows:
start.bat or py -3 app.py. macOS/Linux: sh start.sh or python3 app.py.
- Open http://localhost:8765; keep terminal/machine running. No Flux/paid LLM runtime, credentials or pip dependencies. No native EXE/installer claimed.
Hosting prerequisites
Linux VPS you control; domain/subdomain and DNS rights; public IP; Docker Engine + Compose plugin; SSH key; outbound HTTPS for images/ACME/market reads. Set exact lowercase domain A record to VPS IPv4; AAAA only with working IPv6. Permit inbound80/443 and restrict SSH22 to owner IP/key where feasible; never publish8765 or database volume. Docker published ports may bypass some UFW expectations: verify provider firewall/security group externally. VPS/domain/backups costs independent of Flux. No extra CDN/proxy in this minimal trusted-proxy recipe.
Exact VPS setup
SSH to private package folder after upload/unzip:
- Verify
docker --version and docker compose version after official installation.
sh hosting/init-env.sh — prompts domain/ACME email, generates random64hex persistent APP_ACCESS_SECRET directly into .env mode0600 without printing it. Refuses overwrite. Never use shell tracing or share .env/expanded Docker config. Placeholder hosting/env.example is not usable credentials.
docker compose config --quiet, then docker compose up -d --build; inspect docker compose ps and owner-local logs. Verify DNS/trusted TLS succeeds and https://YOUR-EXACT-DOMAIN shows code redemption, not private ledger. No actual URL exists until you perform this setup.
docker compose exec app python access.py --db /data/history.sqlite3 issue day — displays new secret code ONCE and metadata/grant ID. Securely deliver code separately, never URL query/log/public chat. No working code in ZIP.
Pass tiers, administration and sessions
Local VPS administrator CLI only, no HTTP admin endpoints:
docker compose exec app python access.py --db /data/history.sqlite3 issue day
docker compose exec app python access.py --db /data/history.sqlite3 issue week
docker compose exec app python access.py --db /data/history.sqlite3 issue month
docker compose exec app python access.py --db /data/history.sqlite3 issue year
docker compose exec app python access.py --db /data/history.sqlite3 issue lifetime
docker compose exec app python access.py --db /data/history.sqlite3 list
docker compose exec app python access.py --db /data/history.sqlite3 revoke GRANT_ID
Durations begin on atomic successful redemption:24h/7d/30d/365d/lifetime-until-revoked, fixed counts not calendar months/years. Code is random256bit and only HMAC-SHA256 digest stored in SQLite, keyed with separate env secret. Once redeemed, same code cannot sign in again across races/restarts. List reveals metadata only; revoke invalidates all sessions. No payment/billing/subscription processor.
Session is random bearer token, only keyed digest server-side; __Host-paper_session Secure, HttpOnly, SameSite=Strict, Path=/, no Domain. Persisted,7day sliding inactivity capped by pass expiry; lifetime grants still have finite/revocable browser sessions. Lost/logged-out/inactive session needs administrator revoke/reissue — old code cannot be reused. Reissue starts a newly selected duration. No email/password/device recovery or identity verification. Codes can be shared before redemption; first redeemer wins. Malware/stolen sessions remain possible; not impossible-to-copy DRM.
Redemption same-origin+CSRF with explicit HTTPS Host/trusted proxy/body limits. Persistent keyed-IP8 attempts/10min and global100/10min rate limit; shared NAT can hit same bucket. No code/token in URL or plaintext DB/application logs. New code intentionally shown once in owner CLI; avoid terminal recording/shared output. Preserve secret unchanged across normal restarts/updates; changing it invalidates old code/session digests.
Read-only visitor privacy boundary
Hosted passes unlock shared paper research ONLY. All UI/API assets/research data guarded except minimal redemption page/its static JS/CSS/CSRF and loopback health. Server redaction removes actual trade/close data, private audit, personal locked state, outcomes, actual-size exit valuations and private scorecard; pure external manual contract rows excluded. Export sanitized. Visitor POST lock/trade/close/discover denied even with valid pass. UI hides actual forms; server authorization does not rely on UI hiding.
Local default remains private owner dashboard with actual manual ledger. Hosted owner-admin ledger and separate per-user personal trade ledgers are NOT implemented. No shared private financial records are exposed to code holders. Global HTTP Basic Auth proposal was superseded by code gate (otherwise redemption blocked); private data was not made public. Admin code management is SSH/local CLI only. No real orders/account access/financial credentials.
Network/volumes/security
Only Caddy publishes80/443 with automatic TLS; app nonrootUID10001, read-only filesystem + /tmp tmpfs, private data volume, all capabilities dropped/no-new-privileges. Internal backplane fixed proxy172.29.128.2/app172.29.128.3 with separate un-published egress networks for feeds/ACME. If subnet conflicts, change subnet/IPs AND trusted proxy consistently; do not broaden to wildcard/CIDR trust. Exact APP_PUBLIC_ORIGIN=
https://DOMAIN, Host/protocol/peer enforced; Caddy overwrites forwarded Host/proto and actual clientIP. CSRF maintained. No8765 publish/tunnel/admin auth-bypass header. Proxy max body64KB, app POST4095bytes.
SQLite/grants/sessions persist in history; certificates/config persist in caddy_data/caddy_config; restart unless-stopped. Local-owner default binding remains127.0.0.1 with exact localhost origin/Host. Loopback /health returns static ok without private data or market mutation (poller independent).
Backup / restore
sh hosting/backup.sh uses SQLite online backup API for consistent snapshot, copies to backups/history-TIMESTAMP.sqlite3, owner-only directory. Contains private ledger and auth hashes: encrypt/store securely off-server, never pass visitors. Keep .env in separate encrypted owner storage; preserve Caddy cert volumes to avoid reissue/rate limits. No external backup service configured.
sh hosting/restore.sh backups/history-TIMESTAMP.sqlite3 requires typing RESTORE, stops services, streams/validates DB, replaces it/removes stale journals, then rotates APP_ACCESS_SECRET before restart. All old code/session digests become invalid and require fresh issuance. Mandatory rotation prevents old DB rollback resurrecting used/revoked passes. Any manual restore must do the same. Normal restarts/updates keep original secret. System UTC/NTP must be accurate; wall-clock rollback affects durations.
Stop docker compose stop; restart docker compose up -d; update after backup with docker compose up -d --build. Do not run docker compose down -v unless intentionally deleting ledger/grants/certs. Host must remain running; no permanent hosting guarantee.
Completed vs blocked
Completed: source recipe, explicit public proxy/origin validation, one-use code/session auth, privacy-safe read-only export/route denial, exact durations/revocation, persistent limiter, backup/restore secret-rotation recovery, local launch unchanged;54 tests and browser regression pass.
Blocked/unverified: real VPS/domain/DNS/TLS/account, Docker/Caddy runtime/container ownership/cert/firewall validation and public live URL. No deployment/charges/tunnel. Source/licensing/market/rule/fee/model validation blockers unchanged: real recommendations default SKIP, no verified edge/guaranteed profits or cashouts. Private per-user trading, hosted private admin ledger, billing and formal penetration audit remain open. Full detailed procedure is bundled HOSTING.md.