Added reading of filelist.html file from disk.
This commit is contained in:
parent
cac1ad56fb
commit
182a4c02c9
@ -50,6 +50,7 @@ func main() {
|
||||
srv.GET("/status", hand.Status)
|
||||
srv.GET("/lastsong", hand.LastSong)
|
||||
srv.GET("/playlist", hand.Playlist)
|
||||
srv.GET("/filelist", hand.Filelist)
|
||||
|
||||
if !*noLiquidsoap {
|
||||
liquid, err := radio.NewLiquidsoap(config.Liquidsoap.ExecPath, config.Liquidsoap.ScriptPath)
|
||||
|
@ -6,6 +6,7 @@ icecast:
|
||||
# URL to Icecast's status-json.xsl
|
||||
url: "http://radio.arav.home.arpa/status-json.xsl"
|
||||
playlist_path: "/var/log/icecast/playlist.log"
|
||||
filelist_path: "/srv/radio/filelist.html"
|
||||
liquidsoap:
|
||||
executable_path: "/opt/opam/4.14.0/bin/liquidsoap"
|
||||
script_path: "/etc/dwelling/radio.liq"
|
||||
|
@ -26,12 +26,6 @@ server {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
|
||||
location =/filelist {
|
||||
alias $http_root/shared/radio_filelist.html;
|
||||
default_type text/html;
|
||||
}
|
||||
|
||||
location =/robots.txt {
|
||||
alias $http_root/shared/files/radio.robots.txt;
|
||||
default_type text/html;
|
||||
|
@ -14,7 +14,8 @@ type Configuration struct {
|
||||
URL string `yaml:"url"`
|
||||
Playlist string `yaml:"playlist_path"`
|
||||
} `yaml:"icecast"`
|
||||
Liquidsoap struct {
|
||||
FilelistPath string `yaml:"filelist_path"`
|
||||
Liquidsoap struct {
|
||||
ExecPath string `yaml:"executable_path"`
|
||||
ScriptPath string `yaml:"script_path"`
|
||||
} `yaml:"liquidsoap"`
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -98,3 +99,8 @@ func (h *Handlers) Playlist(w http.ResponseWriter, _ *http.Request) {
|
||||
fc, _ := web.AssetsGetFile("radio.arav.top.m3u")
|
||||
w.Write(fc)
|
||||
}
|
||||
|
||||
func (h *Handlers) Filelist(w http.ResponseWriter, _ *http.Request) {
|
||||
data, _ := os.ReadFile(h.conf.FilelistPath)
|
||||
w.Write(data)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user