Remove the RepoISO integration; keep generic support for shares of other services
build / build (push) Successful in 1m5s

RepoISO now manages the NAS itself, so nasmon no longer polls it (settings field, dashboard card,
menu link and repoiso:* alerts are gone). Drop-in SMB includes, read-only listing and keeping
smbd/nfs-server running for other software's shares stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 19:05:16 +03:00
co-authored by Claude Opus 5.5
parent 30dbb00dd1
commit 42cfb43e2e
17 changed files with 47 additions and 348 deletions
-34
View File
@@ -8,9 +8,7 @@ import (
"io/fs"
"log"
"math"
"net"
"net/http"
"net/url"
"path/filepath"
"strings"
"sync"
@@ -107,7 +105,6 @@ type pageData struct {
Data any
Flash string
Error string
RepoISO string // browser URL of the RepoISO portal ("" = integration off)
}
// render writes a full page, or only the "content" block when ?partial=1 is
@@ -115,7 +112,6 @@ type pageData struct {
func (s *Server) render(w http.ResponseWriter, r *http.Request, name string, pd pageData) {
pd.Page = name
pd.Partial = r.URL.Query().Get("partial") == "1"
pd.RepoISO = browserURL(s.cfg.Get().Integrations.RepoISOURL, r.Host)
if pd.Alerts == 0 {
pd.Alerts = len(s.sch.Status().Alerts)
}
@@ -292,33 +288,3 @@ func sparkline(vals []float64, max float64, class string) template.HTML {
`<svg class="spark %s" viewBox="0 0 %d %d" preserveAspectRatio="none"><polygon points="0,%d %s %d,%d"/><polyline points="%s"/></svg>`,
class, int(w), int(h), int(h), p, int(w), int(h), p))
}
// browserURL turns the configured RepoISO address into one the user's browser
// can open: a loopback host is replaced by the host the browser used for nasmon.
func browserURL(cfg, reqHost string) string {
if cfg == "" {
return ""
}
u, err := url.Parse(cfg)
if err != nil || u.Host == "" {
return cfg
}
switch u.Hostname() {
case "127.0.0.1", "localhost", "::1":
host := reqHost
if h, _, err := net.SplitHostPort(reqHost); err == nil {
host = h
}
if host == "" {
return cfg
}
if strings.Contains(host, ":") {
host = "[" + host + "]"
}
if p := u.Port(); p != "" {
host += ":" + p
}
u.Host = host
}
return u.String()
}