add bghelper to piped

This commit is contained in:
2025-11-02 20:36:20 +01:00
parent 5d54ae898e
commit 7cefa3a650

View File

@@ -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 '<head>' '<head><script>localStorage.setItem("instance","https://${apiDomain}");</script>';
sub_filter_once on;
sub_filter_types text/html;
'';
};