summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-09-05 22:51:37 +0200
committerlassulus <lassulus@lassul.us>2021-09-05 23:09:21 +0200
commitb471ff4191011b000f60dd2c6dafc6e5ed9458c2 (patch)
treed83a70b841bda26335a2771fcf5470a5afce9222 /krebs/3modules
parentaaae1b2f5b6532ae6f5def1678957e2a6dc00c28 (diff)
irc-announce: add tls flag
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/announce-activation.nix5
-rw-r--r--krebs/3modules/hidden-ssh.nix20
2 files changed, 21 insertions, 4 deletions
diff --git a/krebs/3modules/announce-activation.nix b/krebs/3modules/announce-activation.nix
index 76eb4b13..a40ae8ce 100644
--- a/krebs/3modules/announce-activation.nix
+++ b/krebs/3modules/announce-activation.nix
@@ -9,6 +9,7 @@ with import <stockholm/lib>;
${shell.escape (toString cfg.irc.port)} \
${shell.escape cfg.irc.nick} \
${shell.escape cfg.irc.channel} \
+ ${escapeShellArg cfg.irc.tls} \
"$message"
'';
default-get-message = pkgs.writeDash "announce-activation-get-message" ''
@@ -50,6 +51,10 @@ in {
default = "irc.r";
type = types.hostname;
};
+ tls = mkOption {
+ default = false;
+ type = types.bool;
+ };
};
};
config = mkIf cfg.enable {
diff --git a/krebs/3modules/hidden-ssh.nix b/krebs/3modules/hidden-ssh.nix
index 4436a616..acbe717d 100644
--- a/krebs/3modules/hidden-ssh.nix
+++ b/krebs/3modules/hidden-ssh.nix
@@ -19,6 +19,14 @@ let
type = types.str;
default = "irc.hackint.org";
};
+ port = mkOption {
+ type = types.int;
+ default = 6697;
+ };
+ tls = mkOption {
+ type = types.bool;
+ default = true;
+ };
message = mkOption {
type = types.str;
default = "SSH Hidden Service at ";
@@ -53,10 +61,14 @@ let
echo "still waiting for ${hiddenServiceDir}/hostname"
sleep 1
done
- ${pkgs.untilport}/bin/untilport ${cfg.server} 6667 && \
- ${pkgs.irc-announce}/bin/irc-announce \
- ${cfg.server} 6667 ${config.krebs.build.host.name}-ssh \
- \${cfg.channel} \
+ ${pkgs.untilport}/bin/untilport ${escapeShellArg cfg.server} ${toString cfg.port}
+
+ ${pkgs.irc-announce}/bin/irc-announce \
+ ${escapeShellArg cfg.server} \
+ ${toString cfg.port} \
+ "${config.krebs.build.host.name}-ssh" \
+ ${escapeShellArg cfg.channel} \
+ ${escapeShellArg cfg.tls} \
"${cfg.message}$(cat ${hiddenServiceDir}/hostname)"
'';
PrivateTmp = "true";