95 Commits

Author SHA1 Message Date
Michal Tuszowski 2a21fc9e8c split: betoniarka (radio operator) colocated with liquidsoap; musician goes Discord-only
Permissions post-mortem that motivated this: the musician wrote radio
playlists AS ROOT onto a ROOT-OWNED network share which liquidsoap then
read AS USER 'radio' - chown fails on such shares by design (root squash /
uid mapping), so the radio came up and died on the playlists. The fix is
structural: the playlist WRITER now lives in the same container as the
READER, as the same user, on a local volume. No shared partition, no
chown, no uid mapping.

New: conjurer_betoniarka/betoniarka.py - runs inside the radio container
(started by the entrypoint as user 'radio', port 5005):
- library scan -> all_playlist/hit playlists with LOCAL container paths
  (start + every 24h + authenticated GET /rescan)
- bot-facing radio API moved from the musician: /add_to_priority,
  /create_priority_playlist, /request_radio_file, /clear_pr_pls,
  plus GET /ping (health) and /stream (web page)
- radio_log/persistence tailer forwarding play events to the bot's
  /prepped_tracks with the shared API key (bot-unreachable = logged, not fatal)

Musician: pure Discord music player now - keeps /mp3, /update_mp3,
/get_music and the file-share endpoints; all radio playlist writing, radio
paths/env and the tailer removed.

Bot: new CONJURER_RADIO_SERVICE (defaults to CONJURER_FILE_SERVICE so
un-split deployments keep working); radio_commands targets it; separate
'radio' health-gate group on betoniarka /ping (musician group now covers
music_commands + file_search_commands only).

Docker: betoniarka baked into the radio image (python3 + flask/waitress/
requests from Debian debs), port 5005 exposed, entrypoint starts it via
setpriv as 'radio'; data-volume chown is now best-effort with a loud
warning (keep the volume local); docs get the post-mortem + wiring.

Verified: py_compile everything; functional stub tests - rescan writes
local-path playlists, wyszukaj scores and appends to priority, auth
401/ok, tailer forward carries the API key.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 23:42:41 +02:00
Michal Tuszowski fcb03e304c radio: /srv/betoniarka paths, in-container Icecast, drop ffmpeg.pref
Per review of the first radio-container cut:

- radio_conjurer.liq: replace the cargo-culted /home/pi/Conjurer and
  /home/pi/MediaFolder paths with the container layout -
  /srv/betoniarka/data (playlists, script.params, persistence/radio logs),
  /srv/betoniarka/music (library + emergency track) and
  /srv/betoniarka/secrets/icecast_credentials.json;
  interactive.persistent now uses an absolute path;
  output.icecast targets host="localhost" (icecast lives in the container)
- Icecast2 now runs INSIDE the radio container: entrypoint renders
  /etc/icecast2/icecast.xml from docker/icecast.xml.tpl, filling
  source/admin/relay passwords from the secret provisioned at install time
  (same pattern as the bot's netrc); optional admin_password/relay_password
  fields default to password; icecast starts as its unprivileged user;
  port 8000 exposed for listeners; extra_hosts hack removed
- compose.radio.yaml: same-path mounts for /srv/betoniarka/{data,music,secrets}
- ffmpeg.pref removed from the repo (the pin only mattered against the
  RPi OS repo; bookworm ships the right FFmpeg 5.x natively) - verdict
  preserved in the docs and the legacy installer note updated
- docs: updated radio section (volumes, secret provisioning, wire-up)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 23:42:41 +02:00
Michal Tuszowski a6c20a0054 ci: replace broken default workflows with compile/unit/integration CI
The two scaffold workflows (Python application / Python package) failed on
every PR: they installed deps from a non-existent requirements.txt, ran
flake8/pytest over the vendored yt_dlp fork (new syntax under the 3.8/3.9
matrix), and collected ad-hoc root scripts — notably test_ai.py, which is
an invalid pasted object dump (not Python).

- Remove python-app.yml / python-package.yml and the junk root scripts
  (test.py, test_ai.py, test_time.py)
- Add .github/workflows/ci.yml with three PR-check jobs:
  * compile     — py_compile every first-party .py (no deps)
  * unit        — pytest on pure logic (conanjurer_functions, constants)
  * integration — boot the Flask services and assert the X-Conjurer-Api-Key
                  auth contract (communication_subroutine + conjurer_musician)
- Add tests/ suite, pytest.ini (testpaths=tests) and conftest.py (sys.path)

Fixes surfaced by the compile gate / needed for the integration job:
- conjurer_librarian/search_bot.py + search_bot2.py: f-string reused the
  same quote ({item["exists"]}) -> SyntaxError on Python < 3.12
- conjurer_musician/media_search_functions.py: made import-safe
  (env-overridable paths, lazy DB load / mkdir) so the service can be
  imported and tested off the Pi

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 12:24:30 +02:00
Michal Tuszowski 5adeb1b384 Land prototype on main (fix stacked-PR retarget gap)
PRs #10 and #11 were merged into their intermediate base branches
(restructure/working-copy-root and proto-improvements) rather than main,
because the stacked PRs' bases were not auto-retargeted (the branches were
not deleted on merge). As a result main only received the #9 restructure
and is still the plain working-copy bot.

This brings the full prototype onto main as a clean delta on top of the
current main tree (identical content to proto-improvements, but with main
ancestry so it merges without the squash-induced rename/delete conflicts):

- constants.py: env-var config, safe JSON loading, dependency guards,
  env->netrc tokens, API_SHARED_KEY + service_headers(), CONAN_* config
- communication_subroutine.py: queue timeout/Empty, daemon threads,
  cooperative stop_event, inbound _authorize_request()
- bot.py: asyncio event loop + load conanjurer_commands
- music_functions / radio_commands / librarian_commands: X-Conjurer-Api-Key
- conanjurer_commands/_functions: fixed + integrated bridge with RCON
  player-join notifications
- requirements_bot.txt: aiomcrcon, asyncssh
- conjurer_musician/.gitignore: keep runtime playlists/mp3 out of the repo

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:28:14 +02:00
gitea f9ad679833 Dockerization + ai review recomendations. 2025-10-29 14:57:43 +01:00
gitea 8750430cde FX 2025-08-23 17:44:08 +02:00
gitea 1f5b678139 small fixes 2025-05-04 21:15:28 +02:00
gitea 074452e6a9 Params of radio 2025-05-03 16:41:22 +02:00
gitea d0c972c69b M 2025-05-02 20:09:11 +02:00
gitea 78c958e8f5 added server side search 2025-05-02 19:55:52 +02:00
gitea 3ee7fcab59 serverside 2025-05-02 19:55:52 +02:00
gitea a8001ec19d new function 2025-05-02 19:01:51 +02:00
gitea 95cd4760b7 Generated scripts 2025-04-26 13:18:02 +02:00
gitea 7f560decd3 Add musician fixes 2025-04-17 22:59:47 +02:00
gitea fdccde6137 refactor: comment out unused AutoIndex import and related code 2025-02-08 13:25:46 +01:00
gitea 276e814515 Fix old bug 2025-01-10 21:34:56 +01:00
gitea 5dd2aadd7c Arguments added to the utility. 2025-01-08 12:01:01 +01:00
gitea 85d276f2d4 Function for idv3 and bugfix 2025-01-08 11:34:40 +01:00
gitea 9823a94025 aas 2024-11-28 11:10:34 +01:00
gitea 15253f95fb Fun addition 2024-11-20 22:05:19 +00:00
gitea e290e7d656 ADdded smth 2024-11-15 18:33:31 +01:00
gitea bf808eb634 Fixed live 2024-11-11 20:12:47 +00:00
gitea d3bd79b505 silence fx 2 2024-11-11 20:32:08 +01:00
gitea 24247aa760 Fix silence 2024-11-11 20:27:11 +01:00
gitea 443d06280b Duplication error 2024-11-11 17:45:10 +01:00
gitea 94132a8962 Fixes 2024-11-11 11:49:36 +01:00
gitea 3d02d06862 FX 2024-11-10 19:48:47 +01:00
gitea 63366f7ea1 work ongoing 2024-11-10 18:25:12 +01:00
gitea f45dc906ac test mic 2024-11-06 19:35:52 +01:00
gitea 253a82e694 Let's get this effin party started 2024-11-03 14:01:28 +01:00
gitea 6019b92d15 Manual external audition 2024-11-02 22:30:43 +01:00
gitea 7857226e12 Fix 2024-08-23 18:46:40 +02:00
gitea fcefaf11ef Fixing time mismatch 2024-08-09 16:59:33 +02:00
gitea 4842ccdc22 Music trackin upgrade 2024-08-03 15:34:56 +02:00
gitea adb0f9b468 fx 2024-08-02 20:27:27 +02:00
gitea ce806c873f Fx 2024-08-02 20:19:21 +02:00
gitea a54a6686c2 fx 2024-08-02 20:02:02 +02:00
gitea d226d99236 bgfx 2024-08-02 19:57:56 +02:00
gitea a827c5e429 Fix tracker 2024-08-02 19:22:25 +02:00
gitea 1ebd58b8ac UPdate for music tracker 2024-08-02 11:43:38 +02:00
gitea 3a02846a17 fx 2024-08-01 17:50:12 +02:00
gitea 9c3e51631c fx2 2024-08-01 17:46:18 +02:00
gitea c3dd4ad8cf fx 2024-08-01 17:43:49 +02:00
gitea 5d51e99c70 Music tracker 2024-08-01 17:35:54 +02:00
gitea 2c9c86990c Track name broadcast att 1 2024-07-29 14:39:52 +02:00
gitea a68745713b Change in weights 2024-07-20 13:27:40 +02:00
gitea 64849f728f Fixed :) 2024-07-20 09:50:24 +02:00
gitea 9b09c2c13f Fix 2024-07-20 09:41:42 +02:00
gitea f2fb2232ee Audition 2024-07-20 09:09:14 +02:00
gitea 81a387eb4f Best tracks 2024-07-07 19:46:45 +02:00