Expand description
Startup shared by both binaries: the dashboard (eclipse-web) and the gateway
(eclipse-gateway, which serves the same dashboard plus the /v1 API and the scheduled
upgrade check).
Nothing here decides what to serve — only what config to load, which port to bind and what state the router gets. The routers are the binaries’ business.
Structs§
- Options
- What the command line said. Both binaries take the same flags.
- Prepared
- Everything a server needs before it can serve.
Constants§
- MAX_
TTL_ HOURS - A year. A login that outlives the process is pointless — sessions live in memory — and a
typo like
session_ttl_hours = 999999should not mint a cookie that never expires. - MIN_
TOKEN_ LEN - Shorter tokens are guessable;
config initissues 64 hex characters (token::generateis 32 random bytes in hex), so this floor only ever bites a token typed by hand.
Functions§
- auth_
token - The login token the dashboard and the API share: one secret, no second credential to keep.
- bind_
addr - The dashboard is plain HTTP behind a single shared token, so it only binds to loopback addresses.
- credentials
- Who may sign in (
#266): a username and a password hash from.env, or — on an install that has no hash yet — the shared token, which keeps working untileclipse web passwdruns. - dashboard_
config - The config the dashboard serves:
[web] default_profiledecides which profile when the command line names none, resolved by loading again with it named so the overlay, session directories and plugins are exactly what a--profilerun would get. An explicit--profile/ECLIPSE_PROFILEalways wins. - prepare
- Load the config, build the agent and the store, and decide the address. Shared by the dashboard and the gateway so the two can never disagree about what a profile means.
- serve
- Bind and serve until Ctrl-C. The router is the caller’s: the dashboard passes the dashboard router, the gateway passes the dashboard router with the API merged on.