Import golib from github.com/IUCLabs
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

This commit is contained in:
2026-11-20 00:05:05 +11:00
parent 6302091323
commit 2c54e52514
11 changed files with 7 additions and 40 deletions
-2
View File
@@ -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
-2
View File
@@ -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
-4
View File
@@ -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
-4
View File
@@ -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
-5
View File
@@ -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/')
+1 -17
View File
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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=
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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"
)
+1 -1
View File
@@ -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.