fix: player connectivity and media download pipeline

- nginx: add /api/ shortcut block (no portal auth, X-Script-Name /digiserver,
  Host $http_host) so players can reach DigiServer API without /digiserver prefix
- nginx: use $http_host in /api/ block so Flask host_url includes port — fixes
  media download URLs missing :8080 (was http://ip/digiserver/... not http://ip:8080/...)
- player main.py: fix double-port bug when server_ip already contains a port
  (e.g. 192.168.0.230:8080 was producing http://192.168.0.230:8080:80)
- get_playlists_v2.py: force re-sync when server version differs OR local media
  files are missing on disk — fixes stale playlist after server reset
- digiserver api.py: playlist endpoint builds full media URLs using script_root
  from X-Script-Name header set by nginx
- weblink support, player build/deploy improvements, manage-playlist AJAX prefix fix
This commit is contained in:
ske087
2026-06-29 20:04:11 +03:00
parent f674330b93
commit 4f4e017ad2
16 changed files with 1222 additions and 38 deletions
+12
View File
@@ -22,6 +22,18 @@ class Config:
UPLOAD_FOLDER = os.path.join(_basedir, 'static', 'uploads')
UPLOAD_FOLDERLOGO = os.path.join(_basedir, 'static', 'resurse')
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif', 'bmp', 'mp4', 'avi', 'mkv', 'mov', 'webm', 'pdf', 'ppt', 'pptx'}
# Pre-staged player code location (admins build/refresh this; SSH deploy ships it).
# Defaults to <repo>/data/player both in the container (/app/data/player) and in dev.
PLAYER_CODE_DIR = os.getenv(
'PLAYER_CODE_DIR',
os.path.abspath(os.path.join(_basedir, '..', 'data', 'player'))
)
# Default git repository for the player source code.
PLAYER_REPO_URL = os.getenv(
'PLAYER_REPO_URL',
'https://gitea.moto-adv.com/ske087/Kiwy-Signage.git'
)
# Session
PERMANENT_SESSION_LIFETIME = timedelta(minutes=30)