From f1544ef49c8103b3a329b1961f8521e363bfcea2 Mon Sep 17 00:00:00 2001 From: Kevin McIntyre Date: Tue, 10 Feb 2026 10:07:57 -0500 Subject: [PATCH] chore: update module path to gitea.dockr.co/kev/go-jdenticon Move hosting from GitHub to private Gitea instance. --- Makefile | 6 +- PRIVATE_GO_REPO.md | 75 +++++++++++++++++++ cmd/jdenticon/batch.go | 2 +- cmd/jdenticon/batch_bench_test.go | 2 +- cmd/jdenticon/batch_test.go | 2 +- cmd/jdenticon/generate.go | 2 +- cmd/jdenticon/generate_test.go | 2 +- cmd/jdenticon/integration_test.go | 2 +- cmd/jdenticon/root.go | 2 +- examples/concurrent-usage.go | 2 +- go.mod | 2 +- internal/engine/cache.go | 2 +- internal/engine/fuzz_test.go | 2 +- internal/engine/generator.go | 4 +- internal/engine/generator_bench_test.go | 2 +- internal/engine/generator_core_test.go | 2 +- internal/engine/security_memory_test.go | 2 +- internal/engine/singleflight.go | 2 +- internal/perfsuite/regression_test.go | 2 +- internal/perfsuite/suite.go | 2 +- internal/renderer/baseline_comparison_test.go | 2 +- internal/renderer/integration_test.go | 2 +- internal/renderer/micro_bench_test.go | 2 +- internal/renderer/optimized_bench_test.go | 2 +- internal/renderer/png.go | 2 +- internal/renderer/png_test.go | 2 +- internal/renderer/renderer.go | 2 +- internal/renderer/renderer_bench_test.go | 2 +- internal/renderer/renderer_test.go | 2 +- internal/renderer/svg.go | 2 +- internal/renderer/svg_security_test.go | 2 +- internal/renderer/svg_test.go | 2 +- jdenticon/config.go | 4 +- jdenticon/generator.go | 4 +- jdenticon/icon.go | 4 +- jdenticon/security_test.go | 2 +- jdenticon/validation.go | 2 +- 37 files changed, 117 insertions(+), 42 deletions(-) create mode 100644 PRIVATE_GO_REPO.md diff --git a/Makefile b/Makefile index 72fa3e7..3edd302 100644 --- a/Makefile +++ b/Makefile @@ -52,9 +52,9 @@ COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown") BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") # Build flags for version injection -LDFLAGS=-ldflags "-X github.com/ungluedlabs/go-jdenticon/cmd/jdenticon.Version=$(VERSION) \ - -X github.com/ungluedlabs/go-jdenticon/cmd/jdenticon.Commit=$(COMMIT) \ - -X github.com/ungluedlabs/go-jdenticon/cmd/jdenticon.BuildDate=$(BUILD_DATE)" +LDFLAGS=-ldflags "-X gitea.dockr.co/kev/go-jdenticon/cmd/jdenticon.Version=$(VERSION) \ + -X gitea.dockr.co/kev/go-jdenticon/cmd/jdenticon.Commit=$(COMMIT) \ + -X gitea.dockr.co/kev/go-jdenticon/cmd/jdenticon.BuildDate=$(BUILD_DATE)" # Build targets CLI_BINARY=jdenticon-cli diff --git a/PRIVATE_GO_REPO.md b/PRIVATE_GO_REPO.md new file mode 100644 index 0000000..e6eff91 --- /dev/null +++ b/PRIVATE_GO_REPO.md @@ -0,0 +1,75 @@ +# Making This Go Repository Private + +Notes on what changes when converting this public GitHub repo to private. + +## CI/CD - No Changes Required + +GitHub Actions workflows continue to work because: +- `actions/checkout@v4` uses the built-in `GITHUB_TOKEN` which has access to its own repo +- No external private dependencies are required + +## Local Development + +### Configure Go for Private Repos + +Tell Go to bypass the public module proxy: + +```bash +go env -w GOPRIVATE=github.com/yourusername/go-jdenticon +``` + +### Git Authentication + +Ensure one of these is configured: +- SSH key linked to your GitHub account +- Personal Access Token (PAT) in git credential helper +- `~/.netrc` file with GitHub credentials + +## Using as a Dependency in Other Projects + +Any project that imports this module needs: + +1. Set `GOPRIVATE`: + ```bash + go env -w GOPRIVATE=github.com/yourusername/go-jdenticon + ``` + +2. Configure git authentication (see above) + +3. For CI in other repos, add to workflow: + ```yaml + - name: Configure git for private modules + run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/" + ``` + (Requires a `GH_PAT` secret with `repo` scope) + +## What Breaks + +| Feature | Status | Notes | +|---------|--------|-------| +| pkg.go.dev documentation | Unavailable | Public proxy can't access private repos | +| "Go Reference" badges | Broken | Remove from README or accept 404 | +| Codecov | May need token | Add `CODECOV_TOKEN` secret if uploads fail | +| Anonymous `go get` | Blocked | Users need authentication | + +## Codecov Fix (If Needed) + +If coverage uploads fail after going private: + +1. Get token from codecov.io for the repo +2. Add as repository secret: `CODECOV_TOKEN` +3. Update `.github/workflows/ci.yml`: + ```yaml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage.txt + token: ${{ secrets.CODECOV_TOKEN }} # Add this line + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + ``` + +## Reverting to Public + +Simply change the repository visibility back to public in GitHub settings. No code changes required. diff --git a/cmd/jdenticon/batch.go b/cmd/jdenticon/batch.go index b915752..cf35f3d 100644 --- a/cmd/jdenticon/batch.go +++ b/cmd/jdenticon/batch.go @@ -17,7 +17,7 @@ import ( "github.com/mattn/go-isatty" "github.com/schollz/progressbar/v3" "github.com/spf13/cobra" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) const ( diff --git a/cmd/jdenticon/batch_bench_test.go b/cmd/jdenticon/batch_bench_test.go index 47e68a5..3c9ab80 100644 --- a/cmd/jdenticon/batch_bench_test.go +++ b/cmd/jdenticon/batch_bench_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) // benchmarkSizes defines different test scenarios for batch processing diff --git a/cmd/jdenticon/batch_test.go b/cmd/jdenticon/batch_test.go index 41c62f3..e478a98 100644 --- a/cmd/jdenticon/batch_test.go +++ b/cmd/jdenticon/batch_test.go @@ -13,7 +13,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) // TestBatchCommand tests the batch command functionality diff --git a/cmd/jdenticon/generate.go b/cmd/jdenticon/generate.go index dccafdd..699cb59 100644 --- a/cmd/jdenticon/generate.go +++ b/cmd/jdenticon/generate.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/spf13/cobra" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) // isRootPath checks if the given path is a filesystem root. diff --git a/cmd/jdenticon/generate_test.go b/cmd/jdenticon/generate_test.go index 24d4435..55b8c76 100644 --- a/cmd/jdenticon/generate_test.go +++ b/cmd/jdenticon/generate_test.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) // TestGenerateCommand tests the generate command functionality diff --git a/cmd/jdenticon/integration_test.go b/cmd/jdenticon/integration_test.go index 6d053cd..e65d89a 100644 --- a/cmd/jdenticon/integration_test.go +++ b/cmd/jdenticon/integration_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) // testBinaryName returns the correct test binary name for the current OS. diff --git a/cmd/jdenticon/root.go b/cmd/jdenticon/root.go index 2cf6640..ffdce30 100644 --- a/cmd/jdenticon/root.go +++ b/cmd/jdenticon/root.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) const ( diff --git a/examples/concurrent-usage.go b/examples/concurrent-usage.go index fa288dc..48a3227 100644 --- a/examples/concurrent-usage.go +++ b/examples/concurrent-usage.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) func main() { diff --git a/go.mod b/go.mod index 3d5c852..6e99f99 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ungluedlabs/go-jdenticon +module gitea.dockr.co/kev/go-jdenticon go 1.24.0 diff --git a/internal/engine/cache.go b/internal/engine/cache.go index f767057..a372c73 100644 --- a/internal/engine/cache.go +++ b/internal/engine/cache.go @@ -6,7 +6,7 @@ import ( "sync/atomic" lru "github.com/hashicorp/golang-lru/v2" - "github.com/ungluedlabs/go-jdenticon/internal/constants" + "gitea.dockr.co/kev/go-jdenticon/internal/constants" ) // CacheMetrics holds cache performance metrics using atomic operations for efficiency diff --git a/internal/engine/fuzz_test.go b/internal/engine/fuzz_test.go index 69f1d5f..1d68aaa 100644 --- a/internal/engine/fuzz_test.go +++ b/internal/engine/fuzz_test.go @@ -5,7 +5,7 @@ import ( "math" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/util" + "gitea.dockr.co/kev/go-jdenticon/internal/util" ) // FuzzGeneratorGenerate tests the internal engine generator with arbitrary inputs diff --git a/internal/engine/generator.go b/internal/engine/generator.go index 3880fab..8fdb26d 100644 --- a/internal/engine/generator.go +++ b/internal/engine/generator.go @@ -7,8 +7,8 @@ import ( "sync" lru "github.com/hashicorp/golang-lru/v2" - "github.com/ungluedlabs/go-jdenticon/internal/constants" - "github.com/ungluedlabs/go-jdenticon/internal/util" + "gitea.dockr.co/kev/go-jdenticon/internal/constants" + "gitea.dockr.co/kev/go-jdenticon/internal/util" "golang.org/x/sync/singleflight" ) diff --git a/internal/engine/generator_bench_test.go b/internal/engine/generator_bench_test.go index fc546ae..78d8d36 100644 --- a/internal/engine/generator_bench_test.go +++ b/internal/engine/generator_bench_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/util" + "gitea.dockr.co/kev/go-jdenticon/internal/util" ) var benchmarkHashes = []string{ diff --git a/internal/engine/generator_core_test.go b/internal/engine/generator_core_test.go index 10675cb..3152c2f 100644 --- a/internal/engine/generator_core_test.go +++ b/internal/engine/generator_core_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/util" + "gitea.dockr.co/kev/go-jdenticon/internal/util" ) func TestNewGenerator(t *testing.T) { diff --git a/internal/engine/security_memory_test.go b/internal/engine/security_memory_test.go index f0225a1..3e2ea1f 100644 --- a/internal/engine/security_memory_test.go +++ b/internal/engine/security_memory_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/ungluedlabs/go-jdenticon/internal/constants" + "gitea.dockr.co/kev/go-jdenticon/internal/constants" ) // TestResourceExhaustionProtection tests that the generator properly blocks diff --git a/internal/engine/singleflight.go b/internal/engine/singleflight.go index 8d1038d..686319f 100644 --- a/internal/engine/singleflight.go +++ b/internal/engine/singleflight.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/ungluedlabs/go-jdenticon/internal/util" + "gitea.dockr.co/kev/go-jdenticon/internal/util" ) // Generate creates an identicon with the specified hash and size diff --git a/internal/perfsuite/regression_test.go b/internal/perfsuite/regression_test.go index 2d32802..905b0e9 100644 --- a/internal/perfsuite/regression_test.go +++ b/internal/perfsuite/regression_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/perfsuite" + "gitea.dockr.co/kev/go-jdenticon/internal/perfsuite" ) // TestPerformanceRegressionSuite can be called from a regular Go test diff --git a/internal/perfsuite/suite.go b/internal/perfsuite/suite.go index e088247..0e2d8af 100644 --- a/internal/perfsuite/suite.go +++ b/internal/perfsuite/suite.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/ungluedlabs/go-jdenticon/jdenticon" + "gitea.dockr.co/kev/go-jdenticon/jdenticon" ) // PerformanceBenchmark represents a single performance test case diff --git a/internal/renderer/baseline_comparison_test.go b/internal/renderer/baseline_comparison_test.go index 0fd6703..d77f0bd 100644 --- a/internal/renderer/baseline_comparison_test.go +++ b/internal/renderer/baseline_comparison_test.go @@ -3,7 +3,7 @@ package renderer import ( "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // Benchmark optimized renderer to compare against baseline (958,401 B/op) diff --git a/internal/renderer/integration_test.go b/internal/renderer/integration_test.go index 75dc30b..6230d15 100644 --- a/internal/renderer/integration_test.go +++ b/internal/renderer/integration_test.go @@ -7,7 +7,7 @@ import ( "image/png" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // TestPNGRenderer_VisualRegression tests that PNG output matches expected characteristics diff --git a/internal/renderer/micro_bench_test.go b/internal/renderer/micro_bench_test.go index 7ebd340..f33e215 100644 --- a/internal/renderer/micro_bench_test.go +++ b/internal/renderer/micro_bench_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // ============================================================================ diff --git a/internal/renderer/optimized_bench_test.go b/internal/renderer/optimized_bench_test.go index 6a37d1d..e06d409 100644 --- a/internal/renderer/optimized_bench_test.go +++ b/internal/renderer/optimized_bench_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // Benchmark optimized PNG renderer vs original FastPNG renderer diff --git a/internal/renderer/png.go b/internal/renderer/png.go index e53753d..4013884 100644 --- a/internal/renderer/png.go +++ b/internal/renderer/png.go @@ -9,7 +9,7 @@ import ( "math" "sync" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // PNG rendering constants diff --git a/internal/renderer/png_test.go b/internal/renderer/png_test.go index 6c07f94..88821a8 100644 --- a/internal/renderer/png_test.go +++ b/internal/renderer/png_test.go @@ -5,7 +5,7 @@ import ( "image/png" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) func TestNewPNGRenderer(t *testing.T) { diff --git a/internal/renderer/renderer.go b/internal/renderer/renderer.go index 49df28e..728c34a 100644 --- a/internal/renderer/renderer.go +++ b/internal/renderer/renderer.go @@ -1,7 +1,7 @@ package renderer import ( - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // Renderer defines the interface for rendering identicons to various output formats. diff --git a/internal/renderer/renderer_bench_test.go b/internal/renderer/renderer_bench_test.go index 27c786b..3c17081 100644 --- a/internal/renderer/renderer_bench_test.go +++ b/internal/renderer/renderer_bench_test.go @@ -3,7 +3,7 @@ package renderer import ( "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) var benchmarkSizes = []int{ diff --git a/internal/renderer/renderer_test.go b/internal/renderer/renderer_test.go index f4fc0b8..cfd924f 100644 --- a/internal/renderer/renderer_test.go +++ b/internal/renderer/renderer_test.go @@ -3,7 +3,7 @@ package renderer import ( "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) func TestNewBaseRenderer(t *testing.T) { diff --git a/internal/renderer/svg.go b/internal/renderer/svg.go index f82b6f2..1442ae0 100644 --- a/internal/renderer/svg.go +++ b/internal/renderer/svg.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // SVG rendering constants diff --git a/internal/renderer/svg_security_test.go b/internal/renderer/svg_security_test.go index eed8eec..8308c30 100644 --- a/internal/renderer/svg_security_test.go +++ b/internal/renderer/svg_security_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // TestSVGRenderer_SecurityValidation tests defense-in-depth color validation diff --git a/internal/renderer/svg_test.go b/internal/renderer/svg_test.go index e7f10ed..b848694 100644 --- a/internal/renderer/svg_test.go +++ b/internal/renderer/svg_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) func TestSVGPath_AddPolygon(t *testing.T) { diff --git a/jdenticon/config.go b/jdenticon/config.go index 182f268..d1a6855 100644 --- a/jdenticon/config.go +++ b/jdenticon/config.go @@ -4,8 +4,8 @@ import ( "fmt" "regexp" - "github.com/ungluedlabs/go-jdenticon/internal/constants" - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/constants" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // hexColorRegex validates hex color strings in #RGB or #RRGGBB format. diff --git a/jdenticon/generator.go b/jdenticon/generator.go index 8aa4923..4a24f27 100644 --- a/jdenticon/generator.go +++ b/jdenticon/generator.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/ungluedlabs/go-jdenticon/internal/engine" - "github.com/ungluedlabs/go-jdenticon/internal/util" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/util" ) // Generator provides thread-safe identicon generation with caching. diff --git a/jdenticon/icon.go b/jdenticon/icon.go index 433a973..863150c 100644 --- a/jdenticon/icon.go +++ b/jdenticon/icon.go @@ -3,8 +3,8 @@ package jdenticon import ( "fmt" - "github.com/ungluedlabs/go-jdenticon/internal/engine" - "github.com/ungluedlabs/go-jdenticon/internal/renderer" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/renderer" ) // Icon represents a generated identicon that can be rendered as SVG or PNG. diff --git a/jdenticon/security_test.go b/jdenticon/security_test.go index 90c36e6..800032e 100644 --- a/jdenticon/security_test.go +++ b/jdenticon/security_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/ungluedlabs/go-jdenticon/internal/constants" + "gitea.dockr.co/kev/go-jdenticon/internal/constants" ) // TestDoSProtection_InputLength tests protection against large input strings. diff --git a/jdenticon/validation.go b/jdenticon/validation.go index f8d0f1f..6d82daa 100644 --- a/jdenticon/validation.go +++ b/jdenticon/validation.go @@ -1,7 +1,7 @@ package jdenticon import ( - "github.com/ungluedlabs/go-jdenticon/internal/engine" + "gitea.dockr.co/kev/go-jdenticon/internal/engine" ) // validation.go contains helper functions for input validation and DoS protection.