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
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
golang-x-deps:
|
||||
patterns:
|
||||
- "golang.org/x/*"
|
||||
|
||||
# Dependencies listed in .github/workflows/*.yml
|
||||
- package-ecosystem: "github-actions"
|
||||
|
|
|
|||
16
.github/workflows/tests.yml
vendored
16
.github/workflows/tests.yml
vendored
|
|
@ -13,7 +13,7 @@ permissions:
|
|||
contents: read
|
||||
|
||||
env:
|
||||
latest_go: "1.24.x"
|
||||
latest_go: "1.25.x"
|
||||
GO111MODULE: on
|
||||
|
||||
jobs:
|
||||
|
|
@ -22,17 +22,17 @@ jobs:
|
|||
matrix:
|
||||
include:
|
||||
- job_name: Linux
|
||||
go: 1.24.x
|
||||
go: 1.25.x
|
||||
os: ubuntu-latest
|
||||
check_changelog: true
|
||||
|
||||
- job_name: Linux (race)
|
||||
go: 1.24.x
|
||||
go: 1.25.x
|
||||
os: ubuntu-latest
|
||||
test_opts: "-race"
|
||||
|
||||
- job_name: Linux
|
||||
go: 1.23.x
|
||||
go: 1.24.x
|
||||
os: ubuntu-latest
|
||||
|
||||
name: ${{ matrix.job_name }} Go ${{ matrix.go }}
|
||||
|
|
@ -43,7 +43,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Go ${{ matrix.go }}
|
||||
uses: actions/setup-go@v6
|
||||
|
|
@ -78,7 +78,7 @@ jobs:
|
|||
checks: write
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Go ${{ env.latest_go }}
|
||||
uses: actions/setup-go@v6
|
||||
|
|
@ -86,10 +86,10 @@ jobs:
|
|||
go-version: ${{ env.latest_go }}
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
# 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
|
||||
|
||||
# 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.
|
||||
#
|
||||
# A sample config with all settings is here:
|
||||
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
|
||||
|
||||
version: "2"
|
||||
linters:
|
||||
# only enable the linters listed below
|
||||
disable-all: true
|
||||
default: none
|
||||
enable:
|
||||
- asciicheck
|
||||
# ensure that http response bodies are closed
|
||||
- bodyclose
|
||||
- copyloopvar
|
||||
# make sure all errors returned by functions are handled
|
||||
- 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
|
||||
# arguments do not align with the format string
|
||||
- govet
|
||||
|
||||
# make sure names and comments are used according to the conventions
|
||||
- revive
|
||||
|
||||
# consistent imports
|
||||
- importas
|
||||
# detect when assignments to existing variables are not used
|
||||
- ineffassign
|
||||
|
||||
- nolintlint
|
||||
# make sure names and comments are used according to the conventions
|
||||
- revive
|
||||
# run static analysis and find errors
|
||||
- staticcheck
|
||||
|
||||
# find unused variables, functions, structs, types, etc.
|
||||
- unused
|
||||
|
||||
# parse and typecheck code
|
||||
- typecheck
|
||||
|
||||
# ensure that http response bodies are closed
|
||||
- bodyclose
|
||||
|
||||
- importas
|
||||
|
||||
issues:
|
||||
# don't use the default exclude rules, this hides (among others) ignored
|
||||
# errors from Close() calls
|
||||
exclude-use-default: false
|
||||
|
||||
# list of things to not warn about
|
||||
exclude:
|
||||
# revive: do not warn about missing comments for exported stuff
|
||||
- exported (function|method|var|type|const) .* should have comment or be unexported
|
||||
# revive: ignore constants in all caps
|
||||
- don't use ALL_CAPS in Go names; use CamelCase
|
||||
# revive: lots of packages don't have such a comment
|
||||
- "package-comments: should have a package comment"
|
||||
- "redefines-builtin-id:"
|
||||
exclusions:
|
||||
rules:
|
||||
- path: (.+)\.go$
|
||||
text: exported (function|method|var|type|const) .* should have comment or be unexported
|
||||
- path: (.+)\.go$
|
||||
text: don't use ALL_CAPS in Go names; use CamelCase
|
||||
- path: (.+)\.go$
|
||||
text: "package-comments: should have a package comment"
|
||||
- path: (.+)\.go$
|
||||
text: "redefines-builtin-id:"
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
exclusions:
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Rest Server is a high performance HTTP server that implements restic's [REST bac
|
|||
|
||||
## 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.
|
||||
|
||||
|
|
|
|||
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"
|
||||
Main: "github.com/restic/rest-server/cmd/rest-server", // package name for the main package
|
||||
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.
|
||||
|
|
|
|||
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":
|
||||
tlscfg.MinVersion = tls.VersionTLS13
|
||||
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{
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/restic/rest-server
|
||||
|
||||
go 1.23.0
|
||||
go 1.24.0
|
||||
|
||||
require (
|
||||
github.com/coreos/go-systemd/v22 v22.5.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue