From 5a10e10d381f2fd6b6aecc4df6b6b05a13ffae4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 24 Sep 2023 06:21:44 +0100 Subject: [PATCH] migrate notes to peninsula --- nixos/boxes/vpsfree1/cryptpad.config.js | 6 +++--- nixos/boxes/vpsfree1/cryptpad.nix | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/nixos/boxes/vpsfree1/cryptpad.config.js b/nixos/boxes/vpsfree1/cryptpad.config.js index bdbe832d..cff89f4f 100644 --- a/nixos/boxes/vpsfree1/cryptpad.config.js +++ b/nixos/boxes/vpsfree1/cryptpad.config.js @@ -1,14 +1,14 @@ /* globals module */ module.exports = { - httpUnsafeOrigin: 'https://notes.purrfect.estate', - httpSafeOrigin: "https://notes-sandbox.purrfect.estate", + httpUnsafeOrigin: 'https://notes.peninsula.industries', + httpSafeOrigin: "https://notes-sandbox.peninsula.industries", httpAddress: '::', httpPort: 3000, httpSafePort: 3001, adminKeys: [ - "[cyplo@notes.purrfect.estate/Ii+Y2Z5ZDAN2fFpAEQu93SDjQcWkSfY7eaSvhCJedX8=]", + "[cyplo@notes.peninsula.industries/Ii+Y2Z5ZDAN2fFpAEQu93SDjQcWkSfY7eaSvhCJedX8=]", ], /* ===================== diff --git a/nixos/boxes/vpsfree1/cryptpad.nix b/nixos/boxes/vpsfree1/cryptpad.nix index e54cccd3..544bd94e 100644 --- a/nixos/boxes/vpsfree1/cryptpad.nix +++ b/nixos/boxes/vpsfree1/cryptpad.nix @@ -4,15 +4,19 @@ inputs, lib, ... -}: { +}: let + baseDomain = "peninsula.industries"; + domain = "notes.${baseDomain}"; + sandboxDomain = "notes-sandbox.${baseDomain}"; +in { imports = [../nginx.nix]; services.nginx = { virtualHosts = { - "notes.purrfect.estate" = { + "${domain}" = { forceSSL = true; enableACME = true; - serverAliases = ["notes-sandbox.purrfect.estate"]; + serverAliases = ["${sandboxDomain}"]; locations."/" = { proxyPass = "http://127.0.0.1:9005"; proxyWebsockets = true; @@ -32,8 +36,8 @@ "cryptpad_data_files:/cryptpad/datastore" ]; environment = { - CPAD_MAIN_DOMAIN = "notes.purrfect.estate"; - CPAD_SANDBOX_DOMAIN = "notes-sandbox.purrfect.estate"; + CPAD_MAIN_DOMAIN = domain; + CPAD_SANDBOX_DOMAIN = sandboxDomain; CPAD_REALIP_HEADER = "X-Forwarded-For"; CPAD_REALIP_RECURSIVE = "on"; CPAD_TRUSTED_PROXY = "0.0.0.0/0";