Compare commits
No commits in common. "c61ea4ae673a2d02aa0a533ddbf5453ab5c2d4e4" and "c38e2216794885b11cb1261768509a29615dc411" have entirely different histories.
c61ea4ae67
...
c38e221679
2 changed files with 21 additions and 19 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 une flêche soulignée pour déplacer",
|
"hint_move": "Cliquez un champ surligné 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": "Un mail de vérification a été envoyé à votre adresse email — veuillez consulter votre boîte de réception.",
|
"email_not_verified_banner": "Veuillez vérifier votre adresse email — consultez 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…",
|
||||||
|
|
|
||||||
22
module.nix
22
module.nix
|
|
@ -130,8 +130,7 @@ 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 =
|
listen = if withSSL then [
|
||||||
if withSSL then [
|
|
||||||
{ addr = "0.0.0.0"; port = 443; ssl = true; }
|
{ addr = "0.0.0.0"; port = 443; ssl = true; }
|
||||||
{ addr = "[::]"; port = 443; ssl = true; }
|
{ addr = "[::]"; port = 443; ssl = true; }
|
||||||
] else [
|
] else [
|
||||||
|
|
@ -176,13 +175,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
|
||||||
'';
|
'';
|
||||||
startScript = pkgs.writeShellScript "trictrac-start" (
|
smtpEnvScript = if cfg.smtp.passwordFile != null then
|
||||||
optionalString (cfg.smtp.passwordFile != null) ''
|
pkgs.writeShellScript "trictrac-smtp-env" ''
|
||||||
export SMTP_PASS="$(< ${cfg.smtp.passwordFile})"
|
set -euo pipefail
|
||||||
'' + ''
|
printf 'SMTP_PASS=%s\n' "$(< ${cfg.smtp.passwordFile})" > /run/trictrac/smtp.env
|
||||||
exec ${pkgs.trictrac}/bin/relay-server
|
chmod 400 /run/trictrac/smtp.env
|
||||||
''
|
''
|
||||||
);
|
else null;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
description = "trictrac relay server";
|
description = "trictrac relay server";
|
||||||
|
|
@ -209,9 +208,12 @@ 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}";
|
ExecStartPre = [ "${setupScript}" ] ++ optional (smtpEnvScript != null) "+${smtpEnvScript}";
|
||||||
ExecStart = "${startScript}";
|
ExecStart = "${pkgs.trictrac}/bin/relay-server";
|
||||||
|
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