mirror of
https://github.com/restic/rest-server.git
synced 2025-12-08 06:09:47 +00:00
Merge pull request #373 from MichaelEischer/update-ci
Require Go 1.24 and sync CI configuration with restic
This commit is contained in:
commit
fe8f991d9c
8 changed files with 55 additions and 54 deletions
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
|
|
@ -5,6 +5,10 @@ updates:
|
||||||
directory: "/" # Location of package manifests
|
directory: "/" # Location of package manifests
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
|
groups:
|
||||||
|
golang-x-deps:
|
||||||
|
patterns:
|
||||||
|
- "golang.org/x/*"
|
||||||
|
|
||||||
# Dependencies listed in .github/workflows/*.yml
|
# Dependencies listed in .github/workflows/*.yml
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
|
|
|
||||||
16
.github/workflows/tests.yml
vendored
16
.github/workflows/tests.yml
vendored
|
|
@ -13,7 +13,7 @@ permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
latest_go: "1.24.x"
|
latest_go: "1.25.x"
|
||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
@ -22,17 +22,17 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- job_name: Linux
|
- job_name: Linux
|
||||||
go: 1.24.x
|
go: 1.25.x
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
check_changelog: true
|
check_changelog: true
|
||||||
|
|
||||||
- job_name: Linux (race)
|
- job_name: Linux (race)
|
||||||
go: 1.24.x
|
go: 1.25.x
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
test_opts: "-race"
|
test_opts: "-race"
|
||||||
|
|
||||||
- job_name: Linux
|
- job_name: Linux
|
||||||
go: 1.23.x
|
go: 1.24.x
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
|
||||||
name: ${{ matrix.job_name }} Go ${{ matrix.go }}
|
name: ${{ matrix.job_name }} Go ${{ matrix.go }}
|
||||||
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Set up Go ${{ matrix.go }}
|
- name: Set up Go ${{ matrix.go }}
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
|
|
@ -78,7 +78,7 @@ jobs:
|
||||||
checks: write
|
checks: write
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Set up Go ${{ env.latest_go }}
|
- name: Set up Go ${{ env.latest_go }}
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
|
|
@ -86,10 +86,10 @@ jobs:
|
||||||
go-version: ${{ env.latest_go }}
|
go-version: ${{ env.latest_go }}
|
||||||
|
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v6
|
uses: golangci/golangci-lint-action@v9
|
||||||
with:
|
with:
|
||||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||||
version: v1.64.8
|
version: v2.4.0
|
||||||
args: --verbose --timeout 5m
|
args: --verbose --timeout 5m
|
||||||
|
|
||||||
# only run golangci-lint for pull requests, otherwise ALL hints get
|
# only run golangci-lint for pull requests, otherwise ALL hints get
|
||||||
|
|
|
||||||
|
|
@ -1,56 +1,47 @@
|
||||||
# This is the configuration for golangci-lint for the restic project.
|
version: "2"
|
||||||
#
|
|
||||||
# A sample config with all settings is here:
|
|
||||||
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
|
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
# only enable the linters listed below
|
# only enable the linters listed below
|
||||||
disable-all: true
|
default: none
|
||||||
enable:
|
enable:
|
||||||
|
- asciicheck
|
||||||
|
# ensure that http response bodies are closed
|
||||||
|
- bodyclose
|
||||||
|
- copyloopvar
|
||||||
# make sure all errors returned by functions are handled
|
# make sure all errors returned by functions are handled
|
||||||
- errcheck
|
- errcheck
|
||||||
|
|
||||||
# show how code can be simplified
|
|
||||||
- gosimple
|
|
||||||
|
|
||||||
# make sure code is formatted
|
|
||||||
- gofmt
|
|
||||||
|
|
||||||
# examine code and report suspicious constructs, such as Printf calls whose
|
# examine code and report suspicious constructs, such as Printf calls whose
|
||||||
# arguments do not align with the format string
|
# arguments do not align with the format string
|
||||||
- govet
|
- govet
|
||||||
|
# consistent imports
|
||||||
# make sure names and comments are used according to the conventions
|
- importas
|
||||||
- revive
|
|
||||||
|
|
||||||
# detect when assignments to existing variables are not used
|
# detect when assignments to existing variables are not used
|
||||||
- ineffassign
|
- ineffassign
|
||||||
|
- nolintlint
|
||||||
|
# make sure names and comments are used according to the conventions
|
||||||
|
- revive
|
||||||
# run static analysis and find errors
|
# run static analysis and find errors
|
||||||
- staticcheck
|
- staticcheck
|
||||||
|
|
||||||
# find unused variables, functions, structs, types, etc.
|
# find unused variables, functions, structs, types, etc.
|
||||||
- unused
|
- unused
|
||||||
|
exclusions:
|
||||||
# parse and typecheck code
|
rules:
|
||||||
- typecheck
|
- path: (.+)\.go$
|
||||||
|
text: exported (function|method|var|type|const) .* should have comment or be unexported
|
||||||
# ensure that http response bodies are closed
|
- path: (.+)\.go$
|
||||||
- bodyclose
|
text: don't use ALL_CAPS in Go names; use CamelCase
|
||||||
|
- path: (.+)\.go$
|
||||||
- importas
|
text: "package-comments: should have a package comment"
|
||||||
|
- path: (.+)\.go$
|
||||||
issues:
|
text: "redefines-builtin-id:"
|
||||||
# don't use the default exclude rules, this hides (among others) ignored
|
paths:
|
||||||
# errors from Close() calls
|
- third_party$
|
||||||
exclude-use-default: false
|
- builtin$
|
||||||
|
- examples$
|
||||||
# list of things to not warn about
|
formatters:
|
||||||
exclude:
|
enable:
|
||||||
# revive: do not warn about missing comments for exported stuff
|
- gofmt
|
||||||
- exported (function|method|var|type|const) .* should have comment or be unexported
|
exclusions:
|
||||||
# revive: ignore constants in all caps
|
paths:
|
||||||
- don't use ALL_CAPS in Go names; use CamelCase
|
- third_party$
|
||||||
# revive: lots of packages don't have such a comment
|
- builtin$
|
||||||
- "package-comments: should have a package comment"
|
- examples$
|
||||||
- "redefines-builtin-id:"
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ Rest Server is a high performance HTTP server that implements restic's [REST bac
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
Rest Server requires Go 1.23 or higher to build. The only tested compiler is the official Go compiler.
|
Rest Server requires Go 1.24 or higher to build. The only tested compiler is the official Go compiler.
|
||||||
|
|
||||||
The required version of restic backup client to use with `rest-server` is [v0.7.1](https://github.com/restic/restic/releases/tag/v0.7.1) or higher.
|
The required version of restic backup client to use with `rest-server` is [v0.7.1](https://github.com/restic/restic/releases/tag/v0.7.1) or higher.
|
||||||
|
|
||||||
|
|
|
||||||
2
build.go
2
build.go
|
|
@ -58,7 +58,7 @@ var config = Config{
|
||||||
Namespace: "github.com/restic/rest-server", // subdir of GOPATH, e.g. "github.com/foo/bar"
|
Namespace: "github.com/restic/rest-server", // subdir of GOPATH, e.g. "github.com/foo/bar"
|
||||||
Main: "github.com/restic/rest-server/cmd/rest-server", // package name for the main package
|
Main: "github.com/restic/rest-server/cmd/rest-server", // package name for the main package
|
||||||
Tests: []string{"./..."}, // tests to run
|
Tests: []string{"./..."}, // tests to run
|
||||||
MinVersion: GoVersion{Major: 1, Minor: 23, Patch: 0}, // minimum Go version supported
|
MinVersion: GoVersion{Major: 1, Minor: 24, Patch: 0}, // minimum Go version supported
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config configures the build.
|
// Config configures the build.
|
||||||
|
|
|
||||||
6
changelog/unreleased/pull-373
Normal file
6
changelog/unreleased/pull-373
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
Change: Update dependencies and require Go 1.24 or newer
|
||||||
|
|
||||||
|
All dependencies have been updated. Rest-server now requires Go 1.24 or newer
|
||||||
|
to build.
|
||||||
|
|
||||||
|
https://github.com/restic/rest-server/pull/373
|
||||||
|
|
@ -196,7 +196,7 @@ func (app *restServerApp) runRoot(_ *cobra.Command, _ []string) error {
|
||||||
case "1.3":
|
case "1.3":
|
||||||
tlscfg.MinVersion = tls.VersionTLS13
|
tlscfg.MinVersion = tls.VersionTLS13
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unsupported TLS min version: %s. Allowed versions are 1.2 or 1.3", app.Server.TLSMinVer)
|
return fmt.Errorf("unsupported TLS min version: %s. Allowed versions are 1.2 or 1.3", app.Server.TLSMinVer)
|
||||||
}
|
}
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/restic/rest-server
|
module github.com/restic/rest-server
|
||||||
|
|
||||||
go 1.23.0
|
go 1.24.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/coreos/go-systemd/v22 v22.5.0
|
github.com/coreos/go-systemd/v22 v22.5.0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue