Move web UI from /ui/ to /web/ path prefix

The web UI is now mounted at /web/ (previously /ui/) — cmd/server/main.go
wraps web.Server.Handler with http.StripPrefix("/web", ...), so
internal/web's own routes stay unprefixed (/, /login, /logout,
/shares/..., /static/...) and only the outer mux adds the prefix. All
templates, redirects, and cookie paths updated accordingly. The root '/'
route reverts to the original unauthenticated welcome page (linking to
/web/), and /cal/, /card/, /files/ are unaffected.

Also gitignore the bin/ build output directory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-08-19 07:29:32 +02:00
co-authored by Copilot
parent ab3c7f44d5
commit 4dba55c807
15 changed files with 58 additions and 52 deletions
+4 -3
View File
@@ -137,8 +137,9 @@ func buildMux(
mux := http.NewServeMux()
// Web UI (own cookie-based auth, not Basic Auth) — dashboard, login,
// share management.
mux.Handle("/ui/", webUI.Handler(webstatic.FS()))
// share management. Mounted at "/web/"; /cal/, /card/, /files/ keep
// their own dedicated prefixes.
mux.Handle("/web/", http.StripPrefix("/web", webUI.Handler(webstatic.FS())))
// /.well-known/ redirects for auto-discovery
mux.HandleFunc("/.well-known/caldav", func(w http.ResponseWriter, r *http.Request) {
@@ -256,6 +257,6 @@ const welcomePage = `<!DOCTYPE html>
<li><code>%s/.well-known/carddav</code></li>
</ul>
<p><em>Authentication: HTTP Basic Auth</em></p>
<p><a href="/ui/">Open the web dashboard →</a></p>
<p><a href="/web/">Open the web dashboard →</a></p>
</body>
</html>`