4.3 KiB
ai News Daily → preprod2 Deploy Workflow
Publish the locally-aggregated AI News Daily edition to the live site
https://preprod2.afterthedemo.com/. Aggregation and ingestion live on the local PC; the rendered site is pushed to Gitea, whose webhook syncs it to the VPS webroot.
Architecture (2 halves)
- Aggregation (local):
~/athena-oracle-new/— ingest Reddit →oracle.db→ rendersite/. - Delivery (Gitea → VPS): commit + push
maintoTony_tech/athena-oracle; the preprod webhook syncs to/var/www/preprod2→ served athttps://preprod2.afterthedemo.com/.
Local pipeline (one cycle)
cd ~/athena-oracle-new
python pipeline.py --sources reddit # ingest → oracle.db
python -m oracle render --variant ai-news-daily # render site/ai-news-daily/
# Wrapper does both:
python cron/run-ai-news-daily.py --preview # dry-run both
python cron/run-ai-news-daily.py # full run (ingest + render)
- Reddit adapter:
adapters/reddit.py, subredditsHuggingFace, llamacpp, artificial, DeepLearning, limit 10-20. Anonymous RSS is ~1 req/min per IP → the adapter readsx-ratelimit-resetand sleeps between subreddits (~60s). Expect 429 + wait on all-but-first sub. - Scoring: rule-based, AI-keyword boost (
~7.3-7.8typical for top). Non-blocking warningscoring attach failed: no such column: bucketstill lets entries store + render; a schema migration to addbucketis pending.
Automated schedule (Hermes cron, local)
Two no_agent cron jobs run ~/.hermes/scripts/ai-news-daily.py (deliver=telegram):
| Job | Schedule (local) | Notes |
|---|---|---|
| AI News Daily Morning | 0 6 * * * (6am) |
first of two daily cycles |
| AI News Daily Evening | 0 18 * * * (6pm) |
second cycle |
The script sets ROOT from AI_ORACLE_ROOT (default ~/athena-oracle-new).
Publish to preprod2 (the "post" step)
Credential: git credential manager stores git:https://gitea.vps1.afterthedemo.com
(user tonyjbala) — auto-supplied on push, nothing to configure. There is also
an SSH deploy key pair at ~/ssh-keys/vps-deploy (.pub = fight@DESKTOP-81CBTV2).
No GITEA_ACCESS_TOKEN env var is needed on this box (the earlier leonard-flow
token-inline recipe is for the VPS's HTTP-only localhost:3000, not needed here).
cd ~/athena-oracle-new
git status --short # confirm changed files (adapter, variants, site/, cron)
git add -A
git commit -m "ai news daily: <summary>"
git push origin main # triggers preprod2 webhook → VPS sync
# DO NOT print the git credential or let the URL leak the token/scheme in chat output.
Verify at the box (never trust plain "pushed"):
git rev-parse HEAD # local commit SHA
curl -sI https://preprod2.afterthedemo.com/ | head -1 # expect HTTP 200
curl -s https://preprod2.afterthedemo.com/ | grep -oE "<story keyword>" | sort -u
Confirm a freshly-pushed story title is present in the live HTML.
Deploy config
.preprod-config.toml:build.command = "true"(files pre-rendered),output = "site",[[deploy.branch]] branch="main" target="preprod2"..preprod-manifest.json: records last deploy status/SHA (regenerated server-side; disk copy is stale after push).
Gotchas
- Push scheme: remote is
https://gitea.vps1.afterthedemo.com/...(public HTTPS). Anonymous clone works; push needs the stored git credential manager entry. Tailnet route to VPS is broken → always use the public URL, never tailnet IPs. - Live page is the main
site/index.htmlfeed ("Athena AI News"), which is thedefaultvariant (55KB), not the isolatedsite/ai-news-daily/index.html. "Posted to aind" = the daily stories flowing into the main feed; verify against the full titles, not just the ai-news-daily variant. - Rate limits: a full Reddit cycle takes 3-6 min (60s sleeps). Don't stack runs.
- Agent cannot write
/var/wwwon the VPS (hardline guard). Live publish goes through the Gitea webhook, never a directcp.
Related
- Project: athena-oracle/status · athena-oracle/decisions
- Vault git backup: see
[[memory_consolidation]](giteaTony_tech/obsidian-vault) - Deploy plan:
~/athena-oracle-new/docs/Deployment-Plan.md