Skip to content

Commit 12f8c53

Browse files
authored
Merge pull request #30 from backplane/update-deps-31-Mar-2025
update deps / improve builds
2 parents 4dd219c + a970cd3 commit 12f8c53

10 files changed

Lines changed: 88 additions & 78 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: run pre-commit
2727
uses: pre-commit/action@v3.0.1
2828
env:
29-
SKIP: no-commit-to-branch
29+
SKIP: no-commit-to-branch,golangci-lint
3030

3131
golangci-lint:
3232
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: actions/upload-artifact@v4
5151
with:
5252
name: binaries
53-
path: dist/cli*
53+
path: dist/*
5454

5555
image:
5656
runs-on: ubuntu-latest
@@ -139,7 +139,7 @@ jobs:
139139
tags: ${{ steps.meta.outputs.tags }}
140140
labels: |
141141
${{ steps.meta.outputs.labels }}
142-
platforms: linux/amd64,linux/arm64
142+
platforms: linux/amd64,linux/arm64,linux/arm
143143
cache-from: type=gha
144144
cache-to: type=gha,mode=max
145145

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
*.crt
33
*.pem
44
config.yaml
5+
dist/
56
key.json
67
registryproxy

.goreleaser.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
# - go generate ./...
7+
8+
builds:
9+
- env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- darwin
13+
- linux
14+
- windows
15+
goarch:
16+
- amd64
17+
- arm
18+
- arm64
19+
goarm:
20+
- "7"
21+
ignore:
22+
- goos: windows
23+
goarch: arm
24+
25+
universal_binaries:
26+
- replace: false
27+
28+
archives:
29+
- formats: [tar.gz]
30+
# this name template makes the OS and Arch compatible with the results of `uname`.
31+
name_template: >-
32+
{{ .ProjectName }}_
33+
{{- .Version -}}_
34+
{{- if eq .Os "darwin" -}}macos{{- else -}}{{ .Os }}{{- end -}}_
35+
{{- if eq .Arch "amd64" }}x86_64
36+
{{- else if eq .Arch "386" }}i386
37+
{{- else }}{{ .Arch }}{{ end }}
38+
{{- if .Arm }}v{{ .Arm }}{{ end }}
39+
# use zip for windows archives
40+
format_overrides:
41+
- goos: windows
42+
formats: [zip]
43+
44+
changelog:
45+
sort: asc
46+
filters:
47+
exclude:
48+
- "^docs:"
49+
- "^test:"
50+
51+
checksum:
52+
algorithm: sha256
53+
name_template: 'SHA256SUMS.txt'

.goreleaser.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-case-conflict
@@ -18,11 +18,15 @@ repos:
1818
- --branch
1919
- main
2020
- repo: https://github.com/golangci/golangci-lint
21-
rev: v1.58.0
21+
rev: v2.0.2
2222
hooks:
2323
- id: golangci-lint
2424
- repo: https://github.com/rhysd/actionlint
25-
rev: v1.6.27
25+
rev: v1.7.7
2626
hooks:
2727
- id: actionlint-docker
2828
name: check github workflows with actionlint
29+
- repo: https://github.com/hadolint/hadolint
30+
rev: v2.13.1-beta
31+
hooks:
32+
- id: hadolint-docker

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
FROM alpine:edge as dist
2-
ARG TARGETPLATFORM
1+
FROM alpine:edge AS dist
2+
ARG TARGETARCH TARGETOS
33

44
# this is only there if goreleaser has created it
5-
COPY dist /dist/
5+
COPY dist/registryproxy_${TARGETOS}_${TARGETARCH}_*/registryproxy* /
66
RUN set -eux; \
7-
platform_dirname=$(printf '%s' "${TARGETPLATFORM}" | tr / _ | tr A-Z a-z | sed 's/amd64/amd64_v1/g'); \
8-
subdir=$(printf '/dist/cli_%s' $platform_dirname); \
9-
cp ${subdir}/registryproxy /registryproxy; \
107
chmod +x /registryproxy;
118

129
FROM alpine:edge
10+
LABEL maintainer="Backplane BV <backplane@users.noreply.github.com>"
11+
12+
# hadolint ignore=DL3018
1313
RUN apk add --no-cache ca-certificates
14+
1415
COPY --from=dist /registryproxy /
1516

1617
ENTRYPOINT [ "/registryproxy" ]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ proxies:
3535
auth: "Basic cmljazpOZXZlckdvbm5hTGV0WW91RG93bjI="
3636
```
3737
38-
With the above configuration, navigating to reg.example.com/bp/true will serve the image from hub.docker.com/r/backplane/true. It also supports proxying a private repository at ghcr.io to a public URL.
38+
With the above configuration, pulling from `reg.example.com/bp/true` will serve the image from `hub.docker.com/r/backplane/true`. It also supports proxying a private repository at ghcr.io to a public URL.
3939

4040
To use RegistryProxy, follow these steps:
4141

4242
1. Create a config.yaml file with your specific configurations.
4343
2. Run the proxy:
4444
```bash
45-
docker run --rm -d -p 5000:5000 --volume "$(pwd)/config.yaml:/config.yaml:ro" backplane/registryproxy --config /config.yaml
45+
docker run --rm -d -p 5000:5000 --volume "$(pwd)/config.yaml:/config.yaml:ro" backplane/registryproxy
4646
```
4747

4848
## Security Considerations

go.mod

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
module registryproxy
22

3-
go 1.22
3+
go 1.23.0
4+
5+
toolchain go1.24.1
46

57
require (
68
aidanwoods.dev/go-paseto v1.5.4
7-
github.com/urfave/cli/v2 v2.27.5
9+
github.com/urfave/cli/v2 v2.27.6
810
gopkg.in/yaml.v2 v2.4.0
911
)
1012

1113
require (
1214
aidanwoods.dev/go-result v0.3.1 // indirect
13-
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
15+
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
1416
github.com/russross/blackfriday/v2 v2.1.0 // indirect
1517
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
16-
golang.org/x/crypto v0.33.0 // indirect
17-
golang.org/x/sys v0.30.0 // indirect
18+
golang.org/x/crypto v0.36.0 // indirect
19+
golang.org/x/sys v0.31.0 // indirect
1820
)

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ aidanwoods.dev/go-paseto v1.5.4 h1:MH+SBroZEk5Q5pjhVh4l48HIbrdWhWI3SZmA/DXhnuw=
22
aidanwoods.dev/go-paseto v1.5.4/go.mod h1:Rn37AIcqrvSMu0YPw65CrlEUuoyKL6Yw6B0htrGr3EU=
33
aidanwoods.dev/go-result v0.3.1 h1:ee98hpohYUVYbI+pa6gUHTyoRerIudgjky/IPSowDXQ=
44
aidanwoods.dev/go-result v0.3.1/go.mod h1:GKnFg8p/BKulVD3wsfULiPhpPmrTWyiTIbz8EWuUqSk=
5-
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
6-
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
5+
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
6+
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
77
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
88
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
99
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -12,14 +12,14 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf
1212
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
1313
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
1414
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
15-
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
16-
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
15+
github.com/urfave/cli/v2 v2.27.6 h1:VdRdS98FNhKZ8/Az8B7MTyGQmpIr36O1EHybx/LaZ4g=
16+
github.com/urfave/cli/v2 v2.27.6/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
1717
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
1818
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
19-
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
20-
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
21-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
22-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
19+
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
20+
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
21+
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
22+
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
2323
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2424
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2525
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

0 commit comments

Comments
 (0)