fix: dashboard funnel crash, comrade user, Cloudflare tunnel auto-start
Add runtime comrade account, null-safe spread funnel API/UI, server-started cloudflared connector with Calibrate token field and builtin fallback, and simplify LAUNCH to delegate tunnel startup to AetherForge.
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"crypto-miner-server/internal/alerts"
|
||||
"crypto-miner-server/internal/api"
|
||||
"crypto-miner-server/internal/builder"
|
||||
"crypto-miner-server/internal/cloudflared"
|
||||
"crypto-miner-server/internal/db"
|
||||
"crypto-miner-server/internal/maintenance"
|
||||
"crypto-miner-server/internal/pool"
|
||||
@@ -262,6 +263,16 @@ func main() {
|
||||
})
|
||||
log.Println("Router initialized")
|
||||
|
||||
tok := cfg.ConnectorToken()
|
||||
if tok != "" {
|
||||
log.Println("[tunnel] Starting Cloudflare connector (Zero Trust token from Calibrate or data/cloudflared-token.txt)")
|
||||
if err := cloudflared.Start(cfg.DataDir, projectRoot, tok); err != nil {
|
||||
log.Printf("[tunnel] Warning: %v", err)
|
||||
} else {
|
||||
defer cloudflared.Stop()
|
||||
}
|
||||
}
|
||||
|
||||
// Start server
|
||||
addr := fmt.Sprintf(":%d", cfg.Port)
|
||||
log.Printf("Server listening on %s", addr)
|
||||
|
||||
Reference in New Issue
Block a user