Files
Tha.Les 2cb7214aea fix: server network access and YouTube Shorts support (#233)
* feat: support YouTube Shorts URLs

Normalize youtube.com/shorts/<videoId> to the standard watch?v= form
so yt-dlp receives a URL its extractor already handles.

Adds two test cases covering www. and m. variants.

* fix: allow network access by default in server/Docker mode

Two layers were blocking headless server deployments from accepting
network clients (reported in discussion #216):

1. docker-compose.yml bound to 127.0.0.1:8000 - Docker itself rejected
   connections from the network before they reached the app.

2. _default_allow_network() returned False unconditionally, so the
   network_gate middleware blocked all non-loopback requests even when
   Docker networking was configured correctly.

Fix both: bind the Docker port to 0.0.0.0 and derive the network
default from STEMDECK_DESKTOP - desktop keeps its secure off-by-default
behavior; server/Docker deployments open the gate automatically since
network access is the entire point of a headless deployment.
STEMDECK_ALLOW_NETWORK still takes precedence when set explicitly.

* style: ruff format download.py

* test: update network gate tests for server-mode default

Rename test_default_is_off to clarify it covers desktop mode (now
requires STEMDECK_DESKTOP=1). Add test_default_is_on_in_server_mode
covering the new behavior where allow_network defaults to True when
STEMDECK_DESKTOP is absent.

* fix: hide network and port settings in server/Docker mode

Network toggle and port field are desktop-only controls. In server mode
(no window.__TAURI__) the port is fixed by Docker and network access is
on by default, so exposing these controls is misleading. Hide both from
the Advanced settings tab when not running inside Tauri.

* fix: make network and port settings read-only in server/Docker mode

In server mode (no Tauri) the network toggle is always on and the port
is fixed by Docker, so both controls are shown but disabled so the user
can see the current state without being able to change them.

* fix: add read-only note to server-mode settings

Show a explanatory note at the top of the Advanced tab when running in
server mode so users know the network and port controls are intentionally
locked and where to make changes.
2026-06-28 20:59:09 +01:00
..