From ff4197e7579dd02f2a1a35cdc42879219e0ebc0c Mon Sep 17 00:00:00 2001 From: Alexandre Pires Date: Sun, 7 Sep 2025 20:56:44 +0200 Subject: [PATCH] Refactor m3uproxy configuration: update cache and data paths, adjust JSON structure for EPG and auth file --- terraform/modules/apps/m3uproxy/config.tf | 2 +- terraform/modules/apps/m3uproxy/main.tf | 17 +++++++++++++---- .../m3uproxy/resources/m3uproxy/m3uproxy.json | 6 ++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/terraform/modules/apps/m3uproxy/config.tf b/terraform/modules/apps/m3uproxy/config.tf index 0dbd956..c4dd287 100644 --- a/terraform/modules/apps/m3uproxy/config.tf +++ b/terraform/modules/apps/m3uproxy/config.tf @@ -12,7 +12,7 @@ locals { geoip_path = "${local.m3uproxy_path}/geoip" m3uproxy_path = "${local.persistent_folder}/m3uproxy" - m3uproxy_cache_path = "${local.m3uproxy_path}/cache" + m3uproxy_data_path = "${local.m3uproxy_path}/data" squid_app_path = "${local.m3uproxy_path}/squid" wireguard_address = "192.168.5.3/32" wireguard_dns = "192.168.5.1" diff --git a/terraform/modules/apps/m3uproxy/main.tf b/terraform/modules/apps/m3uproxy/main.tf index bb5e8c9..8eb14fe 100644 --- a/terraform/modules/apps/m3uproxy/main.tf +++ b/terraform/modules/apps/m3uproxy/main.tf @@ -150,6 +150,10 @@ resource "kubernetes_deployment" "m3uproxy" { sub_path = "m3uproxy.json" read_only = true } + volume_mount { + name = "m3uproxy-cache" + mount_path = "/app/cache" + } volume_mount { name = "m3uproxy-playlist" mount_path = "/app/conf/playlist.json" @@ -157,8 +161,8 @@ resource "kubernetes_deployment" "m3uproxy" { read_only = true } volume_mount { - name = "m3uproxy-app-cache" - mount_path = "/app/cache" + name = "m3uproxy-app-data" + mount_path = "/app/data" } volume_mount { name = "geoip-db" @@ -176,6 +180,11 @@ resource "kubernetes_deployment" "m3uproxy" { } } } + volume { + name = "m3uproxy-cache" + empty_dir { + } + } volume { name = "m3uproxy-playlist" config_map { @@ -188,9 +197,9 @@ resource "kubernetes_deployment" "m3uproxy" { } volume { - name = "m3uproxy-app-cache" + name = "m3uproxy-app-data" host_path { - path = local.m3uproxy_cache_path + path = local.m3uproxy_data_path } } diff --git a/terraform/modules/apps/m3uproxy/resources/m3uproxy/m3uproxy.json b/terraform/modules/apps/m3uproxy/resources/m3uproxy/m3uproxy.json index 2beb724..924f147 100644 --- a/terraform/modules/apps/m3uproxy/resources/m3uproxy/m3uproxy.json +++ b/terraform/modules/apps/m3uproxy/resources/m3uproxy/m3uproxy.json @@ -1,10 +1,12 @@ { "port": 8080, "playlist": "conf/playlist.json", - "epg": "https://m3upt.com/epg", + "epg": ["https://m3upt.com/epg"], "default_timeout": 3, "num_workers": 4, "scan_time": 43200, + "epg_scan_time": 86400, + "cache_dir": "cache", "security": { "geoip": { "database": "GeoIP/GeoLite2-Country.mmdb", @@ -26,7 +28,7 @@ "provider": "file", "secret_key": "${m3uproxy_secret}", "settings": { - "file_path": "cache/auth.json" + "file_path": "data/auth.json" } } } \ No newline at end of file