From d7a15c4dbe058a0f679a374c73290a004c224734 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sat, 14 Feb 2026 18:22:53 +0100 Subject: [PATCH] Minor cleanup and formatting fixes in docs handler and setup manager --- pkg/service/handlers/handlers_docs.go | 5 ++++- pkg/service/setup/setup.go | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/service/handlers/handlers_docs.go b/pkg/service/handlers/handlers_docs.go index 87b722c..9c11e16 100644 --- a/pkg/service/handlers/handlers_docs.go +++ b/pkg/service/handlers/handlers_docs.go @@ -13,6 +13,7 @@ import ( // HandleDocs returns a handler for serving documentation files as HTML. func (s *Server) HandleDocs(w http.ResponseWriter, r *http.Request) { path := strings.TrimPrefix(r.URL.Path, "/docs") + path = strings.TrimPrefix(path, "/") if path == "" { path = "guides/SURVIVAL-GUIDE.md" @@ -33,6 +34,7 @@ func (s *Server) HandleDocs(w http.ResponseWriter, r *http.Request) { // Load sidebar (SUMMARY.md) summaryContent, _ := os.ReadFile(filepath.Join("docs", "SUMMARY.md")) + sidebar := "" if len(summaryContent) > 0 { // Render summary to HTML @@ -52,7 +54,7 @@ func (s *Server) HandleDocs(w http.ResponseWriter, r *http.Request) { // Wrap in a documentation template with sidebar w.Header().Set("Content-Type", "text/html") - fmt.Fprintf(w, ` + _, _ = fmt.Fprintf(w, ` @@ -120,5 +122,6 @@ func (s *Server) fixSidebarLinks(sidebar string) string { } } } + return strings.Join(lines, "\n") } diff --git a/pkg/service/setup/setup.go b/pkg/service/setup/setup.go index 72f06fe..38f8181 100644 --- a/pkg/service/setup/setup.go +++ b/pkg/service/setup/setup.go @@ -446,10 +446,12 @@ func (m *Manager) MigrateSpeaker(deviceIP, targetURL, proxyURL string, options m // 0b. Pre-flight check for SSH /rw permissions client := m.NewSSH(deviceIP) + rwCmd := "(rw || mount -o remount,rw /)" if rwTest, rwErr := client.Run(rwCmd); rwErr != nil { return logs, fmt.Errorf("pre-flight check failed: cannot gain write access (cmd: %s, output: %s): %w", rwCmd, rwTest, rwErr) } + logs += "Pre-flight: Write access verified.\n" if method == MigrationMethodHosts {