MCPcopy Create free account
hub / github.com/tailscale/tailscale / writeNewConfig

Function writeNewConfig

cmd/derper/derper.go:143–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141}
142
143func writeNewConfig() config {
144 k := key.NewNode()
145 if err := os.MkdirAll(filepath.Dir(*configPath), 0777); err != nil {
146 log.Fatal(err)
147 }
148 cfg := config{
149 PrivateKey: k,
150 }
151 b, err := json.MarshalIndent(cfg, "", "\t")
152 if err != nil {
153 log.Fatal(err)
154 }
155 if err := atomicfile.WriteFile(*configPath, b, 0600); err != nil {
156 log.Fatal(err)
157 }
158 return cfg
159}
160
161func main() {
162 flag.Parse()

Callers 1

loadConfigFunction · 0.85

Calls 3

NewNodeFunction · 0.92
WriteFileFunction · 0.92
FatalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…