1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.tools.commento;
4 env = config.myEnv.tools.commento;
5 webPort = "${host}:${port}";
6 port = toString env.listenPort;
8 postgresql_url = "postgres://${env.postgresql.user}:${env.postgresql.password}@localhost:${env.postgresql.port}/${env.postgresql.database}?sslmode=disable";
11 options.myServices.websites.tools.commento = {
12 enable = lib.mkEnableOption "Enable commento website";
14 config = lib.mkIf cfg.enable {
15 myServices.dns.zones."immae.eu".subdomains.commento =
16 with config.myServices.dns.helpers; ips servers.eldiron.ips.main;
18 myServices.chatonsProperties.services.commento = {
19 file.datetime = "2022-08-21T01:11:00";
22 description = "Commento is a fast, privacy-focused commenting platform";
23 website = "https://commento.immae.eu";
24 logo = "https://commento.immae.eu/images/logo.svg";
26 status.description = "OK";
27 registration."" = ["MEMBER" "CLIENT"];
28 registration.load = "OPEN";
29 install.type = "PACKAGE";
33 website = "https://www.commento.io/";
34 license.url = "https://gitlab.com/commento/commento/-/blob/master/LICENSE";
35 license.name = "MIT License";
36 version = pkgs.commento.version;
37 source.url = "https://gitlab.com/commento/commento";
44 COMMENTO_ORIGIN=https://commento.immae.eu/
46 COMMENTO_POSTGRES=${postgresql_url}
47 COMMENTO_FORBID_NEW_OWNERS=true
48 COMMENTO_BIND_ADDRESS=${host}
49 COMMENTO_GZIP_STATIC=true
50 COMMENTO_SMTP_HOST=${env.smtp.host}
51 COMMENTO_SMTP_PORT=${env.smtp.port}
52 COMMENTO_SMTP_USERNAME=${env.smtp.email}
53 COMMENTO_SMTP_PASSWORD=${env.smtp.password}
54 COMMENTO_SMTP_FROM_ADDRESS=${env.smtp.email}
59 security.acme.certs.eldiron.extraDomainNames = [ "commento.immae.eu" ];
60 services.websites.env.tools.vhostConfs.commento = {
62 hosts = [ "commento.immae.eu" ];
66 ProxyPass / http://${webPort}/
67 ProxyPassReverse / http://${webPort}/
72 systemd.services.commento = {
73 description = "Commento";
74 wantedBy = [ "multi-user.target" ];
75 requires = ["postgresql.service"];
76 after = ["network.target" "postgresql.service"];
79 ExecStart = "${pkgs.commento}/commento";
80 EnvironmentFile = config.secrets.fullPaths."commento/env";