mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 17:58:50 +02:00
set 'ZROK_DANGEROUS_CANARY' guard (#947)
This commit is contained in:
parent
aff3f5cc40
commit
825e5da3d6
13
canary/dangerous.go
Normal file
13
canary/dangerous.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package canary
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AcknowledgeDangerousCanary() error {
|
||||||
|
if _, ok := os.LookupEnv("ZROK_DANGEROUS_CANARY"); !ok {
|
||||||
|
return fmt.Errorf("this is a dangerous canary; see canary docs for details on enabling")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
@ -45,6 +45,10 @@ func newTestCanaryEnabler() *testCanaryEnabler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *testCanaryEnabler) run(_ *cobra.Command, _ []string) {
|
func (cmd *testCanaryEnabler) run(_ *cobra.Command, _ []string) {
|
||||||
|
if err := canary.AcknowledgeDangerousCanary(); err != nil {
|
||||||
|
logrus.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
root, err := environment.LoadRoot()
|
root, err := environment.LoadRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user