Skip to content

Add web admin panel and centralize config - #3

Open
SyButter wants to merge 5 commits into
mainfrom
feature/web-admin-panel
Open

Add web admin panel and centralize config#3
SyButter wants to merge 5 commits into
mainfrom
feature/web-admin-panel

Conversation

@SyButter

@SyButter SyButter commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What this adds

A password-protected management website (webadmin/, Flask) to run on the Pi, plus a refactor so location/volume/pool config lives in one place.

Admin panel features

  • Location & method — writes settings.ini and mirrors to the wall display
  • Volumes — regular / Fajr / Surah, and they now actually take effect
  • Friday Surah Baqarah toggle
  • Adhan library — upload, preview, delete, mark Fajr/Regular, toggle random-pool membership
  • Test on speakers + Apply & reschedule cron

Under the hood

  • adhan_config.py — single source of truth for settings.ini + adhans.json
  • play_adhan.py — cron calls this at prayer time; it picks the random adhan and applies volume, so pool/volume edits apply on the next prayer with no reschedule
  • Fixes the bug where mpv --volume was hardcoded to 100 and volume settings did nothing
  • script.js now reads display_config.json, so the display and speakers no longer use conflicting coordinates

Notes

  • Local files (settings.ini, adhans.json, display_config.json) stay gitignored
  • Admin login is HTTP Basic; credentials live in settings.ini [ADMIN] (defaults to admin/adhan until set on the device)

🤖 Generated with Claude Code

SyButter and others added 5 commits July 6, 2026 20:45
- Add webadmin/ Flask app: password-protected UI to edit location/method,
  volumes, Friday Surah, upload/manage adhans, control the random pool,
  preview audio, test playback, and reinstall cron.
- Add adhan_config.py as the single source of truth for settings.ini and the
  adhans.json random pool; mirror location/method to the display.
- Add play_adhan.py: cron now resolves the random adhan + volume at play time,
  so volume/pool edits apply on the next prayer without rescheduling. Fixes
  volumes never being applied (mpv --volume was hardcoded to 100).
- Wire adhan-display/script.js to read display_config.json instead of
  hardcoded coordinates, keeping the wall display and speaker schedule in sync.
- Document the admin panel in README; ignore local config artifacts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Installs Flask + mpv, creates and enables systemd services for the admin
panel (:8080) and wall display (:8000) with Restart=always, refreshes the
adhan cron jobs, and optionally configures the kiosk browser autostart
(--with-kiosk). Paths and run-user are auto-detected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New POST /api/stop endpoint runs pkill for play_adhan.py and mpv to cut off
any adhan/dua currently playing (e.g. overlapping test playbacks), with a
matching danger-styled button in the Test on speakers section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New "Prayer playback" section lets you mute the adhan for individual prayers
(e.g. Fajr/Dhuhr after a night shift) while their times still show on the
display. Cron now schedules each prayer by name so play_adhan.py checks the
[PRAYERS] toggle at play time and skips muted ones — no reschedule needed.
Also makes the adhan library rows wrap cleanly on mobile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New [CALC] settings let you override the Fajr/Isha twilight angles (blank =
method default) and choose Standard vs Hanafi (later) Asr. Applied via
PrayTimes.adjust() in both updateAzaanTimers.py and the display's script.js,
mirrored through display_config.json so audio and display stay in sync. Also
removes the display's hardcoded fajr=18 override that ignored the method.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant