projects

holonet

A multiplayer video game backend in Go

feat: mirror from tangled

daniel daum committed parent 0ec0e71 commit 29080a1Signed, not verified

SignedGitea couldn't verify the signature.

Showing 3 changed files with 64 additions and 50 deletions.

.tangled/workflows/mirror.ymladded +36 −0
@@ -0,0 +1,36 @@1# .tangled/workflows/mirror-to-github.yml23when:4  - event: ["push", "manual"]5    branch: ["main"]67engine: "nixery"89clone:10  depth: 01112dependencies:13  nixpkgs:14    - git1516steps:17  - name: "Mirror to GitHub"18    command: |19      git fetch --unshallow origin || true20      git fetch origin refs/heads/main:refs/heads/main21      git remote add github https://x-access-token:${GITHUB_PAT}@github.com/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}.git22      git push github refs/heads/main:refs/heads/main --force23    environment:24      GITHUB_USERNAME: "daniel-daum"25      GITHUB_REPO_NAME: "holonet"2627  - name: "Mirror to Gitea"28    command: |29      git fetch --unshallow origin || true30      git fetch origin refs/heads/main:refs/heads/main31      git remote add gitea https://${GITEA_USERNAME}:${GITEA_TOKEN}@${GITEA_HOST}/${GITEA_USERNAME}/${GITEA_REPO_NAME}.git32      git push gitea refs/heads/main:refs/heads/main --force33    environment:34      GITEA_USERNAME: "daniel-daum"35      GITEA_REPO_NAME: "holonet"36      GITEA_HOST: "git.danieldaum.net"
AGENTS.mddeleted +0 −50
@@ -1,50 +0,0 @@1# Holonet23Tick-based MMO game server written in Go. A Godot client communicates with this4server over WebSockets. The server is authoritative: game state advances in a5fixed tick loop (goroutine). Design is early and evolving — currently a single6`main` package.78## Stack910- **Server:** Go, WebSocket API for the Godot client, tick-based game loop11- **Persistence:** Postgres (planned); Redis for caching (planned)12- **Blobs:** Cloudflare R2 if needed13- **Packaging/deploy:** Docker; local dev → self-hosted Dokploy PaaS (test) → production14- **Secrets:** self-hosted Infisical in dev; `.env` is local-only and gitignored1516## Commands1718- `just check` — format, lint (golangci-lint), and test. Run before finishing any task.19- `just run` / `just test` — dev server / tests only.20- Global tools come from mise (`mise.toml`); project dependencies via `go get` (`go.mod`).2122## Conventions2324- **Config:** env vars parsed once at startup in `env.go` (`parseEnv`). Defaults:25  `ENVIRONMENT=dev`, `PORT=8080`. Valid environments: `dev`, `test`, `prod`.26- **Errors:** return wrapped errors (`fmt.Errorf` with `%w`). Log-and-exit only in27  `main`; inner functions never call `os.Exit` or log errors they also return.28- **Logging:** `slog` with key-value attributes (`slog.Info("msg", "key", val)`),29  never values interpolated into the message string. Tint handler in dev.30- **Tests:** stdlib `testing` only, `t.Setenv` for env manipulation. No frameworks.31- **Formatting:** `golangci-lint fmt` (gofmt-compatible). Never hand-format.32- Prefer simple, stable, idiomatic Go and the standard library over clever33  abstractions or new dependencies. Justify any new dependency.34- The maintainer is learning Go — when using a non-obvious idiom, briefly explain35  it in your summary.3637## Commit conventions3839Single-line commits, `type: description` — lowercase, no scope, no period.40Types: `feat` `fix` `docs` `style` `perf` `test` `build` `ci` `chore` `revert`.4142VCS is jj (colocated with git).4344## Don'ts4546- Never commit, branch, or otherwise mutate jj/git state — the user handles VCS.47- Never edit `.env` (real secrets). `example.env` is the committed template; keep48  it in sync when adding config.49- Keep `CHANGELOG.md` updated under `[Unreleased]` — highlight/summary level only,50  not a list of every change.
mise.lockadded +28 −0
@@ -0,0 +1,28 @@1# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html23[[tools.air]]4version = "1.65.3"5backend = "aqua:air-verse/air"67[tools.air."platforms.macos-arm64"]8checksum = "sha256:30526dc9cd0227fa8cd9933ea17666f8abf63dbc183e53d2a721bb4807726f32"9url = "https://github.com/air-verse/air/releases/download/v1.65.3/air_1.65.3_darwin_arm64.tar.gz"10url_api = "https://api.github.com/repos/air-verse/air/releases/assets/426232979"1112[[tools.go]]13version = "1.26.5"14backend = "core:go"1516[tools.go."platforms.macos-arm64"]17checksum = "sha256:efb87ff28af9a188d0536ef5d42e63dd52ba8263cd7344a993cc48dd11dedb6a"18url = "https://dl.google.com/go/go1.26.5.darwin-arm64.tar.gz"1920[[tools.golangci-lint]]21version = "2.12.2"22backend = "aqua:golangci/golangci-lint"2324[tools.golangci-lint."platforms.macos-arm64"]25checksum = "sha256:a9c54498731b3128f79e090be6110f3e5fffccc617b08142ed244d4126c73f29"26url = "https://github.com/golangci/golangci-lint/releases/download/v2.12.2/golangci-lint-2.12.2-darwin-arm64.tar.gz"27url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/413470950"28provenance = "github-attestations"