docs: reflect A1-A5 answers, real game maps/icons in mockups (v0.4); add gvr placeholder deploy

- A1: .5 Docker placeholder on port 2972, NPMplus proxy gvr.tkrmagid.kr, cert script
- A2/A3: delete only audio after 7 days, keep training data
- A4: bot token verified (stored outside repo)
- A5: LoL in-game chat via screen OCR (methods compared), M4 +0.5w
- Mockups: Ascent minimap, agents, weapons (valorant-api.com); SR map, champions,
  objective icons (Data Dragon / Community Dragon) with game->map coordinate transforms

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-14 13:09:35 +09:00
parent d2d854c2c6
commit f5554a9499
47 changed files with 268 additions and 130 deletions

8
deploy/README.md Normal file
View File

@@ -0,0 +1,8 @@
# Deploy (site server)
- Host: .5 Docker (`root@192.168.10.5:/root/other/game-voice-recorder`), container `gvr-web`, port **2972**.
- Domain: `gvr.tkrmagid.kr` → NPMplus on 192.168.10.3 (proxy host id 13, websocket upgrade on) → `192.168.10.5:2972`.
- DNS: A record `gvr` → 211.213.11.141 must be added at hosting.co.kr (user). Then run `./cert.sh` (LE cert + force SSL).
- `placeholder/` is a static "준비 중" page until the real site server replaces it (same port, same compose project name).
Update: `scp -r placeholder/* root@192.168.10.5:/root/other/game-voice-recorder/ && ssh root@192.168.10.5 'cd /root/other/game-voice-recorder && docker compose up -d'`
- Secrets (Discord bot token / OAuth client secret) live in `~/.config/ejclaw/secrets.json` under `discord.com/bot/game-voice-recorder`; inject via `.env` on the host, never commit.

34
deploy/cert.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# gvr.tkrmagid.kr: once DNS points at the home IP, get a Let's Encrypt cert in NPMplus (192.168.10.3)
# and turn on Force SSL / HTTP2 / HSTS for the gvr proxy host (id 13 -> 192.168.10.5:2972). Safe to re-run.
# Exit 0 + "DONE" = https works; exit 3 = DNS not ready yet; other = error.
set -euo pipefail
DOMAIN=gvr.tkrmagid.kr
WANT_IP=211.213.11.141
# Every authoritative NS must answer; Let's Encrypt fails on a single NXDOMAIN (and failures are rate-limited).
for ns in ns1 ns2 ns3 ns4; do
ip=$(dig +short +time=3 +tries=2 "$DOMAIN" A @$ns.hosting.co.kr | tail -1 || true)
if [ "$ip" != "$WANT_IP" ]; then echo "DNS not ready ($DOMAIN @$ns -> '${ip}')"; exit 3; fi
done
ssh -o BatchMode=yes root@192.168.10.3 bash -s -- "$DOMAIN" <<'REMOTE'
set -euo pipefail
DOMAIN=$1
T=$(docker exec -w /app npmplus node --input-type=module -e 'import TokenModel from "./models/token.js"; const t = await TokenModel().create({iss:"api", attrs:{id:1}, scope:["user"], expiresIn:"30m"}); console.log(t.token);' | tail -1)
api() { curl -sk -b "token=$T" -H 'Content-Type: application/json' "$@"; }
HOST_ID=$(api https://127.0.0.1:81/api/nginx/proxy-hosts | python3 -c "import json,sys;print(next((h['id'] for h in json.load(sys.stdin) if '$DOMAIN' in h['domain_names']),0))")
[ "$HOST_ID" = 0 ] && { echo "no proxy host for $DOMAIN"; exit 1; }
host=$(api https://127.0.0.1:81/api/nginx/proxy-hosts/$HOST_ID)
cid=$(echo "$host" | python3 -c 'import json,sys;print(json.load(sys.stdin).get("certificate_id") or 0)')
if [ "$cid" = 0 ]; then
cid=$(api https://127.0.0.1:81/api/nginx/certificates | python3 -c "import json,sys;print(next((c['id'] for c in json.load(sys.stdin) if '$DOMAIN' in c['domain_names']),0))")
fi
if [ "$cid" = 0 ]; then
res=$(api -X POST https://127.0.0.1:81/api/nginx/certificates --data "{\"provider\":\"letsencrypt\",\"domain_names\":[\"$DOMAIN\"],\"meta\":{\"dns_challenge\":false}}")
cid=$(echo "$res" | python3 -c 'import json,sys;print(json.load(sys.stdin).get("id") or 0)')
[ "$cid" = 0 ] && { echo "cert request failed: $res" | head -c 600; exit 1; }
fi
api -X PUT https://127.0.0.1:81/api/nginx/proxy-hosts/$HOST_ID --data "{\"certificate_id\":$cid,\"ssl_forced\":true,\"http2_support\":true,\"hsts_enabled\":true,\"hsts_subdomains\":false}" | python3 -c 'import json,sys;d=json.load(sys.stdin);print("host", d.get("id"), "cert", d.get("certificate_id"), d.get("meta"), d.get("error"))'
REMOTE
code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 10 "https://$DOMAIN/healthz" || true)
echo "https://$DOMAIN/healthz -> $code"
[ "$code" = 200 ] && echo DONE

View File

@@ -0,0 +1,13 @@
# gvr.tkrmagid.kr placeholder until the real site server is built.
# Runs on .5 at /root/other/game-voice-recorder, exposed on port 2972 (NPMplus on .3 proxies the domain here).
name: game-voice-recorder
services:
web:
image: nginx:1.27-alpine
container_name: gvr-web
restart: unless-stopped
ports:
- "2972:80"
volumes:
- ./site:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro

View File

@@ -0,0 +1,6 @@
server {
listen 80;
root /usr/share/nginx/html;
location = /healthz { default_type text/plain; return 200 "ok\n"; }
location / { try_files $uri /index.html; }
}

View File

@@ -0,0 +1,6 @@
<!doctype html><html lang="ko"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Game Voice Recorder</title>
<style>html,body{height:100%;margin:0;background:#0b141c;color:#e8edf2;font-family:sans-serif}
body{display:flex;align-items:center;justify-content:center;text-align:center}
h1{font-size:28px;margin:0 0 10px}p{color:#8696a6;margin:0}</style></head>
<body><div><h1>Game Voice Recorder</h1><p>사이트 준비 중입니다.</p></div></body></html>