尚未偵測到更新。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