Skip to content

Commit ccbb37c

Browse files
committed
Merge branch 'filemode-dirmode-option-support' of github.com:mlusetti/rest-server into filemode-dirmode-option-support
a rebase or something did screw up a prev commit
2 parents 408aa04 + 2624163 commit ccbb37c

File tree

7 files changed

+43
-14
lines changed

7 files changed

+43
-14
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ on:
88
# run tests for all pull requests
99
pull_request:
1010

11+
env:
12+
latest_go: "1.18.x"
13+
GO111MODULE: on
14+
1115
jobs:
1216
test:
1317
strategy:
1418
matrix:
1519
go:
16-
- 1.14.x
1720
- 1.15.x
1821
- 1.16.x
1922
- 1.17.x
23+
- 1.18.x
2024
runs-on: ubuntu-latest
2125
name: Go ${{ matrix.go }}
2226

@@ -50,15 +54,28 @@ jobs:
5054
name: lint
5155
runs-on: ubuntu-latest
5256
steps:
57+
- name: Set up Go ${{ env.latest_go }}
58+
uses: actions/setup-go@v2
59+
with:
60+
go-version: ${{ env.latest_go }}
61+
5362
- name: Check out code
5463
uses: actions/checkout@v2
5564

5665
- name: golangci-lint
5766
uses: golangci/golangci-lint-action@v2
5867
with:
5968
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
60-
version: v1.41
69+
version: v1.45
70+
# Optional: show only new issues if it's a pull request. The default value is `false`.
71+
only-new-issues: true
6172
args: --verbose --timeout 5m
73+
skip-go-installation: true
74+
75+
# only run golangci-lint for pull requests, otherwise ALL hints get
76+
# reported. We need to slowly address all issues until we can enable
77+
# linting the master branch :)
78+
if: github.event_name == 'pull_request'
6279

6380
- name: Check go.mod/go.sum
6481
run: |

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ issues:
5151

5252
# list of things to not warn about
5353
exclude:
54-
# golint: do not warn about missing comments for exported stuff
55-
- exported (function|method|var|type|const) `.*` should have comment or be unexported
56-
# golint: ignore constants in all caps
54+
# revive: do not warn about missing comments for exported stuff
55+
- exported (function|method|var|type|const) .* should have comment or be unexported
56+
# revive: ignore constants in all caps
5757
- don't use ALL_CAPS in Go names; use CamelCase

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Rest Server is a high performance HTTP server that implements restic's [REST bac
1111

1212
## Requirements
1313

14-
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.
14+
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.
1515

1616
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.
1717

build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var config = Config{
5858
Namespace: "github.com/restic/rest-server", // subdir of GOPATH, e.g. "github.com/foo/bar"
5959
Main: "github.com/restic/rest-server/cmd/rest-server", // package name for the main package
6060
Tests: []string{"./..."}, // tests to run
61-
MinVersion: GoVersion{Major: 1, Minor: 14, Patch: 0}, // minimum Go version supported
61+
MinVersion: GoVersion{Major: 1, Minor: 15, Patch: 0}, // minimum Go version supported
6262
}
6363

6464
// Config configures the build.

cmd/rest-server/listener_unix.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !windows
12
// +build !windows
23

34
package main

cmd/rest-server/main_test.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,23 @@ func TestTLSSettings(t *testing.T) {
2727
expected expected
2828
}{
2929
{passed{TLS: false}, expected{"", "", false}},
30-
{passed{TLS: true}, expected{"/tmp/restic/private_key", "/tmp/restic/public_key", false}},
31-
{passed{Path: "/tmp", TLS: true}, expected{"/tmp/private_key", "/tmp/public_key", false}},
32-
{passed{Path: "/tmp", TLS: true, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"/etc/restic/key", "/etc/restic/cert", false}},
33-
{passed{Path: "/tmp", TLS: false, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"", "", true}},
34-
{passed{Path: "/tmp", TLS: false, TLSKey: "/etc/restic/key"}, expected{"", "", true}},
35-
{passed{Path: "/tmp", TLS: false, TLSCert: "/etc/restic/cert"}, expected{"", "", true}},
30+
{passed{TLS: true}, expected{
31+
filepath.Join(os.TempDir(), "restic/private_key"),
32+
filepath.Join(os.TempDir(), "restic/public_key"),
33+
false,
34+
}},
35+
{passed{
36+
Path: os.TempDir(),
37+
TLS: true,
38+
}, expected{
39+
filepath.Join(os.TempDir(), "private_key"),
40+
filepath.Join(os.TempDir(), "public_key"),
41+
false,
42+
}},
43+
{passed{Path: os.TempDir(), TLS: true, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"/etc/restic/key", "/etc/restic/cert", false}},
44+
{passed{Path: os.TempDir(), TLS: false, TLSKey: "/etc/restic/key", TLSCert: "/etc/restic/cert"}, expected{"", "", true}},
45+
{passed{Path: os.TempDir(), TLS: false, TLSKey: "/etc/restic/key"}, expected{"", "", true}},
46+
{passed{Path: os.TempDir(), TLS: false, TLSCert: "/etc/restic/cert"}, expected{"", "", true}},
3647
}
3748

3849
for _, test := range tests {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/restic/rest-server
22

3-
go 1.14
3+
go 1.15
44

55
require (
66
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf

0 commit comments

Comments
 (0)