From b01419062118823f9892b61ceeeed79de860d9f0 Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 14:27:37 +0100 Subject: [PATCH 01/15] update pre-commit deps --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c530c4..b03a517 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -18,11 +18,11 @@ repos: - --branch - main - repo: https://github.com/golangci/golangci-lint - rev: v1.59.1 + rev: v2.8.0 hooks: - id: golangci-lint - repo: https://github.com/rhysd/actionlint - rev: v1.7.1 + rev: v1.7.10 hooks: - id: actionlint-docker name: check github workflows with actionlint From 5fc475112a5657b8490e83e8dd029b782a67a7cf Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 14:27:52 +0100 Subject: [PATCH 02/15] update actions deps --- .github/workflows/check.yml | 14 +++++++------- .github/workflows/release.yml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8770d3d..45a75e4 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,13 +14,13 @@ jobs: steps: # https://github.com/actions/checkout - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 # https://github.com/actions/setup-go - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: '>=1.20' + go-version: ">=1.20" # https://github.com/pre-commit/action - name: run pre-commit @@ -33,14 +33,14 @@ jobs: steps: # https://github.com/actions/checkout - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 # https://github.com/actions/setup-go - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: '>=1.20' + go-version: ">=1.20" # https://github.com/golangci/golangci-lint-action - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v9 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43aeb26..5c86bcd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,13 +13,13 @@ jobs: steps: # https://github.com/actions/checkout - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # https://github.com/actions/setup-go - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: ">=1.22" @@ -45,7 +45,7 @@ jobs: # https://github.com/actions/upload-artifact - name: Upload binaries as artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: binaries path: dist/cli* @@ -56,11 +56,11 @@ jobs: steps: # https://github.com/actions/checkout - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 # https://github.com/actions/download-artifact - name: Download binaries - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: name: binaries path: dist @@ -97,7 +97,7 @@ jobs: # https://github.com/actions/github-script - name: Fetch repository info id: repo_info - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: result-encoding: string script: | @@ -143,7 +143,7 @@ jobs: # https://github.com/peter-evans/dockerhub-description - name: Update Docker Hub Description - uses: peter-evans/dockerhub-description@v4 + uses: peter-evans/dockerhub-description@v5 with: username: ${{ github.actor }} password: ${{ secrets.DOCKER_HUB_TOKEN }} From 87afd1020a8501e985891649c8de286d6cf7fc8c Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 14:28:19 +0100 Subject: [PATCH 03/15] update go deps --- go.mod | 10 +++++----- go.sum | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index e8fde4d..a7a364a 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ module github.com/backplane/restic-runner -go 1.22.5 +go 1.25.6 require ( github.com/jinzhu/configor v1.2.2 - github.com/urfave/cli/v2 v2.27.2 + github.com/urfave/cli/v2 v2.27.7 ) require ( - github.com/BurntSushi/toml v1.4.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/BurntSushi/toml v1.6.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect + github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 38e9f14..211a2fb 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,16 @@ github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= -github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= +github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/jinzhu/configor v1.2.2 h1:sLgh6KMzpCmaQB4e+9Fu/29VErtBUqsS2t8C9BNIVsA= github.com/jinzhu/configor v1.2.2/go.mod h1:iFFSfOBKP3kC2Dku0ZGB3t3aulfQgTGJknodhFavsU8= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI= -github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM= -github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= -github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= +github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU= +github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4= +github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= +github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From a39c69f1e0f9b5bb7c94e5370744971d8e87c2a3 Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 14:28:40 +0100 Subject: [PATCH 04/15] improve readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d61669..4962f96 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ COMMANDS: help, h Shows a list of commands or help for one command GLOBAL OPTIONS: - --config value path to config file (default: "/Users/user/.restic-runner.yml") + --config value path to config file (default: "~/.restic-runner.yml") --loglevel value how verbosely to log, one of: DEBUG, INFO, WARN, ERROR (default: "INFO") - --pidfile value path to pid lock file; this file prevents issues concurrent jobs (default: "/Users/user/.restic-runner.pid") + --pidfile value path to pid lock file; this file prevents issues concurrent jobs (default: "~/.restic-runner.pid") --help, -h show help --version, -v print the version ``` From 624a8e391a80414e398590c487559d456696e49f Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 14:36:30 +0100 Subject: [PATCH 05/15] revert go version update in go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a7a364a..f9f0d48 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/backplane/restic-runner -go 1.25.6 +go 1.22.5 require ( github.com/jinzhu/configor v1.2.2 From 5dd74eafad96825701bd7634964180e58fa92898 Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 14:42:28 +0100 Subject: [PATCH 06/15] try to pull git version from go.mod, skip golangci-lint in pre-commit because we're running that separately --- .github/workflows/check.yml | 6 +++--- .github/workflows/release.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 45a75e4..c3f14b9 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -20,13 +20,13 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: ">=1.20" + go-version-file: "go.mod" # https://github.com/pre-commit/action - name: run pre-commit uses: pre-commit/action@v3.0.1 env: - SKIP: no-commit-to-branch + SKIP: no-commit-to-branch,golangci-lint golangci-lint: runs-on: ubuntu-latest @@ -39,7 +39,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: ">=1.20" + go-version-file: "go.mod" # https://github.com/golangci/golangci-lint-action - name: golangci-lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c86bcd..35aa91e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: ">=1.22" + go-version-file: "go.mod" # https://github.com/goreleaser/goreleaser-action - name: Run GoReleaser (Tag) From ccc21f74bdf11a4b2c007e1ba3d63c54b6aa9b3f Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 14:55:21 +0100 Subject: [PATCH 07/15] update docker login setup (using new Organization access tokens) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35aa91e..f9d6e28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,7 +91,7 @@ jobs: uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} # https://github.com/actions/github-script From 1d7e859f219304b161a66a09905b3c96e10a06e5 Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 15:00:06 +0100 Subject: [PATCH 08/15] take 2: update docker login setup (using new Organization access tokens) --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9d6e28..d0ecaf5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.DOCKER_HUB_TOKEN }} # https://github.com/docker/login-action @@ -91,7 +91,7 @@ jobs: uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} # https://github.com/actions/github-script @@ -145,6 +145,6 @@ jobs: - name: Update Docker Hub Description uses: peter-evans/dockerhub-description@v5 with: - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.DOCKER_HUB_TOKEN }} repository: ${{ github.repository }} From a193585583a85c2e31e3b03917c16b6acbee4c8c Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 15:03:51 +0100 Subject: [PATCH 09/15] minor fixes suggested by "goreleaser check" --- .goreleaser.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 545893b..f8a0117 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -21,6 +21,8 @@ builds: ignore: - goos: freebsd goarch: arm64 + - goos: windows + goarch: arm universal_binaries: - id: cli replace: false @@ -28,7 +30,8 @@ archives: - id: cli format_overrides: - goos: windows - format: zip + formats: + - zip files: - README.md - LICENSE.txt @@ -42,10 +45,10 @@ archives: {{- end -}}_ {{- .Arch -}} checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" changelog: sort: asc filters: exclude: - - '^docs:' - - '^test:' + - "^docs:" + - "^test:" From a8f14f2d1b0787e41772be2c239eadb1411efc3e Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 21:48:53 +0100 Subject: [PATCH 10/15] adding hadolint --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b03a517..34dce14 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,3 +26,7 @@ repos: hooks: - id: actionlint-docker name: check github workflows with actionlint + - repo: https://github.com/hadolint/hadolint + rev: v2.14.0 + hooks: + - id: hadolint-docker From 348f9abc1ee85dbacefad25a44355ece079cadad Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 21:49:05 +0100 Subject: [PATCH 11/15] add dist --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5eaa1bc..29fb237 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ config.yml +dist/ restic-runner testrepo From c09ab7e417f96ad7915f00373b36b3fa35928fbc Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 21:49:31 +0100 Subject: [PATCH 12/15] simplify archive naming --- .goreleaser.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index f8a0117..0f51637 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -38,11 +38,7 @@ archives: name_template: >- {{- .ProjectName -}}_ {{- .Version -}}_ - {{- if eq .Os "darwin" -}} - macos - {{- else -}} - {{ .Os }} - {{- end -}}_ + {{- if eq .Os "darwin" -}}macos{{- else -}}{{ .Os }}{{- end -}}_ {{- .Arch -}} checksum: name_template: "checksums.txt" From 1dd9f45e330df069b75d2efcd0a4b25d714fd3b7 Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 21:51:14 +0100 Subject: [PATCH 13/15] updates for the new goreleaser BuildTarget horribleness --- Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6146668..9e3488a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,23 @@ -FROM alpine:edge as dist +FROM alpine:edge AS dist ARG TARGETPLATFORM -# this is only there if goreleaser has created it +# dist is only there if goreleaser has created it before this build COPY dist /dist/ RUN set -eux; \ - platform_dirname=$(printf '%s' "${TARGETPLATFORM}" | tr / _ | tr A-Z a-z | sed 's/amd64/amd64_v1/g'); \ - subdir=$(printf '/dist/cli_%s' $platform_dirname); \ - cp ${subdir}/restic-runner /restic-runner; \ + case "${TARGETPLATFORM:-}" in \ + linux/amd64) f="dist/cli_linux_amd64_v1/restic-runner"; ;; \ + linux/arm) f="dist/cli_linux_arm_7/restic-runner"; ;; \ + linux/arm64) f="dist/cli_linux_arm64_v8.0/restic-runner"; ;; \ + *) echo "unknown TARGETPLATFORM: '${TARGETPLATFORM:-}'"; exit 1; ;; \ + esac; \ + cp "${f}" /; \ chmod +x /restic-runner; FROM alpine:edge -RUN apk add --no-cache ca-certificates +RUN apk add --no-cache \ + 'ca-certificates>=20251003-r0' \ + 'restic>=0.18.1' \ + ; COPY --from=dist /restic-runner / ENTRYPOINT [ "/restic-runner" ] From 035fb864da7daa0cfecdc63dba28e926e7c244a2 Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 21:51:37 +0100 Subject: [PATCH 14/15] add makefile to simplify some recurring tasks --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..896e9a5 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +restic-runner: + go build -o "$@" + +dist: + goreleaser build --auto-snapshot --clean + +.PHONY: docker-build +docker-build: dist + docker build -t backplane/restic-runner . + +.PHONY: docker-run +docker-run: docker-build + docker run --rm -it backplane/restic-runner + +.PHONY: clean +clean: + go clean + rm -rf dist From 28f83fcc643eb326ec2583117b13f851336b1e92 Mon Sep 17 00:00:00 2001 From: actualben Date: Tue, 20 Jan 2026 22:04:03 +0100 Subject: [PATCH 15/15] adjusting credential setup for DOCKERHUB_DESCRIPTION action --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0ecaf5..200ff81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,6 +145,6 @@ jobs: - name: Update Docker Hub Description uses: peter-evans/dockerhub-description@v5 with: - username: ${{ github.repository_owner }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_HUB_TOKEN_DOCKERHUB_DESCRIPTION }} repository: ${{ github.repository }}