fix: module.nix passfile
This commit is contained in:
parent
fbc76f879a
commit
90f21ac05a
2 changed files with 19 additions and 21 deletions
|
|
@ -66,7 +66,7 @@
|
||||||
"hold": "Tenir",
|
"hold": "Tenir",
|
||||||
"opp_scored_pts": "Adversaire +{{ n }} pts",
|
"opp_scored_pts": "Adversaire +{{ n }} pts",
|
||||||
"opp_hole_made": "Trou adverse ! {{ holes }}/12",
|
"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_hold_or_go": "Tenir pour garder les points — S'en aller pour repartir",
|
||||||
"hint_continue": "Cliquez Continuer quand vous êtes prêt",
|
"hint_continue": "Cliquez Continuer quand vous êtes prêt",
|
||||||
"anonymous_name": "Anonyme",
|
"anonymous_name": "Anonyme",
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
"verify_email_checking": "Vérification en cours…",
|
"verify_email_checking": "Vérification en cours…",
|
||||||
"verify_email_success": "Votre email a été vérifié.",
|
"verify_email_success": "Votre email a été vérifié.",
|
||||||
"verify_email_invalid": "Ce lien de vérification est invalide ou a expiré.",
|
"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",
|
"resend_verification": "Renvoyer l'email de vérification",
|
||||||
"verification_email_resent": "Email de vérification envoyé.",
|
"verification_email_resent": "Email de vérification envoyé.",
|
||||||
"loading": "Chargement…",
|
"loading": "Chargement…",
|
||||||
|
|
|
||||||
36
module.nix
36
module.nix
|
|
@ -130,13 +130,14 @@ in
|
||||||
forceSSL = withSSL;
|
forceSSL = withSSL;
|
||||||
# Explicit listen so this vhost isn't shadowed by a default_server
|
# Explicit listen so this vhost isn't shadowed by a default_server
|
||||||
# created by other virtual hosts with forceSSL = true.
|
# created by other virtual hosts with forceSSL = true.
|
||||||
listen = if withSSL then [
|
listen =
|
||||||
{ addr = "0.0.0.0"; port = 443; ssl = true; }
|
if withSSL then [
|
||||||
{ addr = "[::]"; port = 443; ssl = true; }
|
{ addr = "0.0.0.0"; port = 443; ssl = true; }
|
||||||
] else [
|
{ addr = "[::]"; port = 443; ssl = true; }
|
||||||
{ addr = "0.0.0.0"; port = 80; ssl = false; }
|
] else [
|
||||||
{ addr = "[::]"; port = 80; ssl = false; }
|
{ addr = "0.0.0.0"; port = 80; ssl = false; }
|
||||||
];
|
{ addr = "[::]"; port = 80; ssl = false; }
|
||||||
|
];
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
extraConfig = proxyConfig;
|
extraConfig = proxyConfig;
|
||||||
proxyPass = "http://trictrac-api/";
|
proxyPass = "http://trictrac-api/";
|
||||||
|
|
@ -175,13 +176,13 @@ in
|
||||||
install -m 644 ${pkgs.trictrac}/GameConfig.json "$STATE_DIRECTORY/GameConfig.json"
|
install -m 644 ${pkgs.trictrac}/GameConfig.json "$STATE_DIRECTORY/GameConfig.json"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
smtpEnvScript = if cfg.smtp.passwordFile != null then
|
startScript = pkgs.writeShellScript "trictrac-start" (
|
||||||
pkgs.writeShellScript "trictrac-smtp-env" ''
|
optionalString (cfg.smtp.passwordFile != null) ''
|
||||||
set -euo pipefail
|
export SMTP_PASS="$(< ${cfg.smtp.passwordFile})"
|
||||||
printf 'SMTP_PASS=%s\n' "$(< ${cfg.smtp.passwordFile})" > /run/trictrac/smtp.env
|
'' + ''
|
||||||
chmod 400 /run/trictrac/smtp.env
|
exec ${pkgs.trictrac}/bin/relay-server
|
||||||
''
|
''
|
||||||
else null;
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
description = "trictrac relay server";
|
description = "trictrac relay server";
|
||||||
|
|
@ -194,7 +195,7 @@ in
|
||||||
APP_URL = "${cfg.protocol}://${cfg.hostname}";
|
APP_URL = "${cfg.protocol}://${cfg.hostname}";
|
||||||
SMTP_HOST = cfg.smtp.host;
|
SMTP_HOST = cfg.smtp.host;
|
||||||
SMTP_PORT = toString (if cfg.smtp.port != null then cfg.smtp.port
|
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;
|
SMTP_FROM = cfg.smtp.from;
|
||||||
} // optionalAttrs cfg.smtp.tls {
|
} // optionalAttrs cfg.smtp.tls {
|
||||||
SMTP_TLS = "true";
|
SMTP_TLS = "true";
|
||||||
|
|
@ -208,12 +209,9 @@ in
|
||||||
# systemd creates /var/lib/trictrac and sets STATE_DIRECTORY accordingly
|
# systemd creates /var/lib/trictrac and sets STATE_DIRECTORY accordingly
|
||||||
StateDirectory = "trictrac";
|
StateDirectory = "trictrac";
|
||||||
StateDirectoryMode = "0755";
|
StateDirectoryMode = "0755";
|
||||||
# systemd creates /run/trictrac for the smtp.env file
|
|
||||||
RuntimeDirectory = "trictrac";
|
|
||||||
WorkingDirectory = "/var/lib/trictrac";
|
WorkingDirectory = "/var/lib/trictrac";
|
||||||
ExecStartPre = [ "${setupScript}" ] ++ optional (smtpEnvScript != null) "+${smtpEnvScript}";
|
ExecStartPre = "${setupScript}";
|
||||||
ExecStart = "${pkgs.trictrac}/bin/relay-server";
|
ExecStart = "${startScript}";
|
||||||
EnvironmentFile = mkIf (cfg.smtp.passwordFile != null) "/run/trictrac/smtp.env";
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "5s";
|
RestartSec = "5s";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue