From 1188b79b773b715095e410c8aabf07cc52ebcbfb Mon Sep 17 00:00:00 2001 From: encode42 Date: Sat, 21 Feb 2026 03:34:05 -0500 Subject: [PATCH] Start work on Zipline --- hosts/index/config/web/zipline.nix | 29 +++++++++++++++++++++++ hosts/index/default.nix | 3 ++- lib/mkProxies.nix | 4 +++- packages/server/web/zipline.nix | 37 ++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 hosts/index/config/web/zipline.nix create mode 100644 packages/server/web/zipline.nix diff --git a/hosts/index/config/web/zipline.nix b/hosts/index/config/web/zipline.nix new file mode 100644 index 0000000..eac4334 --- /dev/null +++ b/hosts/index/config/web/zipline.nix @@ -0,0 +1,29 @@ +{ flakeRoot, ... }: + +let + host = "deer.zip"; + + ziplineModule = import (flakeRoot + /packages/server/web/zipline.nix) { + hosts = [ + { + name = host; + ssl = "cloudflare"; + } + ]; + }; +in +{ + imports = [ + ziplineModule + ]; + + services.zipline = { + environmentFiles = [ "/mnt/apps/zipline/.env" ]; + + settings = { + CORE_DEFAULT_DOMAIN = host; + + DATASOURCE_LOCAL_DIRECTORY = "/mnt/data/zipline/"; + }; + }; +} diff --git a/hosts/index/default.nix b/hosts/index/default.nix index 4c06644..d339e9f 100644 --- a/hosts/index/default.nix +++ b/hosts/index/default.nix @@ -49,12 +49,13 @@ ./config/sharing/soulseek.nix ./config/web/caddy.nix - ./config/web/forgejo.nix + #./config/web/forgejo.nix ./config/web/linkwarden.nix ./config/web/miniflux.nix ./config/web/network-optimizer.nix ./config/web/vaultwarden.nix #./config/web/wakapi.nix + ./config/web/zipline.nix ./users ]; diff --git a/lib/mkProxies.nix b/lib/mkProxies.nix index 32e7d77..3b609a9 100644 --- a/lib/mkProxies.nix +++ b/lib/mkProxies.nix @@ -1,7 +1,7 @@ { lib }: # hosts: -# [ { name = str; ssl = str; useLocal = bool?; } ]; +# [ { name = str; ssl = str; useLocal = bool?; extraConfig = string?; } ]; hosts: proxy: let @@ -32,6 +32,8 @@ builtins.listToAttrs ( ${sslModules.${host.ssl}} ${proxy} + + ${host.extraConfig or ""} ''; }; }) hosts diff --git a/packages/server/web/zipline.nix b/packages/server/web/zipline.nix new file mode 100644 index 0000000..94bf471 --- /dev/null +++ b/packages/server/web/zipline.nix @@ -0,0 +1,37 @@ +{ + hosts ? [ ], +}: + +{ config, flakeLib, ... }: + +{ + services.zipline = { + enable = true; + + settings = { + URLS_ROUTE = "/"; + FILES_ROUTE = "/"; + + URLS_LENGTH = 3; + FILES_LENGTH = 3; + + FILES_MAX_FILE_SIZE = "500mb"; + + CORE_PORT = 3030; + + FEATURES_USER_REGISTRATION = false; + FEATURES_OAUTH_REGISTRATION = false; + + FEATURES_METRICS_ENABLED = false; + + FEATURES_VERSION_CHECKING = false; + + # https://zipline.diced.sh/docs/config/settings#variables-9 + # https://zipline.diced.sh/docs/config/settings#pwa + }; + }; + + services.caddy.virtualHosts = flakeLib.mkProxies hosts '' + reverse_proxy :${toString config.services.zipline.settings.CORE_PORT} + ''; +} -- 2.51.2