Sync settinsg with restic, require Go >= 1.15

This commit is contained in:
Alexander Neumann
2022-04-15 09:38:08 +02:00
parent 8538ce7859
commit a87a50ad11
5 changed files with 25 additions and 10 deletions

View File

@@ -8,15 +8,19 @@ on:
# run tests for all pull requests # run tests for all pull requests
pull_request: pull_request:
env:
latest_go: "1.18.x"
GO111MODULE: on
jobs: jobs:
test: test:
strategy: strategy:
matrix: matrix:
go: go:
- 1.14.x
- 1.15.x - 1.15.x
- 1.16.x - 1.16.x
- 1.17.x - 1.17.x
- 1.18.x
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Go ${{ matrix.go }} name: Go ${{ matrix.go }}

View File

@@ -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.14 or higher to build. The only tested compiler is the official Go compiler. Building server with `gccgo` may work, but is not supported. Rest Server requires Go 1.15 or higher to build. The only tested compiler is the official Go compiler. Building server with `gccgo` may work, but is not supported.
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.

View File

@@ -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: 14, Patch: 0}, // minimum Go version supported MinVersion: GoVersion{Major: 1, Minor: 15, Patch: 0}, // minimum Go version supported
} }
// Config configures the build. // Config configures the build.

View File

@@ -27,12 +27,23 @@ func TestTLSSettings(t *testing.T) {
expected expected expected expected
}{ }{
{passed{TLS: false}, expected{"", "", false}}, {passed{TLS: false}, expected{"", "", false}},
{passed{TLS: true}, expected{"/tmp/restic/private_key", "/tmp/restic/public_key", false}}, {passed{TLS: true}, expected{
{passed{Path: "/tmp", TLS: true}, expected{"/tmp/private_key", "/tmp/public_key", false}}, filepath.Join(os.TempDir(), "restic/private_key"),
{passed{Path: "/tmp", TLS: true, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"/etc/restic/key", "/etc/restic/cert", false}}, filepath.Join(os.TempDir(), "restic/public_key"),
{passed{Path: "/tmp", TLS: false, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"", "", true}}, false,
{passed{Path: "/tmp", TLS: false, TLSKey: "/etc/restic/key"}, expected{"", "", true}}, }},
{passed{Path: "/tmp", TLS: false, TLSCert: "/etc/restic/cert"}, expected{"", "", true}}, {passed{
Path: os.TempDir(),
TLS: true,
}, expected{
filepath.Join(os.TempDir(), "private_key"),
filepath.Join(os.TempDir(), "public_key"),
false,
}},
{passed{Path: os.TempDir(), TLS: true, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"/etc/restic/key", "/etc/restic/cert", false}},
{passed{Path: os.TempDir(), TLS: false, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"", "", true}},
{passed{Path: os.TempDir(), TLS: false, TLSKey: "/etc/restic/key"}, expected{"", "", true}},
{passed{Path: os.TempDir(), TLS: false, TLSCert: "/etc/restic/cert"}, expected{"", "", true}},
} }
for _, test := range tests { for _, test := range tests {

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/restic/rest-server module github.com/restic/rest-server
go 1.14 go 1.15
require ( require (
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf