Add etherpad to ruil
This commit is contained in:
parent
77b18f8490
commit
176d2a7723
2 changed files with 52 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./modules/vaultwarden.nix
|
./modules/vaultwarden.nix
|
||||||
|
./modules/etherpad-lite.nix
|
||||||
(modulesPath + "/virtualisation/digital-ocean-config.nix")
|
(modulesPath + "/virtualisation/digital-ocean-config.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
51
hosts/ruil/modules/etherpad-lite.nix
Normal file
51
hosts/ruil/modules/etherpad-lite.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
users.users.etherpad = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "etherpad";
|
||||||
|
};
|
||||||
|
users.groups.etherpad = { };
|
||||||
|
|
||||||
|
environment.etc."etherpad-lite/settings.json".text = builtins.toJSON {
|
||||||
|
ip = "127.0.0.1";
|
||||||
|
port = 9001;
|
||||||
|
trustProxy = true;
|
||||||
|
dbType = "rustydb";
|
||||||
|
dbSettings = {
|
||||||
|
filename = "/var/lib/etherpad-lite/rusty.db";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Etherpad on etherpad.hunner.dev (Cloudflare proxy -> nginx -> localhost:9001).
|
||||||
|
systemd.services.etherpad-lite = {
|
||||||
|
description = "Etherpad Lite";
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
User = "etherpad";
|
||||||
|
Group = "etherpad";
|
||||||
|
StateDirectory = "etherpad-lite";
|
||||||
|
WorkingDirectory = "/var/lib/etherpad-lite";
|
||||||
|
ExecStart = "${pkgs.etherpad-lite}/bin/etherpad-lite --settings /etc/etherpad-lite/settings.json --sessionkey /var/lib/etherpad-lite/SESSIONKEY.txt --apikey /var/lib/etherpad-lite/APIKEY.txt";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "5s";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# ACME certificate for Cloudflare Full (strict) origin TLS.
|
||||||
|
services.nginx.virtualHosts."etherpad.hunner.dev" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:9001";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_read_timeout 360s;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue