diff --git a/configs/workhorse/gogs.nix b/configs/workhorse/gogs.nix index 9eca11a..7c5a9a1 100644 --- a/configs/workhorse/gogs.nix +++ b/configs/workhorse/gogs.nix @@ -75,30 +75,47 @@ in { }; backup.dirs = [ config.services.gogs.repositoryRoot ]; - #services.gitea = { - # enable = true; - # appName = "Git"; - # domain = "git.ingolf-wagner.de"; - # httpPort = 3000; - # repositoryRoot = "/home/gitea/repositories"; - # stateDir = "/home/gitea"; - # rootUrl = "https://git.ingolf-wagner.de/"; - # extraConfig = '' - # [service] - # DISABLE_REGISTRATION = true - # SHOW_REGISTRATION_BUTTON = false - # [server] - # SSH_DOMAIN = "git.ingolf-wagner.de" - # SSH_PORT = 443 - # START_SSH_SERVER = true - # SSH_LISTEN_PORT = 2222 - - # [log] - # LEVEL = Warn - # [log.sublogger.macaron] - # LEVEL = Warn - # ''; - #}; - #backup.dirs = [ config.services.gitea.repositoryRoot ]; + # services.nginx = { + # enable = true; + # statusPage = true; + # virtualHosts = { + # "gitlab.${config.networking.hostName}.private" = { + # extraConfig = error.extraConfig; + # locations."/" = { + # proxyPass = "http://${config.networking.hostName}.private:${ + # toString config.services.gitlab.port + # }"; + # }; + # }; + # }; + # }; + # services.gitlab = { + # enable = true; + # host = "gitlab.${config.networking.hostname}.private"; + # port = 9897; + # #databasePasswordFile = "path/todo"; + # #initialRootPasswordFile = "path/todo"; + # + # secrets = { + # # Make sure the secret is at least 30 characters and all random, + # # no regular words or you'll be exposed to dictionary attacks + # dbFile = "path/todo"; + # + # # openssl genrsa 2048 + # jwsFile = "path/todo"; + # + # # Make sure the secret is at least 30 characters and all random, + # # no regular words or you'll be exposed to dictionary attacks + # otpFile = "path/todo"; + # + # # Make sure the secret is at least 30 characters and all random, + # # no regular words or you'll be exposed to dictionary attacks + # secretFile = "path/todo"; + # }; + # + # # smtp? + # + # # gitlab-runner? + # }; } diff --git a/terranix/graylog/config.nix b/terranix/graylog/config.nix index 5100a8d..65d7ced 100644 --- a/terranix/graylog/config.nix +++ b/terranix/graylog/config.nix @@ -7,4 +7,46 @@ with builtins; { type = "org.graylog2.outputs.LoggingOutput"; configuration = toJSON ({ prefix = "Writing message: "; }); }; + + # create default index + resource.graylog_index_set.default = + let + maxIndexSize = 200; + maxIndexCount = 20; + isDefault = false; + in + { + title = "default"; + description = '' + This is the default index set, where everything ends up which is + not specifically send to another index. + + Be aware this index can only hold ${toString (maxIndexCount * maxIndexSize)}MB of logs! + ''; + default = isDefault; + index_prefix = "test-graylog"; + rotation_strategy_class = + "org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategy"; + retention_strategy_class = + "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy"; + index_analyzer = "standard"; + index_optimization_disabled = true; + writable = true; + shards = 1; + replicas = 0; + index_optimization_max_num_segments = 1; + field_type_refresh_interval = 5000; + + retention_strategy = toJSON ({ + max_number_of_indices = maxIndexCount; + type = + "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig"; + }); + + rotation_strategy = toJSON ({ + #max_docs_per_index = 30000000; + max_size = maxIndexSize * 1024 * 1024; + type = "org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategyConfig"; + }); + }; } diff --git a/terranix/graylog/shell.nix b/terranix/graylog/shell.nix index ffa6446..6f20869 100644 --- a/terranix/graylog/shell.nix +++ b/terranix/graylog/shell.nix @@ -1,9 +1,7 @@ -{ pkgs ? import {} }: -let - pass_access_token_path = "development/graylog/access_token"; -in +{ pkgs ? import { } }: +let pass_access_token_path = "development/graylog/access_token"; -pkgs.mkShell { +in pkgs.mkShell { buildInputs = with pkgs; [ terranix