Experimental daemon.

This commit is contained in:
2025-08-23 06:17:38 -07:00
parent f94f80cd2a
commit e56d981d74
6 changed files with 28 additions and 28 deletions

View File

@@ -12,7 +12,7 @@ func (app *App) GetDnsmasqConfigHandler(w http.ResponseWriter, r *http.Request)
http.Error(w, "No configuration available. Please configure the system first.", http.StatusPreconditionFailed)
return
}
config := app.DnsmasqManager.Generate(app.Config)
w.Header().Set("Content-Type", "text/plain")
w.Write([]byte(config))
@@ -42,4 +42,4 @@ func (app *App) RestartDnsmasqHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]string{"status": "restarted"})
}
}

View File

@@ -33,7 +33,7 @@ func (app *App) downloadTalosAssets() error {
// Get assets directory from data paths
paths := app.DataManager.GetPaths()
assetsDir := filepath.Join(paths.AssetsDir, "talos")
log.Printf("Downloading Talos assets to: %s", assetsDir)
if err := os.MkdirAll(filepath.Join(assetsDir, "amd64"), 0755); err != nil {
return fmt.Errorf("creating assets directory: %w", err)
@@ -93,7 +93,7 @@ boot
return fmt.Errorf("writing boot script: %w", err)
}
// Download iPXE bootloaders
// Download iPXE bootloaders
tftpDir := filepath.Join(paths.AssetsDir, "tftp")
if err := os.MkdirAll(tftpDir, 0755); err != nil {
return fmt.Errorf("creating tftp directory: %w", err)
@@ -135,4 +135,4 @@ func downloadFile(url, filepath string) error {
_, err = io.Copy(out, resp.Body)
return err
}
}