web: allow direct IP dashboard and worker access (#26)

Support direct HTTP IP access on port 5187 without hostname registration or a required proxy. Preserve dashboard/machine authentication and CSRF checks. Update Proxmox setup, D14, tests and documentation for 1.2.3.

Closes #25
This commit was merged in pull request #26.
This commit is contained in:
2026-11-15 16:42:12 +01:00
parent f45e065994
commit 284e692993
19 changed files with 218 additions and 69 deletions
+7 -2
View File
@@ -322,14 +322,17 @@ worker per OS user, following the developer's direction in
- Account ids, expected emails and machine/profile bindings are configured by the operator.
The server has a dashboard access key and distinct per-machine keys. Browser sessions are
HttpOnly, SameSite cookies with CSRF checks; remote access uses HTTPS. A worker cannot select
HttpOnly, SameSite cookies with CSRF checks. Direct IP or hostname access supports HTTP and
HTTPS without a fixed-host allowlist. Browser mutations compare Origin with the actual request
Host; HTTPS sessions use Secure cookies, including through a proxy preserving Host/Origin.
HTTP transport is unencrypted. A worker cannot select
another machine's identity or execute arbitrary remote commands.
- The dashboard calls Core's D7, D12 and D13 APIs. No second forecasting implementation is added.
Local settings remain local; the newest quota observation's profile supplies the pace threshold,
hidden windows and freshness interval. Account timezone controls calendar days. No working-hour
forecast is added. Old/expired limits are displayed but have no current forecast.
- The Proxmox host script creates the LXC only. It does not install a reverse proxy. The server
exposes private HTTP port 5187 behind the operator's existing HTTPS proxy, preserving Host.
exposes HTTP port 5187 directly at the container IP; an operator's HTTPS proxy is optional.
`finaltoken-update` fetches/builds/activates updates inside the container. An update from the
old bundled-proxy layout changes its known listener and disables only the installer-owned
proxy, with configuration rollback on a failed backend check. See
@@ -359,6 +362,8 @@ worker per OS user, following the developer's direction in
**Why.** R8, and the developer's clarification that the browser authorization response must
travel through FinalToken to the CLI, without being stored. D7's analysis answers whether the
remaining allowance will last through the actual reset; token prices alone cannot answer it.
The developer requires direct IP access without hostname registration or a mandatory proxy
([#25](https://git.finalfactory.de/FinalFactory/FinalToken/issues/25)).
**Gives up.** Automatic remote callbacks, provider-token sharing, automatic account switching,
unverified identities, universal login lifetimes, and exact cross-machine attribution of old
+17 -14
View File
@@ -1,8 +1,8 @@
# Proxmox LXC install and update
Use the **Proxmox host only to create the container**. Updates run **inside the LXC**.
FinalToken uses your existing HTTPS reverse proxy and installs no Caddy or other proxy.
The private backend listens on **HTTP port 5187**. This follows
Open the dashboard at **`http://<container-ip>:5187`**. No hostname, HTTPS or proxy is required;
FinalToken installs no Caddy or other proxy. This follows
[D14](decisions.md#d14--self-hosted-dashboard-and-workers).
## Install the server
@@ -12,23 +12,25 @@ As root on the Proxmox host, with Git and Python 3 installed:
```bash
git clone --branch master --single-branch https://git.finalfactory.de/FinalFactory/FinalToken.git /opt/finaltoken-src && \
bash /opt/finaltoken-src/tools/proxmox.sh install --role server --ctid 201 \
--storage local-lvm --domain usage.example.com --timezone Europe/Berlin
--storage local-lvm --timezone Europe/Berlin
```
Use a free CT id and your storage, hostname and timezone. Omit `--ctid` for the next free id.
The hostname is the public hostname on **your existing proxy**, not a certificate request.
Use a free CT id and your storage and timezone. Omit `--ctid` for the next free id.
The optional legacy `--domain` argument is accepted but does not restrict dashboard access.
Add `--dry-run` to validate without creating a CT. Anonymous HTTPS clone needs no Git login.
Configure your existing reverse proxy:
The installer prints the container IP URL. You can also find the address with `hostname -I`
inside the CT. HTTP transport is unencrypted. If you choose to use an HTTPS reverse proxy:
- Public URL: `https://usage.example.com` (your chosen hostname).
- Backend: `http://<LXC-IP>:5187`.
- Preserve the public `Host` header. Restrict backend network access to your proxy/private network.
- Preserve the public `Host` and browser `Origin` headers.
- Allow worker metadata POST bodies up to 32 MiB, matching the server's request-size limit.
- TLS/certificates stay on your existing proxy. The LXC needs no inbound 80/443 or certificates.
The server pins its public Host/Origin and uses secure browser cookies. Do not expose this private
HTTP backend directly to the Internet or remove authentication. No forwarded-header trust is enabled.
The dashboard key, machine keys and CSRF checks remain required. Browser mutation Origins must
match the actual request Host; no fixed hostname allowlist applies. HTTPS sessions use Secure
cookies, and direct HTTP login works. No forwarded-header trust is enabled.
The proxy must not log authorization headers or request bodies containing login responses.
Read the dashboard key on the CT's root console:
@@ -97,8 +99,8 @@ root inside that LXC** to fetch the corrected updater and perform the update:
```
This installs Git in the CT if needed, updates the app, changes the old known loopback listener
to `0.0.0.0:5187` and disables **only** `finaltoken-proxy.service`. Point your existing proxy at
HTTP port 5187. Keys, public hostname, profiles, history, certificate files and installed packages
to `0.0.0.0:5187` and disables **only** `finaltoken-proxy.service`. Open the container IP on
HTTP port 5187. Keys, old environment settings, profiles, history, certificate files and installed packages
are retained. It does not stop an unrelated `caddy.service` or purge packages/configuration.
The old server environment is backed up as root-only `server.env.pre-external-proxy`. If the
@@ -120,12 +122,13 @@ For a worker-only CT, configure the matching machine/account/key on the existing
```bash
bash tools/proxmox.sh install --ctid 202 --storage local-lvm --role worker \
--server-url https://usage.example.com --machine-id lxc_202 \
--server-url http://10.0.30.150:5187 --machine-id lxc_202 \
--worker-key-file /root/lxc_202.key --email [email protected]
```
The enrollment file holds a FinalToken transport key, not a provider token. The worker's OS user
is `finaltoken`; selected provider names are its profile ids. Workers connect outbound over HTTPS.
is `finaltoken`; selected provider names are its profile ids. Workers connect outbound over
the configured HTTP or HTTPS URL.
Use `finaltoken-update` inside worker CTs too.
## Host and container requirements
@@ -139,7 +142,7 @@ when needed. This is not an offline or byte-for-byte reproducible dependency bui
For static IPv4, add `--ip 192.0.2.20/24 --gateway 192.0.2.1`; `--bridge`, `--vlan`,
`--template-storage` and `--template` select host-specific resources. No host firewall, DNS or NAT
rules are changed. Your existing proxy must reach the CT on port 5187.
rules are changed. Your browser and workers must reach the CT on port 5187.
The host installer snapshots the selected local checkout, including uncommitted source, through
the shared allowlist in `tools/proxmox/source_bundle.py`. It excludes recognized local config,
+1 -2
View File
@@ -14,8 +14,7 @@ For the Proxmox workflow, clone the published source on the host, then run its i
```bash
git clone https://git.finalfactory.de/FinalFactory/FinalToken.git
cd FinalToken
bash tools/proxmox.sh install --ctid 201 --storage local-lvm \
--domain usage.example.com --email [email protected]
bash tools/proxmox.sh install --ctid 201 --storage local-lvm --email [email protected]
```
For a later update, run as root **inside the LXC**:
+2 -2
View File
@@ -16,5 +16,5 @@ Each requirement has a stable ID. [Decisions](decisions.md) say how FinalToken m
- **R8** An authenticated self-hosted dashboard combines the user's Windows/Linux machines,
keeping weekly sustainability central, account quota separate from deduplicated consumption,
and measured, estimated, unknown and stale values distinct. See [D14](decisions.md#d14--self-hosted-dashboard-and-workers).
Proxmox installation uses the host only to create the CT. Updates run inside the CT; HTTPS
comes from the user's existing reverse proxy.
Proxmox installation uses the host only to create the CT. Updates run inside the CT. Direct IP
access works over HTTP port 5187 without a hostname or proxy; HTTPS is optional.
+12 -10
View File
@@ -8,7 +8,7 @@ There is no inference gateway. Coding traffic continues through the user's own c
## Run locally
For automatic CT creation from a Proxmox host, use the [Proxmox installer](proxmox.md).
It uses your existing HTTPS proxy and exposes private HTTP :5187; updates run inside the CT
It exposes HTTP :5187 directly at the container IP; updates run inside the CT
with `finaltoken-update`.
Build from the repository root:
@@ -49,14 +49,15 @@ Start the server from the repository root:
dotnet run --project src/FinalToken.Web -c Release --no-build
```
By default it listens on `http://127.0.0.1:5187`. Open exactly that URL and enter the dashboard key.
For a remote deployment, set `FINALTOKEN_PUBLIC_ORIGIN` to the public HTTPS origin and run a TLS
reverse proxy that preserves its Host header, or configure HTTPS directly in Kestrel.
`ASPNETCORE_URLS` changes the listening address. Do not expose a plain HTTP listener to a remote
network. A private HTTP hop from your existing TLS proxy is supported; restrict that backend
listener to the proxy/private network. No forwarded-header trust is enabled automatically. Restrict direct backend access;
the reverse proxy must not log request bodies or authorization headers. Login URLs/codes are
deliberately absent from server logs and disk state. TLS termination sees the transient code.
By default it listens on `http://127.0.0.1:5187`. Set `ASPNETCORE_URLS=http://0.0.0.0:5187`
for network access, then open `http://<server-ip>:5187` and enter the dashboard key. The Proxmox
installer sets this listener automatically. No hostname registration, proxy or HTTPS is required.
The old `FINALTOKEN_PUBLIC_ORIGIN` setting is ignored, including placeholder values in existing CTs.
HTTP transport is unencrypted; an optional HTTPS proxy must preserve Host and browser Origin,
or you can configure HTTPS directly in Kestrel. Browser mutations still require the matching
request Host/Origin and CSRF protection. HTTP sessions work over HTTP; HTTPS sessions use Secure
cookies. No forwarded-header trust is enabled automatically. Proxies must not log request bodies
or authorization headers. Login URLs/codes are absent from server logs and disk state.
Keys authorize all profiles on their configured machine; use service-account file/environment
permissions and a private network/firewall. Rotate a machine key on both ends to revoke it.
@@ -87,7 +88,8 @@ Set `FINALTOKEN_WORKER_KEY` to the server's key for this machine. Start from the
dotnet run --project src/FinalToken.Worker -c Release --no-build -- <absolute worker.json path>
```
Remote worker URLs require HTTPS. Workers only make outbound connections; no worker port is open.
Worker URLs accept HTTP or HTTPS origins, including direct IP addresses. Workers only make
outbound connections; no worker port is open.
Use the OS service manager/Task Scheduler for unattended startup, under the intended user with
the CLI on PATH. A Linux/LXC worker needs .NET 10 (or a future locally built NativeAOT binary),
installed official CLIs, writable profile directories, outbound HTTPS and any CLI keychain