diff --git a/hosts/fw/modules/web/piped.nix b/hosts/fw/modules/web/piped.nix index 22da730..146579b 100644 --- a/hosts/fw/modules/web/piped.nix +++ b/hosts/fw/modules/web/piped.nix @@ -9,6 +9,7 @@ let # Port configuration backendPort = 8082; proxyPort = 8081; + bgHelperPort = 3000; # Database configuration dbName = "piped"; @@ -27,8 +28,7 @@ let # Server configuration PORT=${toString backendPort} HTTP_WORKERS=2 - - # Proxy configuration +# Proxy configuration PROXY_PART=https://${apiDomain}/proxy # API URL @@ -54,6 +54,9 @@ let # Feed retention (days) FEED_RETENTION=30 + + # Background helper for iOS compatibility (generates PoTokens) + BG_HELPER_URL=http://piped-bg-helper:${toString bgHelperPort} ''; # Piped frontend configuration @@ -167,9 +170,9 @@ in # Use Podman for OCI containers virtualisation.oci-containers.backend = "podman"; - # Piped Backend Podman container + # Piped Backend Podman container (using custom image with iOS compatibility fixes) virtualisation.oci-containers.containers.piped-backend = { - image = "1337kavin/piped:latest"; + image = "git.cloonar.com/infrastructure/piped-backend:latest"; ports = [ "127.0.0.1:${toString backendPort}:${toString backendPort}" ]; volumes = [ "/var/lib/piped/config/config.properties:/app/config.properties:ro" @@ -177,6 +180,7 @@ in extraOptions = [ "--pull=newer" # Using default bridge network - connects to PostgreSQL via 10.88.0.1 + # Also connects to bg-helper via container name resolution ]; }; @@ -186,6 +190,16 @@ in requires = mkAfter [ "piped-config-generate.service" ]; }; + # Piped Background Helper (generates PoTokens for iOS compatibility) + virtualisation.oci-containers.containers.piped-bg-helper = { + image = "1337kavin/bg-helper-server:latest"; + ports = [ "127.0.0.1:${toString bgHelperPort}:3000" ]; + extraOptions = [ + "--pull=newer" + # Using default bridge network - accessible by backend via container name + ]; + }; + # Piped Proxy Podman container virtualisation.oci-containers.containers.piped-proxy = { image = "1337kavin/piped-proxy:latest"; @@ -211,11 +225,6 @@ in locations."/" = { extraConfig = '' try_files $uri $uri/ /index.html; - - # Inject instance configuration before Piped loads - sub_filter '' ''; - sub_filter_once on; - sub_filter_types text/html; ''; };