Free range grass fed organic code to have a real http server and real air-support

This commit is contained in:
2026-01-19 21:44:27 +01:00
parent 233389df8f
commit 1a5453a714
6 changed files with 48 additions and 46 deletions

View File

@@ -1,7 +1,6 @@
#!/usr/bin/liquidsoap
# Radio Bullshit - Liquidsoap Configuration
# Modern open-source streaming with automatic song/jingle alternation
# ============================================================================
# CONFIGURATION
@@ -36,12 +35,13 @@ jingles = playlist(
)
# Air support (fallback audio when nothing else is available)
# air_support = playlist(
# mode="randomize",
# reload_mode="watch",
# "/air-support/playlist.pls"
# )
air_support = single("/air-support/Airplane_Sound_Effect.ogg")
air_support = mksafe(
playlist(
mode="randomize",
reload_mode="watch",
"/air-support/playlist.pls"
)
)
# ============================================================================
# ALTERNATING LOGIC
@@ -80,34 +80,22 @@ output.harbor(
# Enable built-in HTTP server for stream and status
settings.harbor.bind_addrs := ["0.0.0.0"]
# Add a simple HTML page
# Add static folder
harbor.http.static(
port=port,
path="/static/",
"/var/www/static"
)
# Add index file
harbor.http.register(
port=port,
method="GET",
"/",
fun (_, response) -> begin
html = "<!DOCTYPE html>
<html>
<head>
<title>Radio Bullshit</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; padding: 50px; background: #1a1a1a; color: #fff; }
h1 { color: #ff6b6b; }
audio { margin: 20px; }
a { color: #4ecdc4; }
</style>
</head>
<body>
<h1>Radio Bullshit</h1>
<p>J'ai une superbe opportunit&eacute; de travail</p>
<audio controls autoplay>
<source src=\"/radio-bullshit\" type=\"audio/mpeg\">
Your browser does not support the audio element.
</audio>
<p><a href=\"/radio-bullshit.m3u\">Download M3U Playlist</a></p>
</body>
</html>"
response.html(html)
response.html(
file.contents("/var/www/index.html")
)
end
)