add bghelper to piped
This commit is contained in:
@@ -9,6 +9,7 @@ let
|
|||||||
# Port configuration
|
# Port configuration
|
||||||
backendPort = 8082;
|
backendPort = 8082;
|
||||||
proxyPort = 8081;
|
proxyPort = 8081;
|
||||||
|
bgHelperPort = 3000;
|
||||||
|
|
||||||
# Database configuration
|
# Database configuration
|
||||||
dbName = "piped";
|
dbName = "piped";
|
||||||
@@ -27,8 +28,7 @@ let
|
|||||||
# Server configuration
|
# Server configuration
|
||||||
PORT=${toString backendPort}
|
PORT=${toString backendPort}
|
||||||
HTTP_WORKERS=2
|
HTTP_WORKERS=2
|
||||||
|
# Proxy configuration
|
||||||
# Proxy configuration
|
|
||||||
PROXY_PART=https://${apiDomain}/proxy
|
PROXY_PART=https://${apiDomain}/proxy
|
||||||
|
|
||||||
# API URL
|
# API URL
|
||||||
@@ -54,6 +54,9 @@ let
|
|||||||
|
|
||||||
# Feed retention (days)
|
# Feed retention (days)
|
||||||
FEED_RETENTION=30
|
FEED_RETENTION=30
|
||||||
|
|
||||||
|
# Background helper for iOS compatibility (generates PoTokens)
|
||||||
|
BG_HELPER_URL=http://piped-bg-helper:${toString bgHelperPort}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Piped frontend configuration
|
# Piped frontend configuration
|
||||||
@@ -167,9 +170,9 @@ in
|
|||||||
# Use Podman for OCI containers
|
# Use Podman for OCI containers
|
||||||
virtualisation.oci-containers.backend = "podman";
|
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 = {
|
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}" ];
|
ports = [ "127.0.0.1:${toString backendPort}:${toString backendPort}" ];
|
||||||
volumes = [
|
volumes = [
|
||||||
"/var/lib/piped/config/config.properties:/app/config.properties:ro"
|
"/var/lib/piped/config/config.properties:/app/config.properties:ro"
|
||||||
@@ -177,6 +180,7 @@ in
|
|||||||
extraOptions = [
|
extraOptions = [
|
||||||
"--pull=newer"
|
"--pull=newer"
|
||||||
# Using default bridge network - connects to PostgreSQL via 10.88.0.1
|
# 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" ];
|
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
|
# Piped Proxy Podman container
|
||||||
virtualisation.oci-containers.containers.piped-proxy = {
|
virtualisation.oci-containers.containers.piped-proxy = {
|
||||||
image = "1337kavin/piped-proxy:latest";
|
image = "1337kavin/piped-proxy:latest";
|
||||||
@@ -211,11 +225,6 @@ in
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
try_files $uri $uri/ /index.html;
|
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;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user