dotfiles/nixos/boxes/vpsfree1/cryptpad.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

2023-08-13 17:00:41 +01:00
{
config,
pkgs,
inputs,
lib,
...
2023-09-24 06:21:44 +01:00
}: let
baseDomain = "peninsula.industries";
domain = "notes.${baseDomain}";
sandboxDomain = "notes-sandbox.${baseDomain}";
in {
2023-08-13 17:00:41 +01:00
imports = [../nginx.nix];
2022-07-19 13:20:48 +01:00
services.nginx = {
virtualHosts = {
2023-09-24 06:21:44 +01:00
"${domain}" = {
2022-07-19 13:20:48 +01:00
forceSSL = true;
enableACME = true;
2023-09-24 06:21:44 +01:00
serverAliases = ["${sandboxDomain}"];
2022-07-23 07:49:40 +01:00
locations."/" = {
proxyPass = "http://127.0.0.1:9005";
2022-07-23 07:49:40 +01:00
proxyWebsockets = true;
};
2022-07-19 13:20:48 +01:00
};
};
};
virtualisation.oci-containers.containers.cryptpad = {
2023-08-13 17:00:41 +01:00
image = "promasu/cryptpad@sha256:29c61f69e41173188c0592e72f2273cf23a83f48e7d143337e2cd7fea441ed87";
2022-07-23 08:37:53 +01:00
volumes = [
"${./cryptpad.config.js}:/cryptpad/config/config.js"
"cryptpad_blob:/cryptpad/blob"
"cryptpad_block:/cryptpad/block"
"cryptpad_customize:/cryptpad/customize"
"cryptpad_data:/cryptpad/data"
"cryptpad_data_files:/cryptpad/datastore"
];
2022-07-23 07:49:40 +01:00
environment = {
2023-09-24 06:21:44 +01:00
CPAD_MAIN_DOMAIN = domain;
CPAD_SANDBOX_DOMAIN = sandboxDomain;
2022-07-23 07:49:40 +01:00
CPAD_REALIP_HEADER = "X-Forwarded-For";
CPAD_REALIP_RECURSIVE = "on";
CPAD_TRUSTED_PROXY = "0.0.0.0/0";
CPAD_HTTP2_DISABLE = "true";
};
2023-08-13 17:00:41 +01:00
ports = ["9005:80"];
2022-07-19 13:20:48 +01:00
};
}