Dispatcharr/apps/proxy/ts_proxy
None db318e4981 Fix #954: Superuser detection; Feature #1004: User account disable/enable
Bug #954: The initialize_superuser endpoint only checked is_superuser=True, missing admin accounts created via the API (user_level=10). This caused users to intermittently see the "Create Super User" page instead of login.

Feature #1004: Admins can now disable/enable user accounts. Disabled users are blocked from JWT login, token refresh, XC API access, and all
authenticated endpoints. The last active admin cannot be disabled.

Files changed:

Backend:
- apps/accounts/api_views.py — Superuser check uses user_level>=10; token refresh blocks disabled users
- apps/accounts/models.py — CustomUserManager ensures create_superuser() always sets user_level=10
- apps/accounts/serializers.py — Last-admin protection guard; respect is_active on user creation
- apps/accounts/tests.py — new tests covering superuser detection, token
 refresh blocking, last-admin protection, disabled user login/access
- apps/backups/api_views.py — Switched from DRF's IsAdminUser (checks is_staff) to app's IsAdmin (checks user_level) on all 8 endpoints
- apps/backups/tests.py — new tests verifying user_level-based admin permission on backup endpoints
- apps/output/views.py — is_active check on xc_get_user(), xc_movie_stream(), xc_series_stream()
- apps/proxy/ts_proxy/views.py — is_active check on stream_xc()
- core/api_views.py — Admin notification filter uses user_level>=10
- core/developer_notifications.py — Admin checks use user_level>=10

Frontend:
- frontend/src/App.jsx — Null-safe superuser existence check
- frontend/src/components/forms/User.jsx — Account Enabled switch with
  self-disable prevention and tooltip
- frontend/src/components/tables/UsersTable.jsx — Status column (Active/Disabled badge)
2026-02-22 18:05:02 -06:00
..
services Squash: Log Parsing Refactor & Enhancing 2025-12-22 15:14:46 -05:00
__init__.py centralized and lazy-loaded redis client singleton, check for manage.py commands so we don't init proxyservers (redis connection), put manage commmands before starting uwsgi 2025-04-04 16:18:12 -04:00
apps.py centralized and lazy-loaded redis client singleton, check for manage.py commands so we don't init proxyservers (redis connection), put manage commmands before starting uwsgi 2025-04-04 16:18:12 -04:00
channel_status.py Add stream type to stats page. 2025-06-10 10:10:05 -05:00
client_manager.py refactor: externalize Redis and Celery configuration via environment variables 2025-12-18 16:54:59 -06:00
config_helper.py Switch HTTP streamer to a thread and pipe its output to a local pipe where the fetch chunk can access it the same way our transcode processes would be accessed. Simplifies the code. 2025-10-12 09:42:15 -05:00
constants.py Enhancement: Adds support for UDP streams. Closes #617 2025-11-11 18:30:59 -06:00
http_streamer.py Switch HTTP streamer to a thread and pipe its output to a local pipe where the fetch chunk can access it the same way our transcode processes would be accessed. Simplifies the code. 2025-10-12 09:42:15 -05:00
redis_keys.py Added client speed statistics to client metadata in redis. 2025-03-21 19:59:54 -05:00
server.py feat: Add Redis authentication support for modular deployment 2026-02-03 21:42:06 -06:00
stream_buffer.py Changed read timeout for http connection for the proxy server to 10 secounds to avoid unnecessary timeouts. 2025-10-11 19:45:21 -05:00
stream_generator.py Enhancement: Add system event logging and viewer with M3U/EPG endpoint caching 2025-11-20 17:41:06 -06:00
stream_manager.py Refactor logging messages in StreamManager for clarity and consistency. Also removed redundant parsing. 2025-12-23 15:52:56 -06:00
url_utils.py Fix: Continue GET request if HEAD fails with the peer closing the connection without returning a response 2025-12-26 15:27:51 +01:00
urls.py Added ability to send a next stream command. 2025-03-27 20:49:24 -05:00
utils.py Enhancement: Adds support for UDP streams. Closes #617 2025-11-11 18:30:59 -06:00
views.py Fix #954: Superuser detection; Feature #1004: User account disable/enable 2026-02-22 18:05:02 -06:00