-
Notifications
You must be signed in to change notification settings - Fork 0
Polish GitHub landing page for internship outreach #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,17 @@ | ||
| # usage.lan | ||
|
|
||
| Self-hosted AI usage & spend dashboard. Aggregates token usage and cost across your local AI coding tools — OpenCode, Codex, and Cursor — and serves a live web dashboard. | ||
| Local AI usage & spend dashboard for your coding tools. | ||
|
|
||
| Reads token usage and cost from **OpenCode**, **Codex**, and **Cursor** already on your machine, then serves a live web UI. **Data stays local** — nothing is uploaded. | ||
|
|
||
| ```sh | ||
| cd dashboard | ||
| rustup target add wasm32-unknown-unknown # pinned nightly in rust-toolchain.toml | ||
| (cd crates/usage-ui && trunk build --release) | ||
| USAGE_PORT=8080 cargo run -p usage-server | ||
| ``` | ||
|
|
||
| Open [http://localhost:8080](http://localhost:8080). Requires Rust nightly and [`trunk`](https://trunkrs.dev/). Details below. | ||
|
|
||
| ## Features | ||
|
|
||
|
|
@@ -27,11 +38,13 @@ dashboard/ | |
|
|
||
| ## Requirements | ||
|
|
||
| - Rust (see `rust-toolchain.toml` — the UI needs **nightly** + `wasm32-unknown-unknown`) | ||
| - Rust (see `dashboard/rust-toolchain.toml` — the UI needs **nightly** + `wasm32-unknown-unknown`) | ||
| - [`trunk`](https://trunkrs.dev/) to build the UI | ||
|
|
||
| ## Building | ||
|
|
||
| Commands below run from `dashboard/` (the Rust workspace). | ||
|
|
||
| ```sh | ||
| # 1. Add the wasm target (pinned in rust-toolchain.toml): | ||
| rustup target add wasm32-unknown-unknown | ||
|
|
@@ -42,10 +55,10 @@ trunk build --release | |
| cd ../.. | ||
|
|
||
| # 3. Run the server (serves both the API and the built UI): | ||
| cargo run -p usage-server | ||
| USAGE_PORT=8080 cargo run -p usage-server | ||
| ``` | ||
|
|
||
| The server serves the UI from `crates/usage-ui/dist` by default (override with `USAGE_DIST`). | ||
| The server serves the UI from `crates/usage-ui/dist` by default (override with `USAGE_DIST`). Default listen port is `443` (set `USAGE_PORT` for an unprivileged port). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Security Misconfiguration (CWE-319): Cleartext Transmission of Sensitive Information Reachability: External · Exploitability: Moderate Document that port When either 🤖 Prompt for AI Agents |
||
|
|
||
| ## Usage | ||
|
|
||
|
|
@@ -64,7 +77,7 @@ GET /api/health | |
|
|
||
| | Var | Default | Purpose | | ||
| |-----|---------|---------| | ||
| | `PORT` / `USAGE_PORT` | `443` | Listen port | | ||
| | `USAGE_PORT` | `443` | Listen port | | ||
| | `USAGE_DIST` | `crates/usage-ui/dist` | Path to built UI | | ||
| | `USAGE_TLS_CERT` | — | PEM cert path (enables HTTPS when set with key) | | ||
| | `USAGE_TLS_KEY` | — | PEM key path | | ||
|
|
@@ -92,4 +105,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). | |
|
|
||
| ## License | ||
|
|
||
| [MIT](LICENSE) | ||
| [MIT](LICENSE) | ||
|
|
||
| Built by [Lawrence Millard](https://millard.ink). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Sensitive Data Exposure (CWE-200): Exposure of Sensitive Information to an Unauthorized Actor
Reachability: External · Exploitability: Moderate
Restrict the usage server to local access.
The server binds
0.0.0.0and exposes/api/usagewithout authentication. Any host that can reach the port can read local usage data. Bind the default server to loopback, or document the network exposure and required access controls.🤖 Prompt for AI Agents