pastila: weechat-relay

This commit is contained in:
root 2024-06-01 19:34:21 +02:00
parent 649f63f08d
commit c42316b4f6
3 changed files with 23 additions and 1 deletions

View file

@ -13,6 +13,7 @@ in
./gitolite.nix ./gitolite.nix
./letsencrypt.nix ./letsencrypt.nix
./srv.nix ./srv.nix
./weechat-relay.nix
]; ];
# Use the GRUB 2 boot loader. # Use the GRUB 2 boot loader.

View file

@ -11,7 +11,8 @@ in
users.users."up" = { users.users."up" = {
isNormalUser = true; isNormalUser = true;
home = up_dir; home = up_dir;
group = config.services.nginx.group; # group = config.services.nginx.group;
group = "nginx";
# Unsure why this is broken, but couldn't make things work without # Unsure why this is broken, but couldn't make things work without
# creating the directory by hand. # creating the directory by hand.
# createHome = true; # createHome = true;

20
pastila/weechat-relay.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
mkProxy = port: {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:" + builtins.toString port + "/weechat";
proxyWebsockets = true;
extraConfig = ''
proxy_read_timeout 604800; # Prevent idle disconnects
proxy_set_header X-Real-IP $remote_addr; # Let WeeChat see the client's IP
'';
};
};
in
{
services.nginx.enable = true;
services.nginx.virtualHosts."relayjq.isomorphis.me" = mkProxy 9001;
}