From 90f21ac05a6fe369c6f5d5b0e3c18427f4eabce1 Mon Sep 17 00:00:00 2001 From: Henri Bourcereau Date: Wed, 20 May 2026 10:45:15 +0200 Subject: [PATCH] fix: module.nix passfile --- clients/web/locales/fr.json | 4 ++-- module.nix | 36 +++++++++++++++++------------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/clients/web/locales/fr.json b/clients/web/locales/fr.json index aae9c52..3f9a1c0 100644 --- a/clients/web/locales/fr.json +++ b/clients/web/locales/fr.json @@ -66,7 +66,7 @@ "hold": "Tenir", "opp_scored_pts": "Adversaire +{{ n }} pts", "opp_hole_made": "Trou adverse ! {{ holes }}/12", - "hint_move": "Cliquez un champ surligné pour déplacer", + "hint_move": "Cliquez une flêche soulignée pour déplacer", "hint_hold_or_go": "Tenir pour garder les points — S'en aller pour repartir", "hint_continue": "Cliquez Continuer quand vous êtes prêt", "anonymous_name": "Anonyme", @@ -95,7 +95,7 @@ "verify_email_checking": "Vérification en cours…", "verify_email_success": "Votre email a été vérifié.", "verify_email_invalid": "Ce lien de vérification est invalide ou a expiré.", - "email_not_verified_banner": "Veuillez vérifier votre adresse email — consultez votre boîte de réception.", + "email_not_verified_banner": "Un mail de vérification a été envoyé à votre adresse email — veuillez consulter votre boîte de réception.", "resend_verification": "Renvoyer l'email de vérification", "verification_email_resent": "Email de vérification envoyé.", "loading": "Chargement…", diff --git a/module.nix b/module.nix index d425bf8..212f614 100644 --- a/module.nix +++ b/module.nix @@ -130,13 +130,14 @@ in forceSSL = withSSL; # Explicit listen so this vhost isn't shadowed by a default_server # created by other virtual hosts with forceSSL = true. - listen = if withSSL then [ - { addr = "0.0.0.0"; port = 443; ssl = true; } - { addr = "[::]"; port = 443; ssl = true; } - ] else [ - { addr = "0.0.0.0"; port = 80; ssl = false; } - { addr = "[::]"; port = 80; ssl = false; } - ]; + listen = + if withSSL then [ + { addr = "0.0.0.0"; port = 443; ssl = true; } + { addr = "[::]"; port = 443; ssl = true; } + ] else [ + { addr = "0.0.0.0"; port = 80; ssl = false; } + { addr = "[::]"; port = 80; ssl = false; } + ]; locations."/" = { extraConfig = proxyConfig; proxyPass = "http://trictrac-api/"; @@ -175,13 +176,13 @@ in install -m 644 ${pkgs.trictrac}/GameConfig.json "$STATE_DIRECTORY/GameConfig.json" fi ''; - smtpEnvScript = if cfg.smtp.passwordFile != null then - pkgs.writeShellScript "trictrac-smtp-env" '' - set -euo pipefail - printf 'SMTP_PASS=%s\n' "$(< ${cfg.smtp.passwordFile})" > /run/trictrac/smtp.env - chmod 400 /run/trictrac/smtp.env + startScript = pkgs.writeShellScript "trictrac-start" ( + optionalString (cfg.smtp.passwordFile != null) '' + export SMTP_PASS="$(< ${cfg.smtp.passwordFile})" + '' + '' + exec ${pkgs.trictrac}/bin/relay-server '' - else null; + ); in { description = "trictrac relay server"; @@ -194,7 +195,7 @@ in APP_URL = "${cfg.protocol}://${cfg.hostname}"; SMTP_HOST = cfg.smtp.host; SMTP_PORT = toString (if cfg.smtp.port != null then cfg.smtp.port - else if cfg.smtp.tls then 465 else 1025); + else if cfg.smtp.tls then 465 else 1025); SMTP_FROM = cfg.smtp.from; } // optionalAttrs cfg.smtp.tls { SMTP_TLS = "true"; @@ -208,12 +209,9 @@ in # systemd creates /var/lib/trictrac and sets STATE_DIRECTORY accordingly StateDirectory = "trictrac"; StateDirectoryMode = "0755"; - # systemd creates /run/trictrac for the smtp.env file - RuntimeDirectory = "trictrac"; WorkingDirectory = "/var/lib/trictrac"; - ExecStartPre = [ "${setupScript}" ] ++ optional (smtpEnvScript != null) "+${smtpEnvScript}"; - ExecStart = "${pkgs.trictrac}/bin/relay-server"; - EnvironmentFile = mkIf (cfg.smtp.passwordFile != null) "/run/trictrac/smtp.env"; + ExecStartPre = "${setupScript}"; + ExecStart = "${startScript}"; Restart = "on-failure"; RestartSec = "5s"; };