From 2c54e5251441b041d25fb8b0786f5966dfc1a0ce Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Fri, 20 Nov 2026 00:05:05 +1100 Subject: [PATCH] Import golib from github.com/IUCLabs --- .woodpecker/pre-commit.yaml | 2 -- .woodpecker/release.yaml | 2 -- .woodpecker/test.yaml | 4 ---- Dockerfile | 4 ---- Makefile | 5 ----- README.md | 18 +----------------- go.mod | 2 +- go.sum | 4 ++-- internal/config/config.go | 2 +- internal/database/postgres.go | 2 +- migrations/migrations_test.go | 2 +- 11 files changed, 7 insertions(+), 40 deletions(-) diff --git a/.woodpecker/pre-commit.yaml b/.woodpecker/pre-commit.yaml index eac394b..4a90b68 100644 --- a/.woodpecker/pre-commit.yaml +++ b/.woodpecker/pre-commit.yaml @@ -7,8 +7,6 @@ steps: commands: - uvx pre-commit run --all-files environment: - # golib lives on Gitea; skip the public proxy/sum db. - GOPRIVATE: git.unkin.net GOCACHE_S3_BUCKET: gocache GOCACHE_S3_REGION: us-east-1 GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml index 73167eb..34314f7 100644 --- a/.woodpecker/release.yaml +++ b/.woodpecker/release.yaml @@ -9,8 +9,6 @@ steps: commands: - make build-cli VERSION=${CI_COMMIT_TAG} environment: - # golib lives on Gitea; skip the public proxy/sum db. - GOPRIVATE: git.unkin.net GOCACHE_S3_BUCKET: gocache GOCACHE_S3_REGION: us-east-1 GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index 58d2a49..b670ef4 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -7,8 +7,6 @@ steps: commands: - make lint environment: - # golib lives on Gitea; skip the public proxy/sum db. - GOPRIVATE: git.unkin.net GOCACHE_S3_BUCKET: gocache GOCACHE_S3_REGION: us-east-1 GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net @@ -37,8 +35,6 @@ steps: # they run in the docker-e2e path / locally. - make test-short environment: - # golib lives on Gitea; skip the public proxy/sum db. - GOPRIVATE: git.unkin.net GOCACHE_S3_BUCKET: gocache GOCACHE_S3_REGION: us-east-1 GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net diff --git a/Dockerfile b/Dockerfile index a6ae6d9..e905eda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,6 @@ RUN apk add --no-cache git WORKDIR /build -# golib is fetched straight from Gitea (git is installed above for it); the -# public proxy and sum db have no view of git.unkin.net modules. -ENV GOPRIVATE=git.unkin.net - COPY go.mod go.sum ./ RUN go mod download diff --git a/Makefile b/Makefile index b1180f5..d5ce444 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,6 @@ DIST := dist OS ?= $(shell go env GOOS) ARCH ?= $(shell go env GOARCH) -# git.unkin.net modules (golib) are fetched straight from Gitea, never via the -# public proxy or sum db, which have no view of them. Exported here rather than -# written with `go env -w`, so a fresh checkout needs no machine-local setup. -export GOPRIVATE := git.unkin.net - GO_VERSION_REQUIRED := 1.23 GO_VERSION_ACTUAL := $(shell go version | sed 's/go version go\([0-9]*\.[0-9]*\).*/\1/') diff --git a/README.md b/README.md index 24038d1..3787f9b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The SQL lives in [`migrations/`](migrations), is embedded in the `encapi` binary, and is applied at startup before the server listens — there is no mirrored copy in the deployment to drift out of sync. -The runner is [`golib/pg`](https://git.unkin.net/unkin/golib)'s +The runner is [`golib/pg`](https://github.com/IUCLabs/golib)'s `pg.NewMigrated`: encapi owns the SQL, the shared library owns the mechanics. Each start takes `pg_advisory_lock` on a key derived from the lock name `encapi-migrations`, creates `schema_migrations` (`version`, `applied_at`) if @@ -128,22 +128,6 @@ make test # full suite (Postgres via testcontainers) make test-short # skip container-backed DB tests ``` -### `GOPRIVATE` - -encapi depends on `git.unkin.net/unkin/golib`, which is served by Gitea and is -unknown to `proxy.golang.org` / `sum.golang.org`. Module resolution therefore -needs: - -``` -export GOPRIVATE=git.unkin.net -``` - -The `Makefile` exports it for every target, and the `Dockerfile` and the -woodpecker Go steps set it themselves, so `make build|test|lint` and CI work on -a clean checkout. Only bare `go` commands run outside `make` need it in your -shell — set it there (or in your shell profile) rather than with `go env -w`, -which is machine state this repo cannot carry. - ## Releases - **`encapi` server image** — tagging `vX.Y.Z` builds and pushes diff --git a/go.mod b/go.mod index 135b885..d449e68 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.unkin.net/unkin/encapi go 1.25.9 require ( - git.unkin.net/unkin/golib v0.1.0 + github.com/IUCLabs/golib v0.3.0 github.com/coreos/go-oidc/v3 v3.21.0 github.com/go-chi/chi/v5 v5.3.0 github.com/go-jose/go-jose/v4 v4.1.6 diff --git a/go.sum b/go.sum index 46890cb..bce13b0 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,11 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= -git.unkin.net/unkin/golib v0.1.0 h1:OjKT5TO7PuXiYQ/1A+I4S2VZ/IsAxXY1reGWwasDMqE= -git.unkin.net/unkin/golib v0.1.0/go.mod h1:1e3PpMLEfa03Re/6tlk+I2XPWzBQMSpw2MB+Aw2lkX4= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/IUCLabs/golib v0.3.0 h1:zFtuQ/q/ls10zBs9SMTJZwmY2qeCQesTkFCdSAcjrWw= +github.com/IUCLabs/golib v0.3.0/go.mod h1:dUHf+bBtDUFAF9CP9zZHGAk+9oPDe9wOXX6GzSNqe2w= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= diff --git a/internal/config/config.go b/internal/config/config.go index 1adf23e..1322cbb 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,7 +6,7 @@ import ( "os" "strconv" - "git.unkin.net/unkin/golib/pg" + "github.com/IUCLabs/golib/pg" ) // Config is the fully-resolved server configuration. diff --git a/internal/database/postgres.go b/internal/database/postgres.go index df00f99..135d4c7 100644 --- a/internal/database/postgres.go +++ b/internal/database/postgres.go @@ -10,7 +10,7 @@ import ( "github.com/jackc/pgx/v5/pgxpool" - "git.unkin.net/unkin/golib/pg" + "github.com/IUCLabs/golib/pg" "git.unkin.net/unkin/encapi/migrations" ) diff --git a/migrations/migrations_test.go b/migrations/migrations_test.go index 2aad52d..60d4884 100644 --- a/migrations/migrations_test.go +++ b/migrations/migrations_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "git.unkin.net/unkin/golib/pg" + "github.com/IUCLabs/golib/pg" ) // readDir returns the .sql files on disk, keyed by name. -- 2.47.3