Add custom AI provider support and improve qBittorrent auth

Introduces support for custom OpenAI-compatible AI providers with configurable base URLs, including UI, backend validation, and connection testing. Enhances qBittorrent integration to support HTTP Basic Auth for reverse proxies, adds detailed debug logging, and updates documentation for both features. Also improves login page description logic and AI prompt generation for recommendations.
This commit is contained in:
kikootwo
2026-01-12 17:11:39 -05:00
parent 682836237b
commit 50fb5a68af
13 changed files with 664 additions and 74 deletions
+2
View File
@@ -216,6 +216,8 @@ Automatically grants admin permissions based on OIDC claims (e.g., group members
- **GET /api/auth/oidc/login** - Initiate OIDC flow, redirect to provider
- **GET /api/auth/oidc/callback** - Handle OAuth callback, create/update user, return JWT
- **GET /api/auth/providers** - List enabled auth providers for login page
- Returns: `backendMode`, `providers[]`, `registrationEnabled`, `hasLocalUsers`, `oidcProviderName`, `localLoginDisabled`, `automationEnabled`
- `automationEnabled`: true if Prowlarr/indexer configured (used for dynamic login page description)
### Configuration Keys
```
+23 -1
View File
@@ -2,7 +2,7 @@
**Status:** ✅ Implemented | Real floating book covers with professional animations
Stylized entry point with Plex OAuth integration, animated floating popular audiobook covers, and prominent "Login with Plex" CTA.
Stylized entry point with Plex/Audiobookshelf authentication, animated floating popular audiobook covers, and dynamic description based on backend configuration.
## Design
@@ -13,6 +13,7 @@ Stylized entry point with Plex OAuth integration, animated floating popular audi
- Multi-layer depth effect with z-index layering (0-20)
- Dark theme optimized with glassmorphism card
- Professional streaming service aesthetic
- **Dynamic description** based on backend mode (Plex/Audiobookshelf) and automation status
## Authentication Flow
@@ -53,6 +54,18 @@ Stylized entry point with Plex OAuth integration, animated floating popular audi
- Seed multipliers (7, 13, 17, 23, 29, 31) prevent pattern repetition
- Math.sin() based pseudo-random for deterministic results
## Dynamic Description
Description text adapts to backend configuration:
**Plex + Automation Enabled:** "Request audiobooks and they'll automatically download and appear in your Plex library"
**Plex + No Automation:** "Request audiobooks for your Plex library"
**Audiobookshelf + Automation:** "Request audiobooks and they'll automatically download and appear in your Audiobookshelf library"
**Audiobookshelf + No Automation:** "Request audiobooks for your Audiobookshelf library"
**Loading State:** "Your Personal Audiobook Library Manager"
Automation is detected by checking for configured indexer (Prowlarr) via `/api/auth/providers` endpoint.
## State
```typescript
@@ -65,6 +78,15 @@ interface LoginPageState {
showAdminLogin: boolean;
adminUsername: string;
adminPassword: string;
authProviders: {
backendMode: string;
providers: string[];
registrationEnabled: boolean;
hasLocalUsers: boolean;
oidcProviderName: string | null;
localLoginDisabled: boolean;
automationEnabled: boolean;
} | null;
}
interface BookCover {
+7
View File
@@ -181,6 +181,13 @@ type TorrentState = 'downloading' | 'uploading' | 'stalledDL' |
- Headers set to qBittorrent base URL (e.g., `https://seedbox.example.com:443/qbittorrent`)
- Applied to both `login()` and `testConnectionWithCredentials()` methods
- Works with all qBittorrent versions and configurations
- Enhanced debug logging for troubleshooting authentication issues (enable with `LOG_LEVEL=debug`)
**13. Nginx/Apache reverse proxy HTTP Basic Auth** - Many seedboxes use nginx or Apache reverse proxy with HTTP Basic Authentication in front of qBittorrent. This causes HTTP 401 errors with `www-authenticate: Basic` header. Browsers handle this by prompting for credentials and sending `Authorization: Basic` header. Fixed by:
- Adding HTTP Basic Auth to all axios requests using `auth` parameter
- Same credentials used for both Basic Auth (nginx/Apache) and qBittorrent Web UI authentication
- Applied to axios client instance and all standalone requests
- Works transparently with or without reverse proxy
- Compatible with popular seedbox providers (seedit4.me, etc.)
## Tech Stack