Skip to content

Commit

Permalink
modules: add soju
Browse files Browse the repository at this point in the history
hosts: import soju into germanium
caddy: reverse proxy Layer 4 streams to allow ircs:// -> irc:// connectivity
  • Loading branch information
fufexan committed Dec 17, 2024
1 parent e08c3f1 commit c4ca24d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
1 change: 1 addition & 0 deletions hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ in {
mod
"${mod}/networking"
"${mod}/services/caddy.nix"
"${mod}/services/soju.nix"
"${mod}/services/vaultwarden.nix"
"${mod}/services/website.nix"
];
Expand Down
9 changes: 0 additions & 9 deletions modules/services/acme.nix

This file was deleted.

9 changes: 8 additions & 1 deletion modules/services/caddy.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
self,
pkgs,
...
}: {
networking.firewall = let
ports = [80 443];
in {
allowedTCPPorts = ports;
allowedUDPPorts = ports;
};

services.caddy.enable = true;
services.caddy = {
enable = true;
package = self.packages.${pkgs.system}.caddy-with-plugins;
};
}
32 changes: 24 additions & 8 deletions modules/services/soju.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
{config, ...}: {
security.acme.certs.soju = {};

services.soju = let
certDir = config.security.acme.certs.soju.directory;
{
networking.firewall = let
ports = [6697];
in {
enable = true;
allowedTCPPorts = ports;
allowedUDPPorts = ports;
};

tlsCertificate = "${certDir}/fullchain.pem";
tlsCertificateKey = "${certDir}/key.pem";
services.soju = {
enable = true;
hostName = "fufexan.net";
listen = ["irc+insecure://localhost:6667"];
};

services.caddy.globalConfig = ''
layer4 {
:6697 {
route {
tls
proxy {
proxy_protocol v2
upstream localhost:6667
}
}
}
}
'';
}

0 comments on commit c4ca24d

Please sign in to comment.