forked from TrueCloudLab/restic
Merge pull request #4403 from MichaelEischer/fix-certificate-env-handling
Fix certificate env handling
This commit is contained in:
commit
7042190807
2 changed files with 13 additions and 3 deletions
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
|
@ -141,6 +141,14 @@ jobs:
|
|||
run: |
|
||||
go run build.go
|
||||
|
||||
- name: Minimal test
|
||||
run: |
|
||||
./restic init
|
||||
./restic backup .
|
||||
env:
|
||||
RESTIC_REPOSITORY: ../testrepo
|
||||
RESTIC_PASSWORD: password
|
||||
|
||||
- name: Run local Tests
|
||||
env:
|
||||
RESTIC_TEST_FUSE: ${{ matrix.test_fuse }}
|
||||
|
|
|
@ -151,7 +151,9 @@ func init() {
|
|||
globalOptions.PasswordFile = os.Getenv("RESTIC_PASSWORD_FILE")
|
||||
globalOptions.KeyHint = os.Getenv("RESTIC_KEY_HINT")
|
||||
globalOptions.PasswordCommand = os.Getenv("RESTIC_PASSWORD_COMMAND")
|
||||
globalOptions.RootCertFilenames = strings.Split(os.Getenv("RESTIC_CACERT"), ",")
|
||||
if os.Getenv("RESTIC_CACERT") != "" {
|
||||
globalOptions.RootCertFilenames = strings.Split(os.Getenv("RESTIC_CACERT"), ",")
|
||||
}
|
||||
globalOptions.TLSClientCertKeyFilename = os.Getenv("RESTIC_TLS_CLIENT_CERT")
|
||||
comp := os.Getenv("RESTIC_COMPRESSION")
|
||||
if comp != "" {
|
||||
|
@ -582,7 +584,7 @@ func open(ctx context.Context, s string, gopts GlobalOptions, opts options.Optio
|
|||
|
||||
rt, err := backend.Transport(globalOptions.TransportOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Fatal(err.Error())
|
||||
}
|
||||
|
||||
// wrap the transport so that the throughput via HTTP is limited
|
||||
|
@ -638,7 +640,7 @@ func create(ctx context.Context, s string, gopts GlobalOptions, opts options.Opt
|
|||
|
||||
rt, err := backend.Transport(globalOptions.TransportOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Fatal(err.Error())
|
||||
}
|
||||
|
||||
factory := gopts.backends.Lookup(loc.Scheme)
|
||||
|
|
Loading…
Reference in a new issue