From 2426cdea08f8a3f324ea070885a8a443a8306dd1 Mon Sep 17 00:00:00 2001 From: satr14 Date: Mon, 4 May 2026 21:25:03 +0700 Subject: [PATCH] disable guest storage --- modules/system/homelab/docs.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/modules/system/homelab/docs.nix b/modules/system/homelab/docs.nix index 9682a0e..adfa357 100644 --- a/modules/system/homelab/docs.nix +++ b/modules/system/homelab/docs.nix @@ -1,4 +1,4 @@ -{ homelab, ... }: let +{ lib, pkgs, homelab, ... }: let domain = "docs.${homelab.domain}"; sandbox = "docs-sandbox.${homelab.domain}"; in { @@ -12,14 +12,31 @@ in { httpSafeOrigin = "https://${sandbox}"; blockDailyCheck = true; disableIntegratedEviction = true; - disableAnonymousStore = true; - disableAnonymousPadCreation = true; adminKeys = [ "[satr14@docs.satr14.my.id/f1A82fmBuqQka2bNqrCb1WbB9r2ex5A3rdys5xLX3Hc=]" ]; }; }; + systemd.tmpfiles.rules = lib.singleton "f /var/lib/cryptpad/customize/application_config.js 0644 root root - ${pkgs.writeText "cryptpad-application-config.js" '' + (() => { + const factory = (AppConfig) => { + AppConfig.disableAnonymousPadCreation = true; + AppConfig.disableAnonymousStore = true; + AppConfig.defaultDarkTheme = 'true'; + return AppConfig; + }; + + if (typeof(module) !== 'undefined' && module.exports) { + module.exports = factory( + require('../www/common/application_config_internal.js') + ); + } else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) { + define(['/common/application_config_internal.js'], factory); + } + })(); + ''}"; + fileSystems."/var/lib/private/cryptpad" = { device = "/mnt/data/apps/cryptpad"; depends = [ "/mnt/data" ];