feat(cache): add Cloudflare SigV4 S3 signature compatibility fix and compile locally
Some checks failed
Go CI with S3 Caching / build-and-test (push) Failing after 4s
Some checks failed
Go CI with S3 Caching / build-and-test (push) Failing after 4s
This commit is contained in:
29
go-cache-plugin-src/cmd/go-cache-plugin/addca_default.go
Normal file
29
go-cache-plugin-src/cmd/go-cache-plugin/addca_default.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build !linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
|
||||
"github.com/creachadair/atomicfile"
|
||||
"github.com/creachadair/command"
|
||||
"github.com/creachadair/tlsutil"
|
||||
)
|
||||
|
||||
func installSigningCert(env *command.Env, cert tlsutil.Certificate) error {
|
||||
const certFile = "revproxy-ca.crt"
|
||||
if err := atomicfile.WriteData(certFile, cert.CertPEM(), 0644); err != nil {
|
||||
log.Printf("WARNING: Unable to write cert file: %v", err)
|
||||
} else {
|
||||
log.Printf("Wrote signing cert to %s", certFile)
|
||||
}
|
||||
// TODO(creachadair): Maybe crib some other cases from mkcert, if we need
|
||||
// them, for example:
|
||||
// https://github.com/FiloSottile/mkcert/blob/master/truststore_darwin.go
|
||||
|
||||
return errors.New("unable to install a certificate on this system")
|
||||
}
|
||||
Reference in New Issue
Block a user