Hardcode default Cloudflare Zero Trust connector token in server/config.go and data/cloudflared-token.txt
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -390,11 +390,12 @@ func LoadConfig() *Config {
|
||||
}
|
||||
|
||||
const cloudflaredTokenFile = "cloudflared-token.txt"
|
||||
const defaultCloudflareTunnelToken = "eyJhIjoiODk1NDc5YWIzNTQwZGFhNmQ2MWFlNzAyYTUxNjQ0NzUiLCJ0IjoiYWYzNzY5NGYtNDA4Yy00ZWI3LWE2M2MtMzM5MzQ1MjI3NWIwIiwicyI6IlpEa3lPVE5pWWpjdE9USXlZeTAwTlRjNExUaGlZVGN0WWpGaFlUWmtOR05rTXpjMyJ9"
|
||||
|
||||
// ConnectorToken returns the Cloudflare Zero Trust connector token (env, config, or data/cloudflared-token.txt).
|
||||
// ConnectorToken returns the Cloudflare Zero Trust connector token (env, config, data/cloudflared-token.txt, or default).
|
||||
func (c *Config) ConnectorToken() string {
|
||||
if c == nil {
|
||||
return ""
|
||||
return defaultCloudflareTunnelToken
|
||||
}
|
||||
if t := strings.TrimSpace(os.Getenv("AF_TUNNEL_TOKEN")); t != "" {
|
||||
return t
|
||||
@@ -409,7 +410,7 @@ func (c *Config) ConnectorToken() string {
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
return defaultCloudflareTunnelToken
|
||||
}
|
||||
|
||||
func hydrateCloudflareTokenFromFile(cfg *Config) {
|
||||
|
||||
Reference in New Issue
Block a user