Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion deploy/Caddyfile.community
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ cosift.pilotprotocol.network, origin.cosift.pilotprotocol.network {
handle /debug/* {
respond "not found" 404
}
@community path / /app.js /style.css /sample.csv /api/*
@operations path /stats /stats/* /metrics /metrics/* /queue /queue/* /domains /domains/* /verify /verify/* /sla /sla/*
handle @operations {
respond "not found" 404
}
@legacy_ui path /chat /chat/*
handle @legacy_ui {
redir /login 302
}
@community path / /login /signup /app.js /style.css /sample.csv /api/*
handle @community {
reverse_proxy 127.0.0.1:7780 {
header_up X-Forwarded-For {client_ip}
Expand Down
13 changes: 13 additions & 0 deletions docs/COMMUNITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,16 @@ rollout also requires preserving the old binary, backend config and Caddy config
Signed release assets include Linux ARM64/AMD64, macOS ARM64/AMD64 and Windows
AMD64. Install the matching binary and use the same public server URL for both
`contribute` and `request`. Payment purchase flows remain disabled.


## Public entry and operations visibility

Anonymous visitors land on the signup/sign-in screen. `/login` opens sign-in,
`/signup` opens account creation, and an existing session opens the workspace.
Guest browsing remains an explicit choice with the same 30-minute allowance.
Signing out returns to authentication.

The production proxy denies public access to `/stats`, `/metrics`, `/queue`,
`/domains`, `/verify`, and `/sla` (including subpaths). Operators can still use
these endpoints over SSH on the loopback engine listener. The old `/chat` UI
redirects to `/login`. `/healthz` retains its minimal health response.
2 changes: 2 additions & 0 deletions internal/community/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ func Open(cfg Config) (*Server, error) {
}
mux := http.NewServeMux()
mux.HandleFunc("GET /{$}", s.asset("index.html", "text/html; charset=utf-8"))
mux.HandleFunc("GET /login", s.asset("index.html", "text/html; charset=utf-8"))
mux.HandleFunc("GET /signup", s.asset("index.html", "text/html; charset=utf-8"))
mux.HandleFunc("GET /app.js", s.asset("app.js", "text/javascript; charset=utf-8"))
mux.HandleFunc("GET /style.css", s.asset("style.css", "text/css; charset=utf-8"))
mux.HandleFunc("GET /sample.csv", func(w http.ResponseWriter, r *http.Request) {
Expand Down
6 changes: 4 additions & 2 deletions internal/community/web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ $("logout").onclick = async () => {
$("search-heading").hidden = true;
$("search-empty").hidden = false;
$("query").value = "";
await enter();
showScreen("auth");
} catch (e) {
notify(e.message, true);
}
Expand Down Expand Up @@ -597,7 +597,9 @@ $("refresh-contributions").onclick = () =>
user = null;
}
try {
await enter();
if (location.pathname === "/login" && signingUp) $("auth-toggle").click();
if (user) await enter();
else showScreen("auth");
} catch (e) {
showScreen("auth");
notify(e.message, true);
Expand Down
2 changes: 1 addition & 1 deletion internal/community/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>
<div id="notice" role="status" aria-live="polite" hidden></div>
<section id="auth" class="entry" hidden>
<section id="auth" class="entry">
<div class="entry-story">
<a class="brand" href="/">cosift<span>●</span></a>
<div>
Expand Down
Loading