Loading nixos/modules/module-list.nix +1 −1 Original line number Diff line number Diff line Loading @@ -1031,7 +1031,7 @@ ./services/web-servers/shellinabox.nix ./services/web-servers/tomcat.nix ./services/web-servers/traefik.nix ./services/web-servers/trafficserver.nix ./services/web-servers/trafficserver/default.nix ./services/web-servers/ttyd.nix ./services/web-servers/uwsgi.nix ./services/web-servers/varnish/default.nix Loading nixos/modules/services/web-servers/trafficserver.nix→nixos/modules/services/web-servers/trafficserver/default.nix +2 −14 Original line number Diff line number Diff line Loading @@ -8,21 +8,9 @@ let group = config.users.groups.trafficserver.name; getManualUrl = name: "https://docs.trafficserver.apache.org/en/latest/admin-guide/files/${name}.en.html"; getConfPath = name: "${pkgs.trafficserver}/etc/trafficserver/${name}"; yaml = pkgs.formats.yaml { }; fromYAML = f: let jsonFile = pkgs.runCommand "in.json" { nativeBuildInputs = [ pkgs.remarshal ]; } '' yaml2json < "${f}" > "$out" ''; in builtins.fromJSON (builtins.readFile jsonFile); mkYamlConf = name: cfg: if cfg != null then { "trafficserver/${name}.yaml".source = yaml.generate "${name}.yaml" cfg; Loading Loading @@ -73,7 +61,7 @@ in ipAllow = mkOption { type = types.nullOr yaml.type; default = fromYAML (getConfPath "ip_allow.yaml"); default = builtins.fromJSON (builtins.readFile ./ip_allow.json); defaultText = "upstream defaults"; example = literalExample { ip_allow = [{ Loading @@ -94,7 +82,7 @@ in logging = mkOption { type = types.nullOr yaml.type; default = fromYAML (getConfPath "logging.yaml"); default = builtins.fromJSON (builtins.readFile ./logging.json); defaultText = "upstream defaults"; example = literalExample { }; description = '' Loading nixos/modules/services/web-servers/trafficserver/ip_allow.json 0 → 100644 +36 −0 Original line number Diff line number Diff line { "ip_allow": [ { "apply": "in", "ip_addrs": "127.0.0.1", "action": "allow", "methods": "ALL" }, { "apply": "in", "ip_addrs": "::1", "action": "allow", "methods": "ALL" }, { "apply": "in", "ip_addrs": "0/0", "action": "deny", "methods": [ "PURGE", "PUSH", "DELETE" ] }, { "apply": "in", "ip_addrs": "::/0", "action": "deny", "methods": [ "PURGE", "PUSH", "DELETE" ] } ] } nixos/modules/services/web-servers/trafficserver/logging.json 0 → 100644 +37 −0 Original line number Diff line number Diff line { "logging": { "formats": [ { "name": "welf", "format": "id=firewall time=\"%<cqtd> %<cqtt>\" fw=%<phn> pri=6 proto=%<cqus> duration=%<ttmsf> sent=%<psql> rcvd=%<cqhl> src=%<chi> dst=%<shi> dstname=%<shn> user=%<caun> op=%<cqhm> arg=\"%<cqup>\" result=%<pssc> ref=\"%<{Referer}cqh>\" agent=\"%<{user-agent}cqh>\" cache=%<crc>" }, { "name": "squid_seconds_only_timestamp", "format": "%<cqts> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<caun> %<phr>/%<shn> %<psct>" }, { "name": "squid", "format": "%<cqtq> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<caun> %<phr>/%<shn> %<psct>" }, { "name": "common", "format": "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl>" }, { "name": "extended", "format": "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> %<sssc> %<sscl> %<cqcl> %<pqcl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts>" }, { "name": "extended2", "format": "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> %<sssc> %<sscl> %<cqcl> %<pqcl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts> %<phr> %<cfsc> %<pfsc> %<crc>" } ], "logs": [ { "filename": "squid", "format": "squid", "mode": "binary" } ] } } Loading
nixos/modules/module-list.nix +1 −1 Original line number Diff line number Diff line Loading @@ -1031,7 +1031,7 @@ ./services/web-servers/shellinabox.nix ./services/web-servers/tomcat.nix ./services/web-servers/traefik.nix ./services/web-servers/trafficserver.nix ./services/web-servers/trafficserver/default.nix ./services/web-servers/ttyd.nix ./services/web-servers/uwsgi.nix ./services/web-servers/varnish/default.nix Loading
nixos/modules/services/web-servers/trafficserver.nix→nixos/modules/services/web-servers/trafficserver/default.nix +2 −14 Original line number Diff line number Diff line Loading @@ -8,21 +8,9 @@ let group = config.users.groups.trafficserver.name; getManualUrl = name: "https://docs.trafficserver.apache.org/en/latest/admin-guide/files/${name}.en.html"; getConfPath = name: "${pkgs.trafficserver}/etc/trafficserver/${name}"; yaml = pkgs.formats.yaml { }; fromYAML = f: let jsonFile = pkgs.runCommand "in.json" { nativeBuildInputs = [ pkgs.remarshal ]; } '' yaml2json < "${f}" > "$out" ''; in builtins.fromJSON (builtins.readFile jsonFile); mkYamlConf = name: cfg: if cfg != null then { "trafficserver/${name}.yaml".source = yaml.generate "${name}.yaml" cfg; Loading Loading @@ -73,7 +61,7 @@ in ipAllow = mkOption { type = types.nullOr yaml.type; default = fromYAML (getConfPath "ip_allow.yaml"); default = builtins.fromJSON (builtins.readFile ./ip_allow.json); defaultText = "upstream defaults"; example = literalExample { ip_allow = [{ Loading @@ -94,7 +82,7 @@ in logging = mkOption { type = types.nullOr yaml.type; default = fromYAML (getConfPath "logging.yaml"); default = builtins.fromJSON (builtins.readFile ./logging.json); defaultText = "upstream defaults"; example = literalExample { }; description = '' Loading
nixos/modules/services/web-servers/trafficserver/ip_allow.json 0 → 100644 +36 −0 Original line number Diff line number Diff line { "ip_allow": [ { "apply": "in", "ip_addrs": "127.0.0.1", "action": "allow", "methods": "ALL" }, { "apply": "in", "ip_addrs": "::1", "action": "allow", "methods": "ALL" }, { "apply": "in", "ip_addrs": "0/0", "action": "deny", "methods": [ "PURGE", "PUSH", "DELETE" ] }, { "apply": "in", "ip_addrs": "::/0", "action": "deny", "methods": [ "PURGE", "PUSH", "DELETE" ] } ] }
nixos/modules/services/web-servers/trafficserver/logging.json 0 → 100644 +37 −0 Original line number Diff line number Diff line { "logging": { "formats": [ { "name": "welf", "format": "id=firewall time=\"%<cqtd> %<cqtt>\" fw=%<phn> pri=6 proto=%<cqus> duration=%<ttmsf> sent=%<psql> rcvd=%<cqhl> src=%<chi> dst=%<shi> dstname=%<shn> user=%<caun> op=%<cqhm> arg=\"%<cqup>\" result=%<pssc> ref=\"%<{Referer}cqh>\" agent=\"%<{user-agent}cqh>\" cache=%<crc>" }, { "name": "squid_seconds_only_timestamp", "format": "%<cqts> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<caun> %<phr>/%<shn> %<psct>" }, { "name": "squid", "format": "%<cqtq> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<caun> %<phr>/%<shn> %<psct>" }, { "name": "common", "format": "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl>" }, { "name": "extended", "format": "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> %<sssc> %<sscl> %<cqcl> %<pqcl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts>" }, { "name": "extended2", "format": "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> %<sssc> %<sscl> %<cqcl> %<pqcl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts> %<phr> %<cfsc> %<pfsc> %<crc>" } ], "logs": [ { "filename": "squid", "format": "squid", "mode": "binary" } ] } }