docs: update README with public endpoints, auth changes, and new features
Reflects all changes since the initial README: Bearer auth on internal endpoints, public index page and /public/* API, dashboard enhancements (announced checkbox, ping button, tabbed UI, copy-to-clipboard), .env file support, and new config variables. Made-with: Cursor
This commit is contained in:
54
README.md
54
README.md
@@ -11,7 +11,7 @@ API.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -e ".[dev]"
|
pip install -e ".[dev]"
|
||||||
export NTR_ADMIN_TOKEN="your-secret-here"
|
cp .env.example .env # edit with your settings
|
||||||
ntr-fetcher
|
ntr-fetcher
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,12 +36,16 @@ Full documentation: [`docs/api.md`](docs/api.md)
|
|||||||
|
|
||||||
| Endpoint | Method | Auth | Description |
|
| Endpoint | Method | Auth | Description |
|
||||||
|----------|--------|------|-------------|
|
|----------|--------|------|-------------|
|
||||||
|
| `/` | GET | -- | Public index page |
|
||||||
| `/health` | GET | -- | Service health check |
|
| `/health` | GET | -- | Service health check |
|
||||||
| `/playlist` | GET | -- | Current week's playlist |
|
| `/public/playlist` | GET | -- | Current week's playlist (unannounced tracks censored) |
|
||||||
| `/playlist/{position}` | GET | -- | Single track by position (1-indexed) |
|
| `/public/shows` | GET | -- | List all shows (paginated) |
|
||||||
| `/shows` | GET | -- | List all shows (paginated) |
|
| `/public/shows/{show_id}` | GET | -- | Past show with full tracklist |
|
||||||
| `/shows/by-episode/{episode_number}` | GET | -- | Look up show by episode number |
|
| `/playlist` | GET | Bearer | Current week's full playlist |
|
||||||
| `/shows/{show_id}` | GET | -- | Specific show by internal ID |
|
| `/playlist/{position}` | GET | Bearer | Single track by position (1-indexed) |
|
||||||
|
| `/shows` | GET | Bearer | List all shows (paginated) |
|
||||||
|
| `/shows/by-episode/{episode_number}` | GET | Bearer | Look up show by episode number |
|
||||||
|
| `/shows/{show_id}` | GET | Bearer | Specific show by internal ID |
|
||||||
| `/login` | GET/POST | -- | Login page |
|
| `/login` | GET/POST | -- | Login page |
|
||||||
| `/logout` | GET | Session | Clear session |
|
| `/logout` | GET | Session | Clear session |
|
||||||
| `/dashboard` | GET | Session | Live playlist dashboard |
|
| `/dashboard` | GET | Session | Live playlist dashboard |
|
||||||
@@ -50,10 +54,16 @@ Full documentation: [`docs/api.md`](docs/api.md)
|
|||||||
| `/admin/tracks/{track_id}` | DELETE | Bearer | Remove track from current show |
|
| `/admin/tracks/{track_id}` | DELETE | Bearer | Remove track from current show |
|
||||||
| `/admin/tracks/{track_id}/position` | PUT | Bearer | Move track to new position |
|
| `/admin/tracks/{track_id}/position` | PUT | Bearer | Move track to new position |
|
||||||
| `/admin/announce` | POST | Bearer/Session | Announce track to IRC |
|
| `/admin/announce` | POST | Bearer/Session | Announce track to IRC |
|
||||||
|
| `/admin/announced` | POST | Bearer/Session | Toggle track announced state |
|
||||||
|
| `/admin/ping` | POST | Bearer/Session | Send IRC message via connected bots |
|
||||||
|
| `/ws/announce` | WS | Bearer | Bot WebSocket for announcements |
|
||||||
|
| `/ws/public` | WS | -- | Public WebSocket for live track reveals |
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Environment variables (prefix `NTR_`):
|
All settings are read from environment variables (prefix `NTR_`). A `.env`
|
||||||
|
file in the project root is loaded automatically. See
|
||||||
|
[`.env.example`](.env.example) for a template with all available variables.
|
||||||
|
|
||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
|----------|---------|-------------|
|
|----------|---------|-------------|
|
||||||
@@ -65,13 +75,35 @@ Environment variables (prefix `NTR_`):
|
|||||||
| `NTR_SOUNDCLOUD_USER` | `nicktherat` | SoundCloud username to track |
|
| `NTR_SOUNDCLOUD_USER` | `nicktherat` | SoundCloud username to track |
|
||||||
| `NTR_SHOW_DAY` | `2` | Day of week for show (0=Mon, 2=Wed) |
|
| `NTR_SHOW_DAY` | `2` | Day of week for show (0=Mon, 2=Wed) |
|
||||||
| `NTR_SHOW_HOUR` | `22` | Hour (Eastern Time) when the show starts |
|
| `NTR_SHOW_HOUR` | `22` | Hour (Eastern Time) when the show starts |
|
||||||
|
| `NTR_SHOW_ROTATION_DELAY_HOURS` | `0` | Hours to wait after the show boundary before rotating to the next episode (recommended `2` for live recording window) |
|
||||||
|
| `NTR_PING_TARGET` | *(empty)* | Default nick/target for the dashboard ping feature |
|
||||||
|
| `NTR_PING_MESSAGE` | *(empty)* | Default message for the dashboard ping feature |
|
||||||
|
|
||||||
|
## Public Index Page
|
||||||
|
|
||||||
|
The root URL (`/`) serves a public-facing page showing the current show's
|
||||||
|
playlist. Unannounced tracks are hidden behind silhouette cards until the
|
||||||
|
admin announces them from the dashboard. Reveals happen in real time over
|
||||||
|
WebSocket (`/ws/public`), so listeners following along see tracks appear
|
||||||
|
as they are played.
|
||||||
|
|
||||||
|
Past episodes are browsable from the same page with their full tracklists
|
||||||
|
visible.
|
||||||
|
|
||||||
## Dashboard
|
## Dashboard
|
||||||
|
|
||||||
An optional web dashboard for announcing tracks to IRC during live shows.
|
An optional web dashboard for managing tracks during live shows. Features:
|
||||||
Nick opens the dashboard, sees the current and previous week's playlist, and
|
|
||||||
clicks "Announce" next to a track to push it to the configured IRC channel
|
- **Tabbed show interface** -- switch between the current and previous week's
|
||||||
via connected bot plugins.
|
playlists in one view.
|
||||||
|
- **Announce button** -- push a track to IRC via connected bot plugins. Also
|
||||||
|
reveals the track on the public index page in real time.
|
||||||
|
- **Announced checkbox** -- persistent per-track flag, auto-checked on
|
||||||
|
announce. Can be toggled manually.
|
||||||
|
- **Copy to clipboard** -- one-click copy of a formatted track line.
|
||||||
|
- **Send IRC Message** -- ping a nick or channel with a custom message through
|
||||||
|
all connected bots. Default target and message are configurable via
|
||||||
|
`NTR_PING_TARGET` / `NTR_PING_MESSAGE`.
|
||||||
|
|
||||||
Enable by setting these environment variables:
|
Enable by setting these environment variables:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user