From d889274f845eae2bd626c72f916e69a67e609781 Mon Sep 17 00:00:00 2001 From: 9qeklajc Date: Thu, 12 Feb 2026 23:25:59 +0100 Subject: [PATCH] update doc --- docs/provider/configuration.md | 107 +++++++++++++++++++++------------ docs/provider/quickstart.md | 28 +++++++-- 2 files changed, 92 insertions(+), 43 deletions(-) diff --git a/docs/provider/configuration.md b/docs/provider/configuration.md index aaa00e86..05e7e2ac 100644 --- a/docs/provider/configuration.md +++ b/docs/provider/configuration.md @@ -6,6 +6,37 @@ For automated deployments, you can optionally pre-configure settings via environ --- +## Initial Setup (.env file) + +Before running your node, you should create a `.env` file in the project root. This file is used to bootstrap the initial configuration and store sensitive secrets. + +### Example .env + +```bash +# Security (CRITICAL) +ADMIN_PASSWORD=your-secure-password + +# Node Identity +NAME="My AI Node" +DESCRIPTION="Fast access to models" + +# Upstream AI Provider +UPSTREAM_BASE_URL=https://openrouter.ai/api/v1 +UPSTREAM_API_KEY=sk-or-v1-... + +# Lightning Payouts +RECEIVE_LN_ADDRESS=yourname@wallet.com +``` + +### Setting the UI Password + +There are two ways to set or change your Admin Dashboard password: + +1. **Via Environment Variable**: Set `ADMIN_PASSWORD` in your `.env` file before starting the container. This will be the password used for the first login. +2. **Via Dashboard**: Once logged in, go to **Settings** → **Security** to update your password. Dashboard settings override the `.env` file once saved. + +--- + ## Admin Dashboard (Primary) Access the dashboard at `/admin/` on your node. @@ -14,29 +45,29 @@ Access the dashboard at `/admin/` on your node. Connect to your AI provider(s): -| Setting | Description | -|---------|-------------| +| Setting | Description | +| ---------------- | ------------------------------------------------ | | **Upstream URL** | API endpoint (e.g., `https://api.openai.com/v1`) | -| **API Key** | Your provider's API key | +| **API Key** | Your provider's API key | ### Node Identity How your node appears to clients: -| Setting | Description | -|---------|-------------| -| **Name** | Display name (e.g., "Fast GPT-4 Node") | -| **Description** | Brief description of your service | +| Setting | Description | +| --------------- | -------------------------------------- | +| **Name** | Display name (e.g., "Fast GPT-4 Node") | +| **Description** | Brief description of your service | ### Pricing Control your profit margins: -| Setting | Description | Default | -|---------|-------------|---------| -| **Fixed Pricing** | Charge flat rate per request vs. per-token | Off | -| **Exchange Fee** | Buffer for BTC volatility | 1.005 (0.5%) | -| **Upstream Fee** | Your profit markup | 1.10 (10%) | +| Setting | Description | Default | +| ----------------- | ------------------------------------------ | ------------ | +| **Fixed Pricing** | Charge flat rate per request vs. per-token | Off | +| **Exchange Fee** | Buffer for BTC volatility | 1.005 (0.5%) | +| **Upstream Fee** | Your profit markup | 1.10 (10%) | See [Pricing](pricing.md) for detailed strategies. @@ -44,33 +75,33 @@ See [Pricing](pricing.md) for detailed strategies. Which mints to accept payments from: -| Setting | Description | -|---------|-------------| +| Setting | Description | +| --------- | ------------------------------- | | **Mints** | List of trusted Cashu mint URLs | ### Lightning Withdrawals Automatic profit withdrawal: -| Setting | Description | -|---------|-------------| +| Setting | Description | +| --------------------- | ------------------------------- | | **Lightning Address** | Your LN address for withdrawals | ### Security -| Setting | Description | -|---------|-------------| +| Setting | Description | +| ------------------ | ----------------------------- | | **Admin Password** | Password for dashboard access | ### Nostr Discovery Announce your node on the network: -| Setting | Description | -|---------|-------------| -| **Npub** | Your Nostr public key | -| **Nsec** | Your Nostr private key (for signing) | -| **Relays** | Relays to publish announcements | +| Setting | Description | +| ---------- | ------------------------------------ | +| **Npub** | Your Nostr public key | +| **Nsec** | Your Nostr private key (for signing) | +| **Relays** | Relays to publish announcements | See [Discovery](discovery.md) for details. @@ -86,21 +117,21 @@ Use environment variables for: ### All Variables -| Variable | Description | Default | -|----------|-------------|---------| -| `UPSTREAM_BASE_URL` | Upstream API endpoint | — | -| `UPSTREAM_API_KEY` | Upstream API key | — | -| `ADMIN_PASSWORD` | Dashboard password | (none) | -| `DATABASE_URL` | Database connection string | `sqlite+aiosqlite:///keys.db` | -| `NAME` | Node display name | `ARoutstrNode` | -| `DESCRIPTION` | Node description | `A Routstr Node` | -| `NPUB` | Nostr public key (bech32) | — | -| `NSEC` | Nostr private key | — | -| `CASHU_MINTS` | Comma-separated mint URLs | `https://mint.minibits.cash/Bitcoin` | -| `RECEIVE_LN_ADDRESS` | Lightning address for withdrawals | — | -| `TOR_PROXY_URL` | SOCKS5 proxy for Tor | `socks5://127.0.0.1:9050` | -| `CORS_ORIGINS` | Allowed CORS origins | `*` | -| `RELAYS` | Nostr relays (comma-separated) | (default set) | +| Variable | Description | Default | +| -------------------- | --------------------------------- | ------------------------------------ | +| `UPSTREAM_BASE_URL` | Upstream API endpoint | — | +| `UPSTREAM_API_KEY` | Upstream API key | — | +| `ADMIN_PASSWORD` | Dashboard password | (none) | +| `DATABASE_URL` | Database connection string | `sqlite+aiosqlite:///keys.db` | +| `NAME` | Node display name | `ARoutstrNode` | +| `DESCRIPTION` | Node description | `A Routstr Node` | +| `NPUB` | Nostr public key (bech32) | — | +| `NSEC` | Nostr private key | — | +| `CASHU_MINTS` | Comma-separated mint URLs | `https://mint.minibits.cash/Bitcoin` | +| `RECEIVE_LN_ADDRESS` | Lightning address for withdrawals | — | +| `TOR_PROXY_URL` | SOCKS5 proxy for Tor | `socks5://127.0.0.1:9050` | +| `CORS_ORIGINS` | Allowed CORS origins | `*` | +| `RELAYS` | Nostr relays (comma-separated) | (default set) | ### Priority diff --git a/docs/provider/quickstart.md b/docs/provider/quickstart.md index 8aabc5d9..69e05d82 100644 --- a/docs/provider/quickstart.md +++ b/docs/provider/quickstart.md @@ -24,7 +24,20 @@ You bring the API keys, Routstr handles the billing, payments, and client manage --- -## 1. Start the Node +## 1. Prepare Configuration + +Create a `.env` file in the root of the project to store your secrets: + +```bash +# Initial Admin Password +ADMIN_PASSWORD=mysecretpassword + +# Your AI Provider Key +UPSTREAM_BASE_URL=https://api.openai.com/v1 +UPSTREAM_API_KEY=sk-proj-... +``` + +## 2. Start the Node You can run the pre-built image directly: @@ -32,6 +45,7 @@ You can run the pre-built image directly: docker run -d \ --name routstr \ -p 8000:8000 \ + --env-file .env \ -v routstr-data:/app/data \ ghcr.io/routstr/proxy:latest ``` @@ -42,8 +56,12 @@ If you want to build the node and UI yourself from source, use the unified Docke ```bash git clone https://github.com/routstr/routstr-core.git cd routstr-core +# Edit your .env with ADMIN_PASSWORD and API keys +cp .env.example .env +nano .env + docker build -f Dockerfile.full -t routstr-local . -docker run -d -p 8000:8000 --name routstr routstr-local +docker run -d -p 8000:8000 --env-file .env --name routstr routstr-local ``` Verify it's running: @@ -54,12 +72,12 @@ curl http://localhost:8000/v1/info --- -## 2. Configure via Dashboard +## 3. Configure via Dashboard Open the **Admin Dashboard** at [http://localhost:8000/admin/](http://localhost:8000/admin/). -!!! note "Default Access" - The dashboard has no password by default. Set one immediately in Settings for production use. +!!! note "Login" + Use the `ADMIN_PASSWORD` you defined in your `.env` file to log in. If you didn't set one, the dashboard will prompt you to set one on first visit. ### Connect Your AI Providers