Files
viraladsource/docker-compose.yml
T
martbost def20f8ffe AI ad writer: "Write my ad from my link" on the ad form (Marty 2026-11-17: "okay, let's do it.")
adwriter.js: the server reads the member's page (or follows their LinkSpin spin link, max 5 hops),
SSRF-safe (http/https, ports 80/443, every hop's DNS answer checked and the connection pinned to it,
no private/loopback/link-local/metadata address, 8 s, 1.5 MB, text/html only), extracts title, meta
and og description, h1-h3 and the first paragraphs (about 2,500 tokens), and asks OpenRouter
deepseek/deepseek-v4-flash (reasoning off; fallback anthropic/claude-haiku-5.5) for 3 options
{headline <= 60, line <= 90} written only from the page. Every option goes through the new
safety.checkAdCopy (no dashes, income promises, guarantees, links, shouting; every number must be
on the page) plus the length limits; failing ones are dropped, one retry when none survive. The
member picks one, it fills the form, nothing is posted.
Limits: AI_AD_DAILY (5) per member per Central day, AI_AD_GLOBAL_DAILY (500), 12 an hour per IP,
one at a time, a 24 h cache by page (a repeat is free). Off and hidden without AI_AD_KEY (a dedicated
OpenRouter key, $5 a month). Admin status: writes today, tokens, estimated spend.
safety.privateIp: IPv4-mapped IPv6 in hex form (::ffff:7f00:1) and all of fe80::/10 now count as private.
Chatbot fact added (KNOWLEDGE_DATE 2026-11-17). Server wiring + form markup landed in 828abce.
qa/adwriter.test.mjs 82/82, qa/e2e.mjs 63/63, qa/chatbot.test.mjs 108/108.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:12:12 -06:00

48 lines
1.6 KiB
YAML

services:
viraladsource:
build: .
restart: unless-stopped
environment:
NODE_ENV: production
PORT: 3000
DATA_DIR: /app/data
SITE_HOST: ${SITE_HOST:-viraladsource.com}
STAGING: ${STAGING:-0}
DOCSTORE_URL: ${DOCSTORE_URL:-}
SESSION_SECRET: ${SESSION_SECRET:-}
ADMIN_TOKEN: ${ADMIN_TOKEN:-}
NETWORK_SSO_SECRET: ${NETWORK_SSO_SECRET:-}
WALLETCONNECT_PROJECT_ID: ${WALLETCONNECT_PROJECT_ID:-}
CONTRACT_ADDRESS: ${CONTRACT_ADDRESS:-}
CHAIN_RPC: ${CHAIN_RPC:-}
CHAIN_ID: ${CHAIN_ID:-137}
SHOP_START_BLOCK: ${SHOP_START_BLOCK:-}
KEEPER_KEY: ${KEEPER_KEY:-}
RELAY_KEY: ${RELAY_KEY:-}
REWARD_PAYOUTS: ${REWARD_PAYOUTS:-0}
HUB_JOIN: ${HUB_JOIN:-0}
MAIL_URL: ${MAIL_URL:-}
MAIL_KEY: ${MAIL_KEY:-}
HUB_URL: ${HUB_URL:-}
HUB_SECRET: ${HUB_SECRET:-}
HUB_SITE: ${HUB_SITE:-viraladsource}
HUB_ENABLED: ${HUB_ENABLED:-0}
HUB_SSO: ${HUB_SSO:-off}
LS_TRACK: ${LS_TRACK:-0}
LS_PARTNER: ${LS_PARTNER:-vas}
TG_TOKEN: ${TG_TOKEN:-}
TG_CHAT: ${TG_CHAT:-}
TG_PAY_TOPIC: ${TG_PAY_TOPIC:-}
JOIN_URL: ${JOIN_URL:-}
VERIFIED_SOURCIFY: ${VERIFIED_SOURCIFY:-0}
VERIFIED_POLYGONSCAN: ${VERIFIED_POLYGONSCAN:-0}
AI_AD_KEY: ${AI_AD_KEY:-}
AI_AD_DAILY: ${AI_AD_DAILY:-5}
AI_AD_GLOBAL_DAILY: ${AI_AD_GLOBAL_DAILY:-500}
volumes:
- vas-data:/app/data # the session secret + the OpenRouter key file only; all data lives in MySQL (DOCSTORE_URL)
expose:
- "3000"
volumes:
vas-data: