k 3 Reaktor: add channels Option

This commit is contained in:
makefu 2015-12-30 11:29:28 +01:00
parent 1798dbaf47
commit c962e8549e
2 changed files with 25 additions and 7 deletions

View File

@ -70,12 +70,17 @@ let
REAKTOR_HOST REAKTOR_HOST
REAKTOR_PORT REAKTOR_PORT
REAKTOR_STATEDIR REAKTOR_STATEDIR
REAKTOR_CHANNELS
debug and nickname can be set separately via the Reaktor api debug and nickname can be set separately via the Reaktor api
''; '';
}; };
channels = mkOption {
default = [ "#krebs" ];
type = types.listOf types.str;
description = ''
Channels the Reaktor should connect to at startup.
'';
};
debug = mkOption { debug = mkOption {
default = false; default = false;
description = '' description = ''
@ -112,7 +117,9 @@ let
GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
REAKTOR_NICKNAME = cfg.nickname; REAKTOR_NICKNAME = cfg.nickname;
REAKTOR_DEBUG = (if cfg.debug then "True" else "False"); REAKTOR_DEBUG = (if cfg.debug then "True" else "False");
REAKTOR_CHANNELS = lib.concatStringsSep "," cfg.channels;
state_dir = cfg.workdir; state_dir = cfg.workdir;
} // cfg.extraEnviron; } // cfg.extraEnviron;
serviceConfig= { serviceConfig= {
ExecStartPre = pkgs.writeScript "Reaktor-init" '' ExecStartPre = pkgs.writeScript "Reaktor-init" ''

View File

@ -18,8 +18,6 @@ in {
../2configs/iodined.nix ../2configs/iodined.nix
# Reaktor
../2configs/Reaktor/simpleExtend.nix
# other nginx # other nginx
../2configs/nginx/euer.wiki.nix ../2configs/nginx/euer.wiki.nix
@ -29,9 +27,22 @@ in {
# collectd # collectd
../2configs/collectd/collectd-base.nix ../2configs/collectd/collectd-base.nix
]; ];
krebs.build.host = config.krebs.hosts.wry; krebs.build.host = config.krebs.hosts.wry;
krebs.Reaktor.enable = true; krebs.Reaktor = {
nickname = "Reaktor|bot";
channels = [ "#krebs_test" ];
enable = true;
debug = true;
plugins = with pkgs.ReaktorPlugins;[
titlebot
# stockholm-issue
nixos-version
shack-correct
sed-plugin
random-emoji ];
};
# bepasty to listen only on the correct interfaces # bepasty to listen only on the correct interfaces
krebs.bepasty.servers.internal.nginx.listen = [ "${internal-ip}:80" ]; krebs.bepasty.servers.internal.nginx.listen = [ "${internal-ip}:80" ];
@ -59,11 +70,11 @@ in {
}; };
networking = { networking = {
firewall = { firewall = {
allowPing = true; allowPing = true;
logRefusedConnections = false; logRefusedConnections = false;
allowedTCPPorts = [ 53 80 443 ]; allowedTCPPorts = [ 53 80 443 ];
allowedUDPPorts = [ 655 ]; allowedUDPPorts = [ 655 53 ];
}; };
interfaces.enp2s1.ip4 = [{ interfaces.enp2s1.ip4 = [{
address = external-ip; address = external-ip;