Commit Graph
13 Commits
Author SHA1 Message Date
Renovate Bot 2d7a86144b Update module github.com/oschwald/maxminddb-golang/v2 to v2.5.0 2026-08-15 17:02:49 +00:00
claudecodeandClaude e2b0732014 Fix data races, robustness, and cleanup across codebase (#10-#21)
Concurrency & correctness:
- #10: guard IpDb Query/IsLoaded with RLock so Reload() (which reassigns d.r
  and closes the old reader) cannot race with concurrent lookups. Confirmed
  via -race regression test.
- #12: replace DbUpdatedAt time.Time with atomic.Int64 (cron writes,
  /metrics reads) to fix the read/write data race.
- #11: graceful HTTP shutdown (srv.Shutdown with 10s timeout) instead of
  srv.Close() aborting in-flight requests.
- #14: stop swallowing mergeMmdb() errors in fetchDbs() — keep the previous
  DB when a merge fails instead of reloading a possibly-empty output.
- #13: add resty timeout (2m) + retry (x2) to download() so a hung CDN can't
  stall the daily cron forever.
- #15: correct HTTP status codes (503 db loading, 404 not found via new
  ErrNotFound sentinel, 500 otherwise) instead of 200 on query error.

Robustness:
- #16: surface osx.Copy dstFile.Close() errors (flush may fail) via named
  return + defer.

Dependency migration:
- #17: migrate maxminddb-golang v1 -> v2. v2 is a breaking API
  (LookupNetwork -> Lookup returning Result, netip.Addr), so Query was
  rewritten; v1 dropped from go.mod.

Tests:
- #21: add internal/data unit tests (valid/invalid/not-found lookup) plus a
  concurrent Query/Reload race regression test. chdir to repo root in TestMain
  because data helpers use relative paths.

Cleanup:
- #18: README Go version 1.22 -> 1.25.
- #19: replace stray fmt.Printf with zerolog in ipdb.go.
- #20: .env.example API_PORT 28080 -> 8080 (container port, matches
  docker-compose 28080:8080 mapping) with an explanatory comment.

Closes #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-22 06:37:40 +00:00
codex d05ab4b402 update dep
Build Docker Image / build (arm64) (push) Successful in 1m44s
Build Docker Image / build (amd64) (push) Successful in 4m41s
Build Docker Image / amend-manifest (push) Successful in 11s
2026-07-09 10:40:13 +07:00
thuanle 0146e6446a Merge pull request 'Update module github.com/go-resty/resty/v2 to v2.17.2' (#5) from renovate/github.com-go-resty-resty-v2-2.x into main
Build Docker Image / build (arm64) (push) Failing after 37s
Build Docker Image / build (amd64) (push) Failing after 1m11s
Build Docker Image / amend-manifest (push) Has been skipped
Reviewed-on: #5
2026-07-06 10:13:36 +07:00
thuanle afa8ba4dba Merge pull request 'Update module github.com/rs/zerolog to v1.35.1' (#7) from renovate/github.com-rs-zerolog-1.x into main
Build Docker Image / build (arm64) (push) Failing after 34s
Build Docker Image / build (amd64) (push) Failing after 1m13s
Build Docker Image / amend-manifest (push) Has been skipped
Reviewed-on: #7
2026-07-06 10:13:02 +07:00
Renovate Bot d73dd1b5e8 Update module github.com/oschwald/maxminddb-golang to v2
renovate/artifacts Artifact file update failure
2026-07-04 17:02:48 +00:00
Renovate Bot 602e579365 Update module github.com/rs/zerolog to v1.35.1
renovate/artifacts Artifact file update failure
2026-07-04 17:02:46 +00:00
Renovate Bot 0b7d66cec0 Update module github.com/go-resty/resty/v2 to v2.17.2
renovate/artifacts Artifact file update failure
2026-07-04 17:02:43 +00:00
claudecodeandClaude 7f78bdd23d fix(ci): regenerate go.sum for robfig/cron/v3 v3.0.1
Build Docker Image / build (arm64) (push) Successful in 1m2s
Build Docker Image / build (amd64) (push) Successful in 1m59s
Build Docker Image / amend-manifest (push) Successful in 9s
Renovate bumped github.com/robfig/cron/v3 to v3.0.1 in go.mod (edde31c)
without regenerating go.sum, leaving only the v3.0.0 hash. The Docker CI
build (go build -mod=readonly) then failed with 'missing go.sum entry for
module providing package github.com/robfig/cron/v3' on both amd64/arm64.

Run go mod tidy to regenerate go.sum (also corrects indirect markers and
drops the unused spaolacci/murmur3 entry). Verified the exact CI build
command now passes locally.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 21:11:40 +07:00
Renovate Bot edde31c308 Update module github.com/robfig/cron/v3 to v3.0.1
renovate/artifacts Artifact file update failure
2026-06-13 17:01:44 +00:00
thuanle f33d064d6e tune update db 2024-08-05 15:06:39 +07:00
thuanle 1fb71e14c4 fix go mod 2024-07-14 00:19:20 +07:00
thuanle 4bb5ee09f0 first commit 2024-07-13 23:58:47 +07:00