1572 Commits
Author SHA1 Message Date
Safihre 3376cb5143 Escape the server-supplied NNTP message during testing 2026-09-14 22:24:09 +02:00
mnightingale 112d449446 Continue with the other RSS feed URIs when one fails 2026-09-11 14:35:33 +02:00
Safihre b18cdc38f8 Robustly strip HTML tags to prevent XSS
Previous HTML stripping could allow malformed or unclosed tags to pass through, potentially leading to Cross-Site Scripting (XSS) vulnerabilities if completed by the browser.

This change updates the regex to aggressively remove all HTML tags, even incomplete ones. The `knockout-extensions.js` code also now universally escapes HTML, removing a potential bypass. New tests confirm this behavior.
2026-09-10 12:37:01 +02:00
T3553 29699890d5 fix background color for .table-server-connections thead 2026-09-09 17:52:44 +02:00
Safihre 6cbe811d10 Restore checkboxes color 2026-09-04 09:03:26 +02:00
Safihre c65ce5d5aa Add tooltip to explain search filters in queue and history
Provide users with guidance on advanced search capabilities, including filter options like `cat:`, `status:`, and `priority:`.
Closes #3558
2026-09-03 11:24:44 +02:00
Safihre ab702860df Refactor color scheme implementation
Moves theme-specific styles into main CSS files for each interface,
leveraging `color-scheme` and `light-dark()` CSS functions. This
consolidates styling, reduces HTTP requests, and improves automatic
dark/light mode detection based on OS preferences.
2026-09-02 22:02:33 +02:00
mnightingale 20915cc626 Fix mobile dropdown menu styling 2026-08-31 17:44:22 +02:00
mnightingale 4fde6e490c Update jQuery UI to 1.14.2 2026-08-31 16:32:13 +02:00
mnightingale 58c3c13954 Update jQuery to 3.7.1 2026-08-31 16:32:13 +02:00
mnightingale 7b3d1d41ab Load one copy of jQuery, jQuery UI and Bootstrap instead of two 2026-08-31 16:32:13 +02:00
mnightingale cb1102d992 Match navbar heights between styles 2026-08-31 14:31:01 +02:00
mnightingale ecf5e27c04 Let the browser hold static files for good 2026-08-31 08:58:41 +02:00
mnightingale cd96dadcc3 Send the restart request below the configured URL base 2026-08-31 08:58:41 +02:00
mnightingale fb2660dbb9 Serve Glitter's scripts as files the browser can cache 2026-08-31 08:58:41 +02:00
Safihre e3bc15e8e6 Make Compact Great Again 2026-08-28 14:48:13 +02:00
Safihre 5696a667e7 Show in-progress status for server tests
Add an `alert-info` class to the result box while a server test is running,
providing visual feedback to the user that the process is ongoing.
2026-08-27 14:25:06 +02:00
mnightingale b192a7eca4 Persistent sessions, CSRF tokens, and no apikey in the web interface (#3559)
* Add a session store that keeps web-UI logins in the admin folder

* Authenticate the web interface with session cookies and CSRF tokens

* Stop embedding the apikey in the web interface

* Cover the session, CSRF and apikey changes
2026-08-27 13:05:12 +02:00
coopa11yandcoopa11y 21d639bf5f Announce news server test results to screen readers (#3566)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-08-19 11:31:14 +02:00
coopa11yandcoopa11y 6d897a5f23 Announce notification test results to screen readers (#3567)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-08-19 11:31:06 +02:00
Safihre 19b597d21b Add static cache busting for Config Auto colorscheme 2026-08-18 08:50:08 +02:00
mnightingale 583617f0a9 Fix submission of server forms when priority, displayname, or notes changes (#3578) 2026-08-17 20:57:42 +02:00
mnightingale cf26260910 Fix display of downloaded rss history (#3570) 2026-08-16 15:46:28 +02:00
Safihre 61df709a04 Add static cache busting for Auto colorscheme
Yes ugly, but it works for major updates
2026-08-12 10:55:18 +02:00
mnightingale 35d5355f49 Replace CherryPy with Uvicorn and Starlette (#3550)
* Migrate web interface from CherryPy to Uvicorn/Starlette

Squashed rebase of feature/uvicorn (34 commits) onto develop, reconciled
with ~3 months of intervening develop changes.

Replaces the CherryPy webserver and request handling with Uvicorn/Starlette
across the API, web interface, RSS, config pages and related modules.

Reconciliation with develop during the rebase:
- api.py: kept develop's security/behaviour fixes (orphan path-traversal
  guard, expanded log redaction incl. host_whitelist and
  remote_label_replacement, get_dconfig single-return, get_retryable_jobs,
  connections default, translated NNTP test errors) on top of the Starlette
  request/response rewrite.
- interface.py: ported the RSS route handlers to develop's DB-backed
  RSSRepository API (process_feed, rss_repository / find_job_by_url /
  clear_feed / clear_downloaded / flag_downloaded).
- misc.py: kept develop's hachoir-based get_media_duration.
- requirements.txt: dropped the CherryPy stack, adopted develop's newer pins.

Also applied ruff --fix (PEP 604 unions, builtin generics) to align with
develop's lint config.

Verified: ruff check, black --check, and the affected test suites
(9413 passed, 1 skipped) all pass.

* Update starlette/uvicorn versions

* Fix race issues in global rss state

* Fix test race in server shutdown

The uvicorn migration turned /shutdown (and the shutdown API) into fire-and-forget: it spawned shutdown_program() in a background thread and replied immediately, whereas develop ran it synchronously and only replied once halt() had persisted all state. Because the module-scoped test teardown doesn't wait for the process to exit, the next module's clean_cache_dir wiped the shared cache dir (and reused the fixed port) while the previous instance was still saving state and holding the port — producing the three intermittent failures (deleted sabnzbd.log → "File log disabled or not found"; un-persisted [sorters] → KeyError; stale instance → missing wizard .quoteBlock).

* Fix robots and description, add favicon

* Remove remains of http basic auth

* Setup Starlette once configuration is available, fix static file relative cwd and url_base config

* abort_and_show_error when webserver fails to start

* Guard stopping webserver that never started

* Delegate XFF handling to ProxyHeadersMiddleware

* Merged params at request.state.params instead of modifying private apis

* Both shutdown routes share implementation and do not block event loop

* Run sync handlers via run_in_threadpool and facilitate eventual migration to async

* Pool database connections

* Online backup of database due to WAL changes

* Fix exception on None request.client (test clients or unix sockets)

* Fix flakey tests due to process not fully shutting down

* Restore X-Frame-Options behaviour via middleware

* Fix set_config_default with multiple keywords

* Remove broken logging call

* Restore api logging functionality

* Cache-Control: no-store

* Login only via POST

* Remove 401 (basic-auth) and add 404 handling via redirect

* Fix crash when shutdown not an int

* Use BaseRedirectResponse helper

* Remove trailing slashes from wizard routes

* URL helper, absolute URLs everywhere, fixes issues with nested navigation

* Fix scheduler adding multiple daysofweek

* Restore CherryPy api behaviour merging body with query params (body wins)

* Clearer documentation of get_request_params and request_params

* First stage supporting gradual api async

* Fix rss ajax consuming flash

* Restore access log functionality

* Hostname check in middleware

* Request logging in middleware

* Param parsing in middleware

* Security checks in middleware

* secured_expose is now purely route registration

* Lookup api handler once per request

* Fix flakey alert dialogs

* Trigger restart via BackgroundTask

* Restore CherryPy first param wins and get/post consistency

* Remove dead code

* Secure cookies based on protocol the client used

* Fix various issues with port_is_free

1. port_is_free answered the wrong question. It connect-probed ("is something answering?") rather than bind-probed ("can I bind?"). A port could report free and then kill startup at uvicorn's bind().
2. The bind-all remap crossed address families. :: was mapped to 127.0.0.1, probing IPv4 for an IPv6 bind — a regression against portend, which maps :: → ::1.
3. The call sites passed the wrong host. browserhost is a client-reachable address; the thing that has to be bindable is web_host.
4. Errors were swallowed. A bare except OSError hid gaierror, so an unresolvable host reported "free".
5. find_free_port had a port-0 trap. Under a bind-probe, currentport=0 always succeeds and returned 0 — the old failure sentinel. Now guarded, and None instead of 0.
6. Ports 80/443 were misdiagnosed. EACCES was folded into "occupied", producing ten futile probes and a panic claiming another program held the port. PermissionError now propagates to a dedicated panic explaining the actual remedies.
7. The tests were largely tautological. Three tests covering one branch, an IPv6 test with no IPv6 in it, a timeout test that never engaged the timeout, TOCTOU-prone fixed-range probes, no SO_REUSEADDR on the helper listener, and nothing asserting the property that matters — that "free" implies bindable.
8. A portability bug I introduced, then fixed. I'd baked Linux SO_REUSEADDR overlap semantics into four assertions; macOS differs. Now platform-aware, with the IPv6 regression re-covered by checking the socket family directly.

* Claim the bind address for uvicorn on startup, resolves "49" in err handling from cherrypy

* Rename function BaseRedirectResponse to base_redirect_response

* Restore error response on change web directory

* Add missing typings

* Fix return type of retry job for future types

* A better fix for xdist compatibility - test overwrote db_path

* Secure session cookies (rss flash)

* Inline or remove some functions

* Retry job futuretype behaviour

* Sneak a worksteal fix in

* Test and fix retry_job futuretype behaviour
2026-08-11 13:27:51 +01:00
coopa11yandcoopa11y fd191d1b79 Add screen reader names to Glitter and Config dialogs (#3545)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-08-10 12:25:17 +01:00
coopa11yandcoopa11y 8e39722359 Improve Glitter queue and history table accessibility (#3539)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-08-10 12:49:33 +02:00
Safihre 40860c68ca Correct Notifications page display 2026-08-08 21:34:48 +02:00
Safihre b8838c4728 Improvements to Notification options display 2026-08-07 11:03:39 +02:00
Safihre 78cb553b14 Fix config UI selection and update direct unpack log message
Correctly pre-select the 'all' option for `history_retention_option` in the config UI by using the correct variable.
2026-08-06 16:15:09 +02:00
Safihre 2cb12a07c9 Update 'Mark as Completed' link to a button 2026-08-03 14:53:42 +02:00
thezoggy d167fb0fe7 fix active pagination for light theme (#3541) 2026-08-03 08:52:22 +02:00
coopa11yandcoopa11y 0411e8acc1 Label schedule time, enable, and delete controls for screen readers (#3525)
* Label schedule time, enable, and delete controls

* Use ARIA label for schedule enable control

---------

Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-28 21:12:47 +03:00
coopa11yandcoopa11y 9122633907 Label SABnzbd login fields and help link for screen readers (#3524)
* Label SABnzbd login fields and help link

* Use ARIA labels for login fields

---------

Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-28 17:42:48 +03:00
coopa11yandcoopa11y af10190e0b Improve Glitter status table accessibility (#3523)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-26 20:07:31 +03:00
Parsa YazdaniandQuixThe2nd 404060373b feat: add 'Sort by Remaining Size' queue sort option (#3512)
* feat: add 'Sort by Remaining Size' queue sort option

Add a new 'remaining_bytes' sort field that sorts the queue by absolute
remaining bytes (bytes - bytes_tried), complementing the existing
'remaining' sort which uses percentage downloaded and the 'size' sort
which uses total bytes.

Changes:
- nzbqueue.py: add remaining_bytes sort field, fix update_sort_order()
  to parse field+direction from config instead of hardcoding 'remaining'
- skintext.py: add Glitter-sortRemainingBytesAsc/Desc translation strings,
  update auto_sort explanation text
- Glitter UI: add dropdown entries and JS handlers for both directions
- Config: add auto_sort options for remaining_bytes asc/desc
- Tests: parametrize remaining_bytes asc/desc against sizeleft slot field

* style: wrap long string for Black formatting

* fix: limit remaining-size sorting to ascending

---------

Co-authored-by: QuixThe2nd <QuixThe2nd@users.noreply.github.com>
2026-07-26 16:28:08 +03:00
coopa11yandcoopa11y a84544bef8 Improve Glitter message accessibility (#3518)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-25 12:50:52 +03:00
coopa11yandcoopa11y f38b602924 Improve interface options form accessibility (#3516)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-25 11:50:58 +03:00
coopa11yandcoopa11y 3ab1782dc2 Improve Add NZB form accessibility (#3511)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-22 22:15:35 +03:00
coopa11yandcoopa11y 1336d66f78 Restore keyboard access to queue actions (#3503)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-21 15:25:04 +02:00
coopa11yandcoopa11y 1f7bec651d Improve Glitter history row accessibility (#3504)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-20 10:24:13 +02:00
coopa11yandcoopa11y efb16cc69b Improve Glitter search and pagination accessibility (#3505)
* Improve Glitter search and pagination accessibility

* Fixed: Preserve pagination keyboard shortcuts

---------

Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-20 10:23:24 +02:00
Safihre 636aa91e21 Restore queue action buttons 2026-07-17 08:58:52 +02:00
mnightingale ba2099d006 Add RSS Age rule (#3498)
* RSS age rule

* Support years (y) and months (mo) and do not approximate durations in seconds

* Better handling of entries with no age

* Formatting

* Allow >=, =>, <=, and =< aliases

* Implement feedback

* Fix existing issue with From SxxEyy in default row

* Test unitless ages
2026-07-16 21:24:41 +02:00
Safihre 889fbf688d Correct CSS for queue rows
After #3477
2026-07-16 21:17:53 +02:00
coopa11yandcoopa11y 1eed5c7866 Improve Glitter queue row accessibility (#3477)
* Improve Glitter queue row action labels

* Simplify queue row accessibility labels

---------

Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-16 07:51:36 +02:00
Safihre 0bcb28d576 Correctly fix dots-styling in pagination 2026-07-09 12:08:09 +02:00
Safihre dc421047d3 Render Config UI tooltips in body
Closes #3486
2026-07-04 20:32:28 +02:00
coopa11yandcoopa11y fd6d8c71c7 Improve Config search accessibility (#3476)
Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-07-03 13:07:20 +02:00
coopa11yandcoopa11y 6112ded96b Improve Glitter header menu labels (#3471)
* Improve Glitter header menu labels

* Improve Glitter header label localization

---------

Co-authored-by: coopa11y <coopa11y@users.noreply.github.com>
2026-06-30 20:15:40 +02:00