尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗Real time multiplayer poker application powered by go, react, and websockets
Can run from a prebuilt container, evanofslack/go-poker:latest, with Postgres to keep tables
across restarts:
services:
go-poker:
image: evanofslack/go-poker:latest
restart: unless-stopped
ports:
- 8080:8080
environment:
DATABASE_URL: postgres://poker:poker@postgres:5432/poker?sslmode=disable
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: poker
POSTGRES_PASSWORD: poker
POSTGRES_DB: poker
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "poker"]
interval: 2s
retries: 15
volumes:
postgres:
DATABASE_URL picks where tables are kept:
postgres://user:pass@host:5432/db: Postgressqlite:/data/poker.db: a SQLite file; mount a volume at its directoryTables are saved between hands and on shutdown. A graceful restart carries on mid-hand; a crash goes
back to the end of the last hand, which is then dealt again. Closed tables are kept for
RETAIN_DAYS (default 30) and then deleted.
The same store keeps an audit of what each connection did and tried, refused messages included, with
its IP: for settling disputes, never shown to players. Entries outlive their table and are deleted
after AUDIT_RETAIN_DAYS (default 30).
ADMIN_ADDR (off by default) serves a read-only admin page at /admin on its own address: open
tables, who is behind each name with their IP, and the audit. It has no login, so keep it off the
internet and reach it over an SSH tunnel (ssh -L 2113:localhost:2113 host) or a private network
such as Tailscale. Outside Docker, set ADMIN_ADDR=127.0.0.1:2113. In Docker, the container has to
listen on every interface, so set ADMIN_ADDR=:2113 and publish the port on the host's loopback
only:
ports:
- 8080:8080
- 127.0.0.1:2113:2113
environment:
ADMIN_ADDR: ":2113"
The public port never serves it. With just start it's at localhost:3000/admin, and with just serve at
localhost:2113/admin.
Prometheus metrics are served at /metrics on a separate port, METRICS_ADDR (default :2112, or set it empty to turn off).
| metric | labels | |
|---|---|---|
poker_connections | open websockets | |
poker_tables | state: active, ended | open tables |
poker_players | kind: human, bot | seated players |
poker_limit | limit: conns, conns_per_ip, tables, tables_per_ip, messages | configured limits |
poker_limit_hits_total | limit | connections, tables or messages refused by a limit |
poker_hands_total | hands dealt | |
poker_tables_closed_total | reason: empty, ended, idle, shutdown | tables closed |
poker_seat_grace_total | outcome: reconnected, expired | dropped players who came back or lost their seat |
poker_slow_client_drops_total | clients dropped for falling behind | |
poker_panics_total | panics recovered while handling a message | |
poker_save_errors_total | tables or audit batches that failed to save | |
poker_audit_dropped_total | audit entries dropped for a full queue or a failing store | |
poker_save_seconds | how long saving a table took |
Plus the standard go_* and process_* metrics.
Run the go server and next dev server with hot reload (needs go, node and just):
just start
Then open http://localhost:3000. Run just check for the same checks as CI, or just to list all recipes. Or build and run the production image from local code:
docker compose -f docker-compose-dev.yaml up --build