nixos: services: add thelounge
All checks were successful
ci/woodpecker/push/check Pipeline was successful
All checks were successful
ci/woodpecker/push/check Pipeline was successful
This commit is contained in:
parent
6d9ed122b0
commit
2bf5ae32cf
2 changed files with 60 additions and 0 deletions
|
|
@ -38,6 +38,7 @@
|
||||||
./servarr
|
./servarr
|
||||||
./ssh-server
|
./ssh-server
|
||||||
./tandoor-recipes
|
./tandoor-recipes
|
||||||
|
./thelounge
|
||||||
./tlp
|
./tlp
|
||||||
./transmission
|
./transmission
|
||||||
./vikunja
|
./vikunja
|
||||||
|
|
|
||||||
59
modules/nixos/services/thelounge/default.nix
Normal file
59
modules/nixos/services/thelounge/default.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
# Web IRC client
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.thelounge;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.thelounge = with lib; {
|
||||||
|
enable = mkEnableOption "The Lounge, a self-hosted web IRC client";
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 9050;
|
||||||
|
example = 4242;
|
||||||
|
description = "The port on which The Lounge will listen for incoming HTTP traffic.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.thelounge = {
|
||||||
|
enable = true;
|
||||||
|
inherit (cfg) port;
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
reverseProxy = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
irc = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
# Proxy websockets for RPC
|
||||||
|
websocketsLocations = [ "/" ];
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
locations."/".extraConfig = ''
|
||||||
|
proxy_read_timeout 1d;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.fail2ban.jails = {
|
||||||
|
thelounge = ''
|
||||||
|
enabled = true
|
||||||
|
filter = thelounge
|
||||||
|
port = http,https
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc = {
|
||||||
|
"fail2ban/filter.d/thelounge.conf".text = ''
|
||||||
|
[Definition]
|
||||||
|
failregex = Authentication failed for user .* from <HOST>$
|
||||||
|
Authentication for non existing user attempted from <HOST>$
|
||||||
|
journalmatch = _SYSTEMD_UNIT=thelounge.service
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue