feat(samba): Megosztas page + guarded folder picker (R-7 slice 1, Part 3)
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.
This commit is contained in:
@@ -354,6 +354,21 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
s.storagePageHandler(w, r)
|
||||
case path == "/storage/network" && r.Method == http.MethodGet:
|
||||
s.storageNetworkPageHandler(w, r)
|
||||
// „Megosztás" — LAN network sharing (R-7 slice 1)
|
||||
case path == "/sharing" && r.Method == http.MethodGet:
|
||||
s.sharingPageHandler(w, r)
|
||||
case path == "/sharing/enable" && r.Method == http.MethodPost:
|
||||
s.sharingEnableHandler(w, r)
|
||||
case path == "/sharing/password" && r.Method == http.MethodPost:
|
||||
s.sharingPasswordHandler(w, r)
|
||||
case path == "/sharing/shares" && r.Method == http.MethodPost:
|
||||
s.sharingShareCreateHandler(w, r)
|
||||
case path == "/sharing/shares/delete" && r.Method == http.MethodPost:
|
||||
s.sharingShareDeleteHandler(w, r)
|
||||
case path == "/sharing/shares/offsite" && r.Method == http.MethodPost:
|
||||
s.sharingShareOffsiteHandler(w, r)
|
||||
case path == "/api/sharing/browse" && r.Method == http.MethodGet:
|
||||
s.sharingBrowseHandler(w, r)
|
||||
case path == "/settings/notifications" && r.Method == http.MethodGet:
|
||||
s.settingsNotificationsPageHandler(w, r)
|
||||
case path == "/settings/security" && r.Method == http.MethodGet:
|
||||
|
||||
Reference in New Issue
Block a user