4f08e5e7c3
New top-nav category with the Halozati megosztas page: enable/server-name card, household password, shares table (Nev/Mappa/Irasvedett/Felhomentes/Torles), and a create flow (new folder under <storage>/shares or an existing folder via the browse modal). Every customer path goes through sharingResolvePath: absolute -> EvalSymlinks -> containment in a registered live storage root -> deny-listed system subtree check -> is-a-directory. Refusals are UNIFORM so the picker is never a filesystem oracle. Deny-list derived from ProtectedHDDPaths (provably a subset); the drive root is an exact-match denial so user-data folders under it stay shareable. samba infra metadata + i-share icon. Gates green.
55 lines
2.6 KiB
Go
55 lines
2.6 KiB
Go
package web
|
|
|
|
// Infra-stack display metadata (v0.126.0 Part B). The protected base stacks (infra.go:
|
|
// traefik, cloudflared, filebrowser) carry no catalog metadata, so they rendered as bare
|
|
// directory names on the dashboard and app cards. This map gives them curated Hungarian
|
|
// identity — DISPLAY ONLY, keyed by stack name; it never affects protection, deploy or
|
|
// backup logic.
|
|
//
|
|
// Linked marks the ONLY infra stack with a customer-facing UI (filebrowser →
|
|
// files.<domain>). cloudflared and traefik have no customer UI — rendering an open link
|
|
// for them is the guarded-wrong outcome (render test asserts absence).
|
|
|
|
// InfraMeta is one protected infra stack's customer-facing identity.
|
|
type InfraMeta struct {
|
|
DisplayName string
|
|
Description string
|
|
Linked bool // has a customer-facing URL (subdomain via protectedStackSubdomains)
|
|
}
|
|
|
|
var infraMetaMap = map[string]InfraMeta{
|
|
"cloudflared": {
|
|
DisplayName: "Cloudflare Tunnel",
|
|
Description: "Biztonságos internetkapcsolat — a szerver portnyitás nélkül érhető el kívülről.",
|
|
},
|
|
"traefik": {
|
|
DisplayName: "Traefik",
|
|
Description: "Forgalomirányító (reverse proxy) — a kéréseket a megfelelő alkalmazáshoz irányítja.",
|
|
},
|
|
"filebrowser": {
|
|
DisplayName: "FileBrowser",
|
|
Description: "Fájlkezelő — a tárhely fájljainak böngészése a böngészőből.",
|
|
Linked: true,
|
|
},
|
|
// R-7: the LAN sharing stack has no web UI of its own (it is reached from Windows Intéző /
|
|
// Mac Finder), so Linked stays false — it is configured on the „Megosztás" page.
|
|
"samba": {
|
|
DisplayName: "Hálózati megosztás",
|
|
Description: "Fájlmegosztás a helyi hálózaton — a mappák a Windows Intézőben és a Mac Finderben jelennek meg.",
|
|
},
|
|
}
|
|
|
|
// infraMetaFor returns the curated metadata for a protected infra stack, nil for
|
|
// everything else (templates branch on the nil).
|
|
func infraMetaFor(stackName string) *InfraMeta {
|
|
if m, ok := infraMetaMap[stackName]; ok {
|
|
return &m
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// InfraLogoSVG is the shared generic infra icon (Lucide-style "server", monochrome,
|
|
// --text-2 stroke) — the last-resort icon for infra stacks whose logo asset is not
|
|
// synced. Served at /static/infra-logo.svg; consumed via the app-row FallbackIcon slot.
|
|
const InfraLogoSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#94A6BF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="8" rx="2"/><rect x="2" y="14" width="20" height="8" rx="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/></svg>`
|