Commit Graph

80 Commits

Author SHA1 Message Date
ske087 05fc1a14f6 Move the Ajutor nav link after Logout
Header nav order was Dashboard, Players, Playlists, Ajutor, Admin, Logout,
toggle. Ajutor now sits after Logout and before the theme toggle, so the
navigation links stay grouped and the two "settings"-style controls (logout,
help, theme) are together at the end.
2026-10-15 00:01:07 +03:00
ske087 ef85a3ca42 Stop per-heartbeat re-auth log spam; stop logging bearer tokens
Two issues found while investigating repeated "Re-authentication required for
Test player (rpi-test1): token_reset" entries appearing every ~20s.

1) Log spam. The heartbeat handler logged an INFO row every time it asked a
   player to re-authenticate. A player heartbeats every ~15s and the request
   repeats until the player complies, so a pending request wrote a server_log
   row every few seconds (~230 rows in ~1.3h here) and buried the dashboard.

   The per-heartbeat log line is removed. The request is now recorded once, at
   the moment it is raised: the admin action already logs when the button is
   pressed, and the automatic interval now logs at its transition. The
   outstanding request stays visible in Admin -> Maintenance as
   "awaiting re-auth".

2) Credential leak. verify_player_auth logged the rejected value in full
   ("Invalid auth code attempt: <token>"). server_log is readable in the UI and
   the database, so this wrote a live bearer token to a readable store. It now
   logs a 6-character prefix plus the client IP, which is enough to correlate
   failures without exposing the credential.
2026-10-14 23:54:48 +03:00
ske087 6b0e51898c Make player token reset non-breaking (deferred rotation)
The maintenance-page reset used to rotate auth_code immediately. Because the
token also guards the playlist endpoints, that stopped a player from syncing
content the instant the button was pressed -- before the player ever had a
chance to react -- and clients that do not understand the heartbeat's
401 auth_required would have stayed broken until redeployed.

Split the model behaviour:

* request_reauth()  -- sets the flag only (used by the admin reset endpoints
  and the automatic interval). The current token stays valid, so there is no
  outage while the player is being asked to re-authenticate.
* issue_new_token() -- replaces the token now (used by the existing
  "regenerate auth code" action, where the admin is shown the new value).
* mark_authenticated() -- if a reset was pending, this is where the old token
  is retired: a new token is issued and returned to the player in the
  /api/auth/player response.

Net effect: the reset is a request the player acts on, never a forced logout.
A player that ignores it keeps working and shows as "awaiting re-auth" in the
UI; one that handles it gets a fresh token and the old one stops working.

Maintenance page wording updated to match (request vs reset; "awaiting
re-auth" badge), plus a themed info note explaining it is not a forced logout.

Adds docs/player-auth-reset.md describing the protocol and exactly what the
player client (Kiwy-Signage) still needs to implement: detect 401 /
auth_required on the heartbeat (and on the token-guarded endpoints), re-run
POST /api/auth/player with the stored quick-connect code, save the new
auth_code and retry. No password or SSH redeploy required.

Verified end-to-end: token unchanged and still accepted after the request
(200), heartbeat answers 401 auth_required=token_reset, re-auth issues a
different token, the old token is then rejected (403) and the new one accepted
(200), flag cleared; the interval path only flags without rotating.
2026-10-14 23:14:11 +03:00
ske087 4dc8506c9b Fix all remaining dark-theme colour bugs across the templates
Follow-up to the player-modal / maintenance-page fix: the same root cause --
colours hard-coded for the light theme -- affected the whole app, in two
places.

1) Inline style attributes (inline outranks the theme rules, so the light
   value survives dark mode and the inherited text colour turns
   light-on-light). base.html now carries a single, property-scoped
   dark-mode override layer that maps every light literal found in the
   templates to the theme variables: light backgrounds/whites -> dark
   surfaces, semantic pastels -> dark equivalents, dark text -> light text,
   light borders -> dark borders, plus .back-link. Scoped to
   body.dark-mode, so the light theme is untouched. This covers all
   templates, including ones not edited here and any added later.

2) Page-level <style> blocks with no dark support:
   * admin/https_config.html hard-coded a light-only palette (blue-tint
     panels, dark labels) -- added a body.dark-mode block for it.
   * dashboard.html / help.html / manage_player.html coloured text links
     with --primary-color (#7c3aed in dark = too dim). Introduced a
     dedicated --link-color (#667eea light / #a78bfa dark) and used it for
     text links, leaving --primary-color for button/background use.

Verified with an automated luminance scan of all 18 pages in both themes:
dark mode has 0 light backgrounds and 0 dark-on-dark text (the only
remaining light surfaces are the intentional white buttons on the admin
gradient cards), and light mode is unchanged.
2026-10-14 22:45:09 +03:00
ske087 5b69ccb02b Fix dark-theme colours on player delete modal and maintenance page
Both bugs had the same cause: light colours were set with inline style
attributes, which outrank the theme rules in base.html and so survived the
dark theme. Text that inherits --text-color then became light-on-light.

* manage_player.html: the delete confirmation modal used an inline
  background-color of #fefefe with the body's dark-mode text colour, making
  the message unreadable in dark mode. Rebuilt it with .modal-* classes
  driven by the base.html CSS variables (and dark-mode variants for the
  title, warning and player name).
* admin/maintenance.html: the "Automatic reset interval" panel, table
  headers and JS-rendered rows/tables hardcoded #f8f9fa/#e2e8f0/#dee2e6.
  Switched them to --bg-color / --card-bg / --border-color /
  --text-secondary and added a themed .maint-badge-pending.

Verified with computed styles in both themes; light mode is unchanged.
2026-10-14 22:35:39 +03:00
ske087 88827be7be Add admin maintenance console
Admin-only page reachable from a new card on the admin panel (replacing the
Quick Actions card) that centralises housekeeping operations:

* Database integrity: PRAGMA integrity_check / quick_check / foreign_key_check,
  plus VACUUM + ANALYZE to reclaim free space.
* Leftover records: detects and removes orphaned rows left behind by deleted
  players/content (player_feedback, player_edit, playlist_content, dangling
  player.playlist_id) and orphaned edited-media folders on disk.
* Player authentication tokens: manual reset (single or all), a configurable
  automatic reset interval, and cancellation of a pending reset.

Resetting a token rotates player.auth_code and sets auth_reset_required, so the
next heartbeat (POST /api/player-feedback) answers 401 + auth_required and the
client restarts its authentication flow. A successful authentication clears the
flag and stamps auth_token_issued_at, from which the interval is measured.

New: PlayerAuthConfig model, add_player_auth_reset migration (registered in
docker-entrypoint.sh), admin/maintenance.html.
2026-10-14 22:13:18 +03:00
ske087 2539f82868 Fix Add Content card overlapping the playlist table
The two cards on the playlist manage page overlapped: the Add Content card
was painted on top of the playlist content card.

Cause: the 9-column playlist table needs ~830px, but its grid column was
only ~683px, so the table overflowed its card by ~150px. The Add Content
card comes later in the DOM, so it painted over the overflowing table.

This was introduced by the minmax(0, ...) I added in the previous commit
to stop a long filename widening the track. That fixed a page-wide
horizontal scrollbar but capped the track, which is what made the table
spill. Reverting alone would not have been correct either — it swaps the
overlap for the scrollbar — so this fixes the underlying width problem:

- Widen the page container. The template already declared max-width:1400px,
  but on its own wrapper — a child cannot widen its parent, so it did
  nothing and the layout was stuck at base.html's 1200px.
- Use 3fr/1fr instead of 2fr/1fr. At 2fr/1fr the table column came out
  ~50px too narrow and sat in a permanent horizontal scrollbar.
- Stack the cards below 1440px, where side-by-side cannot give the table
  the width it needs. Stacked, it fits outright.
- The stacked rule uses minmax(0, 1fr): a bare 1fr keeps the min-content
  floor, which let the table widen the track and push the whole page into
  horizontal overflow at <=900px.
- Trim cell padding 12px -> 8px to reclaim ~72px for the table.
- Keep .playlist-table-scroll (overflow-x:auto) as a last-resort clip for
  genuinely narrow screens, so the table can never paint over its
  neighbour again.

Verified by hit-testing the Add Content card at 500-1920px: zero elements
from the table are painted over it at any width. No page-wide horizontal
overflow at any width; the table fits without scrolling at >=1024px.
2026-10-14 21:54:45 +03:00
ske087 7784da495b Show image thumbnails in the playlist Add Content card
The "Add Content" card listed available media as an icon plus a filename,
so the only way to tell two media items apart was to read near-identical
filenames. Images now render an actual thumbnail.

Previews are shown for every image type, not just JPEG: the library is a
mix of JPEG and PNG (the PDF/PPTX converter emits PNG), so a JPEG-only
rule would have left most items without a preview. Non-images keep the
existing emoji icon. A missing or unreadable file falls back to the icon
via onerror, and images are `loading="lazy"` since the list is scrollable.

This surfaced two layout bugs in the same card, both now fixed:

- .content-grid used bare `2fr 1fr`. A grid track has an automatic
  min-content floor, so the long unbreakable media filenames forced the
  track wider than the viewport — the page had a horizontal scrollbar
  (scrollWidth 1475 in a 1185px viewport). minmax(0, ...) fixes it.

- Long names were truncated with ellipsis, which hides the distinguishing
  part: media filenames differ at the END (..._slide_003.png). Names now
  wrap with overflow-wrap: anywhere instead.

The row is flex-wrap so that on a narrow card the Add button drops to its
own line rather than squeezing the name.

Verified: 5/5 items render an <img> whose URL returns HTTP 200 (including
a nested edited_media/ JPEG), no element overlaps at 1000-1500px, and dark
mode picks up the theme variables.
2026-10-14 21:54:45 +03:00
ske087 7177cdb9ab Add in-app help page with user manual (Romanian)
Adds a /help page served from the dashboard navigation, containing the full
Romanian user manual for operators: dashboard, playlist management, adding
media, removing files from playlists, player management, and the advanced
edited-media view.

Implementation notes
- Manual is pre-rendered to HTML with pandoc and shipped as a static asset
  (app/static/help/_manual_body.html) rather than parsed at runtime. This
  keeps the container free of a Markdown dependency and makes the page render
  identically regardless of what is installed.
- /help is login-protected; the sidebar table of contents is derived from the
  level-2 headings at request time.
- Screenshots are served from app/static/help/screenshots/ (32 images).
- Regenerate after editing the manual:
    documentatie/convert_help_page.sh
    docker compose up -d --build

Also adds
- backup_players_playlists.sh / restore_database.sh for DB backup and restore.
- .gitignore rules so local database backups (real production data), generated
  .docx files and duplicate screenshot copies are never committed.
2026-09-15 16:46:16 +03:00
ske087 b4c3f65636 Dashboard: move Recent Activity under Playlist Overview and split out heartbeats
Moves the Recent Activity card into the main column, directly beneath
Playlist Overview, so the two cards that describe "what the server and
its players are doing" sit together. System Status stays full-width below
the grid.

While moving it, the card was showing almost nothing useful: player
feedback ("Feedback received from ...") is a ~15s heartbeat that makes up
84% of all log rows (423/506) and 18 of the newest 20, so the list was a
wall of repeated one-line status reports that pushed real events off the
screen.

The card is now tabbed:
  - "Activity" (default) - uploads, logins, HTTPS changes, deployments...
  - "Player heartbeats"  - the raw status stream, on demand

get_recent_logs() gains exclude_prefix / include_prefix so the split
happens in SQL. Filtering a single wide window in Python instead gave only
7 useful entries, because the number returned depends on heartbeat volume
and would fall further as more players are added. Both queries now return
25. Prefixes are passed with autoescape=True so a literal '%' or '_' in a
prefix matches itself rather than acting as a LIKE wildcard.

UI: the list is capped at 320px and scrolls, so a long log cannot make
the card dominate the page. Long messages wrap instead of pushing the
timestamp off-screen (previously float:right), and the debug level now
has its own colour instead of rendering as "info" green.

Verified: 25/25 entries per tab, no cross-contamination, no horizontal
overflow at 500-1400px, tabs wrap below the title under ~600px, and dark
mode uses the theme variables.
2026-09-11 15:42:45 +03:00
ske087 84b5cd3d48 Dashboard: add Playlist Overview card and compact the sidebar
Restructure the dashboard into a two-column layout: a wide main column
holding the new Playlist Overview card, and a narrow (220px) right
sidebar with the compacted Quick Actions and Workflow Guide cards.

The Overview card answers "which playlist should I add media to, and
who will see it?" without opening each playlist. Per playlist it shows:
  - name, linked to that playlist's content manager
  - item count, total duration and current version
  - "N/M online" coverage, or a "no players" warning
  - one chip per assigned player, with an online/offline dot, linking
    to that player's manage page
  - an explicit empty state when no player is assigned

Players with no playlist are surfaced in a separate warning, since they
silently display nothing.

main.py builds this in a fixed number of queries: players are fetched
once and grouped by playlist_id, rather than calling
Playlist.players per row (which would be one query per playlist).

Layout notes:
- minmax(0, 1fr) on the main column so long names cannot widen the grid
- sidebar is sticky on tall screens and collapses below the main column
  under 900px, where the two small cards sit side by side
- sidebar cards used the global .card hover lift; suppressed for these

Also fixes a corrupted emoji (U+FFFD) in the System Status card.

Verified at 1600/1200/950/850/600px: no overflow, no button label
wrapping, and correct dark-mode colours.
2026-09-11 14:28:49 +03:00
ske087 57b7810069 Fix 404 on the header logo caused by an encoded query string
base.html passed the cache-busting query string INSIDE the filename argument:

    url_for('static', filename='uploads/header_logo.png?v=1')

Flask percent-encodes the '?' to '%3F', producing a request for a file
literally named "header_logo.png%3Fv=1", which does not exist. Every
authenticated page therefore logged:

    GET /static/uploads/header_logo.png%3Fv=1 404

The logo silently stayed hidden too, because the element carries
onerror="this.style.display='none'".

Changes:
- base.html / login.html: append "?v=..." OUTSIDE url_for(), matching what
  admin/customize_logos.html already did correctly.
- Inject logo_version from a context processor instead of hardcoding it.
  It is derived from the newest logo's mtime, so uploading a new logo in
  Admin -> Customize Logos is reflected immediately. The previous value was
  a literal 1, which defeated cache-busting entirely; login.html used
  range(1, 999999) | random, which changed on every request and made the
  logo uncacheable.

Verified: /, /content/ and /players/ now render
/static/uploads/header_logo.png?v=<mtime> (HTTP 200), and no %3F requests
appear in the logs.
2026-09-11 13:18:29 +03:00
ske087 46602f1933 Sanitize codebase, reorganize docs, and add missing deploy files
Remove dead code identified in docs/SANITIZATION-REVIEW.md:
- app/blueprints/content_old.py and app/blueprints/playlist.py
- app/models/group.py, app/utils/nginx_config_reader.py
- orphaned templates (content_list, edit_content, upload_content,
  player_page) and the related group/Template references

Result: 6 blueprints, 82 routes, no dead modules or orphan templates.

Add files that deploy.sh and docker-entrypoint.sh already require but
which were never tracked:
- https_manager.py       (referenced by deploy.sh, migrate_network.sh,
                          docker-entrypoint.sh)
- Caddyfile.example      (seeded by deploy.sh; its absence aborts deploy)

Relocate generated Graphify artifacts from graphify-out/ to
docs/graphify-out/ (110 files, no content change) and archive the
superseded docs under docs/.

Ignore hygiene:
- ignore ad-hoc .env backups (.env.bak*) — they contain live secrets
- keep the pre-sanitization snapshots (docs/legacy code/,
  docs/old_code_documentation/) on disk but out of the repo

Fix .env.example: drop a duplicated config block, genericize the
hardcoded host IP, and document HOSTNAME_INTERNAL.
2026-09-11 12:18:34 +03:00
ske087 1c5186463a updates to digiserver app server 2026-09-10 21:03:16 +03:00
ske087 046f5e5efd Add audio parameter to player playlist and auto-mark deployment status
- api.py: include 'audio' (on/off) field in playlist JSON served to players,
  derived from the muted toggle in the manage playlist page
- players.py: include 'audio' field in legacy player playlist builder
- api.py: auto-flip deployment_status pending/deploying -> deployed when a
  player sends feedback (player is confirmed running)
- players_list.html: poll deployment status for pending/failed badges so the
  players list live-updates once a player starts sending feedback
- .dockerignore: exclude runtime data/ volume dir from build context
2026-08-05 11:43:02 +03:00
ske087 052751b599 Rewrite QUICK_DEPLOYMENT.md for Caddy-based architecture
- Replace Nginx references throughout with Caddy
- Update architecture diagram to show Caddy
- Update container details (caddy:2-alpine, ports 8080/8443)
- Update volume paths (caddy-data, caddy-config, caddy-logs)
- Add rebuild guide for code changes (docker build + restart)
- Add quick-test method (docker cp + pkill -HUP)
- Simplify commands section (docker compose not docker-compose)
- Remove Nginx-specific troubleshooting
- Add Caddy validation and reload commands
2026-07-21 10:09:26 +03:00
ske087 b7b21547f7 Update QUICK_DEPLOYMENT.md for Caddy architecture and move old nginx files to docs 2026-07-21 10:05:31 +03:00
ske087 05194a19b6 Add edited media report page and fix image versioning
- New route GET /players/<id>/edited-media-report with tabular report
- New template edited_media_report.html with User/Filename/Date/Link columns
- Launch Report button (green) next to View All Edited Media button
- Fix: on first edit, move original file to versionized folder as original_<name>
- Fix: content lookup fallback via PlayerEdit records and path regex
- Keep Content.filename pointing to latest edit for player playlist
2026-07-21 09:56:14 +03:00
ske087 2af04e1db3 feat: add weblink playlists, SSH player deployment, Caddy HTTPS, build player page
- Content model: add url column + is_weblink() for web page content items
- Player model: add deployment tracking fields (status, timestamps, message)
- Content blueprint: add add_weblink and add_weblink_to_playlist routes;
  weblinks auto-deleted when removed from playlist
- Players blueprint: add SSH deploy mode in add_player; weblink-aware playlist
- API blueprint: weblink URL served directly in playlist response;
  add /api/deploy/test-ssh and /api/deploy/player endpoints
- Admin blueprint: add build-player page (clone from Gitea, write base config);
  replace nginx status card with Caddy status on HTTPS config page
- caddy_manager: rewritten to generate proper HTTPS/internal-CA Caddyfiles
  and reload Caddy via admin API (/load) for live config updates
- ssh_deploy, background_tasks, player_build: new utils for SSH deployment
- background_tasks: push Flask app context into background thread so DB
  updates after deployment complete correctly
- ssh_deploy: robust install script detection with passwordless sudo injection
  (uses SSH credentials, cleaned up after install)
- Dockerfile: add git, sshpass, openssh-client, rsync
- docker-compose: switch nginx to Caddy on ports 80/443; add port 5000 for dev
- Templates: add_player deploy mode UI, weblink form in playlist/upload pages,
  build_player admin page, Caddy status on HTTPS config page
- Migrations: add_url_to_content, add_deployment_fields_to_player
- app.py: call db.create_all() on startup for schema bootstrap
- config.py: add PLAYER_CODE_DIR and PLAYER_REPO_URL settings
2026-07-13 16:46:19 +03:00
Deployment System ae3b82862d rrrrr 2026-01-21 21:33:32 +02:00
Deployment System 8a89df3486 Fix undefined playlist variable in receive_edited_media endpoint
- Initialize playlist variable to None to prevent UnboundLocalError
- Fixes crash when player has no assigned playlist
- Ensures graceful handling of all playlist assignment scenarios
2026-01-17 21:50:27 +02:00
Deployment System 9c0a45afab Add missing update-duration endpoint for playlist content
- Create new endpoint to handle duration updates for playlist content items
- Validates duration is at least 1 second
- Updates duration in playlist_content association table
- Increments playlist version for sync tracking
- Fixes issue where duration spinner buttons were returning save errors
2026-01-17 18:13:59 +02:00
Deployment System 49393d9a73 Final: Complete modernization - Option 1 deployment, unified persistence, migration scripts
- Implement Docker image-based deployment (Option 1)
  * Code immutable in image, no volume override
  * Eliminated init-data.sh manual step
  * Simplified deployment process

- Unified persistence in data/ folder
  * Moved nginx.conf and nginx-custom-domains.conf to data/
  * All runtime configs and data in single location
  * Clear separation: repo (source) vs data/ (runtime)

- Archive legacy features
  * Groups blueprint and templates removed
  * Legacy playlist routes redirected to content area
  * Organized in old_code_documentation/

- Added network migration support
  * New migrate_network.sh script for IP changes
  * Regenerates SSL certs for new IP
  * Updates database configuration
  * Tested workflow: clone → deploy → migrate

- Enhanced deploy.sh
  * Creates data directories
  * Copies nginx configs from repo to data/
  * Validates file existence before deployment
  * Prevents incomplete deployments

- Updated documentation
  * QUICK_DEPLOYMENT.md shows 4-step workflow
  * Complete deployment workflow documented
  * Migration procedures included

- Production ready deployment workflow:
  1. Clone & setup (.env configuration)
  2. Deploy (./deploy.sh)
  3. Migrate network (./migrate_network.sh if needed)
  4. Normal operations (docker compose restart)
2026-01-17 10:30:42 +02:00
Deployment System d235c8e057 Add quick deployment steps guide (4 phases, 12 steps)
- Create DEPLOYMENT_STEPS_QUICK.md with concise deployment workflow
- Include command cheat sheet and timing breakdown
- Add troubleshooting quick fixes
- Update DOCUMENTATION_INDEX.md to highlight quick guide
2026-01-16 22:44:37 +02:00
Deployment System 52e910346b Add pre-deployment IP configuration guide for network transitions
- Add HOST_IP field to .env.example with documentation
- Improve TRUSTED_PROXIES comments with examples
- Create PRE_DEPLOYMENT_IP_CONFIGURATION.md guide
- Update deployment docs with network transition workflow
- Add comprehensive IP configuration checklist
2026-01-16 22:40:34 +02:00
Deployment System f2470e27ec Add comprehensive documentation index for production deployment 2026-01-16 22:33:28 +02:00
Deployment System 0e242eb0b3 Production deployment documentation: Add deployment guides, environment template, verification scripts 2026-01-16 22:32:01 +02:00
Deployment System c4e43ce69b HTTPS/CORS improvements: Enable CORS for player connections, secure session cookies, add certificate endpoint, nginx CORS headers 2026-01-16 22:29:49 +02:00
Quality App Developer cf44843418 merge: integrate nginx reverse proxy and deployment improvements
- Nginx reverse proxy configuration (replacing Caddy)
- ProxyFix middleware for handling X-Forwarded-* headers
- Docker Compose with Nginx service (nginx:alpine)
- Complete deployment workflow and documentation
- Self-signed SSL certificate generation script
- Removed obsolete Caddy-related files
- Fixed file permissions and ownership (no sudo needed)
- Comprehensive quick deployment guide
- Ready for HTTPS deployment on IP:443
2026-01-15 22:41:57 +02:00
Quality App Developer a4262da7c9 chore: fix file permissions and ownership across project
- Changed ownership of all files to scheianu:scheianu
- Set directories to 755 permissions (rwxr-xr-x)
- Set files to 644 permissions (rw-r--r--)
- Made shell scripts executable (755)
- Allows development without requiring sudo for file modifications
- Improves development workflow and security
2026-01-15 22:39:51 +02:00
Quality App Developer 024430754c docs: add comprehensive quick deployment guide
- Complete deployment workflow documentation
- Container architecture explanation
- Step-by-step deployment process
- Common commands reference
- Troubleshooting section
- SSL certificate management
- Performance tuning guide
- Security checklist
- Health checks information
- Database backup/restore procedures
2026-01-15 22:31:37 +02:00
Quality App Developer d17ed79e29 chore: remove caddy-related and obsolete files
Removed:
- Caddyfile: Caddy reverse proxy config (replaced by nginx.conf)
- setup_https.sh: Caddy HTTPS setup script
- https_manager.py: Caddy HTTPS management utility
- HTTPS_STATUS.txt: Old HTTPS documentation
- docker-compose.http.yml: HTTP-only Caddy compose file
- player_auth_module.py: Old authentication module (unused)
- player_config_template.ini: Old player config template (unused)
- test connection.txr: Test file

Updated:
- init-data.sh: Removed references to deleted caddy/obsolete files
- .dockerignore: Removed obsolete ignore entries

This completes the Caddy → Nginx migration cleanup.
2026-01-15 22:25:13 +02:00
root 21eb63659a feat: complete nginx migration from caddy
- Replace Caddy reverse proxy with Nginx (nginx:alpine)
- Add nginx.conf with HTTP/HTTPS, gzip, and proxy settings
- Add nginx-custom-domains.conf template for custom domains
- Update docker-compose.yml to use Nginx service
- Add ProxyFix middleware to Flask app for proper header handling
- Create nginx_config_reader.py utility to read Nginx configuration
- Update admin blueprint to display Nginx status in https_config page
- Add Nginx configuration display to https_config.html template
- Generate self-signed SSL certificates for localhost
- Add utility scripts: generate_nginx_certs.sh
- Add documentation: NGINX_SETUP_QUICK.md, PROXY_FIX_SETUP.md
- All containers now running, HTTPS working, HTTP redirects to HTTPS
- Session cookies marked as Secure
- Security headers properly configured
2026-01-15 22:15:11 +02:00
DigiServer Admin bb293b6a81 updated docvker compose 2026-01-15 09:00:32 +02:00
root 2ea24a98cd feat: add real-time HTTPS status detection on admin config page
- Detect actual HTTPS status from current request (scheme + X-Forwarded-Proto)
- Auto-sync database when HTTPS status mismatch is detected
- Show real-time connection info (protocol, host, port)
- Display helpful message when accessing via HTTPS but config shows disabled
- Add CSS styling for detection status display
- Users now see accurate HTTPS status even if database wasn't in sync
2026-01-14 21:22:22 +02:00
root 2f0e9ffdf9 feat: include migrations and utility scripts in data folder
- Copy migrations/ folder for database setup
- Copy https_manager.py for HTTPS configuration
- Copy player_auth_module.py and fix_player_user_schema.py
- All necessary files now centralized in ./data for complete deployments
2026-01-14 21:16:50 +02:00
root b7afa9736b fix: correct data folder mount structure for Python imports
- Mount ./data:/app instead of ./data/app:/app to preserve directory nesting
- This allows Python imports like 'from app.config' to work correctly
- data/app/ now contains the Python package (app.py, config.py, etc.)
- Verified containers start healthy with proper module resolution
2026-01-14 21:15:34 +02:00
root c879bbaed0 chore: consolidate all persistent data into ./data folder
- Update docker-compose.yml to mount Caddyfile from ./data
- Remove Dockerfile directory creation - handled by init-data.sh
- Add init-data.sh script to initialize ./data with all required files
- Add DATA_DEPLOYMENT.md documentation for deployment workflow
- Update .gitignore to exclude ./data folder
- All persistent data (app, config, database, uploads) now centralized in ./data
2026-01-14 21:07:57 +02:00
root a39dbdd613 chore: reorganize persistent data into ./data folder
- Move all persistent data (instance, uploads, caddy configs) to ./data folder
- Update docker-compose.yml volumes to use ./data structure
- All data is now centralized for easier backup and portability
- Simplify volume management by removing named volumes
- Add data folder to .gitignore
2026-01-14 20:55:58 +02:00
Quality App Developer cedb411536 feat: Complete HTTPS multi-endpoint configuration and deployment automation
- Enhanced Caddyfile with consolidated HTTPS block supporting all access points
- Added support for https://digiserver, https://10.76.152.164, and https://digiserver.sibiusb.harting.intra
- Configured Caddy reverse proxy with HTTP/3 (QUIC), TLS 1.3+, and HTTP/2 support
- Implemented security headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection)
- Added HTTP to HTTPS automatic redirects for all endpoints
- Enhanced setup_https.sh with improved error handling and progress reporting
- Created deploy.sh for fully automated one-command deployment
- Added comprehensive deployment documentation (5 guides)
- Configured 2GB file upload limit and 300s request/response timeouts
- Added Caddy admin API on port 2019 for configuration management
- Implemented health checks and container dependency management
- All volumes persistent and properly isolated
- Production-ready configuration with environment variable parameterization
2026-01-14 20:40:26 +02:00
Quality App Developer 361e0bc459 Update TLS configuration for IP address access
- Switch IP address HTTPS to use on_demand TLS mode
- Allows proper certificate generation for IP-based access
- Maintains self-signed certificates for internal use
2026-01-14 15:08:54 +02:00
Quality App Developer 1e08fa45a1 Add HTTPS support with self-signed certificates for internal domain
- Add HTTPS blocks for digiserver.sibiusb.harting.intra with internal TLS
- Add HTTPS support for IP address 10.76.152.164
- Add catch-all HTTPS handler with self-signed certificate
- Fixes connection refused error on port 443
2026-01-14 14:28:16 +02:00
Quality App Developer 48f1bfbcad Add HTTPS configuration management system
- Add HTTPSConfig model for managing HTTPS settings
- Add admin routes for HTTPS configuration management
- Add beautiful admin template for HTTPS configuration
- Add database migration for https_config table
- Add CLI utility for HTTPS management
- Add setup script for automated configuration
- Add Caddy configuration generator and manager
- Add comprehensive documentation (3 guides)
- Add HTTPS Configuration card to admin dashboard
- Implement input validation and security features
- Add admin-only access control with audit trail
- Add real-time configuration preview
- Integrate with existing Caddy reverse proxy

Features:
- Enable/disable HTTPS from web interface
- Configure domain, hostname, IP address, port
- Automatic SSL certificate management via Let's Encrypt
- Real-time Caddyfile generation and reload
- Full audit trail with admin username and timestamps
- Support for HTTPS and HTTP fallback access points
- Beautiful, mobile-responsive UI

Modified files:
- app/models/__init__.py (added HTTPSConfig import)
- app/blueprints/admin.py (added HTTPS routes)
- app/templates/admin/admin.html (added HTTPS card)
- docker-compose.yml (added Caddyfile mount and admin port)

New files:
- app/models/https_config.py
- app/blueprints/https_config.html
- app/utils/caddy_manager.py
- https_manager.py
- setup_https.sh
- migrations/add_https_config_table.py
- migrations/add_email_to_https_config.py
- HTTPS_STATUS.txt
- Documentation files (3 markdown guides)
2026-01-14 12:02:49 +02:00
Quality App Developer ef17abfe6b Fix HTTPS configuration: use service hostname for networking and add HTTP-only compose file
- Updated service name from 'digiserver' to 'digiserver-app' in docker-compose.yml for proper Docker network DNS resolution
- Fixed Caddyfile to reference correct service hostname 'digiserver-app:5000'
- Changed port mapping from 'ports' to 'expose' for internal-only access
- Added docker-compose.http.yml for HTTP-only deployment on port 80 (development/testing)
- Both Flask app and Caddy now communicate correctly over internal Docker network
- App now accessible at https://localhost or https://your-domain.com on port 443
2026-01-13 15:20:25 +02:00
Quality App Developer fc4c8a7474 Enable Caddy reverse proxy with automatic HTTPS on port 443 2026-01-13 14:28:07 +02:00
DigiServer Developer 3829d98e91 Implement editing users management and permission updates
- Added auto-creation of PlayerUser records from player metadata (user_card_data)
- Fixed player_user table schema (removed player_id, made user_code unique globally)
- Created admin page for managing editing users (view, update names, delete)
- Updated permissions: normal users can now access admin panel, editing users, and leftover media
- Admin-only access: user management, system dependencies, logo customization
- Fixed edited media workflow to preserve original files
- Content.filename now points to edited_media folder, keeping originals intact
- Added user display names in edited media page (shows name if set, code otherwise)
- Fixed leftover media file size calculation (handle None values)
- Split editing users into separate card on admin panel with description
2025-12-14 14:14:04 +02:00
DigiServer Developer 88e24f8fec sincronized the adding of the edit user 2025-12-13 22:06:58 +02:00
DigiServer Developer 87709bab4d updated to get card name 2025-12-13 21:51:45 +02:00
DigiServer Admin 0dfeb0ef7f modified 2025-12-12 15:52:04 +02:00
DigiServer Admin 4a9616a0f7 Add HTTPS support with Caddy and clean up legacy files
- Add Caddy reverse proxy for automatic HTTPS with Let's Encrypt
- Update docker-compose.yml with Caddy service and internal networking
- Remove all Redis dependencies (not needed for this deployment)
- Fix Dockerfile permissions for instance and uploads directories
- Move legacy scripts to old_code_documentation folder
  - add_muted_column.py, check_fix_player.py, migrate_add_edit_enabled.py
  - docker-start.sh, run_dev.sh, start.sh, clean_for_deployment.sh
- Add HTTPS_SETUP.md documentation for Caddy configuration
- Update .env.example with DOMAIN and EMAIL variables
- Remove redis package from requirements.txt
- Remove rate limiting Redis storage from config.py
2025-12-11 16:56:44 +02:00