This pull request introduces improvements to the API key generation and management process for Listenarr, enhancing both backend and frontend workflows for initial setup and regeneration scenarios. The main changes include a new backend endpoint for initial API key generation, frontend logic to handle first-time and subsequent API key creation, and improved resilience in configuration handling.
API Key Generation & Management
- Added a new backend endpoint (
/configuration/apikey/generate-initial) that allows generating an API key only when no users exist, preventing unauthorized access after initial setup. - Updated the authentication middleware to allow unauthenticated access to the initial API key generation endpoint, enabling first-time setup flows.
Frontend Integration & UX
- Enhanced the frontend (
SettingsView.vue) to distinguish between initial API key generation and regeneration, including dynamic button labels, icons, and confirmation messages. The frontend now attempts initial generation and falls back to regeneration if needed.
Configuration Service Robustness
- Improved backend configuration service to automatically generate and persist an API key if missing from an existing config, and to ensure a secure key is generated on first run. Refactored config saving logic for consistency.
Documentation
- Added a new
WARP.mdfile with comprehensive guidance for development, architecture, and workflow, improving onboarding and tooling support.Introduces an endpoint and frontend logic to generate an API key during initial setup when no users exist. Updates backend services to auto-generate API keys if missing, refines authentication middleware to allow the new endpoint, and improves SettingsView to handle both generation and regeneration scenarios.
Automated nightly build