fix: inject <base href> from base_path config; fix relative asset/nav links; add README

This commit is contained in:
2026-06-09 01:46:53 +02:00
parent 9fc9494ccd
commit 6e40fc0eb1
6 changed files with 123 additions and 9 deletions
+2
View File
@@ -19,6 +19,7 @@ static void set_defaults(void) {
strncpy(g_cfg.dl_dir_mov, "/mnt/media/Movies", sizeof(g_cfg.dl_dir_mov)-1);
strncpy(g_cfg.template_dir, "/usr/local/share/iptv-dl", sizeof(g_cfg.template_dir)-1);
strncpy(g_cfg.data_dir, "/var/lib/iptv-dl", sizeof(g_cfg.data_dir)-1);
strncpy(g_cfg.base_path, "", sizeof(g_cfg.base_path)-1);
g_cfg.max_recv_speed = 20L * 1024 * 1024; /* 20 MiB/s */
}
@@ -79,6 +80,7 @@ static int try_load(const char *path) {
cfg_read_str(buf, "jellyfin_token", g_cfg.jellyfin_token, sizeof(g_cfg.jellyfin_token));
cfg_read_str(buf, "template_dir", g_cfg.template_dir, sizeof(g_cfg.template_dir));
cfg_read_str(buf, "data_dir", g_cfg.data_dir, sizeof(g_cfg.data_dir));
cfg_read_str(buf, "base_path", g_cfg.base_path, sizeof(g_cfg.base_path));
g_cfg.port = cfg_read_int(buf, "port", g_cfg.port);
g_cfg.max_recv_speed = cfg_read_long(buf, "max_recv_speed", g_cfg.max_recv_speed);
+1
View File
@@ -32,6 +32,7 @@ typedef struct {
/* Paths */
char template_dir[512]; /* dir containing header.html, footer.html, iptv.css, *.js */
char data_dir[512]; /* dir for history.json, notifications.json */
char base_path[128]; /* URL prefix when behind reverse proxy, e.g. "/iptv" (no trailing slash) */
/* Limits */
long max_recv_speed; /* bytes/sec, 0 = unlimited */