diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..e32c27d --- /dev/null +++ b/.envrc @@ -0,0 +1,13 @@ +# reload when these files change +watch_file shell/* flake.nix +use flake || use nix + +#watch_file flake.nix +#watch_file shell.nix +# +#{ +# # shell gc root dir +# mkdir -p "$(direnv_layout_dir)" +# +# eval "$(nix print-dev-env --profile $(direnv_layout_dir)/flake-profile)" +#} || use nix diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml new file mode 100644 index 0000000..e474c17 --- /dev/null +++ b/.forgejo/workflows/check.yml @@ -0,0 +1,50 @@ +name: Flake checks +on: [pull_request] +env: + USER: ci + +jobs: + Check: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: https://code.forgejo.org/actions/checkout@v4 + + - uses: https://github.com/nixbuild/nix-quick-install-action@v26 + with: + load_nixConfig: false + nix_conf: | + substituters = https://cache.nixos.org/ https://nix-community.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= + keep-outputs = true + + - name: Calculate flake.lock hash + id: flake-lock-hash + run: | + echo "hash=$(md5sum flake.lock | awk '{print $1}')" >> $GITHUB_OUTPUT + + - name: Restore and cache Nix store + uses: https://github.com/nix-community/cache-nix-action@v4 + id: nix-store-cache + with: + key: cache-${{ runner.os }}-nix-store-${{ steps.flake-lock-hash.outputs.hash }} + restore-keys: | + cache-${{ runner.os }}-nix-store- + + gc-linux: true + gc-max-store-size-linux: 10000000000 + + purge-caches: true + purge-keys: cache-${{ runner.os }}-nix-store- + purge-created: true + purge-created-max-age: 42 + + # - name: Prepare cachix + # uses: https://github.com/cachix/cachix-action@v12 + # with: + # name: pub-solar + # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + + - name: Run flake checks + run: | + nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check diff --git a/.gitignore b/.gitignore index 092cd25..37acdb0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,13 @@ -.terraform -*.plan +result +.direnv +doc/index.html + +# Result of bud commands +vm +iso +doi + +pkgs/_sources/.shake* + +tags +/owners diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..99dd0cd --- /dev/null +++ b/flake.lock @@ -0,0 +1,342 @@ +{ + "nodes": { + "agenix": { + "inputs": { + "darwin": [ + "nix-darwin" + ], + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1703433843, + "narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=", + "owner": "ryantm", + "repo": "agenix", + "rev": "417caa847f9383e111d1397039c9d4337d024bf0", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "deploy-rs": { + "inputs": { + "flake-compat": [ + "flake-compat" + ], + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1703087360, + "narHash": "sha256-0VUbWBW8VyiDRuimMuLsEO4elGuUw/nc2WDeuO1eN1M=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "b709d63debafce9f5645a5ba550c9e0983b3d1f7", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "devshell": { + "inputs": { + "nixpkgs": [ + "erpnext", + "nixpkgs" + ], + "systems": [ + "erpnext", + "systems" + ] + }, + "locked": { + "lastModified": 1701787589, + "narHash": "sha256-ce+oQR4Zq9VOsLoh9bZT8Ip9PaMLcjjBUHVPzW5d7Cw=", + "owner": "numtide", + "repo": "devshell", + "rev": "44ddedcbcfc2d52a76b64fb6122f209881bd3e1e", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "erpnext": { + "inputs": { + "agenix": [ + "agenix" + ], + "devshell": "devshell", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1704557841, + "narHash": "sha256-KpAkdJnY1NV21zRRd8Tncw6nBerSv50qmz6pSpjsxLg=", + "ref": "main", + "rev": "7fc327263630e2f5ce693e8569a1072bd0cea67b", + "revCount": 49, + "type": "git", + "url": "https://git.pub.solar/axeman/erpnext-nix" + }, + "original": { + "ref": "main", + "type": "git", + "url": "https://git.pub.solar/axeman/erpnext-nix" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1704152458, + "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704099619, + "narHash": "sha256-QRVMkdxLmv+aKGjcgeEg31xtJEIsYq4i1Kbyw5EPS6g=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "7e398b3d76bc1503171b1364c9d4a07ac06f3851", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.11", + "repo": "home-manager", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704277720, + "narHash": "sha256-meAKNgmh3goankLGWqqpw73pm9IvXjEENJloF0coskE=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "0dd382b70c351f528561f71a0a7df82c9d2be9a4", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixos-flake": { + "locked": { + "lastModified": 1702145288, + "narHash": "sha256-apVeRT0kOnDejwwBwbwNccm+qq1l6+qUOiRKE0vK5qk=", + "owner": "srid", + "repo": "nixos-flake", + "rev": "4e422edf6b511f8e214b392cf1a0d4707a0399a4", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "nixos-flake", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1704458188, + "narHash": "sha256-f6BYEuIqnbrs6J/9m1/1VdkJ6d63hO9kUC09kTPuOqE=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "172385318068519900a7d71c1024242fa6af75f0", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704420045, + "narHash": "sha256-C36QmoJd5tdQ5R9MC1jM7fBkZW9zBUqbUCsgwS6j4QU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c1be43e8e837b8dbee2b3665a007e761680f0c3d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "agenix": "agenix", + "deploy-rs": "deploy-rs", + "erpnext": "erpnext", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixos-flake": "nixos-flake", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs", + "unstable": "unstable" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "unstable": { + "locked": { + "lastModified": 1704194953, + "narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f013635 --- /dev/null +++ b/flake.nix @@ -0,0 +1,100 @@ +{ + description = "Momo infra in nix"; + + nixConfig.extra-experimental-features = "nix-command flakes"; + + inputs = { + # Track channels with commits tested and built by hydra + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + + flake-compat.url = "github:edolstra/flake-compat"; + flake-compat.flake = false; + + nix-darwin.url = "github:lnl7/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + + home-manager.url = "github:nix-community/home-manager/release-23.11"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + flake-parts.url = "github:hercules-ci/flake-parts"; + nixos-flake.url = "github:srid/nixos-flake"; + + deploy-rs.url = "github:serokell/deploy-rs"; + deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; + deploy-rs.inputs.flake-compat.follows = "flake-compat"; + + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + agenix.inputs.darwin.follows = "nix-darwin"; + agenix.inputs.home-manager.follows = "home-manager"; + + nixos-hardware.url = "github:nixos/nixos-hardware"; + + erpnext.url = "git+https://git.pub.solar/axeman/erpnext-nix?ref=main"; + erpnext.inputs.nixpkgs.follows = "nixpkgs"; + erpnext.inputs.agenix.follows = "agenix"; + }; + + outputs = inputs @ {self, ...}: + inputs.flake-parts.lib.mkFlake {inherit inputs;} { + debug = true; + systems = [ + "x86_64-linux" + ]; + + imports = [ + inputs.nixos-flake.flakeModule + ./lib + ./modules + ./hosts + ./users + ./overlays + ]; + + perSystem = args @ { + system, + pkgs, + config, + ... + }: { + _module.args = { + inherit inputs; + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.agenix.overlays.default + ]; + }; + unstable = import inputs.unstable {inherit system;}; + }; + + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + deploy-rs + drone-cli + nixpkgs-fmt + agenix + cachix + editorconfig-checker + nodePackages.prettier + nvfetcher + shellcheck + shfmt + alejandra + treefmt + nixos-generators + ]; + }; + }; + + flake = { + deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations { + pioneer-momo-koeln = { + hostname = "80.244.242.4"; + sshUser = "barkeeper"; + }; + }; + }; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..16415fc --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,19 @@ +{ + self, + inputs, + ... +}: { + flake = { + nixosConfigurations = { + pioneer-momo-koeln = self.nixos-flake.lib.mkLinuxSystem { + nixpkgs.hostPlatform = "x86_64-linux"; + imports = [ + self.nixosModules.base + ./pioneer-momo-koeln + self.nixosModules.barkeeper + inputs.erpnext.nixosModules.erpnext + ]; + }; + }; + }; +} diff --git a/hosts/pioneer-momo-koeln/caddy.nix b/hosts/pioneer-momo-koeln/caddy.nix new file mode 100644 index 0000000..b0c77d2 --- /dev/null +++ b/hosts/pioneer-momo-koeln/caddy.nix @@ -0,0 +1,18 @@ +{config, ...}: { + services.caddy = { + enable = true; + email = "wg-tooling@list.momo.koeln"; + virtualHosts = { + "auth.momo.koeln" = { + logFormat = '' + output discard + ''; + extraConfig = '' + reverse_proxy :8080 + ''; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [80 443]; +} diff --git a/hosts/pioneer-momo-koeln/configuration.nix b/hosts/pioneer-momo-koeln/configuration.nix new file mode 100644 index 0000000..b52f7b4 --- /dev/null +++ b/hosts/pioneer-momo-koeln/configuration.nix @@ -0,0 +1,34 @@ +{ + config, + latestModulesPath, + lib, + pkgs, + ... +}: { + imports = [ + ./caddy.nix + ./keycloak.nix + ./erpnext.nix + ]; + + time.timeZone = "Europe/Berlin"; + + networking = { + useDHCP = false; + + interfaces.enp1s0.ipv4.addresses = [ + { + address = "80.244.242.4"; + prefixLength = 29; + } + ]; + + defaultGateway = "80.244.242.1"; + nameservers = ["95.129.51.51" "80.244.244.244"]; + }; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + system.stateVersion = "22.05"; +} diff --git a/hosts/pioneer-momo-koeln/default.nix b/hosts/pioneer-momo-koeln/default.nix new file mode 100644 index 0000000..187a110 --- /dev/null +++ b/hosts/pioneer-momo-koeln/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/hosts/pioneer-momo-koeln/erpnext.nix b/hosts/pioneer-momo-koeln/erpnext.nix new file mode 100644 index 0000000..6deb759 --- /dev/null +++ b/hosts/pioneer-momo-koeln/erpnext.nix @@ -0,0 +1,38 @@ +{ + config, + lib, + inputs, + pkgs, + flake, + ... +}: { + age.secrets.erpnext-admin-password = { + file = "${flake.self}/secrets/erpnext-admin-password.age"; + mode = "700"; + owner = "erpnext"; + }; + age.secrets.erpnext-db-root-password = { + file = "${flake.self}/secrets/erpnext-db-root-password.age"; + mode = "700"; + owner = "erpnext"; + }; + age.secrets.erpnext-db-user-password = { + file = "${flake.self}/secrets/erpnext-db-user-password.age"; + mode = "700"; + owner = "erpnext"; + }; + + # erpnext + services.erpnext = { + enable = true; + domain = "erp.momo.koeln"; + + # Secrets + adminPasswordFile = config.age.secrets.erpnext-admin-password.path; + database.rootPasswordFile = config.age.secrets.erpnext-db-root-password.path; + database.userPasswordFile = config.age.secrets.erpnext-db-user-password.path; + + # Required to enable caddy + caddy = {}; + }; +} diff --git a/hosts/pioneer-momo-koeln/hardware-configuration.nix b/hosts/pioneer-momo-koeln/hardware-configuration.nix new file mode 100644 index 0000000..a1a65bf --- /dev/null +++ b/hosts/pioneer-momo-koeln/hardware-configuration.nix @@ -0,0 +1,54 @@ +{ + config, + pkgs, + lib, + ... +}: { + boot.loader.systemd-boot.enable = false; + boot.loader.grub = { + enable = true; + devices = ["/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-1"]; + }; + + boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + boot.initrd.luks.devices."cryptroot" = { + device = "/dev/disk/by-uuid/bf890962-9f43-4c44-a0df-64cabd303662"; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/7eb8989a-6ec4-405f-8810-06486f7621c1"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1fd053f8-725b-418d-aed1-aee71dac2b62"; + fsType = "ext4"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/2f114633-5b71-46ab-88be-997b27927269";} + ]; + + networking = { + defaultGateway = { + address = "80.244.242.1"; + interface = "enp1s0"; + }; + nameservers = ["95.129.51.51" "80.244.244.244"]; + interfaces.enp1s0 = { + useDHCP = false; + ipv4.addresses = [ + { + address = "80.244.242.4"; + prefixLength = 29; + } + ]; + }; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/pioneer-momo-koeln/keycloak.nix b/hosts/pioneer-momo-koeln/keycloak.nix new file mode 100644 index 0000000..1c3cc18 --- /dev/null +++ b/hosts/pioneer-momo-koeln/keycloak.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + inputs, + pkgs, + flake, + ... +}: { + age.secrets.keycloak-database-password = { + file = "${flake.self}/secrets/keycloak-database-password.age"; + mode = "700"; + }; + + # keycloak + services.keycloak = { + enable = true; + database.passwordFile = config.age.secrets.keycloak-database-password.path; + settings = { + hostname = "auth.momo.koeln"; + http-host = "127.0.0.1"; + http-port = 8080; + proxy = "edge"; + }; + }; +} diff --git a/lib/add-local-hostname.nix b/lib/add-local-hostname.nix new file mode 100644 index 0000000..2e15ff5 --- /dev/null +++ b/lib/add-local-hostname.nix @@ -0,0 +1,4 @@ +{lib}: hostnames: { + "127.0.0.1" = hostnames; + "::1" = hostnames; +} diff --git a/lib/compat/default.nix b/lib/compat/default.nix new file mode 100644 index 0000000..fc1bc0c --- /dev/null +++ b/lib/compat/default.nix @@ -0,0 +1,21 @@ +let + lock = builtins.fromJSON (builtins.readFile builtins.path { + path = ../../flake.lock; + name = "lockPath"; + }); + flake = + import + ( + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { + src = builtins.path { + path = ../../.; + name = "projectRoot"; + }; + }; +in + flake diff --git a/lib/compat/nixos/default.nix b/lib/compat/nixos/default.nix new file mode 100644 index 0000000..617c6a9 --- /dev/null +++ b/lib/compat/nixos/default.nix @@ -0,0 +1,9 @@ +{...}: let + inherit (default.inputs.nixos) lib; + + host = configs.${hostname} or configs.PubSolarOS; + configs = default.nixosConfigurations; + default = (import ../.).defaultNix; + hostname = lib.fileContents /etc/hostname; +in + host diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..90a7f3f --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,21 @@ +{ + lib, + inputs, + ... +}: { + # Configuration common to all Linux systems + flake = { + lib = let + callLibs = file: import file {inherit lib;}; + in rec { + ## Define your own library functions here! + #id = x: x; + ## Or in files, containing functions that take {lib} + #foo = callLibs ./foo.nix; + ## In configs, they can be used under "lib.our" + + deploy = import ./deploy.nix {inherit inputs lib;}; + addLocalHostname = callLibs ./add-local-hostname.nix; + }; + }; +} diff --git a/lib/deploy.nix b/lib/deploy.nix new file mode 100644 index 0000000..65fd5a5 --- /dev/null +++ b/lib/deploy.nix @@ -0,0 +1,64 @@ +/* +* The contents of this file are adapted from digga +* https://github.com/divnix/digga +* +* Licensed under the MIT license +*/ +{ + lib, + inputs, +}: let + getFqdn = c: let + net = c.config.networking; + fqdn = + if (net ? domain) && (net.domain != null) + then "${net.hostName}.${net.domain}" + else net.hostName; + in + fqdn; +in { + mkDeployNodes = systemConfigurations: extraConfig: + /* + * + Synopsis: mkNodes _systemConfigurations_ _extraConfig_ + + Generate the `nodes` attribute expected by deploy-rs + where _systemConfigurations_ are `nodes`. + + _systemConfigurations_ should take the form of a flake's + _nixosConfigurations_. Note that deploy-rs does not currently support + deploying to darwin hosts. + + _extraConfig_, if specified, will be merged into each of the + nodes' configurations. + + Example _systemConfigurations_ input: + + ``` + { + hostname-1 = { + fastConnection = true; + sshOpts = [ "-p" "25" ]; + }; + hostname-2 = { + sshOpts = [ "-p" "19999" ]; + sshUser = "root"; + }; + } + ``` + * + */ + lib.recursiveUpdate + (lib.mapAttrs + ( + _: c: { + hostname = getFqdn c; + profiles.system = { + user = "root"; + path = inputs.deploy-rs.lib.${c.pkgs.stdenv.hostPlatform.system}.activate.nixos c; + }; + } + ) + systemConfigurations) + extraConfig; +} diff --git a/modules/adb/default.nix b/modules/adb/default.nix new file mode 100644 index 0000000..7a0a83d --- /dev/null +++ b/modules/adb/default.nix @@ -0,0 +1,15 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + programs.adb.enable = true; + + users.users."${psCfg.user.name}" = { + extraGroups = ["adbusers"]; + }; +} diff --git a/modules/arduino/default.nix b/modules/arduino/default.nix new file mode 100644 index 0000000..8b0e51d --- /dev/null +++ b/modules/arduino/default.nix @@ -0,0 +1,17 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + users.users."${psCfg.user.name}" = { + extraGroups = ["dialout"]; + packages = with pkgs; [ + arduino + arduino-cli + ]; + }; +} diff --git a/modules/audio/.config/vimpc/vimpcrc b/modules/audio/.config/vimpc/vimpcrc new file mode 100644 index 0000000..c4b5fcc --- /dev/null +++ b/modules/audio/.config/vimpc/vimpcrc @@ -0,0 +1,53 @@ +echo Parsing config file + +" Set the default tab +set window playlist + +" Set the windows to show at startup +set windows playlist,library,browse,help + +" Stop playing music when we quit +"set stoponquit + +" A silly example of an alias +"alias smiths deleteall; findartist! The Smiths; play 1 + +" Example maps +" map the F key to change to the browse window, go to the first line and enter search mode +"map F :browsegg/ +" map @ to switch to add next, add a song, then change back +"map @ :set add nexta:set add end + +map i +map j +map k + +map h i + +map q ZQ +map Q ZQ + +map l :tabnext +map j :tabprevious + +" Turn consume on when we connect +"consume on + +" Ensure that the database is up to date each connect +update + +" A more complex example, When we start vimpc +" - clear the playlist +" - add all songs +" - shuffle +" - start playling +"deleteall +"addall +"shuffle +"play 1 + +" Color the statusline and tabs +" highlight status blackbg +" highlight tab blackbg + +echo Config File Complete diff --git a/modules/audio/default.nix b/modules/audio/default.nix new file mode 100644 index 0000000..f3ce232 --- /dev/null +++ b/modules/audio/default.nix @@ -0,0 +1,39 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in { + users.users."${psCfg.user.name}" = { + extraGroups = ["audio"]; + packages = with pkgs; [ + # easyeffects, e.g. for microphone noise filtering + easyeffects + mu + pavucontrol + pa_applet + playerctl + # Needed for pactl cmd, until pw-cli is more mature (vol up/down hotkeys?) + pulseaudio + vimpc + ]; + }; + + home-manager.users."${psCfg.user.name}" = { + xdg.configFile."vimpc/vimpcrc".source = ./.config/vimpc/vimpcrc; + systemd.user.services.easyeffects = import ./easyeffects.service.nix pkgs; + }; + + # rtkit is optional but recommended + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/modules/audio/easyeffects.service.nix b/modules/audio/easyeffects.service.nix new file mode 100644 index 0000000..c172e2b --- /dev/null +++ b/modules/audio/easyeffects.service.nix @@ -0,0 +1,7 @@ +pkgs: { + Service = { + Type = "dbus"; + BusName = "com.github.wwmm.easyeffects"; + ExecStart = "${pkgs.easyeffects}/bin/easyeffects --gapplication-service"; + }; +} diff --git a/modules/bluetooth/default.nix b/modules/bluetooth/default.nix new file mode 100644 index 0000000..4ce05b1 --- /dev/null +++ b/modules/bluetooth/default.nix @@ -0,0 +1,35 @@ +{ + lib, + config, + pkgs, + ... +}: { + hardware.bluetooth = { + enable = true; + # Disable bluetooth on startup to save battery + powerOnBoot = false; + # Disable useless SIM Access Profile plugin + disabledPlugins = [ + "sap" + ]; + settings = { + General = { + # Enables experimental features and interfaces. + # Makes BlueZ Battery Provider available + Experimental = true; + }; + }; + }; + + services.blueman.enable = true; + environment.etc."wireplumber/bluetooth.lua.d/51-bluez-config.lua" = { + text = '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + ''; + }; +} diff --git a/modules/core/boot.nix b/modules/core/boot.nix new file mode 100644 index 0000000..ab45fe4 --- /dev/null +++ b/modules/core/boot.nix @@ -0,0 +1,35 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.pub-solar.core; +in { + options.pub-solar.core.disk-encryption-active = mkOption { + type = types.bool; + default = true; + description = "Whether it should be assumed that there is a cryptroot device"; + }; + + config = { + boot = { + # Mount / luks device in initrd + # Allow fstrim to work on it. + initrd = mkIf cfg.disk-encryption-active { + luks.devices."cryptroot" = { + allowDiscards = true; + }; + }; + + loader.systemd-boot.enable = lib.mkDefault true; + + # Use latest LTS linux kernel by default + kernelPackages = lib.mkDefault pkgs.linuxPackages_6_6; + + # Support ntfs drives + supportedFilesystems = ["ntfs"]; + }; + }; +} diff --git a/modules/core/default.nix b/modules/core/default.nix new file mode 100644 index 0000000..3e388c7 --- /dev/null +++ b/modules/core/default.nix @@ -0,0 +1,38 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.pub-solar.core; + psCfg = config.pub-solar; +in { + imports = [ + ./boot.nix + ./hibernation.nix + ./i18n.nix + ./networking.nix + ./packages.nix + ]; + + # Service that makes Out of Memory Killer more effective + services.earlyoom.enable = true; + + services.logind.lidSwitch = "hibernate"; + + services.tor.settings = { + UseBridges = true; + }; + + # The options below are directly taken from or inspired by + # https://xeiaso.net/blog/paranoid-nixos-2021-07-18 + + # Limit the use of sudo to the group wheel + security.sudo.execWheelOnly = true; + + # Remove the complete default environment of packages like + # nano, perl and rsync + environment.defaultPackages = lib.mkForce []; + + # fileSystems."/".options = [ "noexec" ]; +} diff --git a/modules/core/hibernation.nix b/modules/core/hibernation.nix new file mode 100644 index 0000000..74befd7 --- /dev/null +++ b/modules/core/hibernation.nix @@ -0,0 +1,36 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.pub-solar.core.hibernation; +in { + options.pub-solar.core.hibernation = { + enable = mkOption { + type = types.bool; + default = false; + description = "Whether the device can hibernate. This creates a swapfile at /swapfile."; + }; + + resumeDevice = mkOption { + type = types.nullOr types.str; + default = null; + description = "The location of the hibernation resume swap file."; + }; + + resumeOffset = mkOption { + type = types.nullOr types.int; + default = null; + description = "The swap file offset. Can be found by running `filefrag -v $swap_file_location`. See https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file"; + }; + }; + + config = { + boot = mkIf cfg.enable { + resumeDevice = mkIf (cfg.resumeDevice != null) cfg.resumeDevice; + kernelParams = mkIf (cfg.resumeOffset != null) ["resume_offset=${builtins.toString cfg.resumeOffset}"]; + }; + }; +} diff --git a/modules/core/i18n.nix b/modules/core/i18n.nix new file mode 100644 index 0000000..1b52428 --- /dev/null +++ b/modules/core/i18n.nix @@ -0,0 +1,20 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; { + config = { + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + console = { + font = "Lat2-Terminus16"; + }; + i18n = { + defaultLocale = "en_US.UTF-8"; + }; + }; +} diff --git a/modules/core/networking.nix b/modules/core/networking.nix new file mode 100644 index 0000000..4539c16 --- /dev/null +++ b/modules/core/networking.nix @@ -0,0 +1,39 @@ +{ + flake, + config, + pkgs, + lib, + ... +}: { + # disable NetworkManager and systemd-networkd -wait-online by default + systemd.services.NetworkManager-wait-online.enable = lib.mkDefault false; + systemd.services.systemd-networkd-wait-online.enable = lib.mkDefault false; + + networking.networkmanager = { + # Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff. + enable = lib.mkDefault true; + # not as stable as wpa_supplicant yet, also more trouble with 5 GHz networks + #wifi.backend = "iwd"; + }; + + networking.firewall.enable = true; + + # For rage encryption, all hosts need a ssh key pair + services.openssh = { + enable = true; + allowSFTP = lib.mkDefault false; + + openFirewall = lib.mkDefault false; + + settings.PasswordAuthentication = lib.mkDefault false; + settings.KbdInteractiveAuthentication = false; + + extraConfig = '' + AllowTcpForwarding yes + X11Forwarding no + AllowAgentForwarding no + AllowStreamLocalForwarding no + AuthenticationMethods publickey + ''; + }; +} diff --git a/modules/core/packages.nix b/modules/core/packages.nix new file mode 100644 index 0000000..3dcf7d0 --- /dev/null +++ b/modules/core/packages.nix @@ -0,0 +1,28 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + psCfg = config.pub-solar; + cfg = config.pub-solar.core; +in { + environment.systemPackages = with pkgs; [ + # Core unix utility packages + coreutils-full + dnsutils + inetutils + progress + pciutils + usbutils + diffutils + findutils + exfat + + gitMinimal + + btop + mtr + ]; +} diff --git a/modules/crypto/default.nix b/modules/crypto/default.nix new file mode 100644 index 0000000..e959010 --- /dev/null +++ b/modules/crypto/default.nix @@ -0,0 +1,33 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + services.udev.packages = [pkgs.yubikey-personalization]; + services.dbus.packages = [pkgs.gcr]; + services.pcscd.enable = true; + + services.gnome.gnome-keyring.enable = true; + + users.users."${psCfg.user.name}".packages = with pkgs; [ + libsecret + ]; + + home-manager.users."${psCfg.user.name}" = { + systemd.user.services.polkit-gnome-authentication-agent = import ./polkit-gnome-authentication-agent.service.nix pkgs; + + services.gpg-agent = { + enable = true; + pinentryFlavor = "gnome3"; + verbose = true; + }; + + programs.gpg = { + enable = true; + }; + }; +} diff --git a/modules/crypto/polkit-gnome-authentication-agent.service.nix b/modules/crypto/polkit-gnome-authentication-agent.service.nix new file mode 100644 index 0000000..ffa5b78 --- /dev/null +++ b/modules/crypto/polkit-gnome-authentication-agent.service.nix @@ -0,0 +1,15 @@ +pkgs: { + Unit = { + Description = "Legacy polkit authentication agent for GNOME"; + Documentation = ["https://gitlab.freedesktop.org/polkit/polkit/"]; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/ddclient/default.nix b/modules/ddclient/default.nix new file mode 100644 index 0000000..efcc9bc --- /dev/null +++ b/modules/ddclient/default.nix @@ -0,0 +1,269 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.services.ddclient; + boolToStr = bool: + if bool + then "yes" + else "no"; + dataDir = "/var/lib/ddclient"; + StateDirectory = builtins.baseNameOf dataDir; + RuntimeDirectory = StateDirectory; + + usev4 = + if cfg.usev4 != "" + then "usev4=${cfg.usev4}" + else ""; + usev6 = + if cfg.usev6 != "" + then "usev6=${cfg.usev6}" + else ""; + + configFile' = pkgs.writeText "ddclient.conf" '' + # This file can be used as a template for configFile or is automatically generated by Nix options. + use=no + ${usev4} + ${usev6} + cache=${dataDir}/ddclient.cache + foreground=yes + login=${cfg.username} + password=${ + if cfg.protocol == "nsupdate" + then "/run/${RuntimeDirectory}/ddclient.key" + else "@password_placeholder@" + } + protocol=${cfg.protocol} + ${lib.optionalString (cfg.script != "") "script=${cfg.script}"} + ${lib.optionalString (cfg.server != "") "server=${cfg.server}"} + ${lib.optionalString (cfg.zone != "") "zone=${cfg.zone}"} + ssl=${boolToStr cfg.ssl} + wildcard=yes + quiet=${boolToStr cfg.quiet} + verbose=${boolToStr cfg.verbose} + ${cfg.extraConfig} + ${lib.concatStringsSep "," cfg.domains} + ''; + configFile = + if (cfg.configFile != null) + then cfg.configFile + else configFile'; + + preStart = '' + install --mode=600 --owner=$USER ${configFile} /run/${RuntimeDirectory}/ddclient.conf + ${lib.optionalString (cfg.configFile == null) ( + if (cfg.protocol == "nsupdate") + then '' + install --mode=600 --owner=$USER ${cfg.passwordFile} /run/${RuntimeDirectory}/ddclient.key + '' + else if (cfg.passwordFile != null) + then '' + "${pkgs.replace-secret}/bin/replace-secret" "@password_placeholder@" "${cfg.passwordFile}" "/run/${RuntimeDirectory}/ddclient.conf" + '' + else '' + sed -i '/^password=@password_placeholder@$/d' /run/${RuntimeDirectory}/ddclient.conf + '' + )} + ''; +in + with lib; { + disabledModules = [ + "services/networking/ddclient.nix" + ]; + + imports = [ + (mkChangedOptionModule ["services" "ddclient" "domain"] ["services" "ddclient" "domains"] + (config: let + value = getAttrFromPath ["services" "ddclient" "domain"] config; + in + if value != "" + then [value] + else [])) + (mkRemovedOptionModule ["services" "ddclient" "homeDir"] "") + (mkRemovedOptionModule ["services" "ddclient" "password"] "Use services.ddclient.passwordFile instead.") + ]; + + ###### interface + + options = { + services.ddclient = with lib.types; { + enable = mkOption { + default = false; + type = bool; + description = lib.mdDoc '' + Whether to synchronise your machine's IP address with a dynamic DNS provider (e.g. dyndns.org). + ''; + }; + + package = mkOption { + type = package; + default = pkgs.ddclient; + defaultText = lib.literalExpression "pkgs.ddclient"; + description = lib.mdDoc '' + The ddclient executable package run by the service. + ''; + }; + + domains = mkOption { + default = [""]; + type = listOf str; + description = lib.mdDoc '' + Domain name(s) to synchronize. + ''; + }; + + username = mkOption { + # For `nsupdate` username contains the path to the nsupdate executable + default = lib.optionalString (config.services.ddclient.protocol == "nsupdate") "${pkgs.bind.dnsutils}/bin/nsupdate"; + defaultText = ""; + type = str; + description = lib.mdDoc '' + User name. + ''; + }; + + passwordFile = mkOption { + default = null; + type = nullOr str; + description = lib.mdDoc '' + A file containing the password or a TSIG key in named format when using the nsupdate protocol. + ''; + }; + + interval = mkOption { + default = "10min"; + type = str; + description = lib.mdDoc '' + The interval at which to run the check and update. + See {command}`man 7 systemd.time` for the format. + ''; + }; + + configFile = mkOption { + default = null; + type = nullOr path; + description = lib.mdDoc '' + Path to configuration file. + When set this overrides the generated configuration from module options. + ''; + example = "/root/nixos/secrets/ddclient.conf"; + }; + + protocol = mkOption { + default = "dyndns2"; + type = str; + description = lib.mdDoc '' + Protocol to use with dynamic DNS provider (see https://sourceforge.net/p/ddclient/wiki/protocols). + ''; + }; + + server = mkOption { + default = ""; + type = str; + description = lib.mdDoc '' + Server address. + ''; + }; + + ssl = mkOption { + default = true; + type = bool; + description = lib.mdDoc '' + Whether to use SSL/TLS to connect to dynamic DNS provider. + ''; + }; + + quiet = mkOption { + default = false; + type = bool; + description = lib.mdDoc '' + Print no messages for unnecessary updates. + ''; + }; + + script = mkOption { + default = ""; + type = str; + description = lib.mdDoc '' + script as required by some providers. + ''; + }; + + usev4 = mkOption { + default = "webv4, webv4=checkip.dyndns.com/, webv4-skip='Current IP Address: '"; + type = str; + description = lib.mdDoc '' + Method to determine the IP address to send to the dynamic DNS provider. + ''; + }; + + usev6 = mkOption { + default = ""; + type = str; + description = lib.mdDoc '' + Method to determine the IP address to send to the dynamic DNS provider. + ''; + }; + + verbose = mkOption { + default = false; + type = bool; + description = lib.mdDoc '' + Print verbose information. + ''; + }; + + zone = mkOption { + default = ""; + type = str; + description = lib.mdDoc '' + zone as required by some providers. + ''; + }; + + extraConfig = mkOption { + default = ""; + type = lines; + description = lib.mdDoc '' + Extra configuration. Contents will be added verbatim to the configuration file. + + ::: {.note} + `daemon` should not be added here because it does not work great with the systemd-timer approach the service uses. + ::: + ''; + }; + }; + }; + + ###### implementation + + config = mkIf config.services.ddclient.enable { + systemd.services.ddclient = { + description = "Dynamic DNS Client"; + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + restartTriggers = optional (cfg.configFile != null) cfg.configFile; + + serviceConfig = { + DynamicUser = true; + RuntimeDirectoryMode = "0700"; + inherit RuntimeDirectory; + inherit StateDirectory; + Type = "oneshot"; + ExecStartPre = "!${pkgs.writeShellScript "ddclient-prestart" preStart}"; + ExecStart = "${lib.getBin cfg.package}/bin/ddclient -file /run/${RuntimeDirectory}/ddclient.conf"; + }; + }; + + systemd.timers.ddclient = { + description = "Run ddclient"; + wantedBy = ["timers.target"]; + timerConfig = { + OnBootSec = cfg.interval; + OnUnitInactiveSec = cfg.interval; + }; + }; + }; + } diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..58ed2c0 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,42 @@ +{ + self, + inputs, + ... +}: { + flake = { + nixosModules = rec { + audio = import ./audio; + bluetooth = import ./bluetooth; + core = import ./core; + crypto = import ./crypto; + desktop-extended = import ./desktop-extended; + docker = import ./docker; + #email = import ./email; + #gaming = import ./gaming; + graphical = import ./graphical; + #invoiceplane = import ./invoiceplane; + nix = import ./nix; + nextcloud = import ./nextcloud; + office = import ./office; + printing = import ./printing; + terminal-life = import ./terminal-life; + user = import ./user; + virtualisation = import ./virtualisation; + #wireguard-client = import ./wireguard-client; + + base.imports = [ + self.nixosModules.home-manager + inputs.agenix.nixosModules.default + + self.nixosModules.overlays + self.nixosModules.core + self.nixosModules.crypto + self.nixosModules.nix + self.nixosModules.terminal-life + + self.nixosModules.root + self.nixosModules.user + ]; + }; + }; +} diff --git a/modules/desktop-extended/default.nix b/modules/desktop-extended/default.nix new file mode 100644 index 0000000..d0db042 --- /dev/null +++ b/modules/desktop-extended/default.nix @@ -0,0 +1,49 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + users.users."${psCfg.user.name}".packages = with pkgs; [ + ungoogled-chromium + wine + + gimp + inkscape + tigervnc + nodejs + + signal-desktop + tdesktop + element-desktop + + # Nix specific utilities + alejandra + manix + nix-output-monitor + nix-tree + nvd + nixpkgs-review + nix-search-cli + ]; + + fonts = { + packages = with pkgs; [ + dejavu_fonts + fira-code + fira-code-symbols + #google-fonts + lato + montserrat + nerdfonts + noto-fonts + noto-fonts-cjk + open-sans + powerline-fonts + source-sans-pro + ]; + }; +} diff --git a/modules/docker/default.nix b/modules/docker/default.nix new file mode 100644 index 0000000..b7aa344 --- /dev/null +++ b/modules/docker/default.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + virtualisation.docker.enable = true; + virtualisation.docker.package = pkgs.docker_24; + + users.users."${psCfg.user.name}" = { + extraGroups = ["docker"]; + }; + + environment.systemPackages = with pkgs; [ + docker-compose + ]; +} diff --git a/modules/email/default.nix b/modules/email/default.nix new file mode 100644 index 0000000..d9530d8 --- /dev/null +++ b/modules/email/default.nix @@ -0,0 +1,54 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + users.users."${psCfg.user.name}".packages = with pkgs; [ + w3m + urlscan + neomutt + offlineimap + msmtp + mailto-mutt + ]; + + home-manager.users."${psCfg.user.name}" = { + programs.offlineimap = { + enable = true; + pythonFile = builtins.readFile ./offlineimap.py; + }; + + xdg.configFile."mutt/muttrc".source = ./.config/mutt/muttrc; + xdg.configFile."mutt/base16.muttrc".source = ./.config/mutt/base16.muttrc; + xdg.configFile."mutt/mailcap".source = ./.config/mutt/mailcap; + xdg.configFile."offlineimap/functions.py".source = ./.config/offlineimap/functions.py; + + xdg.configFile."mutt/accounts.muttrc".text = '' + source ./hello@benjaminbaedorf.eu.muttrc + + macro index 'source $XDG_CONFIG_HOME/mutt/hello@benjaminbaedorf.eu.muttrc!' + macro index 'source $XDG_CONFIG_HOME/mutt/benjamin.baedorf@rwth-aachen.de.muttrc!' + macro index 'source $XDG_CONFIG_HOME/mutt/byb@miom.space.muttrc!' + macro index 'source $XDG_CONFIG_HOME/mutt/mail@b12f.io.muttrc!' + macro index 'source $XDG_CONFIG_HOME/mutt/admins@pub.solar.muttrc!' + macro index 'source $XDG_CONFIG_HOME/mutt/crew@pub.solar.muttrc!' + ''; + xdg.configFile."mutt/hello@benjaminbaedorf.eu.muttrc".source = ./.config/mutt + "/hello@benjaminbaedorf.eu.muttrc"; + xdg.configFile."mutt/benjamin.baedorf@rwth-aachen.de.muttrc".source = ./.config/mutt + "/benjamin.baedorf@rwth-aachen.de.muttrc"; + xdg.configFile."mutt/hello@benjaminbaedorf.eu.signature".source = ./.config/mutt + "/hello@benjaminbaedorf.eu.signature"; + xdg.configFile."mutt/byb@miom.space.muttrc".source = ./.config/mutt + "/byb@miom.space.muttrc"; + xdg.configFile."mutt/byb@miom.space.signature".source = ./.config/mutt + "/byb@miom.space.signature"; + xdg.configFile."mutt/mail@b12f.io.muttrc".source = ./.config/mutt + "/mail@b12f.io.muttrc"; + xdg.configFile."mutt/mail@b12f.io.signature".source = ./.config/mutt + "/mail@b12f.io.signature"; + xdg.configFile."mutt/admins@pub.solar.muttrc".source = ./.config/mutt + "/admins@pub.solar.muttrc"; + xdg.configFile."mutt/admins@pub.solar.signature".source = ./.config/mutt + "/admins@pub.solar.signature"; + xdg.configFile."mutt/crew@pub.solar.muttrc".source = ./.config/mutt + "/crew@pub.solar.muttrc"; + xdg.configFile."mutt/crew@pub.solar.signature".source = ./.config/mutt + "/crew@pub.solar.signature"; + xdg.configFile."offlineimap/config".source = ./.config/offlineimap/config; + xdg.configFile."msmtp/config".source = ./.config/msmtp/config; + }; +} diff --git a/modules/email/offlineimap.py b/modules/email/offlineimap.py new file mode 100644 index 0000000..110b9e4 --- /dev/null +++ b/modules/email/offlineimap.py @@ -0,0 +1,9 @@ +#! /usr/bin/env python2 +import os +import subprocess + +def get_env(key): + return os.getenv(key) + +def get_secret(*attributes): + return subprocess.check_output(["secret-tool", "lookup"] + list(attributes)) diff --git a/modules/gaming/default.nix b/modules/gaming/default.nix new file mode 100644 index 0000000..ba654d1 --- /dev/null +++ b/modules/gaming/default.nix @@ -0,0 +1,21 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + programs.steam.enable = true; + nixpkgs.config.packageOverrides = pkgs: { + steam = pkgs.steam.override {}; + }; + + users.users."${psCfg.user.name}".packages = with pkgs; [ + playonlinux + godot + obs-studio + obs-studio-plugins.wlrobs + ]; +} diff --git a/modules/graphical/.Xdefaults b/modules/graphical/.Xdefaults new file mode 100644 index 0000000..fcfcb22 --- /dev/null +++ b/modules/graphical/.Xdefaults @@ -0,0 +1,62 @@ +Xft.dpi: 96 +Xft.antialias: true +Xft.hinting: true +Xft.rgba: rgb +Xft.autohint: false +Xft.hintstyle: hintslight +Xft.lcdfilter: lcddefault + +! Base16 Burn +! Scheme: Benjamin Bädorf + +#define base00 #1a181a +#define base01 #2d2a2e +#define base02 #303030 +#define base03 #949494 +#define base04 #d3d1d4 +#define base05 #e3e1e4 +#define base06 #303030 +#define base07 #ff5f5f +#define base08 #f85e84 +#define base09 #df5923 +#define base0A #e5c463 +#define base0B #9ecd6f +#define base0C #ef9062 +#define base0D #7accd7 +#define base0E #ab9df2 +#define base0F #d70000 + +*foreground: base05 +#ifdef background_opacity +*background: [background_opacity]base00 +#else +*background: base00 +#endif +*cursorColor: base05 + +*color0: base00 +*color1: base08 +*color2: base0B +*color3: base0A +*color4: base0D +*color5: base0E +*color6: base0C +*color7: base05 + +*color8: base03 +*color9: base08 +*color10: base0B +*color11: base0A +*color12: base0D +*color13: base0E +*color14: base0C +*color15: base07 + +! Note: colors beyond 15 might not be loaded (e.g., xterm, urxvt), +! use 'shell' template to set these if necessary +*color16: base09 +*color17: base0F +*color18: base01 +*color19: base02 +*color20: base04 +*color21: base06 diff --git a/modules/graphical/.config/libinput-gestures.conf b/modules/graphical/.config/libinput-gestures.conf new file mode 100644 index 0000000..17b8777 --- /dev/null +++ b/modules/graphical/.config/libinput-gestures.conf @@ -0,0 +1,198 @@ +# Configuration file for libinput-gestures. +# Mark Blakeney, Sep 2015 +# +# The default configuration file exists at /etc/libinput-gestures.conf +# but a user can create a personal custom configuration file at +# ~/.config/libinput-gestures.conf. +# +# Lines starting with '#' and blank lines are ignored. Currently +# "gesture" and "device" configuration keywords are supported as +# described below. The keyword can optionally be appended with a ":" (to +# maintain compatibility with original format configuration files). +# +# Each gesture line has 3 [or 4] arguments separated by whitespace: +# +# action motion [finger_count] command +# +# where action and motion is either: +# swipe up +# swipe down +# swipe left +# swipe right +# swipe left_up +# swipe left_down +# swipe right_up +# swipe right_down +# pinch in +# pinch out +# pinch clockwise +# pinch anticlockwise +# +# command is the remainder of the line and is any valid shell command + +# arguments. +# +# finger_count is a single numeric digit and is optional (and is +# typically 3 or 4). If specified then the command is executed when +# exactly that number of fingers is used in the gesture. If not +# specified then the command is executed when that gesture is executed +# with any number of fingers. Gesture lines specified with finger_count +# have priority over the same gesture specified without any +# finger_count. +# +# Typically command will be xdotool, or wmctrl. See "man xdotool" for +# the many things you can action with that tool. Note that unfortunately +# xdotool does not work with native Wayland clients. + +############################################################################### +# SWIPE GESTURES: +############################################################################### + +# Note the default is an "internal" command that uses wmctrl to switch +# workspaces and, unlike xdotool, works on both Xorg and Wayland (via +# XWayland). It also can be configured for vertical and horizontal +# switching over tabular workspaces, as per the example below. You can +# also add "-w" to the internal command to allow wrapping workspaces. + +# Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg) +#gesture swipe up _internal ws_up + +# NOTE ABOUT FINGER COUNT: +# The above command will configure this command for all fingers (i.e. 3 +# for 4) but to configure it for 3 fingers only, change it to: +# gesture swipe up 3 _internal ws_up +# Then you can configure something else for 4 fingers or leave 4 fingers +# unconfigured. You can configure an explicit finger count like this for +# all example commands in this configuration file. +# +gesture swipe up 3 ydotool key Super_L+Down +gesture swipe up 4 ydotool key Super_L+Ctrl+Right + +# Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg) +#gesture swipe down _internal ws_down +gesture swipe down 3 ydotool key Super_L+Up +gesture swipe down 4 ydotool key Super_L+Ctrl+Left + +# Browser go forward (works only for Xorg, and Xwayland clients) +gesture swipe left 3 ydotool key ctrl+] + +# Browser go back (works only for Xorg, and Xwayland clients) +gesture swipe right 3 ydotool key ctrl+[ + +# NOTE: If you don't use "natural" scrolling direction for your touchpad +# then you may want to swap the above default left/right and up/down +# configurations. + +# Optional extended swipe gestures, e.g. for browser tab navigation: +# +# Jump to next open browser tab +#gesture swipe right_up xdotool key control+Tab +#gesture swipe right_up xdotool key control+Next +gesture swipe right_up ydotool key ctrl+PageDown +# +# Jump to previous open browser tab +#gesture swipe left_up xdotool key control+shift+Tab +gesture swipe left_up ydotool key ctrl+PageUp +# +# Close current browser tab +# gesture swipe left_down xdotool key control+w +# +# Reopen and jump to last closed browser tab +# gesture swipe right_down xdotool key control+shift+t + +# Example of 8 static workspaces, e.g. using KDE virtual-desktops, +# arranged in 2 rows of 4 columns across using swipe up/down/left/right +# to navigate in fixed planes. You can also add the "-w/--wrap" option +# to allow wrapping in any direction. You must configure your virtual +# desktops with the same column dimension. +# gesture swipe up _internal --cols 4 ws_up +# gesture swipe down _internal --cols 4 ws_down +# gesture swipe left _internal --cols 4 ws_left +# gesture swipe right _internal --cols 4 ws_right +# +# Example of 16 static workspaces, e.g. using KDE virtual-desktops, +# arranged in 4 rows of 4 columns across using swipe up/down/left/right +# to navigate in fixed planes, and also using swipe +# left_up/left_down/right_up/right_down to navigate diagonally. You can +# also add the "-w/--wrap" option to allow wrapping in any direction +# and/or diagonally. You must configure your virtual desktops with the +# same column dimension. +# gesture swipe up _internal --cols 4 ws_up +# gesture swipe down _internal --cols 4 ws_down +# gesture swipe left _internal --cols 4 ws_left +# gesture swipe right _internal --cols 4 ws_right +# gesture swipe left_up _internal --cols 4 ws_left_up +# gesture swipe left_down _internal --cols 4 ws_left_down +# gesture swipe right_up _internal --cols 4 ws_right_up +# gesture swipe right_down _internal --cols 4 ws_right_down + +# Example virtual desktop switching for Ubuntu Unity/Compiz. The +# _internal command does not work for Compiz but you can explicitly +# configure the swipe commands to work for a Compiz virtual 2 +# dimensional desktop as follows: +# gesture swipe up xdotool key ctrl+alt+Up +# gesture swipe down xdotool key ctrl+alt+Down +# gesture swipe left xdotool key ctrl+alt+Left +# gesture swipe right xdotool key ctrl+alt+Right + +# Example to change audio volume: +# Note this only works on an Xorg desktop (not Wayland). +# gesture swipe up xdotool key XF86AudioRaiseVolume +# gesture swipe down xdotool key XF86AudioLowerVolume + +############################################################################### +# PINCH GESTURES: +############################################################################### + +# GNOME SHELL open/close overview (works for GNOME on Xorg only) +gesture pinch in ydotool key ctrl+- +gesture pinch out ydotool key ctrl+shift+= + +# KDE Plasma open/close overview +# gesture pinch in xdotool key ctrl+F9 +# gesture pinch out xdotool key ctrl+F9 + +# GNOME SHELL open/close overview (works for GNOME on Wayland and Xorg) +# Note since GNOME 3.24 on Wayland this is implemented natively so no +# real point configuring for Wayland. +# gesture pinch in dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' +# gesture pinch out dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' + +# Optional extended pinch gestures: +# gesture pinch clockwise +# gesture pinch anticlockwise + +############################################################################### +# This application normally determines your touchpad device +# automatically. Some users may have multiple touchpads but by default +# we use only the first one found. However, you can choose to specify +# the explicit device name to use. Run "libinput list-devices" to work +# out the name of your device (from the "Device:" field). Then add a +# device line specifying that name, e.g: +# +# device DLL0665:01 06CB:76AD Touchpad +# +# If the device name starts with a '/' then it is instead considered as +# the explicit device path although since device paths can change +# through reboots this is best to be a symlink. E.g. instead of specifying +# /dev/input/event12, use the corresponding full path link under +# /dev/input/by-path/ or /dev/input/by-id/. +# +# You can choose to use ALL touchpad devices by setting the device name +# to "all". E.g. Do this if you have multiple touchpads which you want +# to use in parallel. This reduces performance slightly so only set this +# if you have to. +# +# device all + +############################################################################### +# You can set a minimum travel distance threshold before swipe gestures +# are actioned using the swipe_threshold configuration command. +# Specify this value in dots. The default is 0. +# E.g. set it to 100 dots with "swipe_threshold 100". +# swipe_threshold 0 + +############################################################################### +# You can set a timeout on gestures from start to end. The default is +# the value commented below. It can be any value in float secs >= 0. +# 0 = no timeout. E.g. set it to 2 secs with "timeout 2". +# timeout 1.5 diff --git a/modules/graphical/.config/mako/config b/modules/graphical/.config/mako/config new file mode 100644 index 0000000..73a16fa --- /dev/null +++ b/modules/graphical/.config/mako/config @@ -0,0 +1,22 @@ +padding=10 +margin=5,5,0 +default-timeout=5000 + +## Base16 Burn +# Author: Benjamin Bädorf +# +# You can use these variables anywhere in the mako configuration file. + +background-color=#1a181a +text-color=#e3e1e4 +border-color=#ff5f5f + +[urgency=low] +background-color=#1a181a +text-color=#e3e1e4 +border-color=#ff5f5f + +[urgency=high] +background-color=#ff5f5f +text-color=#1a181a +border-color=#1a181a diff --git a/modules/graphical/.config/swaync/config.json b/modules/graphical/.config/swaync/config.json new file mode 100644 index 0000000..06f7d02 --- /dev/null +++ b/modules/graphical/.config/swaync/config.json @@ -0,0 +1,12 @@ +{ + "positionX": "right", + "positionY": "top", + "timeout": 10, + "timeout-low": 5, + "timeout-critical": 0, + "notification-window-width": 500, + "keyboard-shortcuts": true, + "image-visibility": "always", + "transition-time": 200, + "hide-on-clear": false +} diff --git a/modules/graphical/.config/swaync/style.css b/modules/graphical/.config/swaync/style.css new file mode 100644 index 0000000..2e33e7e --- /dev/null +++ b/modules/graphical/.config/swaync/style.css @@ -0,0 +1,149 @@ +/* + * vim: ft=less + */ + +@define-color border-color rgb(7, 7, 7); +@define-color bg rgb(58, 58, 58); +@define-color bg-hover rgb(68, 68, 68); +@define-color bg-focus rgba(68, 68, 68, 0.6); +@define-color bg-selected rgb(0, 128, 255); + +.notification-row { + outline: none; +} +.notification-row:focus, +.notification-row:hover { + background: @bg-focus; +} + +.notification { + border-radius: 10px; + margin: 6px 12px; + box-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.3); + padding: 0; +} + +.notification-content { + background: transparent; + padding: 6px; + border-radius: 10px; +} + +.close-button { + background: black; + color: white; + text-shadow: none; + padding: 0 2px; + box-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.3); + border-radius: 100%; +} +.close-button:hover { + background: rgb(30, 30, 30); + transition: all 0.15s ease-in-out; +} + +.notification-default-action, +.notification-action { + padding: 4px; + margin: 0; + box-shadow: none; + background: @bg; + border: 1px solid @border-color; +} + +.notification-default-action:hover, +.notification-action:hover { + background: @bg-hover; +} + +.notification-default-action { + border-radius: 10px; +} + +/* When alternative actions are visible */ +.notification-default-action:not(:only-child) { + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +} + +.notification-action { + border-radius: 0px; + border-top: none; + border-right: none; +} + +/* add bottom border radius to eliminate clipping */ +.notification-action:first-child { + border-bottom-left-radius: 10px; +} +.notification-action:last-child { + border-bottom-right-radius: 10px; + border-right: 1px solid @border-color; +} + +.image { +} + +.body-image { + margin-top: 6px; + background-color: white; + border-radius: 10px; +} + +.summary { + color: white; + text-shadow: none; +} + +.time { + color: white; + text-shadow: none; +} + +.body { + background: transparent; + color: white; + text-shadow: none; +} + +.top-action-title { + color: white; + text-shadow: none; +} + +.control-center-clear-all { + color: white; + text-shadow: none; + background: @bg; + border: 1px solid @border-color; + box-shadow: none; + border-radius: 10px; +} +.control-center-clear-all:hover { + background: @bg-hover; +} + +.control-center-dnd { + border-radius: 10px; + background: @bg; + border: 1px solid @border-color; + box-shadow: none; +} + +.control-center-dnd:checked { + background: @bg-selected; +} +.control-center-dnd slider { + background: @bg-hover; +} + +.control-center { + background: rgba(0, 0, 0, 0.7); +} +.control-center-list { + background: transparent; +} + +.floating-notifications { + background: transparent; +} diff --git a/modules/graphical/.config/user-dirs.dirs b/modules/graphical/.config/user-dirs.dirs new file mode 100644 index 0000000..a1bf8b4 --- /dev/null +++ b/modules/graphical/.config/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. + +XDG_DESKTOP_DIR="$HOME/" +XDG_DOWNLOAD_DIR="$HOME/Downloads" +XDG_TEMPLATES_DIR="$HOME/Templates" +XDG_PUBLICSHARE_DIR="$HOME/Public" +XDG_DOCUMENTS_DIR="$HOME/" +XDG_MUSIC_DIR="$HOME/" +XDG_PICTURES_DIR="$HOME/" +XDG_VIDEOS_DIR="$HOME/" diff --git a/modules/graphical/.config/user-dirs.locale b/modules/graphical/.config/user-dirs.locale new file mode 100644 index 0000000..7741b83 --- /dev/null +++ b/modules/graphical/.config/user-dirs.locale @@ -0,0 +1 @@ +en_US diff --git a/modules/graphical/.config/waybar/colorscheme.css b/modules/graphical/.config/waybar/colorscheme.css new file mode 100644 index 0000000..9cb06b3 --- /dev/null +++ b/modules/graphical/.config/waybar/colorscheme.css @@ -0,0 +1,23 @@ +/* +* +* Base16 Burn +* Author: Benjamin Bädorf +* +*/ + +@define-color base00 #1a181a; +@define-color base01 #2d2a2e; +@define-color base02 #303030; +@define-color base03 #949494; +@define-color base04 #d3d1d4; +@define-color base05 #e3e1e4; +@define-color base06 #303030; +@define-color base07 #ff5f5f; +@define-color base08 #f85e84; +@define-color base09 #df5923; +@define-color base0A #e5c463; +@define-color base0B #9ecd6f; +@define-color base0C #ef9062; +@define-color base0D #7accd7; +@define-color base0E #ab9df2; +@define-color base0F #d70000; diff --git a/modules/graphical/.config/waybar/config b/modules/graphical/.config/waybar/config new file mode 100644 index 0000000..7eac8d9 --- /dev/null +++ b/modules/graphical/.config/waybar/config @@ -0,0 +1,148 @@ +{ + "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + + "height": 26, // Waybar height + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": ["network"], + "modules-right": [ + "sway/language", + "backlight", + "custom/notification", + "pulseaudio", + "idle_inhibitor", + "battery", + "clock", + "tray" + ], + "sway/workspaces": { + "disable-scroll": true + }, + "sway/mode": { + "tooltip": false, + "format": "{}" + }, + "sway/window": { + "tooltip": false, + "max-length": 96 + }, + "sway/language": { + "format": "{}", + "max-length": 50 + }, + "tray": { + "icon-size": 21, + "spacing": 10 + }, + "clock": { + "tooltip-format": "{calendar}", + "format": "{:%H:%M} ", + "format-alt": "{:%a %d. %h %H:%M} ", + //"on-scroll": { + // "calendar": 1 + //} + "smooth-scrolling-threshold": 1.0, + "calendar": { + "mode-mon-col" : 3, + "on-scroll": -1, + "on-click-right": "mode", + "format": { + "months": "{}", + "days": "{}", + "weekdays": "{}", + "today": "{}" + }, + }, + "actions": { + "on-click-right": "mode", + "on-click-forward": "tz_up", + "on-click-backward": "tz_down", + "on-scroll-up": "shift_up", + "on-scroll-down": "shift_down" + } + }, + "backlight": { + "device": "acpi_video0", + "format": " {percent}% {icon}", + "format-icons": ["", ""] + }, + "cpu": { + "format": "{}% " + }, + "memory": { + "format": "{}% " + }, + "idle_inhibitor": { + "format": "{icon} ", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "battery": { + "tooltip": false, + "states": { + "critical": 25 + }, + //"full-at": 84, + "format": "{icon} {capacity}%", + "format-full": "{icon}", + "format-icons": ["", "", "", "", ""], + }, + "network": { + "interval": 3, + "tooltip": true, + //"interface": "wlp4s0", // (Optional) To force the use of this interface   \uF2E7, + "format-wifi": " \uf062 {bandwidthUpBits} | \uf063 {bandwidthDownBits}", + "format-ethernet": " \uf062 {bandwidthUpBits} | \uf063 {bandwidthDownBits}", + "format-disconnected": "", + "tooltip-format-wifi": "{essid} ({signalStrength}%)  {ipaddr}", + "tooltip-format-ethernet": "{ifname}  {ipaddr}" + }, + //\ue04f{volume}% + "pulseaudio": { + "tooltip": false, + "format": "{volume}% {icon}", + "format-bluetooth": "{volume}% {icon}", + "format-muted": "", + "on-click": "pavucontrol", + "format-alt": "{volume}% {icon}", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["","", ""] + } + }, + "mpd": { + "format": "{artist} - {title} [{elapsedTime:%M:%S} / {totalTime:%M:%S}]", + "format-disconnected": "", + "format-stopped": "", + "interval": 1, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "custom/notification": { + "tooltip": false, + "format": " {icon}", + "format-icons": { + "notification": "", + "none": "", + "dnd-notification": "", + "dnd-none": "" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, +} diff --git a/modules/graphical/.config/waybar/style.css b/modules/graphical/.config/waybar/style.css new file mode 100644 index 0000000..238417e --- /dev/null +++ b/modules/graphical/.config/waybar/style.css @@ -0,0 +1,80 @@ +@import "./colorscheme.css"; + +window#waybar { + font-family: Hack, FontAwesome; + font-weight: 500; + font-size: 14px; + /*background: rgba(11, 12, 13, 0.90);*/ + background-color: rgba(0, 0, 0, 0); + border-bottom: 1px solid rgba(0, 0, 2, 0.53); + color: @base04; +} + +window#waybar.hidden { + opacity: 0.2; +} + +#workspaces button { + font-size: 14px; + box-shadow: none; + text-shadow: none; + padding: 0px 3px 0px 3px; + color: @base04; +} + +#workspaces button.focused { + color: #f85e84; + color: @base07; + /* margin: 2px 0px 2px 0px; */ +} + +#workspaces button:hover { + background: rgba(255, 255, 255, 0.00); + /* margin: 2px 0px 2px 0px; */ +} + +#clock, #backlight, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode { + font-size: 14px; + margin: 0px 10px 0px 5px; +} + +#pulseaudio { + /* border-top: 1px solid transparent; */ + font-size: 12px; + margin-left: 15px; +} + +#battery { + font-size: 12px; +} + +#battery.critical { + color: @base07; +} + +#battery.charging { + color: @base0B; +} + +#battery.full { + margin: 0px 0px 0px 0px; +} + +#network { + border-top: 1px solid transparent; + color: rgba(255,255,255,0.3); +} + +#network.disconnected { + margin: 0px 0px 0px 0px; + color: rgba(75, 81, 98, 0); +} + +#pulseaudio.muted { + margin: 0px 0px 0px 0px; + color: rgba(75, 81, 98, 0); +} + +#custom-notification { + font-family: "NotoSansMono Nerd Font"; +} diff --git a/modules/graphical/.config/xmodmap b/modules/graphical/.config/xmodmap new file mode 100644 index 0000000..3eb325a --- /dev/null +++ b/modules/graphical/.config/xmodmap @@ -0,0 +1,8 @@ +! Swap Caps_Lock and Control_L +! +remove Lock = Caps_Lock +remove Control = Control_L +!keysym Control_L = Caps_Lock +keysym Caps_Lock = Control_L +add Lock = Caps_Lock +add Control = Control_L diff --git a/modules/graphical/.config/xsettingsd/xsettingsd.conf b/modules/graphical/.config/xsettingsd/xsettingsd.conf new file mode 100644 index 0000000..8ea990f --- /dev/null +++ b/modules/graphical/.config/xsettingsd/xsettingsd.conf @@ -0,0 +1,18 @@ +Gtk/ButtonImages 1 +Gtk/CanChangeAccels 1 +Gtk/CursorThemeName "default" +Gtk/CursorThemeSize 0 +Gtk/EnableEventSounds 0 +Gtk/EnableInputFeedbackSounds 0 +Gtk/FontName "Lato" +Gtk/ThemeName "Matcha-dark-aliz" +Gtk/IconThemeName "Papirus-Adapta-Nokto-Maia" +Gtk/MenuBarAccel "F10" +Gtk/MenuImages 1 +Gtk/ToolbarIconSize 3 +Gtk/ToolbarStyle "icons" +Xft/Antialias 1 +Xft/DPI 102400 +Xft/Hinting 1 +Xft/HintStyle "hintslight" +Xft/RGBA "rgb" diff --git a/modules/graphical/.xinitrc b/modules/graphical/.xinitrc new file mode 100644 index 0000000..d961f66 --- /dev/null +++ b/modules/graphical/.xinitrc @@ -0,0 +1,75 @@ +#!/bin/sh +# +# ~/.xinitrc +# +# Executed by startx (run your window manager from here) + +userresources=$HOME/.Xresources +usermodmap=$HOME/.config/xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +DEFAULT_SESSION='i3 --shmlog-size 0' + +xset -b + +if [ -d $HOME/.fonts ]; then + xset +fp $HOME/.fonts + xset fp rehash +fi + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f "$userresources" ]; then + xrdb -merge "$userresources" +fi + +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +# start some nice programs + +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +get_session(){ + local dbus_args=(--sh-syntax --exit-with-session) + case $1 in + awesome) dbus_args+=(awesome) ;; + bspwm) dbus_args+=(bspwm-session) ;; + budgie) dbus_args+=(budgie-desktop) ;; + cinnamon) dbus_args+=(cinnamon-session) ;; + deepin) dbus_args+=(startdde) ;; + enlightenment) dbus_args+=(enlightenment_start) ;; + fluxbox) dbus_args+=(startfluxbox) ;; + gnome) dbus_args+=(gnome-session) ;; + i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;; + jwm) dbus_args+=(jwm) ;; + kde) dbus_args+=(startkde) ;; + lxde) dbus_args+=(startlxde) ;; + lxqt) dbus_args+=(lxqt-session) ;; + mate) dbus_args+=(mate-session) ;; + xfce) dbus_args+=(xfce4-session) ;; + openbox) dbus_args+=(openbox-session) ;; + *) dbus_args+=($DEFAULT_SESSION) ;; + esac + + echo "dbus-launch ${dbus_args[*]}" +} + +exec $(get_session) +xset r rate 660 25 + diff --git a/modules/graphical/alacritty.nix b/modules/graphical/alacritty.nix new file mode 100644 index 0000000..fe5dd81 --- /dev/null +++ b/modules/graphical/alacritty.nix @@ -0,0 +1,271 @@ +{ + env = { + TERM = "xterm-256color"; + }; + + window = { + # Window dimensions in character columns and lines + # Falls back to size specified by window manager if set to 0x0. + # (changes require restart) + dimensions = { + columns = 80; + lines = 24; + }; + + padding = { + x = 0; + y = 0; + }; + + decorations = "full"; + }; + + scrolling = { + # How many lines of scrollback to keep, + # "0" will disable scrolling. + history = 100000; + + # Number of lines the viewport will move for every line + # scrolled when scrollback is enabled (history > 0). + multiplier = 3; + }; + + # When true, bold text is drawn using the bright variant of colors. + draw_bold_text_with_bright_colors = true; + + font = { + # The normal (roman) font face to use. + normal = { + family = "Hack"; # should be "Menlo" or something on macOS. + # Style can be specified to pick a specific face. + style = "Regular"; + }; + + # The bold font face + bold = { + family = "Hack"; # should be "Menlo" or something on macOS. + # Style can be specified to pick a specific face. + style = "Bold"; + }; + + # The italic font face + italic = { + family = "Hack"; # should be "Menlo" or something on macOS. + # Style can be specified to pick a specific face. + style = "Italic"; + }; + + size = 12.0; + + offset = { + x = 0; + y = 0; + }; + + glyph_offset = { + x = 0; + y = 0; + }; + }; + + key_bindings = [ + { + key = "V"; + mods = "Control|Super"; + action = "Paste"; + } + { + key = "C"; + mods = "Control|Super"; + action = "Copy"; + } + { + key = "V"; + mods = "Control|Alt"; + action = "Paste"; + } + { + key = "C"; + mods = "Control|Alt"; + action = "Copy"; + } + { + key = "Paste"; + action = "Paste"; + } + { + key = "Copy"; + action = "Copy"; + } + { + key = "Q"; + mods = "Command"; + action = "Quit"; + } + { + key = "W"; + mods = "Command"; + action = "Quit"; + } + { + key = "Insert"; + mods = "Shift"; + action = "PasteSelection"; + } + { + key = "Key0"; + mods = "Control"; + action = "ResetFontSize"; + } + { + key = "Equals"; + mods = "Control"; + action = "IncreaseFontSize"; + } + { + key = "PageUp"; + mods = "Shift"; + action = "ScrollPageUp"; + } + { + key = "PageDown"; + mods = "Shift"; + action = "ScrollPageDown"; + } + { + key = "Minus"; + mods = "Control"; + action = "DecreaseFontSize"; + } + { + key = "H"; + mode = "Vi|~Search"; + action = "ScrollToBottom"; + } + { + key = "H"; + mode = "Vi|~Search"; + action = "ToggleViMode"; + } + { + key = "I"; + mode = "Vi|~Search"; + action = "Up"; + } + { + key = "K"; + mode = "Vi|~Search"; + action = "Down"; + } + { + key = "J"; + mode = "Vi|~Search"; + action = "Left"; + } + { + key = "L"; + mode = "Vi|~Search"; + action = "Right"; + } + ]; + + # Base16 Burn 256 - alacritty color config + # Benjamin Bädorf + colors = { + # Default colors + primary = { + background = "0x1a181a"; + foreground = "0xe3e1e4"; + }; + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + cursor = { + text = "CellBackground"; + cursor = "CellForeground"; + }; + + # Colors used for the search bar and match highlighting. + search = { + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + matches = { + foreground = "0xe5c463"; + background = "0x1a181a"; + }; + focused_match = { + foreground = "CellBackground"; + background = "CellForeground"; + }; + #bar = + # background = "#c5c8c6"; + # foreground = "#1d1f21"; + }; + + # Selection colors + # + # Colors which should be used to draw the selection area. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + selection = { + text = "0x1a181a"; + background = "0xf85e84"; + }; + + # Normal colors + normal = { + black = "0x1a181a"; + red = "0xf85e84"; + green = "0x9ecd6f"; + yellow = "0xe5c463"; + blue = "0x7accd7"; + magenta = "0xab9df2"; + cyan = "0xef9062"; + white = "0xe3e1e4"; + }; + + # Bright colors + bright = { + black = "0x949494"; + red = "0xf85e84"; + green = "0x9ecd6f"; + yellow = "0xe5c463"; + blue = "0x7accd7"; + magenta = "0xab9df2"; + cyan = "0xef9062"; + white = "0xff5f5f"; + }; + + indexed_colors = [ + { + index = 16; + color = "0xdf5923"; + } + { + index = 17; + color = "0xd70000"; + } + { + index = 18; + color = "0x2d2a2e"; + } + { + index = 19; + color = "0x303030"; + } + { + index = 20; + color = "0xd3d1d4"; + } + { + index = 21; + color = "0x303030"; + } + ]; + }; +} diff --git a/modules/graphical/assets/pub-solar.jpg b/modules/graphical/assets/pub-solar.jpg new file mode 100644 index 0000000..ec0624d Binary files /dev/null and b/modules/graphical/assets/pub-solar.jpg differ diff --git a/modules/graphical/assets/wallpaper.jpg b/modules/graphical/assets/wallpaper.jpg new file mode 100644 index 0000000..bcbb7ee Binary files /dev/null and b/modules/graphical/assets/wallpaper.jpg differ diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix new file mode 100644 index 0000000..8911970 --- /dev/null +++ b/modules/graphical/default.nix @@ -0,0 +1,166 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; + yamlFormat = pkgs.formats.yaml {}; + sessionVariables = { + WLR_RENDERER = + if psCfg.graphical.wayland.software-renderer.enable + then "pixman" + else "gles2"; + # Fix KeepassXC rendering issue + # https://github.com/void-linux/void-packages/issues/23517 + QT_AUTO_SCREEN_SCALE_FACTOR = "0"; + }; +in { + imports = [ + ./sway + ]; + + options.pub-solar.graphical = { + wayland.software-renderer.enable = mkOption { + type = types.bool; + default = false; + description = "Feature flag enabling wlroots software renderer, useful in VMs"; + }; + }; + + config = { + hardware.opengl.enable = true; + + environment = { + systemPackages = with pkgs; [ + gtk-engine-murrine + gtk_engines + gsettings-desktop-schemas + + matcha-gtk-theme + papirus-maia-icon-theme + + glib + xdg-utils + ]; + + etc = { + "xdg/PubSolar.conf".text = '' + [Qt] + style=GTK+ + ''; + }; + + variables = sessionVariables; + }; + + services.getty.autologinUser = psCfg.user.name; + + qt = { + enable = true; + platformTheme = "gtk2"; + style = "gtk2"; + }; + + services.udev.packages = with pkgs; [gnome3.gnome-settings-daemon]; + # Enable Sushi, a quick previewer for nautilus + services.gnome.sushi.enable = true; + # Enable GVfs, a userspace virtual filesystem + services.gvfs.enable = true; + services.yubikey-agent.enable = true; + + fonts = { + packages = with pkgs; [ + dejavu_fonts + powerline-fonts + ]; + enableDefaultPackages = true; + fontconfig.enable = true; + fontconfig.defaultFonts = { + monospace = ["DejaVu Sans Mono for Powerline"]; + sansSerif = ["DejaVu Sans"]; + }; + }; + + users.users."${psCfg.user.name}".packages = with pkgs; [ + alacritty + firefox-wayland + flameshot + gnome.adwaita-icon-theme + gnome.eog + gnome.nautilus + gnome.seahorse + gnome.yelp + hicolor-icon-theme + keepassxc + qMasterPassword-wayland + libnotify + vlc + ]; + + home-manager.users."${psCfg.user.name}" = { + home.file."xinitrc".source = ./.xinitrc; + xdg.configFile."alacritty/alacritty.yml".source = yamlFormat.generate "alacritty.yml" (import ./alacritty.nix); + xdg.configFile."xmodmap".source = ./.config/xmodmap; + xdg.configFile."user-dirs.dirs".source = ./.config/user-dirs.dirs; + xdg.configFile."user-dirs.locale".source = ./.config/user-dirs.locale; + xdg.configFile."xsettingsd/xsettingsd.conf".source = ./.config/xsettingsd/xsettingsd.conf; + xdg.configFile."mako/config".source = ./.config/mako/config; + xdg.configFile."libinput-gestures.conf".source = ./.config/libinput-gestures.conf; + xdg.configFile."swaync/config.json".source = ./.config/swaync/config.json; + xdg.configFile."swaync/style.css".source = ./.config/swaync/style.css; + xdg.configFile."waybar/config".source = ./.config/waybar/config; + xdg.configFile."waybar/style.css".source = ./.config/waybar/style.css; + xdg.configFile."waybar/colorscheme.css".source = ./.config/waybar/colorscheme.css; + xdg.configFile."wallpaper.jpg".source = ./assets/wallpaper.jpg; + + # Required for running Gnome apps outside the Gnome DE, see + # https://nixos.wiki/wiki/GNOME#Running_GNOME_programs_outside_of_GNOME + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + }; + }; + }; + + gtk = { + enable = true; + font.name = "Lato"; + iconTheme = { + package = pkgs.papirus-icon-theme; + name = "Papirus-Adapta-Nokto-Maia"; + }; + theme = { + package = pkgs.matcha-gtk-theme; + name = "Matcha-dark-aliz"; + }; + + gtk3.extraConfig = { + gtk-xft-antialias = "1"; + gtk-xft-hinting = "1"; + gtk-xft-hintstyle = "hintfull"; + gtk-xft-rgba = "rgb"; + gtk-application-prefer-dark-theme = "true"; + }; + + gtk4.extraConfig = { + gtk-xft-antialias = "1"; + gtk-xft-hinting = "1"; + gtk-xft-hintstyle = "hintfull"; + gtk-xft-rgba = "rgb"; + gtk-application-prefer-dark-theme = "true"; + }; + }; + + xresources.extraConfig = builtins.readFile ./.Xdefaults; + + systemd.user.services.network-manager-applet = import ./network-manager-applet.service.nix pkgs; + + home.sessionVariables = sessionVariables; + systemd.user.sessionVariables = sessionVariables; + }; + }; +} diff --git a/modules/graphical/network-manager-applet.service.nix b/modules/graphical/network-manager-applet.service.nix new file mode 100644 index 0000000..a321465 --- /dev/null +++ b/modules/graphical/network-manager-applet.service.nix @@ -0,0 +1,15 @@ +pkgs: { + Unit = { + Description = "Network Manager applet"; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + # ConditionEnvironment requires systemd v247 to work correctly + ConditionEnvironment = ["WAYLAND_DISPLAY"]; + }; + Service = { + ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet --sm-disable --indicator"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/config/config.d/applications.conf b/modules/graphical/sway/config/config.d/applications.conf new file mode 100644 index 0000000..00eecef --- /dev/null +++ b/modules/graphical/sway/config/config.d/applications.conf @@ -0,0 +1,78 @@ +# switch to workspace with urgent window automatically +for_window [urgent=latest] focus + +for_window [app_id="keepassxc"] floating disable +assign [app_id="keepassxc"] $ws8 + +for_window [app_id="virt-manager"] floating disable +assign [app_id="virt-manager"] $ws9 + +assign [instance="element"] $ws4 +assign [app_id="Signal"] $ws4 +assign [app_id="telegramdesktop"] $ws4 + +# Launcher +for_window [app_id="launcher" title="Alacritty"] floating enable, border pixel 10, sticky enable + +for_window [app_id="pavucontrol"] floating enable, border pixel 10, sticky enable + +# Floating menus +for_window [app_id="blueman-manager"] floating enable + +# Open specific applications in floating mode +for_window [title="alsamixer"] floating enable border pixel 1 +for_window [class="Calamares"] floating enable border normal +for_window [class="Clipgrab"] floating enable +for_window [title="File Transfer*"] floating enable +for_window [class="Galculator"] floating enable border pixel 1 +for_window [class="GParted"] floating enable border normal +for_window [title="i3_help"] floating enable sticky enable border normal +for_window [class="Lightdm-gtk-greeter-settings"] floating enable +for_window [class="Lxappearance"] floating enable sticky enable border normal +for_window [class="Manjaro-hello"] floating enable +for_window [class="Manjaro Settings Manager"] floating enable border normal +for_window [title="MuseScore: Play Panel"] floating enable +for_window [class="Nitrogen"] floating enable sticky enable border normal +for_window [class="Oblogout"] fullscreen enable +for_window [class="octopi"] floating enable +for_window [title="About Pale Moon"] floating enable +for_window [class="Pamac-manager"] floating enable +for_window [class="Pavucontrol"] floating enable +for_window [class="qt5ct"] floating enable sticky enable border normal +for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal +for_window [class="Simple-scan"] floating enable border normal +for_window [class="(?i)System-config-printer.py"] floating enable border normal +for_window [class="Skype"] floating enable border normal +for_window [class="Thus"] floating enable border normal +for_window [class="Timeset-gui"] floating enable border normal +for_window [class="(?i)virtualbox"] floating enable border normal +for_window [class="Xfburn"] floating enable +for_window [class="^VirtualBox Machine$" title="Running"] floating disable +for_window [class="^rdesktop" title="rdesktop"] floating disable + +# firefox floating menus +for_window [window_role="pop-up"] floating enable +for_window [window_role="task_dialog"] floating enable +for_window [window_role="pop-up"] floating enable +for_window [window_role="bubble"] floating enable +for_window [window_role="task_dialog"] floating enable +for_window [window_role="Preferences"] floating enable +for_window [window_type="dialog"] floating enable +for_window [window_type="menu"] floating enable +for_window [title="About Mozilla Firefox"] floating enable +for_window [title="Password Required - Mozilla Firefox"] floating enable +for_window [title="Extension: (Open in Browser)*"] floating enable + +# Technical media stuff happens on ws7 +for_window [app_id="screen-recorder" title="Alacritty"] move to workspace $ws7, floating disable +no_focus [app_id="screen-recorder"] +for_window [title="Firefox — Sharing Indicator"] move to workspace $ws7, floating disable +no_focus [title="Firefox — Sharing Indicator"] + +# qMasterPassword floating menu +for_window [title="qMasterPassword"] focus +for_window [title="qMasterPassword"] floating enable + +# vimpc floating instance +for_window [app_id="mu_vimpc"] focus +for_window [app_id="mu_vimpc"] floating enable, border pixel 10, sticky enable diff --git a/modules/graphical/sway/config/config.d/colorscheme.conf b/modules/graphical/sway/config/config.d/colorscheme.conf new file mode 100644 index 0000000..3886c3d --- /dev/null +++ b/modules/graphical/sway/config/config.d/colorscheme.conf @@ -0,0 +1,19 @@ +## Base16 Burn +# Author: Benjamin Bädorf + +set $base00 #1a181a +set $base01 #2d2a2e +set $base02 #303030 +set $base03 #949494 +set $base04 #d3d1d4 +set $base05 #e3e1e4 +set $base06 #303030 +set $base07 #ff5f5f +set $base08 #f85e84 +set $base09 #df5923 +set $base0A #e5c463 +set $base0B #9ecd6f +set $base0C #ef9062 +set $base0D #7accd7 +set $base0E #ab9df2 +set $base0F #d70000 diff --git a/modules/graphical/sway/config/config.d/custom-keybindings.conf b/modules/graphical/sway/config/config.d/custom-keybindings.conf new file mode 100644 index 0000000..6d3019b --- /dev/null +++ b/modules/graphical/sway/config/config.d/custom-keybindings.conf @@ -0,0 +1,47 @@ +# launch categorized menu +bindsym $mod+z exec --no-startup-id morc_menu + +# switch keyboard input language +#bindsym $mod+tab exec toggle-kbd-layout + +################################################################################################ +## sound-section - ## +################################################################################################ + +bindsym $mod+Ctrl+m exec pavucontrol + +################################################################################################ + +# Quickstart application shortcuts +bindsym $mod+F1 exec psos help +bindsym $mod+Shift+h exec psos help + +bindsym $mod+F2 exec firefox + +bindsym $mod+F4 exec nautilus -w +bindsym $mod+Shift+F4 exec signal-desktop --use-tray-icon + +# Notifications with swaynotificationcenter +# Toggle control center +bindsym $mod+Shift+n exec swaync-client -t -sw + +bindsym $mod+Shift+m exec qMasterPassword + +# Screenshots and screen recordings +bindsym $mod+Ctrl+p exec grim -g "$(slurp -d -b \#ffffff11)" ~/Pictures/Screenshots/$(date +%Y%m%d_%Hh%Mm%Ss)_grim.png +bindsym $mod+Shift+p exec grim ~/Pictures/Screenshots/$(date +%Y%m%d_%Hh%Mm%Ss)_grim.png +bindsym $mod+Ctrl+f exec "( pkill flameshot || true && flameshot & ) && ( sleep 0.5s && flameshot gui )" + +bindsym $mod+Ctrl+r exec record-screen + +# Launcher +set $menu exec alacritty --class launcher -e env TERMINAL_COMMAND="alacritty -e" sway-launcher +bindsym $mod+Space exec $menu + +set $mode_vncclient In VNCClient mode. Press $mod+Num_Lock or $mod+Shift+Escape to return. +bindsym $mod+Num_Lock mode "$mode_vncclient" +bindsym $mod+Shift+Escape mode "$mode_vncclient" +mode "$mode_vncclient" { + bindsym $mod+Num_Lock mode "default" + bindsym $mod+Shift+Escape mode "default" +} diff --git a/modules/graphical/sway/config/config.d/gaps.conf b/modules/graphical/sway/config/config.d/gaps.conf new file mode 100644 index 0000000..0dcc508 --- /dev/null +++ b/modules/graphical/sway/config/config.d/gaps.conf @@ -0,0 +1,53 @@ +# Set inner/outer gaps +gaps inner 10 +gaps outer -5 + +# Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size. +# gaps inner|outer current|all set|plus|minus +# gaps inner all set 10 +# gaps outer all plus 5 + +# Smart gaps (gaps used if only more than one container on the workspace) +smart_gaps on + +# Smart borders (draw borders around container only if it is not the only container on this workspace) +# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0) +smart_borders on + +# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces. +set $mode_gaps Gaps: (o) outer, (i) inner +set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) +set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) +bindsym $mod+Shift+g mode "$mode_gaps" + +mode "$mode_gaps" { + bindsym o mode "$mode_gaps_outer" + bindsym i mode "$mode_gaps_inner" + bindsym Return mode "default" + bindsym Escape mode "default" +} +mode "$mode_gaps_inner" { + bindsym plus gaps inner current plus 5 + bindsym minus gaps inner current minus 5 + bindsym 0 gaps inner current set 0 + + bindsym Shift+plus gaps inner all plus 5 + bindsym Shift+minus gaps inner all minus 5 + bindsym Shift+0 gaps inner all set 0 + + bindsym Return mode "default" + bindsym Escape mode "default" +} +mode "$mode_gaps_outer" { + bindsym plus gaps outer current plus 5 + bindsym minus gaps outer current minus 5 + bindsym 0 gaps outer current set 0 + + bindsym Shift+plus gaps outer all plus 5 + bindsym Shift+minus gaps outer all minus 5 + bindsym Shift+0 gaps outer all set 0 + + bindsym Return mode "default" + bindsym Escape mode "default" +} + diff --git a/modules/graphical/sway/config/config.d/mode_system.conf.nix b/modules/graphical/sway/config/config.d/mode_system.conf.nix new file mode 100644 index 0000000..62d4557 --- /dev/null +++ b/modules/graphical/sway/config/config.d/mode_system.conf.nix @@ -0,0 +1,41 @@ +{ + pkgs, + psCfg, + ... +}: +'' + # Set shut down, restart and locking features +'' ++ ( + if psCfg.core.hibernation.enable + then '' + set $mode_system (e)xit, (h)ibernate, (l)ock, (s)uspend, (r)eboot, (Shift+s)hutdown + '' + else '' + set $mode_system (e)xit, (l)ock, (s)uspend, (r)eboot, (Shift+s)hutdown + '' +) ++ '' + bindsym $mod+0 mode "$mode_system" + + mode "$mode_system" { + bindsym e exec swaymsg exit, mode "default" +'' ++ ( + if psCfg.core.hibernation.enable + then '' + bindsym h exec systemctl hibernate, mode "default" + '' + else "" +) ++ '' + bindsym l exec ${pkgs.swaylock-bg}/bin/swaylock-bg, mode "default" + bindsym s exec systemctl suspend, mode "default" + bindsym r exec systemctl reboot, mode "default" + bindsym Shift+s exec systemctl poweroff, mode "default" + + # exit system mode: "Enter" or "Escape" + bindsym Return mode "default" + bindsym Escape mode "default" + } +'' diff --git a/modules/graphical/sway/config/config.d/systemd.conf b/modules/graphical/sway/config/config.d/systemd.conf new file mode 100644 index 0000000..66759c4 --- /dev/null +++ b/modules/graphical/sway/config/config.d/systemd.conf @@ -0,0 +1,8 @@ +# Note that the systemctl commands must be run synchronously and can't be split into +# three exec statements, since otherwise the session target may be started before +# systemctl import-environment is complete, and services that require certain variables +# will fail to run. +# https://github.com/swaywm/sway/wiki/Systemd-integration +# Also, import the most important environment variables into the D-Bus and systemd +# user environments (e.g. required for screen sharing and Pinentry prompts): +exec "systemctl --user import-environment; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd $IMPORT_ENVIRONMENT_ENV_LIST DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway" diff --git a/modules/graphical/sway/config/config.d/theme.conf b/modules/graphical/sway/config/config.d/theme.conf new file mode 100644 index 0000000..eb4427a --- /dev/null +++ b/modules/graphical/sway/config/config.d/theme.conf @@ -0,0 +1,16 @@ +# Border BG Text Ind Child Border +client.focused $base00 $base01 $base07 $base0D $base07 +client.focused_inactive $base00 $base01 $base07 $base03 $base00 +client.unfocused $base00 $base00 $base04 $base06 $base00 +client.urgent $base00 $base0F $base00 $base08 $base00 + +client.background $base00 + +# Read the gtk settings from gtk setting.ini and pass them to gsettings +exec_always import-gtk-settings \ + gtk-theme:gtk-theme-name \ + icon-theme:gtk-icon-theme-name \ + cursor-theme:gtk-cursor-theme-name + +# Workaround to fix cursor scaling, see https://github.com/swaywm/sway/issues/4112 +seat seat0 xcursor_theme Adwaita diff --git a/modules/graphical/sway/config/config.nix b/modules/graphical/sway/config/config.nix new file mode 100644 index 0000000..b811c30 --- /dev/null +++ b/modules/graphical/sway/config/config.nix @@ -0,0 +1,217 @@ +{ + config, + pkgs, + ... +}: '' + # Default config for sway + # + # Copy this to ~/.config/sway/config and edit it to your liking. + # + # Read `man 5 sway` for a complete reference. + + ### Variables + # + # Logo key. Use Mod1 for Alt. + set $mod Mod4 + # Home row direction keys, like vim + set $left j + set $down k + set $up i + set $right l + # Your preferred terminal emulator + set $term ${pkgs.alacritty}/bin/alacritty + # Your preferred application launcher + # Note: pass the final command to swaymsg so that the resulting window can be opened + # on the original workspace that the command was run on. + #set $menu dmenu_path | dmenu | xargs swaymsg exec bemenu-run --no-overlap + + default_border pixel 1 + + ### Output configuration + # + # Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/) + output * bg ~/.config/wallpaper.jpg fill + + ### Key bindings + # + # Basics: + # + # Start a terminal + bindsym $mod+Return exec $term + + # Start a terminal + bindsym $mod+Shift+Return exec sh -c '$term --working-directory $(wcwd)' + + # Kill focused window + bindsym $mod+Shift+q kill + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+F5 reload + + # + # Moving around: + # + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right + # + # Workspaces: + # + + + # Workspace names + # to display names or symbols instead of plain workspace numbers you can use + # something like: set $ws1 1:mail + # set $ws2 2: + set $ws1 1 + set $ws2 2 + set $ws3 3 + set $ws4 4 + set $ws5 5 + set $ws6 6 + set $ws7 7 + set $ws8 8 + set $ws9 9 + + # Switch to workspace + bindsym $mod+1 workspace 1 + bindsym $mod+2 workspace 2 + bindsym $mod+3 workspace 3 + bindsym $mod+4 workspace 4 + bindsym $mod+5 workspace 5 + bindsym $mod+6 workspace 6 + bindsym $mod+7 workspace 7 + bindsym $mod+8 workspace 8 + bindsym $mod+9 workspace 9 + # Move focused container to workspace + bindsym $mod+Ctrl+1 move container to workspace $ws1 + bindsym $mod+Ctrl+2 move container to workspace $ws2 + bindsym $mod+Ctrl+3 move container to workspace $ws3 + bindsym $mod+Ctrl+4 move container to workspace $ws4 + bindsym $mod+Ctrl+5 move container to workspace $ws5 + bindsym $mod+Ctrl+6 move container to workspace $ws6 + bindsym $mod+Ctrl+7 move container to workspace $ws7 + bindsym $mod+Ctrl+8 move container to workspace $ws8 + bindsym $mod+Ctrl+9 move container to workspace $ws9 + # Move focused container to workspace and move focus with it + bindsym $mod+Shift+1 move container to workspace 1; workspace $ws1 + bindsym $mod+Shift+2 move container to workspace 2; workspace $ws2 + bindsym $mod+Shift+3 move container to workspace 3; workspace $ws3 + bindsym $mod+Shift+4 move container to workspace 4; workspace $ws4 + bindsym $mod+Shift+5 move container to workspace 5; workspace $ws5 + bindsym $mod+Shift+6 move container to workspace 6; workspace $ws6 + bindsym $mod+Shift+7 move container to workspace 7; workspace $ws7 + bindsym $mod+Shift+8 move container to workspace 8; workspace $ws8 + bindsym $mod+Shift+9 move container to workspace 9; workspace $ws9 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. + + #navigate workspaces next / previous + bindsym $mod+Ctrl+Right workspace next + bindsym $mod+Ctrl+Left workspace prev + + # workspace back and forth (with/without active container) + workspace_auto_back_and_forth yes + bindsym $mod+b workspace back_and_forth + bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth + + # + # Layout stuff: + # + # Configure border style + default_border pixel 1 + default_floating_border normal + + # Hide borders + hide_edge_borders none + + # Font for window titles. Will also be used by the bar unless a different font + # is used in the bar {} block below. + font xft:Hack 16 + + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+h splith; exec notify-send 'tile horizontally' + bindsym $mod+v splitv; exec notify-send 'tile vertically' + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+t focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent + bindsym $mod+d focus child + # + # Scratchpad: + # + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show + # + # Resizing containers: + # + mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" + } + bindsym $mod+r mode "resize" + + include ~/.config/sway/config.d/*'' diff --git a/modules/graphical/sway/config/wayvnc/config.nix b/modules/graphical/sway/config/wayvnc/config.nix new file mode 100644 index 0000000..23a885d --- /dev/null +++ b/modules/graphical/sway/config/wayvnc/config.nix @@ -0,0 +1,11 @@ +{ + psCfg, + pkgs, +}: " +address=0.0.0.0 +enable_auth=true +username=${psCfg.user.name} +password=testtest +private_key_file=/run/agenix/vnc-key.pem +certificate_file=/run/agenix/vnc-cert.pem +" diff --git a/modules/graphical/sway/default.nix b/modules/graphical/sway/default.nix new file mode 100644 index 0000000..7cfa343 --- /dev/null +++ b/modules/graphical/sway/default.nix @@ -0,0 +1,101 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + options.pub-solar.graphical = { + v4l2loopback.enable = mkOption { + type = types.bool; + default = false; + description = "WebCam streaming tool"; + }; + }; + + config = { + boot = mkIf psCfg.graphical.v4l2loopback.enable { + extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; + kernelModules = ["v4l2loopback"]; + extraModprobeConfig = '' + options v4l2loopback exclusive_caps=1 devices=3 + ''; + }; + + environment.systemPackages = with pkgs; + mkIf psCfg.graphical.v4l2loopback.enable [ + linuxPackages.v4l2loopback + ]; + + programs.sway.enable = true; + + xdg.portal = { + enable = true; + wlr = { + enable = true; + settings = { + screencast = { + max_fps = 30; + chooser_type = "simple"; + chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or"; + }; + }; + }; + extraPortals = with pkgs; [xdg-desktop-portal-gtk]; + }; + + services.pipewire.enable = true; + + users.users."${psCfg.user.name}".packages = with pkgs; [ + sway + grim + kanshi + slurp + swaybg + swayidle + swaynotificationcenter + xwayland + + libappindicator-gtk3 + + wl-clipboard + wf-recorder + brightnessctl + gammastep + geoclue2 + xsettingsd + ydotool + + sway-launcher + record-screen + import-gtk-settings + # Unused on teutat3s hosts, see custom-keybindings.conf + #toggle-kbd-layout + s + wcwd + ]; + + home-manager.users."${psCfg.user.name}" = { + programs.waybar.enable = true; + #programs.waybar.systemd.enable = true; + + systemd.user.services.swaynotificationcenter = import ./swaynotificationcenter.service.nix pkgs; + systemd.user.services.sway = import ./sway.service.nix {inherit pkgs psCfg;}; + systemd.user.services.swayidle = import ./swayidle.service.nix {inherit pkgs psCfg;}; + systemd.user.services.xsettingsd = import ./xsettingsd.service.nix {inherit pkgs psCfg;}; + systemd.user.services.waybar = import ./waybar.service.nix {inherit pkgs psCfg;}; + systemd.user.targets.sway-session = import ./sway-session.target.nix {inherit pkgs psCfg;}; + + xdg.configFile."sway/config".text = import ./config/config.nix {inherit config pkgs;}; + xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf; + xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf; + xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf; + xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf; + xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix {inherit pkgs psCfg;}; + xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf; + xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf; + }; + }; +} diff --git a/modules/graphical/sway/gammastep.service.nix b/modules/graphical/sway/gammastep.service.nix new file mode 100644 index 0000000..d488ea5 --- /dev/null +++ b/modules/graphical/sway/gammastep.service.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + Unit = { + Description = "set color temperature of display according to time of day"; + Documentation = ["man:gammastep(1)"]; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + # ConditionEnvironment requires systemd v247 to work correctly + ConditionEnvironment = ["WAYLAND_DISPLAY"]; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.gammastep}/bin/gammastep -l geoclue2 -m wayland -v"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/libinput-gestures.service.nix b/modules/graphical/sway/libinput-gestures.service.nix new file mode 100644 index 0000000..eed9518 --- /dev/null +++ b/modules/graphical/sway/libinput-gestures.service.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + Unit = { + Description = "Actions gestures on your touchpad using libinput"; + Documentation = ["https://github.com/bulletmark/libinput-gestures"]; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.libinput-gestures}/bin/libinput-gestures"; + Restart = "on-failure"; + RestartSec = "1"; + TimeoutStopSec = "10"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/mako.service.nix b/modules/graphical/sway/mako.service.nix new file mode 100644 index 0000000..22524d3 --- /dev/null +++ b/modules/graphical/sway/mako.service.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + Unit = { + Description = "Lightweight Wayland notification daemon"; + Documentation = ["man:mako(1)"]; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + ConditionEnvironment = ["WAYLAND_DISPLAY"]; + }; + Service = { + Type = "dbus"; + BusName = "org.freedesktop.Notifications"; + ExecStart = "${pkgs.mako}/bin/mako"; + ExecReload = "${pkgs.mako}/bin/makoctl reload"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/sway-session.target.nix b/modules/graphical/sway/sway-session.target.nix new file mode 100644 index 0000000..f35ed28 --- /dev/null +++ b/modules/graphical/sway/sway-session.target.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + Unit = { + Description = "sway compositor session"; + Documentation = ["man:systemd.special(7)"]; + BindsTo = ["graphical-session.target"]; + Wants = ["graphical-session-pre.target"]; + After = ["graphical-session-pre.target"]; + }; +} diff --git a/modules/graphical/sway/sway.service.nix b/modules/graphical/sway/sway.service.nix new file mode 100644 index 0000000..253df4a --- /dev/null +++ b/modules/graphical/sway/sway.service.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + Unit = { + Description = "sway - SirCmpwn's Wayland window manager"; + Documentation = ["man:sway(5)"]; + BindsTo = ["graphical-session.target"]; + Wants = ["graphical-session-pre.target"]; + After = ["graphical-session-pre.target"]; + }; + Service = { + Type = "simple"; + ExecStartPre = "${pkgs.systemd}/bin/systemctl --user unset-environment WAYLAND_DISPLAY DISPLAY"; + ExecStart = "${pkgs.sway}/bin/sway"; + Restart = "on-failure"; + RestartSec = "1"; + TimeoutStopSec = "10"; + }; +} diff --git a/modules/graphical/sway/swayidle.service.nix b/modules/graphical/sway/swayidle.service.nix new file mode 100644 index 0000000..de984e7 --- /dev/null +++ b/modules/graphical/sway/swayidle.service.nix @@ -0,0 +1,26 @@ +{ + pkgs, + psCfg, + ... +}: { + Unit = { + Description = "Idle manager for Wayland"; + Documentation = ["man:swayidle(1)"]; + BindsTo = ["graphical-session.target"]; + Wants = ["graphical-session-pre.target"]; + After = ["graphical-session-pre.target"]; + }; + Service = { + Type = "simple"; + ExecStart = '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 300 '${pkgs.swaylock-bg}/bin/swaylock-bg' \ + timeout 600 '${pkgs.sway}/bin/swaymsg "output * dpms off"' \ + resume '${pkgs.sway}/bin/swaymsg "output * dpms on"' \ + before-sleep '${pkgs.swaylock-bg}/bin/swaylock-bg' + ''; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/swaynotificationcenter.service.nix b/modules/graphical/sway/swaynotificationcenter.service.nix new file mode 100644 index 0000000..44d22bd --- /dev/null +++ b/modules/graphical/sway/swaynotificationcenter.service.nix @@ -0,0 +1,21 @@ +pkgs: { + Unit = { + Description = "Swaync notification daemon"; + Documentation = "https://github.com/ErikReider/SwayNotificationCenter"; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + Requisite = ["graphical-session.target"]; + # ConditionEnvironment requires systemd v247 to work correctly + ConditionEnvironment = ["WAYLAND_DISPLAY"]; + }; + Service = { + Type = "dbus"; + BusName = "org.freedesktop.Notifications"; + ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync"; + ExecReload = "${pkgs.swaynotificationcenter}/bin/swaync-client --reload-config ; ${pkgs.swaynotificationcenter}/bin/swaync-client --reload-css"; + Restart = "on-failure"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/waybar.service.nix b/modules/graphical/sway/waybar.service.nix new file mode 100644 index 0000000..4715fe8 --- /dev/null +++ b/modules/graphical/sway/waybar.service.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: { + Unit = { + Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors."; + Documentation = "https://github.com/Alexays/Waybar/wiki/"; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target" "network-online.target"]; + Wants = ["graphical-session-pre.target" "network-online.target" "blueman-applet.service"]; + ConditionEnvironment = ["WAYLAND_DISPLAY"]; + }; + + Service = { + Type = "dbus"; + Environment = "PATH=${pkgs.bash}/bin:${pkgs.pavucontrol}/bin"; + BusName = "fr.arouillard.waybar"; + ExecStart = "${pkgs.waybar}/bin/waybar"; + }; + + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/xsettingsd.service.nix b/modules/graphical/sway/xsettingsd.service.nix new file mode 100644 index 0000000..3905726 --- /dev/null +++ b/modules/graphical/sway/xsettingsd.service.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + Unit = { + Description = "X Settings Daemon"; + Documentation = ["https://github.com/derat/xsettingsd/wiki/Installation"]; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + # ConditionEnvironment requires systemd v247 to work correctly + ConditionEnvironment = ["WAYLAND_DISPLAY"]; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.xsettingsd}/bin/xsettingsd"; + ExecStop = "/run/current-system/sw/bin/env pkill xsettingsd"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/graphical/sway/ydotool.service.nix b/modules/graphical/sway/ydotool.service.nix new file mode 100644 index 0000000..4ef7646 --- /dev/null +++ b/modules/graphical/sway/ydotool.service.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + Unit = { + Description = "ydotool - Generic command-line automation tool (no X!)"; + Documentation = ["https://github.com/ReimuNotMoe/ydotool"]; + BindsTo = ["sway-session.target"]; + After = ["sway-session.target"]; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.ydotool}/bin/ydotoold"; + Restart = "on-failure"; + RestartSec = "1"; + TimeoutStopSec = "10"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/hm-system-defaults.nix b/modules/hm-system-defaults.nix new file mode 100644 index 0000000..4bc6cf6 --- /dev/null +++ b/modules/hm-system-defaults.nix @@ -0,0 +1,11 @@ +{config, ...}: { + home-manager.sharedModules = [ + { + home.sessionVariables = { + inherit (config.environment.sessionVariables) NIX_PATH; + }; + xdg.configFile."nix/registry.json".text = + config.environment.etc."nix/registry.json".text; + } + ]; +} diff --git a/modules/invoiceplane/default.nix b/modules/invoiceplane/default.nix new file mode 100644 index 0000000..c086c24 --- /dev/null +++ b/modules/invoiceplane/default.nix @@ -0,0 +1,377 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.services.invoiceplane; + eachSite = cfg.sites; + user = "invoiceplane"; + webserver = config.services.${cfg.webserver}; + + invoiceplane-config = hostName: cfg: + pkgs.writeText "ipconfig.php" '' + IP_URL=http://${hostName} + ENABLE_DEBUG=false + DISABLE_SETUP=false + REMOVE_INDEXPHP=false + DB_HOSTNAME=${cfg.database.host} + DB_USERNAME=${cfg.database.user} + # NOTE: file_get_contents adds newline at the end of returned string + DB_PASSWORD=${ + if cfg.database.passwordFile == null + then "" + else "trim(file_get_contents('${cfg.database.passwordFile}'),\"\\r\\n\")" + } + DB_DATABASE=${cfg.database.name} + DB_PORT=${toString cfg.database.port} + SESS_EXPIRATION=864000 + ENABLE_INVOICE_DELETION=false + DISABLE_READ_ONLY=false + ENCRYPTION_KEY= + ENCRYPTION_CIPHER=AES-256 + SETUP_COMPLETED=false + REMOVE_INDEXPHP=true + ''; + + extraConfig = hostName: cfg: + pkgs.writeText "extraConfig.php" '' + ${toString cfg.extraConfig} + ''; + + pkg = hostName: cfg: + pkgs.stdenv.mkDerivation rec { + pname = "invoiceplane-${hostName}"; + version = src.version; + src = pkgs.invoiceplane; + + postPhase = '' + # Patch index.php file to load additional config file + substituteInPlace index.php \ + --replace "require('vendor/autoload.php');" "require('vendor/autoload.php'); \$dotenv = Dotenv\Dotenv::createImmutable(__DIR__, 'extraConfig.php'); \$dotenv->load();"; + ''; + + installPhase = '' + mkdir -p $out + cp -r * $out/ + + # symlink uploads and log directories + rm -r $out/uploads $out/application/logs $out/vendor/mpdf/mpdf/tmp + ln -sf ${cfg.stateDir}/uploads $out/ + ln -sf ${cfg.stateDir}/logs $out/application/ + ln -sf ${cfg.stateDir}/tmp $out/vendor/mpdf/mpdf/ + + # symlink the InvoicePlane config + ln -s ${cfg.stateDir}/ipconfig.php $out/ipconfig.php + + # symlink the extraConfig file + ln -s ${extraConfig hostName cfg} $out/extraConfig.php + + # symlink additional templates + ${concatMapStringsSep "\n" (template: "cp -r ${template}/. $out/application/views/invoice_templates/pdf/") cfg.invoiceTemplates} + ''; + }; + + siteOpts = { + lib, + name, + ... + }: { + options = { + enable = mkEnableOption (lib.mdDoc "InvoicePlane web application"); + + stateDir = mkOption { + type = types.path; + default = "/var/lib/invoiceplane/${name}"; + description = lib.mdDoc '' + This directory is used for uploads of attachments and cache. + The directory passed here is automatically created and permissions + adjusted as required. + ''; + }; + + database = { + host = mkOption { + type = types.str; + default = "localhost"; + description = lib.mdDoc "Database host address."; + }; + + port = mkOption { + type = types.port; + default = 3306; + description = lib.mdDoc "Database host port."; + }; + + name = mkOption { + type = types.str; + default = "invoiceplane"; + description = lib.mdDoc "Database name."; + }; + + user = mkOption { + type = types.str; + default = "invoiceplane"; + description = lib.mdDoc "Database user."; + }; + + passwordFile = mkOption { + type = types.nullOr types.path; + default = null; + example = "/run/keys/invoiceplane-dbpassword"; + description = lib.mdDoc '' + A file containing the password corresponding to + {option}`database.user`. + ''; + }; + + createLocally = mkOption { + type = types.bool; + default = true; + description = lib.mdDoc "Create the database and database user locally."; + }; + }; + + invoiceTemplates = mkOption { + type = types.listOf types.path; + default = []; + description = lib.mdDoc '' + List of path(s) to respective template(s) which are copied from the 'invoice_templates/pdf' directory. + + ::: {.note} + These templates need to be packaged before use, see example. + ::: + ''; + example = literalExpression '' + let + # Let's package an example template + template-vtdirektmarketing = pkgs.stdenv.mkDerivation { + name = "vtdirektmarketing"; + # Download the template from a public repository + src = pkgs.fetchgit { + url = "https://git.project-insanity.org/onny/invoiceplane-vtdirektmarketing.git"; + sha256 = "1hh0q7wzsh8v8x03i82p6qrgbxr4v5fb05xylyrpp975l8axyg2z"; + }; + sourceRoot = "."; + # Installing simply means copying template php file to the output directory + installPhase = "" + mkdir -p $out + cp invoiceplane-vtdirektmarketing/vtdirektmarketing.php $out/ + ""; + }; + # And then pass this package to the template list like this: + in [ template-vtdirektmarketing ] + ''; + }; + + poolConfig = mkOption { + type = with types; attrsOf (oneOf [str int bool]); + default = { + "pm" = "dynamic"; + "pm.max_children" = 32; + "pm.start_servers" = 2; + "pm.min_spare_servers" = 2; + "pm.max_spare_servers" = 4; + "pm.max_requests" = 500; + }; + description = lib.mdDoc '' + Options for the InvoicePlane PHP pool. See the documentation on `php-fpm.conf` + for details on configuration directives. + ''; + }; + + extraConfig = mkOption { + type = types.nullOr types.lines; + default = null; + example = '' + SETUP_COMPLETED=true + DISABLE_SETUP=true + IP_URL=https://invoice.example.com + ''; + description = lib.mdDoc '' + InvoicePlane configuration. Refer to + + for details on supported values. + ''; + }; + + cron = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Enable cron service which periodically runs Invoiceplane tasks. + Requires key taken from the administration page. Refer to + + on how to configure it. + ''; + }; + + key = mkOption { + type = types.str; + description = lib.mdDoc "Cron key taken from the administration page."; + }; + }; + }; + }; +in { + disabledModules = [ + "services/web-apps/invoiceplane.nix" + ]; + + # interface + options = { + services.invoiceplane = mkOption { + type = types.submodule { + options.sites = mkOption { + type = types.attrsOf (types.submodule siteOpts); + default = {}; + description = lib.mdDoc "Specification of one or more WordPress sites to serve"; + }; + + options.webserver = mkOption { + type = types.enum ["caddy"]; + default = "caddy"; + description = lib.mdDoc '' + Which webserver to use for virtual host management. Currently only + caddy is supported. + ''; + }; + }; + default = {}; + description = lib.mdDoc "InvoicePlane configuration."; + }; + }; + + # implementation + config = mkIf (eachSite != {}) (mkMerge [ + { + assertions = flatten (mapAttrsToList (hostName: cfg: [ + { + assertion = cfg.database.createLocally -> cfg.database.user == user; + message = ''services.invoiceplane.sites."${hostName}".database.user must be ${user} if the database is to be automatically provisioned''; + } + { + assertion = cfg.database.createLocally -> cfg.database.passwordFile == null; + message = ''services.invoiceplane.sites."${hostName}".database.passwordFile cannot be specified if services.invoiceplane.sites."${hostName}".database.createLocally is set to true.''; + } + { + assertion = cfg.cron.enable -> cfg.cron.key != null; + message = ''services.invoiceplane.sites."${hostName}".cron.key must be set in order to use cron service.''; + } + ]) + eachSite); + + services.mysql = mkIf (any (v: v.database.createLocally) (attrValues eachSite)) { + enable = true; + package = mkDefault pkgs.mariadb; + ensureDatabases = mapAttrsToList (hostName: cfg: cfg.database.name) eachSite; + ensureUsers = + mapAttrsToList ( + hostName: cfg: { + name = cfg.database.user; + ensurePermissions = {"${cfg.database.name}.*" = "ALL PRIVILEGES";}; + } + ) + eachSite; + }; + + services.phpfpm = { + phpPackage = pkgs.php81; + pools = + mapAttrs' (hostName: cfg: ( + nameValuePair "invoiceplane-${hostName}" { + inherit user; + group = webserver.group; + settings = + { + "listen.owner" = webserver.user; + "listen.group" = webserver.group; + } + // cfg.poolConfig; + } + )) + eachSite; + }; + } + + { + systemd.tmpfiles.rules = flatten (mapAttrsToList (hostName: cfg: [ + "d ${cfg.stateDir} 0750 ${user} ${webserver.group} - -" + "f ${cfg.stateDir}/ipconfig.php 0750 ${user} ${webserver.group} - -" + "d ${cfg.stateDir}/logs 0750 ${user} ${webserver.group} - -" + "d ${cfg.stateDir}/uploads 0750 ${user} ${webserver.group} - -" + "d ${cfg.stateDir}/uploads/archive 0750 ${user} ${webserver.group} - -" + "d ${cfg.stateDir}/uploads/customer_files 0750 ${user} ${webserver.group} - -" + "d ${cfg.stateDir}/uploads/temp 0750 ${user} ${webserver.group} - -" + "d ${cfg.stateDir}/uploads/temp/mpdf 0750 ${user} ${webserver.group} - -" + "d ${cfg.stateDir}/tmp 0750 ${user} ${webserver.group} - -" + ]) + eachSite); + + systemd.services.invoiceplane-config = { + serviceConfig.Type = "oneshot"; + script = concatStrings (mapAttrsToList (hostName: cfg: '' + mkdir -p ${cfg.stateDir}/logs \ + ${cfg.stateDir}/uploads + if ! grep -q IP_URL "${cfg.stateDir}/ipconfig.php"; then + cp "${invoiceplane-config hostName cfg}" "${cfg.stateDir}/ipconfig.php" + fi + '') + eachSite); + wantedBy = ["multi-user.target"]; + }; + + users.users.${user} = { + group = webserver.group; + isSystemUser = true; + }; + } + { + # Cron service implementation + + systemd.timers = + mapAttrs' (hostName: cfg: ( + nameValuePair "invoiceplane-cron-${hostName}" (mkIf cfg.cron.enable { + wantedBy = ["timers.target"]; + timerConfig = { + OnBootSec = "5m"; + OnUnitActiveSec = "5m"; + Unit = "invoiceplane-cron-${hostName}.service"; + }; + }) + )) + eachSite; + + systemd.services = + mapAttrs' (hostName: cfg: ( + nameValuePair "invoiceplane-cron-${hostName}" (mkIf cfg.cron.enable { + serviceConfig = { + Type = "oneshot"; + User = user; + ExecStart = "${pkgs.curl}/bin/curl --header 'Host: ${hostName}' http://localhost/invoices/cron/recur/${cfg.cron.key}"; + }; + }) + )) + eachSite; + } + + (mkIf (cfg.webserver == "caddy") { + services.caddy = { + enable = true; + virtualHosts = + mapAttrs' (hostName: cfg: ( + nameValuePair "http://${hostName}" { + extraConfig = '' + root * ${pkg hostName cfg} + file_server + php_fastcgi unix/${config.services.phpfpm.pools."invoiceplane-${hostName}".socket} + ''; + } + )) + eachSite; + }; + }) + ]); +} diff --git a/modules/nextcloud/default.nix b/modules/nextcloud/default.nix new file mode 100644 index 0000000..09fb840 --- /dev/null +++ b/modules/nextcloud/default.nix @@ -0,0 +1,13 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + home-manager.users."${psCfg.user.name}" = { + systemd.user.services.nextcloud-client = import ./nextcloud.service.nix pkgs; + }; +} diff --git a/modules/nextcloud/nextcloud.service.nix b/modules/nextcloud/nextcloud.service.nix new file mode 100644 index 0000000..f326797 --- /dev/null +++ b/modules/nextcloud/nextcloud.service.nix @@ -0,0 +1,20 @@ +pkgs: { + Unit = { + Description = "Nextcloud Client"; + BindsTo = ["sway-session.target"]; + Wants = ["graphical-session-pre.target"]; + After = ["graphical-session-pre.target"]; + # ConditionEnvironment requires systemd v247 to work correctly + ConditionEnvironment = ["WAYLAND_DISPLAY"]; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.nextcloud-client}/bin/nextcloud --background"; + ExecReload = "/run/current-system/sw/bin/kill -HUP $MAINPID"; + KillMode = "process"; + Restart = "on-failure"; + }; + Install = { + WantedBy = ["sway-session.target"]; + }; +} diff --git a/modules/nix/default.nix b/modules/nix/default.nix new file mode 100644 index 0000000..1d6746e --- /dev/null +++ b/modules/nix/default.nix @@ -0,0 +1,65 @@ +{ + config, + pkgs, + lib, + flake, + ... +}: { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "1password" + "1password-cli" + "cups-brother-hl3140cw" + "facetimehd-firmware" + "slack" + "veracrypt" + "zoom" + ]; + + nix = { + # Use default version alias for nix package + package = pkgs.nix; + gc.automatic = true; + optimise.automatic = true; + + registry = { + nixpkgs.flake = flake.inputs.nixpkgs; + unstable.flake = flake.inputs.unstable; + system.flake = flake.self; + }; + + settings = { + # Improve nix store disk usage + auto-optimise-store = true; + # Prevents impurities in builds + sandbox = true; + # Give root and @wheel special privileges with nix + trusted-users = ["root" "@wheel"]; + # Allow only group wheel to connect to the nix daemon + allowed-users = ["@wheel"]; + + substituters = [ + "https://pub-solar.cachix.org/" + ]; + + trusted-public-keys = [ + "pub-solar.cachix.org-1:ZicXIxKgdxMtgSJECWR8iihZxHRvu8ObL4n2cuBmtos=" + ]; + }; + + # Generally useful nix option defaults + extraOptions = lib.mkForce '' + experimental-features = flakes nix-command + min-free = 536870912 + keep-outputs = true + keep-derivations = true + fallback = true + ''; + + nixPath = [ + "nixpkgs=${flake.inputs.nixpkgs}" + "nixos-config=${../../lib/compat/nixos}" + "home-manager=${flake.inputs.home-manager}" + ]; + }; +} diff --git a/modules/office/default.nix b/modules/office/default.nix new file mode 100644 index 0000000..483e33f --- /dev/null +++ b/modules/office/default.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + programs.evince.enable = true; + + users.users."${psCfg.user.name}".packages = with pkgs; [ + libreoffice-fresh + gnome.simple-scan + # Tools like pdfunite + poppler_utils + # tool for annotating PDFs + xournalpp + ]; +} diff --git a/modules/printing/default.nix b/modules/printing/default.nix new file mode 100644 index 0000000..7de591e --- /dev/null +++ b/modules/printing/default.nix @@ -0,0 +1,40 @@ +{ + flake, + config, + pkgs, + lib, + ... +}: { + services.avahi.enable = true; + services.avahi.ipv6 = true; + services.avahi.nssmdns = true; + services.avahi.publish.enable = true; + services.avahi.publish.userServices = true; + + services.printing.enable = true; + services.printing.browsing = true; + services.printing.listenAddresses = ["localhost:631"]; + services.printing.defaultShared = lib.mkDefault false; + + services.printing.drivers = + [ + pkgs.gutenprint + ] + ++ ( + if (pkgs.system == "x86_64-linux") + then [pkgs.cups-brother-hl3140cw] + else [] + ); + + networking.hosts = flake.self.lib.addLocalHostname ["cups.local"]; + + services.caddy = { + enable = true; + extraConfig = '' + cups.local { + request_header Host localhost:631 + reverse_proxy unix//run/cups/cups.sock + } + ''; + }; +} diff --git a/modules/terminal-life/.config/git/config.nix b/modules/terminal-life/.config/git/config.nix new file mode 100644 index 0000000..dc50bd8 --- /dev/null +++ b/modules/terminal-life/.config/git/config.nix @@ -0,0 +1,47 @@ +{ + config, + pkgs, + ... +}: let + user = config.pub-solar.user; + xdg = config.home-manager.users."${user.name}".xdg; +in '' [user] + ${ + if user.email != null + then "email = ${user.email}" + else "" + } + ${ + if user.fullName != null + then "name = ${user.fullName}" + else "" + } + ${ + if user.gpgKeyId != null + then "signingkey = ${user.gpgKeyId}" + else "" + } + [core] + editor = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim + excludesFile = /home/${config.pub-solar.user.name}/.config/git/global_gitignore + [alias] + pol = pull + ack = -c color.grep.linenumber=\"bold yellow\"\n -c color.grep.filename=\"bold green\"\n -c color.grep.match=\"reverse yellow\"\n grep --break --heading --line-number + # define command which will be used when "nvim"is set as a merge tool + + [mergetool] + prompt = false + [merge] + tool = nvim + [mergetool "nvim"] + cmd = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim -f -c \"Gdiffsplit!\" \"$MERGED\" + + [commit] + gpgsign = true + template = ${xdg.configHome}/git/gitmessage + [tag] + gpgsign = true + [init] + defaultBranch = main + [pull] + rebase = false'' diff --git a/modules/terminal-life/.config/git/gitmessage.nix b/modules/terminal-life/.config/git/gitmessage.nix new file mode 100644 index 0000000..223bfc3 --- /dev/null +++ b/modules/terminal-life/.config/git/gitmessage.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + ... +}: let + user = config.pub-solar.user; + xdg = config.home-manager.users."${user.name}".xdg; +in '' +# What happened? +# +# fix feat build chore ci docs style refactor perf test +# +# type!(optional scope): --------------# +# + + +# ^\n +# What exactly was done and why? --------------------------------------# +# + + +# ^\n +# +# Any issue numbers or links? +# +# Ref: #123 + + +# ^\n +# +# Co-authored-by: Example Name +'' diff --git a/modules/terminal-life/.config/git/global_gitignore.nix b/modules/terminal-life/.config/git/global_gitignore.nix new file mode 100644 index 0000000..ece329a --- /dev/null +++ b/modules/terminal-life/.config/git/global_gitignore.nix @@ -0,0 +1,6 @@ +{ + config, + pkgs, + ... +}: let +in ''tags'' diff --git a/modules/terminal-life/.local/share/nvim/json-schemas/caddy_schema.json b/modules/terminal-life/.local/share/nvim/json-schemas/caddy_schema.json new file mode 100644 index 0000000..71873a0 --- /dev/null +++ b/modules/terminal-life/.local/share/nvim/json-schemas/caddy_schema.json @@ -0,0 +1,8087 @@ +{ + "title": "Caddy v2 autogenerated JSON schema \nhttps://github.com/abiosoft/caddy-json-schema", + "description": ": object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Config\nConfig is the top (or beginning) of the Caddy configuration structure.\nCaddy config is expressed natively as a JSON document. If you prefer\nnot to work with JSON directly, there are [many config adapters](/docs/config-adapters)\navailable that can convert various inputs into Caddy JSON.\n\nMany parts of this config are extensible through the use of Caddy modules.\nFields which have a json.RawMessage type and which appear as dots (•••) in\nthe online docs can be fulfilled by modules in a certain module\nnamespace. The docs show which modules can be used in a given place.\n\nWhenever a module is used, its name must be given either inline as part of\nthe module, or as the key to the module's value. The docs will make it clear\nwhich to use.\n\nGenerally, all config settings are optional, as it is Caddy convention to\nhave good, documented default values. If a parameter is required, the docs\nshould say so.\n\nGo programs which are directly building a Config struct value should take\ncare to populate the JSON-encodable fields of the struct (i.e. the fields\nwith `json` struct tags) if employing the module lifecycle (e.g. Provision\nmethod calls).\n\n", + "markdownDescription": ": `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Config) \nConfig is the top (or beginning) of the Caddy configuration structure.\nCaddy config is expressed natively as a JSON document. If you prefer\nnot to work with JSON directly, there are [many config adapters](/docs/config-adapters)\navailable that can convert various inputs into Caddy JSON.\n\nMany parts of this config are extensible through the use of Caddy modules.\nFields which have a json.RawMessage type and which appear as dots (•••) in\nthe online docs can be fulfilled by modules in a certain module\nnamespace. The docs show which modules can be used in a given place.\n\nWhenever a module is used, its name must be given either inline as part of\nthe module, or as the key to the module's value. The docs will make it clear\nwhich to use.\n\nGenerally, all config settings are optional, as it is Caddy convention to\nhave good, documented default values. If a parameter is required, the docs\nshould say so.\n\nGo programs which are directly building a Config struct value should take\ncare to populate the JSON-encodable fields of the struct (i.e. the fields\nwith `json` struct tags) if employing the module lifecycle (e.g. Provision\nmethod calls).\n \n", + "type": "object", + "definitions": { + "admin.api.load": { + "description": "load: object\nModule: admin.api.load", + "markdownDescription": "load: `object` \nModule: `admin.api.load`", + "type": "object" + }, + "admin.api.metrics": { + "description": "metrics: object\nModule: admin.api.metrics\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/metrics#AdminMetrics", + "markdownDescription": "metrics: `object` \nModule: `admin.api.metrics` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/metrics#AdminMetrics)", + "type": "object" + }, + "admin.api.pki": { + "description": "pki: object\nModule: admin.api.pki", + "markdownDescription": "pki: `object` \nModule: `admin.api.pki`", + "type": "object" + }, + "admin.api.reverse_proxy": { + "description": "reverse_proxy: object\nModule: admin.api.reverse_proxy", + "markdownDescription": "reverse_proxy: `object` \nModule: `admin.api.reverse_proxy`", + "type": "object" + }, + "caddy.adapters.caddyfile": { + "description": "caddyfile: object\nModule: caddy.adapters.caddyfile", + "markdownDescription": "caddyfile: `object` \nModule: `caddy.adapters.caddyfile`", + "type": "object" + }, + "caddy.config_loaders.http": { + "description": "http: object\nModule: caddy.config_loaders.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/caddyconfig#HTTPLoader\nHTTPLoader can load Caddy configs over HTTP(S). It can adapt the config\nbased on the Content-Type header of the HTTP response.\n\n", + "markdownDescription": "http: `object` \nModule: `caddy.config_loaders.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/caddyconfig#HTTPLoader) \nHTTPLoader can load Caddy configs over HTTP(S). It can adapt the config\nbased on the Content-Type header of the HTTP response.\n \n", + "type": "object", + "properties": { + "header": { + "description": "header: object\nModule: caddy.config_loaders.http\nHTTP headers to add to the request.\n", + "markdownDescription": "header: `object` \nModule: `caddy.config_loaders.http` \nHTTP headers to add to the request. \n", + "type": "object", + "additionalProperties": { + "description": "HTTP headers to add to the request.\n", + "markdownDescription": "HTTP headers to add to the request. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "method": { + "description": "method: string\nModule: caddy.config_loaders.http\nThe method for the request. Default: GET\n", + "markdownDescription": "method: `string` \nModule: `caddy.config_loaders.http` \nThe method for the request. Default: GET \n", + "type": "string" + }, + "timeout": { + "description": "timeout: number\nModule: caddy.config_loaders.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nMaximum time allowed for a complete connection and request.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "timeout: `number` \nModule: `caddy.config_loaders.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nMaximum time allowed for a complete connection and request.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "tls": { + "description": "tls: object\nModule: caddy.config_loaders.http\n", + "markdownDescription": "tls: `object` \nModule: `caddy.config_loaders.http` \n", + "type": "object", + "properties": { + "client_certificate_file": { + "description": "client_certificate_file: string\nModule: caddy.config_loaders.http\n", + "markdownDescription": "client_certificate_file: `string` \nModule: `caddy.config_loaders.http` \n", + "type": "string" + }, + "client_certificate_key_file": { + "description": "client_certificate_key_file: string\nModule: caddy.config_loaders.http\n", + "markdownDescription": "client_certificate_key_file: `string` \nModule: `caddy.config_loaders.http` \n", + "type": "string" + }, + "root_ca_pem_files": { + "description": "root_ca_pem_files: array\nModule: caddy.config_loaders.http\n", + "markdownDescription": "root_ca_pem_files: `array` \nModule: `caddy.config_loaders.http` \n", + "type": "array", + "items": { + "type": "string" + } + }, + "use_server_identity": { + "description": "use_server_identity: boolean\nModule: caddy.config_loaders.http\n", + "markdownDescription": "use_server_identity: `boolean` \nModule: `caddy.config_loaders.http` \n", + "type": "boolean" + } + } + }, + "url": { + "description": "url: string\nModule: caddy.config_loaders.http\nThe URL of the request.\n", + "markdownDescription": "url: `string` \nModule: `caddy.config_loaders.http` \nThe URL of the request. \n", + "type": "string" + } + } + }, + "caddy.listeners.http_redirect": { + "description": "http_redirect: object\nModule: caddy.listeners.http_redirect\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#HTTPRedirectListenerWrapper\nHTTPRedirectListenerWrapper provides HTTP-\u003eHTTPS redirects for\nconnections that come on the TLS port as an HTTP request,\nby detecting using the first few bytes that it's not a TLS\nhandshake, but instead an HTTP request.\n\nThis is especially useful when using a non-standard HTTPS port.\nA user may simply type the address in their browser without the\nhttps:// scheme, which would cause the browser to attempt the\nconnection over HTTP, but this would cause a \"Client sent an\nHTTP request to an HTTPS server\" error response.\n\nThis listener wrapper must be placed BEFORE the \"tls\" listener\nwrapper, for it to work properly.\n\n", + "markdownDescription": "http_redirect: `object` \nModule: `caddy.listeners.http_redirect` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#HTTPRedirectListenerWrapper) \nHTTPRedirectListenerWrapper provides HTTP-\u003eHTTPS redirects for\nconnections that come on the TLS port as an HTTP request,\nby detecting using the first few bytes that it's not a TLS\nhandshake, but instead an HTTP request.\n\nThis is especially useful when using a non-standard HTTPS port.\nA user may simply type the address in their browser without the\nhttps:// scheme, which would cause the browser to attempt the\nconnection over HTTP, but this would cause a \"Client sent an\nHTTP request to an HTTPS server\" error response.\n\nThis listener wrapper must be placed BEFORE the \"tls\" listener\nwrapper, for it to work properly.\n \n", + "type": "object" + }, + "caddy.listeners.tls": { + "description": "tls: object\nModule: caddy.listeners.tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#tlsPlaceholderWrapper\ntlsPlaceholderWrapper is a no-op listener wrapper that marks\nwhere the TLS listener should be in a chain of listener wrappers.\nIt should only be used if another listener wrapper must be placed\nin front of the TLS handshake.\n\n", + "markdownDescription": "tls: `object` \nModule: `caddy.listeners.tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#tlsPlaceholderWrapper) \ntlsPlaceholderWrapper is a no-op listener wrapper that marks\nwhere the TLS listener should be in a chain of listener wrappers.\nIt should only be used if another listener wrapper must be placed\nin front of the TLS handshake.\n \n", + "type": "object" + }, + "caddy.logging.encoders.console": { + "description": "console: object\nModule: caddy.logging.encoders.console\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#ConsoleEncoder\nConsoleEncoder encodes log entries that are mostly human-readable.\n\n", + "markdownDescription": "console: `object` \nModule: `caddy.logging.encoders.console` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#ConsoleEncoder) \nConsoleEncoder encodes log entries that are mostly human-readable.\n \n", + "type": "object", + "properties": { + "caller_key": { + "description": "caller_key: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "caller_key: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "duration_format": { + "description": "duration_format: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "duration_format: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "level_format": { + "description": "level_format: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "level_format: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "level_key": { + "description": "level_key: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "level_key: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "line_ending": { + "description": "line_ending: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "line_ending: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "message_key": { + "description": "message_key: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "message_key: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "name_key": { + "description": "name_key: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "name_key: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "stacktrace_key": { + "description": "stacktrace_key: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "stacktrace_key: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "time_format": { + "description": "time_format: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "time_format: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + }, + "time_key": { + "description": "time_key: string\nModule: caddy.logging.encoders.console\n", + "markdownDescription": "time_key: `string` \nModule: `caddy.logging.encoders.console` \n", + "type": "string" + } + } + }, + "caddy.logging.encoders.filter": { + "description": "filter: object\nModule: caddy.logging.encoders.filter\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#FilterEncoder\nFilterEncoder can filter (manipulate) fields on\nlog entries before they are actually encoded by\nan underlying encoder.\n\n", + "markdownDescription": "filter: `object` \nModule: `caddy.logging.encoders.filter` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#FilterEncoder) \nFilterEncoder can filter (manipulate) fields on\nlog entries before they are actually encoded by\nan underlying encoder.\n \n", + "type": "object", + "properties": { + "fields": { + "description": "fields: object\nModule: caddy.logging.encoders.filter\nA map of field names to their filters. Note that this\nis not a module map; the keys are field names.\n\nNested fields can be referenced by representing a\nlayer of nesting with `\u003e`. In other words, for an\nobject like `{\"a\":{\"b\":0}}`, the inner field can\nbe referenced as `a\u003eb`.\n\nThe following fields are fundamental to the log and\ncannot be filtered because they are added by the\nunderlying logging library as special cases: ts,\nlevel, logger, and msg.\n", + "markdownDescription": "fields: `object` \nModule: `caddy.logging.encoders.filter` \nA map of field names to their filters. Note that this\nis not a module map; the keys are field names.\n\nNested fields can be referenced by representing a\nlayer of nesting with `\u003e`. In other words, for an\nobject like `{\"a\":{\"b\":0}}`, the inner field can\nbe referenced as `a\u003eb`.\n\nThe following fields are fundamental to the log and\ncannot be filtered because they are added by the\nunderlying logging library as special cases: ts,\nlevel, logger, and msg. \n", + "type": "object", + "additionalProperties": { + "required": [ + "filter" + ], + "allOf": [ + { + "if": { + "properties": { + "filter": { + "const": "rename" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.rename" + } + }, + { + "if": { + "properties": { + "filter": { + "const": "replace" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.replace" + } + }, + { + "if": { + "properties": { + "filter": { + "const": "cookie" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.cookie" + } + }, + { + "if": { + "properties": { + "filter": { + "const": "delete" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.delete" + } + }, + { + "if": { + "properties": { + "filter": { + "const": "hash" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.hash" + } + }, + { + "if": { + "properties": { + "filter": { + "const": "ip_mask" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.ip_mask" + } + }, + { + "if": { + "properties": { + "filter": { + "const": "query" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.query" + } + }, + { + "if": { + "properties": { + "filter": { + "const": "regexp" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter.regexp" + } + }, + { + "properties": { + "filter": { + "description": "key to identify fields module.\nfilter: string\nModule: caddy.logging.encoders.filter", + "markdownDescription": "key to identify `fields` module. \nfilter: `string` \nModule: `caddy.logging.encoders.filter`", + "type": "string", + "enum": [ + "rename", + "replace", + "cookie", + "delete", + "hash", + "ip_mask", + "query", + "regexp" + ] + } + } + } + ] + } + }, + "wrap": { + "description": "wrap: object\nModule: caddy.logging.encoders\nThe underlying encoder that actually\nencodes the log entries. Required.\n", + "markdownDescription": "wrap: `object` \nModule: `caddy.logging.encoders` \nThe underlying encoder that actually\nencodes the log entries. Required. \n", + "type": "object", + "required": [ + "format" + ], + "allOf": [ + { + "if": { + "properties": { + "format": { + "const": "json" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.json" + } + }, + { + "if": { + "properties": { + "format": { + "const": "console" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.console" + } + }, + { + "if": { + "properties": { + "format": { + "const": "filter" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter" + } + }, + { + "properties": { + "format": { + "description": "key to identify wrap module.\nformat: string\nModule: caddy.logging.encoders", + "markdownDescription": "key to identify `wrap` module. \nformat: `string` \nModule: `caddy.logging.encoders`", + "type": "string", + "enum": [ + "json", + "console", + "filter" + ] + } + } + } + ] + } + } + }, + "caddy.logging.encoders.filter.cookie": { + "description": "cookie: object\nModule: caddy.logging.encoders.filter.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter", + "markdownDescription": "cookie: `object` \nModule: `caddy.logging.encoders.filter.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter)", + "type": "object", + "properties": { + "actions": { + "description": "actions: array\nModule: caddy.logging.encoders.filter.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter", + "markdownDescription": "actions: `array` \nModule: `caddy.logging.encoders.filter.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter)", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "name: string\nModule: caddy.logging.encoders.filter.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter", + "markdownDescription": "name: `string` \nModule: `caddy.logging.encoders.filter.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter)", + "type": "string" + }, + "type": { + "description": "type: string\nModule: caddy.logging.encoders.filter.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter", + "markdownDescription": "type: `string` \nModule: `caddy.logging.encoders.filter.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter)", + "type": "string" + }, + "value": { + "description": "value: string\nModule: caddy.logging.encoders.filter.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter", + "markdownDescription": "value: `string` \nModule: `caddy.logging.encoders.filter.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#CookieFilter)", + "type": "string" + } + } + } + } + } + }, + "caddy.logging.encoders.filter.delete": { + "description": "delete: object\nModule: caddy.logging.encoders.filter.delete\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#DeleteFilter", + "markdownDescription": "delete: `object` \nModule: `caddy.logging.encoders.filter.delete` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#DeleteFilter)", + "type": "object" + }, + "caddy.logging.encoders.filter.hash": { + "description": "hash: object\nModule: caddy.logging.encoders.filter.hash\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#HashFilter", + "markdownDescription": "hash: `object` \nModule: `caddy.logging.encoders.filter.hash` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#HashFilter)", + "type": "object" + }, + "caddy.logging.encoders.filter.ip_mask": { + "description": "ip_mask: object\nModule: caddy.logging.encoders.filter.ip_mask\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#IPMaskFilter", + "markdownDescription": "ip_mask: `object` \nModule: `caddy.logging.encoders.filter.ip_mask` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#IPMaskFilter)", + "type": "object", + "properties": { + "ipv4_cidr": { + "description": "ipv4_cidr: number\nModule: caddy.logging.encoders.filter.ip_mask\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#IPMaskFilter", + "markdownDescription": "ipv4_cidr: `number` \nModule: `caddy.logging.encoders.filter.ip_mask` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#IPMaskFilter)", + "type": "number" + }, + "ipv6_cidr": { + "description": "ipv6_cidr: number\nModule: caddy.logging.encoders.filter.ip_mask\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#IPMaskFilter", + "markdownDescription": "ipv6_cidr: `number` \nModule: `caddy.logging.encoders.filter.ip_mask` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#IPMaskFilter)", + "type": "number" + } + } + }, + "caddy.logging.encoders.filter.query": { + "description": "query: object\nModule: caddy.logging.encoders.filter.query\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter", + "markdownDescription": "query: `object` \nModule: `caddy.logging.encoders.filter.query` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter)", + "type": "object", + "properties": { + "actions": { + "description": "actions: array\nModule: caddy.logging.encoders.filter.query\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter", + "markdownDescription": "actions: `array` \nModule: `caddy.logging.encoders.filter.query` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter)", + "type": "array", + "items": { + "type": "object", + "properties": { + "parameter": { + "description": "parameter: string\nModule: caddy.logging.encoders.filter.query\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter", + "markdownDescription": "parameter: `string` \nModule: `caddy.logging.encoders.filter.query` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter)", + "type": "string" + }, + "type": { + "description": "type: string\nModule: caddy.logging.encoders.filter.query\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter", + "markdownDescription": "type: `string` \nModule: `caddy.logging.encoders.filter.query` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter)", + "type": "string" + }, + "value": { + "description": "value: string\nModule: caddy.logging.encoders.filter.query\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter", + "markdownDescription": "value: `string` \nModule: `caddy.logging.encoders.filter.query` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#QueryFilter)", + "type": "string" + } + } + } + } + } + }, + "caddy.logging.encoders.filter.regexp": { + "description": "regexp: object\nModule: caddy.logging.encoders.filter.regexp\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RegexpFilter", + "markdownDescription": "regexp: `object` \nModule: `caddy.logging.encoders.filter.regexp` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RegexpFilter)", + "type": "object", + "properties": { + "regexp": { + "description": "regexp: string\nModule: caddy.logging.encoders.filter.regexp\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RegexpFilter", + "markdownDescription": "regexp: `string` \nModule: `caddy.logging.encoders.filter.regexp` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RegexpFilter)", + "type": "string" + }, + "value": { + "description": "value: string\nModule: caddy.logging.encoders.filter.regexp\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RegexpFilter", + "markdownDescription": "value: `string` \nModule: `caddy.logging.encoders.filter.regexp` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RegexpFilter)", + "type": "string" + } + } + }, + "caddy.logging.encoders.filter.rename": { + "description": "rename: object\nModule: caddy.logging.encoders.filter.rename\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RenameFilter", + "markdownDescription": "rename: `object` \nModule: `caddy.logging.encoders.filter.rename` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RenameFilter)", + "type": "object", + "properties": { + "name": { + "description": "name: string\nModule: caddy.logging.encoders.filter.rename\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RenameFilter", + "markdownDescription": "name: `string` \nModule: `caddy.logging.encoders.filter.rename` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#RenameFilter)", + "type": "string" + } + } + }, + "caddy.logging.encoders.filter.replace": { + "description": "replace: object\nModule: caddy.logging.encoders.filter.replace\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#ReplaceFilter", + "markdownDescription": "replace: `object` \nModule: `caddy.logging.encoders.filter.replace` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#ReplaceFilter)", + "type": "object", + "properties": { + "value": { + "description": "value: string\nModule: caddy.logging.encoders.filter.replace\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#ReplaceFilter", + "markdownDescription": "value: `string` \nModule: `caddy.logging.encoders.filter.replace` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#ReplaceFilter)", + "type": "string" + } + } + }, + "caddy.logging.encoders.json": { + "description": "json: object\nModule: caddy.logging.encoders.json\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#JSONEncoder\nJSONEncoder encodes entries as JSON.\n\n", + "markdownDescription": "json: `object` \nModule: `caddy.logging.encoders.json` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#JSONEncoder) \nJSONEncoder encodes entries as JSON.\n \n", + "type": "object", + "properties": { + "caller_key": { + "description": "caller_key: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "caller_key: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "duration_format": { + "description": "duration_format: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "duration_format: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "level_format": { + "description": "level_format: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "level_format: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "level_key": { + "description": "level_key: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "level_key: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "line_ending": { + "description": "line_ending: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "line_ending: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "message_key": { + "description": "message_key: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "message_key: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "name_key": { + "description": "name_key: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "name_key: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "stacktrace_key": { + "description": "stacktrace_key: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "stacktrace_key: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "time_format": { + "description": "time_format: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "time_format: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + }, + "time_key": { + "description": "time_key: string\nModule: caddy.logging.encoders.json\n", + "markdownDescription": "time_key: `string` \nModule: `caddy.logging.encoders.json` \n", + "type": "string" + } + } + }, + "caddy.logging.writers.discard": { + "description": "discard: object\nModule: caddy.logging.writers.discard\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#DiscardWriter\nDiscardWriter discards all writes.\n\n", + "markdownDescription": "discard: `object` \nModule: `caddy.logging.writers.discard` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#DiscardWriter) \nDiscardWriter discards all writes.\n \n", + "type": "object" + }, + "caddy.logging.writers.file": { + "description": "file: object\nModule: caddy.logging.writers.file\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#FileWriter\nFileWriter can write logs to files. By default, log files\nare rotated (\"rolled\") when they get large, and old log\nfiles get deleted, to ensure that the process does not\nexhaust disk space.\n\n", + "markdownDescription": "file: `object` \nModule: `caddy.logging.writers.file` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#FileWriter) \nFileWriter can write logs to files. By default, log files\nare rotated (\"rolled\") when they get large, and old log\nfiles get deleted, to ensure that the process does not\nexhaust disk space.\n \n", + "type": "object", + "properties": { + "filename": { + "description": "filename: string\nModule: caddy.logging.writers.file\nFilename is the name of the file to write.\n", + "markdownDescription": "filename: `string` \nModule: `caddy.logging.writers.file` \nFilename is the name of the file to write. \n", + "type": "string" + }, + "roll": { + "description": "roll: boolean\nModule: caddy.logging.writers.file\nRoll toggles log rolling or rotation, which is\nenabled by default.\n", + "markdownDescription": "roll: `boolean` \nModule: `caddy.logging.writers.file` \nRoll toggles log rolling or rotation, which is\nenabled by default. \n", + "type": "boolean" + }, + "roll_gzip": { + "description": "roll_gzip: boolean\nModule: caddy.logging.writers.file\nWhether to compress rolled files. Default: true\n", + "markdownDescription": "roll_gzip: `boolean` \nModule: `caddy.logging.writers.file` \nWhether to compress rolled files. Default: true \n", + "type": "boolean" + }, + "roll_keep": { + "description": "roll_keep: number\nModule: caddy.logging.writers.file\nThe maximum number of rolled log files to keep.\nDefault: 10\n", + "markdownDescription": "roll_keep: `number` \nModule: `caddy.logging.writers.file` \nThe maximum number of rolled log files to keep.\nDefault: 10 \n", + "type": "number" + }, + "roll_keep_days": { + "description": "roll_keep_days: number\nModule: caddy.logging.writers.file\nHow many days to keep rolled log files. Default: 90\n", + "markdownDescription": "roll_keep_days: `number` \nModule: `caddy.logging.writers.file` \nHow many days to keep rolled log files. Default: 90 \n", + "type": "number" + }, + "roll_local_time": { + "description": "roll_local_time: boolean\nModule: caddy.logging.writers.file\nWhether to use local timestamps in rolled filenames.\nDefault: false\n", + "markdownDescription": "roll_local_time: `boolean` \nModule: `caddy.logging.writers.file` \nWhether to use local timestamps in rolled filenames.\nDefault: false \n", + "type": "boolean" + }, + "roll_size_mb": { + "description": "roll_size_mb: number\nModule: caddy.logging.writers.file\nWhen a log file reaches approximately this size,\nit will be rotated.\n", + "markdownDescription": "roll_size_mb: `number` \nModule: `caddy.logging.writers.file` \nWhen a log file reaches approximately this size,\nit will be rotated. \n", + "type": "number" + } + } + }, + "caddy.logging.writers.net": { + "description": "net: object\nModule: caddy.logging.writers.net\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#NetWriter\nNetWriter implements a log writer that outputs to a network socket. If\nthe socket goes down, it will dump logs to stderr while it attempts to\nreconnect.\n\n", + "markdownDescription": "net: `object` \nModule: `caddy.logging.writers.net` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/logging#NetWriter) \nNetWriter implements a log writer that outputs to a network socket. If\nthe socket goes down, it will dump logs to stderr while it attempts to\nreconnect.\n \n", + "type": "object", + "properties": { + "address": { + "description": "address: string\nModule: caddy.logging.writers.net\nThe address of the network socket to which to connect.\n", + "markdownDescription": "address: `string` \nModule: `caddy.logging.writers.net` \nThe address of the network socket to which to connect. \n", + "type": "string" + }, + "dial_timeout": { + "description": "dial_timeout: number\nModule: caddy.logging.writers.net\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nThe timeout to wait while connecting to the socket.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "dial_timeout: `number` \nModule: `caddy.logging.writers.net` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nThe timeout to wait while connecting to the socket.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "caddy.logging.writers.stderr": { + "description": "stderr: object\nModule: caddy.logging.writers.stderr\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#StderrWriter\nStderrWriter writes logs to standard error.\n\n", + "markdownDescription": "stderr: `object` \nModule: `caddy.logging.writers.stderr` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#StderrWriter) \nStderrWriter writes logs to standard error.\n \n", + "type": "object" + }, + "caddy.logging.writers.stdout": { + "description": "stdout: object\nModule: caddy.logging.writers.stdout\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#StdoutWriter\nStdoutWriter writes logs to standard out.\n\n", + "markdownDescription": "stdout: `object` \nModule: `caddy.logging.writers.stdout` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#StdoutWriter) \nStdoutWriter writes logs to standard out.\n \n", + "type": "object" + }, + "caddy.storage.consul": { + "description": "consul: object\nModule: caddy.storage.consul\nhttps://pkg.go.dev/github.com/pteich/caddy-tlsconsul#ConsulStorage\nConsulStorage allows to store certificates and other TLS resources\nin a shared cluster environment using Consul's key/value-store.\nIt uses distributed locks to ensure consistency.\n\n", + "markdownDescription": "consul: `object` \nModule: `caddy.storage.consul` \n[godoc](https://pkg.go.dev/github.com/pteich/caddy-tlsconsul#ConsulStorage) \nConsulStorage allows to store certificates and other TLS resources\nin a shared cluster environment using Consul's key/value-store.\nIt uses distributed locks to ensure consistency.\n \n", + "type": "object", + "properties": { + "address": { + "description": "address: string\nModule: caddy.storage.consul\n", + "markdownDescription": "address: `string` \nModule: `caddy.storage.consul` \n", + "type": "string" + }, + "aes_key": { + "description": "aes_key: array\nModule: caddy.storage.consul\n", + "markdownDescription": "aes_key: `array` \nModule: `caddy.storage.consul` \n", + "type": "array", + "items": { + "type": "number" + } + }, + "prefix": { + "description": "prefix: string\nModule: caddy.storage.consul\n", + "markdownDescription": "prefix: `string` \nModule: `caddy.storage.consul` \n", + "type": "string" + }, + "timeout": { + "description": "timeout: number\nModule: caddy.storage.consul\n", + "markdownDescription": "timeout: `number` \nModule: `caddy.storage.consul` \n", + "type": "number" + }, + "tls_enabled": { + "description": "tls_enabled: boolean\nModule: caddy.storage.consul\n", + "markdownDescription": "tls_enabled: `boolean` \nModule: `caddy.storage.consul` \n", + "type": "boolean" + }, + "tls_insecure": { + "description": "tls_insecure: boolean\nModule: caddy.storage.consul\n", + "markdownDescription": "tls_insecure: `boolean` \nModule: `caddy.storage.consul` \n", + "type": "boolean" + }, + "token": { + "description": "token: string\nModule: caddy.storage.consul\n", + "markdownDescription": "token: `string` \nModule: `caddy.storage.consul` \n", + "type": "string" + }, + "value_prefix": { + "description": "value_prefix: string\nModule: caddy.storage.consul\n", + "markdownDescription": "value_prefix: `string` \nModule: `caddy.storage.consul` \n", + "type": "string" + } + } + }, + "caddy.storage.file_system": { + "description": "file_system: object\nModule: caddy.storage.file_system\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/filestorage#FileStorage\nFileStorage is a certmagic.Storage wrapper for certmagic.FileStorage.\n\n", + "markdownDescription": "file_system: `object` \nModule: `caddy.storage.file_system` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/filestorage#FileStorage) \nFileStorage is a certmagic.Storage wrapper for certmagic.FileStorage.\n \n", + "type": "object", + "properties": { + "root": { + "description": "root: string\nModule: caddy.storage.file_system\nThe base path to the folder used for storage.\n", + "markdownDescription": "root: `string` \nModule: `caddy.storage.file_system` \nThe base path to the folder used for storage. \n", + "type": "string" + } + } + }, + "http": { + "description": "http: object\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#App\nApp is a robust, production-ready HTTP server.\n\nHTTPS is enabled by default if host matchers with qualifying names are used\nin any of routes; certificates are automatically provisioned and renewed.\nAdditionally, automatic HTTPS will also enable HTTPS for servers that listen\nonly on the HTTPS port but which do not have any TLS connection policies\ndefined by adding a good, default TLS connection policy.\n\nIn HTTP routes, additional placeholders are available (replace any `*`):\n\nPlaceholder | Description\n------------|---------------\n`{http.request.body}` | The request body (⚠️ inefficient; use only for debugging)\n`{http.request.cookie.*}` | HTTP request cookie\n`{http.request.duration}` | Time up to now spent handling the request (after decoding headers from client)\n`{http.request.duration_ms}` | Same as 'duration', but in milliseconds.\n`{http.request.uuid}` | The request unique identifier\n`{http.request.header.*}` | Specific request header field\n`{http.request.host.labels.*}` | Request host labels (0-based from right); e.g. for foo.example.com: 0=com, 1=example, 2=foo\n`{http.request.host}` | The host part of the request's Host header\n`{http.request.hostport}` | The host and port from the request's Host header\n`{http.request.method}` | The request method\n`{http.request.orig_method}` | The request's original method\n`{http.request.orig_uri.path.dir}` | The request's original directory\n`{http.request.orig_uri.path.file}` | The request's original filename\n`{http.request.orig_uri.path}` | The request's original path\n`{http.request.orig_uri.query}` | The request's original query string (without `?`)\n`{http.request.orig_uri}` | The request's original URI\n`{http.request.port}` | The port part of the request's Host header\n`{http.request.proto}` | The protocol of the request\n`{http.request.remote.host}` | The host part of the remote client's address\n`{http.request.remote.port}` | The port part of the remote client's address\n`{http.request.remote}` | The address of the remote client\n`{http.request.scheme}` | The request scheme\n`{http.request.tls.version}` | The TLS version name\n`{http.request.tls.cipher_suite}` | The TLS cipher suite\n`{http.request.tls.resumed}` | The TLS connection resumed a previous connection\n`{http.request.tls.proto}` | The negotiated next protocol\n`{http.request.tls.proto_mutual}` | The negotiated next protocol was advertised by the server\n`{http.request.tls.server_name}` | The server name requested by the client, if any\n`{http.request.tls.client.fingerprint}` | The SHA256 checksum of the client certificate\n`{http.request.tls.client.public_key}` | The public key of the client certificate.\n`{http.request.tls.client.public_key_sha256}` | The SHA256 checksum of the client's public key.\n`{http.request.tls.client.certificate_pem}` | The PEM-encoded value of the certificate.\n`{http.request.tls.client.certificate_der_base64}` | The base64-encoded value of the certificate.\n`{http.request.tls.client.issuer}` | The issuer DN of the client certificate\n`{http.request.tls.client.serial}` | The serial number of the client certificate\n`{http.request.tls.client.subject}` | The subject DN of the client certificate\n`{http.request.tls.client.san.dns_names.*}` | SAN DNS names(index optional)\n`{http.request.tls.client.san.emails.*}` | SAN email addresses (index optional)\n`{http.request.tls.client.san.ips.*}` | SAN IP addresses (index optional)\n`{http.request.tls.client.san.uris.*}` | SAN URIs (index optional)\n`{http.request.uri.path.*}` | Parts of the path, split by `/` (0-based from left)\n`{http.request.uri.path.dir}` | The directory, excluding leaf filename\n`{http.request.uri.path.file}` | The filename of the path, excluding directory\n`{http.request.uri.path}` | The path component of the request URI\n`{http.request.uri.query.*}` | Individual query string value\n`{http.request.uri.query}` | The query string (without `?`)\n`{http.request.uri}` | The full request URI\n`{http.response.header.*}` | Specific response header field\n`{http.vars.*}` | Custom variables in the HTTP handler chain\n\n", + "markdownDescription": "http: `object` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#App) \nApp is a robust, production-ready HTTP server.\n\nHTTPS is enabled by default if host matchers with qualifying names are used\nin any of routes; certificates are automatically provisioned and renewed.\nAdditionally, automatic HTTPS will also enable HTTPS for servers that listen\nonly on the HTTPS port but which do not have any TLS connection policies\ndefined by adding a good, default TLS connection policy.\n\nIn HTTP routes, additional placeholders are available (replace any `*`):\n\nPlaceholder | Description\n------------|---------------\n`{http.request.body}` | The request body (⚠️ inefficient; use only for debugging)\n`{http.request.cookie.*}` | HTTP request cookie\n`{http.request.duration}` | Time up to now spent handling the request (after decoding headers from client)\n`{http.request.duration_ms}` | Same as 'duration', but in milliseconds.\n`{http.request.uuid}` | The request unique identifier\n`{http.request.header.*}` | Specific request header field\n`{http.request.host.labels.*}` | Request host labels (0-based from right); e.g. for foo.example.com: 0=com, 1=example, 2=foo\n`{http.request.host}` | The host part of the request's Host header\n`{http.request.hostport}` | The host and port from the request's Host header\n`{http.request.method}` | The request method\n`{http.request.orig_method}` | The request's original method\n`{http.request.orig_uri.path.dir}` | The request's original directory\n`{http.request.orig_uri.path.file}` | The request's original filename\n`{http.request.orig_uri.path}` | The request's original path\n`{http.request.orig_uri.query}` | The request's original query string (without `?`)\n`{http.request.orig_uri}` | The request's original URI\n`{http.request.port}` | The port part of the request's Host header\n`{http.request.proto}` | The protocol of the request\n`{http.request.remote.host}` | The host part of the remote client's address\n`{http.request.remote.port}` | The port part of the remote client's address\n`{http.request.remote}` | The address of the remote client\n`{http.request.scheme}` | The request scheme\n`{http.request.tls.version}` | The TLS version name\n`{http.request.tls.cipher_suite}` | The TLS cipher suite\n`{http.request.tls.resumed}` | The TLS connection resumed a previous connection\n`{http.request.tls.proto}` | The negotiated next protocol\n`{http.request.tls.proto_mutual}` | The negotiated next protocol was advertised by the server\n`{http.request.tls.server_name}` | The server name requested by the client, if any\n`{http.request.tls.client.fingerprint}` | The SHA256 checksum of the client certificate\n`{http.request.tls.client.public_key}` | The public key of the client certificate.\n`{http.request.tls.client.public_key_sha256}` | The SHA256 checksum of the client's public key.\n`{http.request.tls.client.certificate_pem}` | The PEM-encoded value of the certificate.\n`{http.request.tls.client.certificate_der_base64}` | The base64-encoded value of the certificate.\n`{http.request.tls.client.issuer}` | The issuer DN of the client certificate\n`{http.request.tls.client.serial}` | The serial number of the client certificate\n`{http.request.tls.client.subject}` | The subject DN of the client certificate\n`{http.request.tls.client.san.dns_names.*}` | SAN DNS names(index optional)\n`{http.request.tls.client.san.emails.*}` | SAN email addresses (index optional)\n`{http.request.tls.client.san.ips.*}` | SAN IP addresses (index optional)\n`{http.request.tls.client.san.uris.*}` | SAN URIs (index optional)\n`{http.request.uri.path.*}` | Parts of the path, split by `/` (0-based from left)\n`{http.request.uri.path.dir}` | The directory, excluding leaf filename\n`{http.request.uri.path.file}` | The filename of the path, excluding directory\n`{http.request.uri.path}` | The path component of the request URI\n`{http.request.uri.query.*}` | Individual query string value\n`{http.request.uri.query}` | The query string (without `?`)\n`{http.request.uri}` | The full request URI\n`{http.response.header.*}` | Specific response header field\n`{http.vars.*}` | Custom variables in the HTTP handler chain\n \n", + "type": "object", + "properties": { + "grace_period": { + "description": "grace_period: number\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nGracePeriod is how long to wait for active connections when shutting\ndown the server. Once the grace period is over, connections will\nbe forcefully closed.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "grace_period: `number` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nGracePeriod is how long to wait for active connections when shutting\ndown the server. Once the grace period is over, connections will\nbe forcefully closed.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "http_port": { + "description": "http_port: number\nModule: http\nHTTPPort specifies the port to use for HTTP (as opposed to HTTPS),\nwhich is used when setting up HTTP-\u003eHTTPS redirects or ACME HTTP\nchallenge solvers. Default: 80.\n", + "markdownDescription": "http_port: `number` \nModule: `http` \nHTTPPort specifies the port to use for HTTP (as opposed to HTTPS),\nwhich is used when setting up HTTP-\u003eHTTPS redirects or ACME HTTP\nchallenge solvers. Default: 80. \n", + "type": "number" + }, + "https_port": { + "description": "https_port: number\nModule: http\nHTTPSPort specifies the port to use for HTTPS, which is used when\nsolving the ACME TLS-ALPN challenges, or whenever HTTPS is needed\nbut no specific port number is given. Default: 443.\n", + "markdownDescription": "https_port: `number` \nModule: `http` \nHTTPSPort specifies the port to use for HTTPS, which is used when\nsolving the ACME TLS-ALPN challenges, or whenever HTTPS is needed\nbut no specific port number is given. Default: 443. \n", + "type": "number" + }, + "servers": { + "description": "servers: object\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Server\nServers is the list of servers, keyed by arbitrary names chosen\nat your discretion for your own convenience; the keys do not\naffect functionality.\n\n\nServer describes an HTTP server.\n", + "markdownDescription": "servers: `object` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Server) \nServers is the list of servers, keyed by arbitrary names chosen\nat your discretion for your own convenience; the keys do not\naffect functionality.\n\n\nServer describes an HTTP server. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Server\nServers is the list of servers, keyed by arbitrary names chosen\nat your discretion for your own convenience; the keys do not\naffect functionality.\n\n\nServer describes an HTTP server.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Server) \nServers is the list of servers, keyed by arbitrary names chosen\nat your discretion for your own convenience; the keys do not\naffect functionality.\n\n\nServer describes an HTTP server. \n", + "properties": { + "allow_h2c": { + "description": "allow_h2c: boolean\nModule: http\nEnables H2C (\"Cleartext HTTP/2\" or \"H2 over TCP\") support,\nwhich will serve HTTP/2 over plaintext TCP connections if\nthe client supports it. Because this is not implemented by the\nGo standard library, using H2C is incompatible with most\nof the other options for this server. Do not enable this\nonly to achieve maximum client compatibility. In practice,\nvery few clients implement H2C, and even fewer require it.\nThis setting applies only to unencrypted HTTP listeners.\n⚠️ Experimental feature; subject to change or removal.\n", + "markdownDescription": "allow_h2c: `boolean` \nModule: `http` \nEnables H2C (\"Cleartext HTTP/2\" or \"H2 over TCP\") support,\nwhich will serve HTTP/2 over plaintext TCP connections if\nthe client supports it. Because this is not implemented by the\nGo standard library, using H2C is incompatible with most\nof the other options for this server. Do not enable this\nonly to achieve maximum client compatibility. In practice,\nvery few clients implement H2C, and even fewer require it.\nThis setting applies only to unencrypted HTTP listeners.\n⚠️ Experimental feature; subject to change or removal. \n", + "type": "boolean" + }, + "automatic_https": { + "description": "automatic_https: object\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#AutoHTTPSConfig\nAutoHTTPS configures or disables automatic HTTPS within this server.\nHTTPS is enabled automatically and by default when qualifying names\nare present in a Host matcher and/or when the server is listening\nonly on the HTTPS port.\n\n\nAutoHTTPSConfig is used to disable automatic HTTPS\nor certain aspects of it for a specific server.\nHTTPS is enabled automatically and by default when\nqualifying hostnames are available from the config.\n", + "markdownDescription": "automatic_https: `object` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#AutoHTTPSConfig) \nAutoHTTPS configures or disables automatic HTTPS within this server.\nHTTPS is enabled automatically and by default when qualifying names\nare present in a Host matcher and/or when the server is listening\nonly on the HTTPS port.\n\n\nAutoHTTPSConfig is used to disable automatic HTTPS\nor certain aspects of it for a specific server.\nHTTPS is enabled automatically and by default when\nqualifying hostnames are available from the config. \n", + "type": "object", + "properties": { + "disable": { + "description": "disable: boolean\nModule: http\nIf true, automatic HTTPS will be entirely disabled,\nincluding certificate management and redirects.\n", + "markdownDescription": "disable: `boolean` \nModule: `http` \nIf true, automatic HTTPS will be entirely disabled,\nincluding certificate management and redirects. \n", + "type": "boolean" + }, + "disable_certificates": { + "description": "disable_certificates: boolean\nModule: http\nIf true, automatic certificate management will be\ndisabled, but other auto-HTTPS features will\nremain enabled.\n", + "markdownDescription": "disable_certificates: `boolean` \nModule: `http` \nIf true, automatic certificate management will be\ndisabled, but other auto-HTTPS features will\nremain enabled. \n", + "type": "boolean" + }, + "disable_redirects": { + "description": "disable_redirects: boolean\nModule: http\nIf true, only automatic HTTP-\u003eHTTPS redirects will\nbe disabled, but other auto-HTTPS features will\nremain enabled.\n", + "markdownDescription": "disable_redirects: `boolean` \nModule: `http` \nIf true, only automatic HTTP-\u003eHTTPS redirects will\nbe disabled, but other auto-HTTPS features will\nremain enabled. \n", + "type": "boolean" + }, + "ignore_loaded_certificates": { + "description": "ignore_loaded_certificates: boolean\nModule: http\nBy default, automatic HTTPS will obtain and renew\ncertificates for qualifying hostnames. However, if\na certificate with a matching SAN is already loaded\ninto the cache, certificate management will not be\nenabled. To force automated certificate management\nregardless of loaded certificates, set this to true.\n", + "markdownDescription": "ignore_loaded_certificates: `boolean` \nModule: `http` \nBy default, automatic HTTPS will obtain and renew\ncertificates for qualifying hostnames. However, if\na certificate with a matching SAN is already loaded\ninto the cache, certificate management will not be\nenabled. To force automated certificate management\nregardless of loaded certificates, set this to true. \n", + "type": "boolean" + }, + "skip": { + "description": "skip: array\nModule: http\nHosts/domain names listed here will not be included\nin automatic HTTPS (they will not have certificates\nloaded nor redirects applied).\n", + "markdownDescription": "skip: `array` \nModule: `http` \nHosts/domain names listed here will not be included\nin automatic HTTPS (they will not have certificates\nloaded nor redirects applied). \n", + "type": "array", + "items": { + "description": "Hosts/domain names listed here will not be included\nin automatic HTTPS (they will not have certificates\nloaded nor redirects applied).\n", + "markdownDescription": "Hosts/domain names listed here will not be included\nin automatic HTTPS (they will not have certificates\nloaded nor redirects applied). \n", + "type": "string" + } + }, + "skip_certificates": { + "description": "skip_certificates: array\nModule: http\nHosts/domain names listed here will still be enabled\nfor automatic HTTPS (unless in the Skip list), except\nthat certificates will not be provisioned and managed\nfor these names.\n", + "markdownDescription": "skip_certificates: `array` \nModule: `http` \nHosts/domain names listed here will still be enabled\nfor automatic HTTPS (unless in the Skip list), except\nthat certificates will not be provisioned and managed\nfor these names. \n", + "type": "array", + "items": { + "description": "Hosts/domain names listed here will still be enabled\nfor automatic HTTPS (unless in the Skip list), except\nthat certificates will not be provisioned and managed\nfor these names.\n", + "markdownDescription": "Hosts/domain names listed here will still be enabled\nfor automatic HTTPS (unless in the Skip list), except\nthat certificates will not be provisioned and managed\nfor these names. \n", + "type": "string" + } + } + } + }, + "errors": { + "description": "errors: object\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#HTTPErrorConfig\nErrors is how this server will handle errors returned from any\nof the handlers in the primary routes. If the primary handler\nchain returns an error, the error along with its recommended\nstatus code are bubbled back up to the HTTP server which\nexecutes a separate error route, specified using this property.\nThe error routes work exactly like the normal routes.\n\n\nHTTPErrorConfig determines how to handle errors\nfrom the HTTP handlers.\n", + "markdownDescription": "errors: `object` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#HTTPErrorConfig) \nErrors is how this server will handle errors returned from any\nof the handlers in the primary routes. If the primary handler\nchain returns an error, the error along with its recommended\nstatus code are bubbled back up to the HTTP server which\nexecutes a separate error route, specified using this property.\nThe error routes work exactly like the normal routes.\n\n\nHTTPErrorConfig determines how to handle errors\nfrom the HTTP handlers. \n", + "type": "object", + "properties": { + "routes": { + "description": "routes: array\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "routes: `array` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "object", + "properties": { + "group": { + "description": "group: string\nModule: http\nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed.\n", + "markdownDescription": "group: `string` \nModule: `http` \nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed. \n", + "type": "string" + }, + "handle": { + "description": "handle: array\nModule: http.handlers\nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "handle: `array` \nModule: `http.handlers` \nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "type": "array", + "items": { + "description": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "metrics" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.metrics" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "request_body" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.request_body" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "rewrite" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.rewrite" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tracing" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.tracing" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "encode" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.encode" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "static_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.static_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "authentication" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.authentication" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response_headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response_headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "error" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.error" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "file_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.file_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "map" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.map" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "reverse_proxy" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.reverse_proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "templates" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.templates" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "acme_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.acme_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "vars" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.vars" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "push" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.push" + } + }, + { + "properties": { + "handler": { + "description": "key to identify handle module.\nhandler: string\nModule: http.handlers", + "markdownDescription": "key to identify `handle` module. \nhandler: `string` \nModule: `http.handlers`", + "type": "string", + "enum": [ + "headers", + "metrics", + "request_body", + "rewrite", + "subroute", + "tracing", + "encode", + "static_response", + "authentication", + "copy_response", + "copy_response_headers", + "error", + "file_server", + "map", + "reverse_proxy", + "templates", + "acme_server", + "vars", + "push" + ] + } + } + } + ] + } + }, + "match": { + "description": "match: array\nModule: http.matchers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "match: `array` \nModule: `http.matchers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "properties": { + "expression": { + "$ref": "#/definitions/http.matchers.expression" + }, + "file": { + "$ref": "#/definitions/http.matchers.file" + }, + "header": { + "$ref": "#/definitions/http.matchers.header" + }, + "header_regexp": { + "$ref": "#/definitions/http.matchers.header_regexp" + }, + "host": { + "$ref": "#/definitions/http.matchers.host" + }, + "method": { + "$ref": "#/definitions/http.matchers.method" + }, + "not": { + "$ref": "#/definitions/http.matchers.not" + }, + "path": { + "$ref": "#/definitions/http.matchers.path" + }, + "path_regexp": { + "$ref": "#/definitions/http.matchers.path_regexp" + }, + "protocol": { + "$ref": "#/definitions/http.matchers.protocol" + }, + "query": { + "$ref": "#/definitions/http.matchers.query" + }, + "remote_ip": { + "$ref": "#/definitions/http.matchers.remote_ip" + }, + "vars": { + "$ref": "#/definitions/http.matchers.vars" + }, + "vars_regexp": { + "$ref": "#/definitions/http.matchers.vars_regexp" + } + } + } + }, + "terminal": { + "description": "terminal: boolean\nModule: http\nIf true, no more routes will be executed after this one.\n", + "markdownDescription": "terminal: `boolean` \nModule: `http` \nIf true, no more routes will be executed after this one. \n", + "type": "boolean" + } + } + } + } + } + }, + "experimental_http3": { + "description": "experimental_http3: boolean\nModule: http\nEnable experimental HTTP/3 support. Note that HTTP/3 is not a\nfinished standard and has extremely limited client support.\nThis field is not subject to compatibility promises.\n", + "markdownDescription": "experimental_http3: `boolean` \nModule: `http` \nEnable experimental HTTP/3 support. Note that HTTP/3 is not a\nfinished standard and has extremely limited client support.\nThis field is not subject to compatibility promises. \n", + "type": "boolean" + }, + "idle_timeout": { + "description": "idle_timeout: number\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nIdleTimeout is the maximum time to wait for the next request\nwhen keep-alives are enabled. If zero, a default timeout of\n5m is applied to help avoid resource exhaustion.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "idle_timeout: `number` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nIdleTimeout is the maximum time to wait for the next request\nwhen keep-alives are enabled. If zero, a default timeout of\n5m is applied to help avoid resource exhaustion.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "listen": { + "description": "listen: array\nModule: http\nSocket addresses to which to bind listeners. Accepts\n[network addresses](/docs/conventions#network-addresses)\nthat may include port ranges. Listener addresses must\nbe unique; they cannot be repeated across all defined\nservers.\n", + "markdownDescription": "listen: `array` \nModule: `http` \nSocket addresses to which to bind listeners. Accepts\n[network addresses](/docs/conventions#network-addresses)\nthat may include port ranges. Listener addresses must\nbe unique; they cannot be repeated across all defined\nservers. \n", + "type": "array", + "items": { + "description": "Socket addresses to which to bind listeners. Accepts\n[network addresses](/docs/conventions#network-addresses)\nthat may include port ranges. Listener addresses must\nbe unique; they cannot be repeated across all defined\nservers.\n", + "markdownDescription": "Socket addresses to which to bind listeners. Accepts\n[network addresses](/docs/conventions#network-addresses)\nthat may include port ranges. Listener addresses must\nbe unique; they cannot be repeated across all defined\nservers. \n", + "type": "string" + } + }, + "listener_wrappers": { + "description": "listener_wrappers: array\nModule: caddy.listeners\nA list of listener wrapper modules, which can modify the behavior\nof the base listener. They are applied in the given order.\n", + "markdownDescription": "listener_wrappers: `array` \nModule: `caddy.listeners` \nA list of listener wrapper modules, which can modify the behavior\nof the base listener. They are applied in the given order. \n", + "type": "array", + "items": { + "description": "A list of listener wrapper modules, which can modify the behavior\nof the base listener. They are applied in the given order.\n", + "markdownDescription": "A list of listener wrapper modules, which can modify the behavior\nof the base listener. They are applied in the given order. \n", + "required": [ + "wrapper" + ], + "allOf": [ + { + "if": { + "properties": { + "wrapper": { + "const": "http_redirect" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.listeners.http_redirect" + } + }, + { + "if": { + "properties": { + "wrapper": { + "const": "tls" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.listeners.tls" + } + }, + { + "properties": { + "wrapper": { + "description": "key to identify listener_wrappers module.\nwrapper: string\nModule: caddy.listeners", + "markdownDescription": "key to identify `listener_wrappers` module. \nwrapper: `string` \nModule: `caddy.listeners`", + "type": "string", + "enum": [ + "http_redirect", + "tls" + ] + } + } + } + ] + } + }, + "logs": { + "description": "logs: object\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ServerLogConfig\nEnables access logging and configures how access logs are handled\nin this server. To minimally enable access logs, simply set this\nto a non-null, empty struct.\n\n\nServerLogConfig describes a server's logging configuration. If\nenabled without customization, all requests to this server are\nlogged to the default logger; logger destinations may be\ncustomized per-request-host.\n", + "markdownDescription": "logs: `object` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ServerLogConfig) \nEnables access logging and configures how access logs are handled\nin this server. To minimally enable access logs, simply set this\nto a non-null, empty struct.\n\n\nServerLogConfig describes a server's logging configuration. If\nenabled without customization, all requests to this server are\nlogged to the default logger; logger destinations may be\ncustomized per-request-host. \n", + "type": "object", + "properties": { + "default_logger_name": { + "description": "default_logger_name: string\nModule: http\nThe default logger name for all logs emitted by this server for\nhostnames that are not in the LoggerNames (logger_names) map.\n", + "markdownDescription": "default_logger_name: `string` \nModule: `http` \nThe default logger name for all logs emitted by this server for\nhostnames that are not in the LoggerNames (logger_names) map. \n", + "type": "string" + }, + "logger_names": { + "description": "logger_names: object\nModule: http\nLoggerNames maps request hostnames to a custom logger name.\nFor example, a mapping of \"example.com\" to \"example\" would\ncause access logs from requests with a Host of example.com\nto be emitted by a logger named \"http.log.access.example\".\n", + "markdownDescription": "logger_names: `object` \nModule: `http` \nLoggerNames maps request hostnames to a custom logger name.\nFor example, a mapping of \"example.com\" to \"example\" would\ncause access logs from requests with a Host of example.com\nto be emitted by a logger named \"http.log.access.example\". \n", + "type": "object", + "additionalProperties": { + "description": "LoggerNames maps request hostnames to a custom logger name.\nFor example, a mapping of \"example.com\" to \"example\" would\ncause access logs from requests with a Host of example.com\nto be emitted by a logger named \"http.log.access.example\".\n", + "markdownDescription": "LoggerNames maps request hostnames to a custom logger name.\nFor example, a mapping of \"example.com\" to \"example\" would\ncause access logs from requests with a Host of example.com\nto be emitted by a logger named \"http.log.access.example\". \n" + } + }, + "should_log_credentials": { + "description": "should_log_credentials: boolean\nModule: http\nIf true, credentials that are otherwise omitted, will be logged.\nThe definition of credentials is defined by https://fetch.spec.whatwg.org/#credentials,\nand this includes some request and response headers, i.e `Cookie`,\n`Set-Cookie`, `Authorization`, and `Proxy-Authorization`.\n", + "markdownDescription": "should_log_credentials: `boolean` \nModule: `http` \nIf true, credentials that are otherwise omitted, will be logged.\nThe definition of credentials is defined by https://fetch.spec.whatwg.org/#credentials,\nand this includes some request and response headers, i.e `Cookie`,\n`Set-Cookie`, `Authorization`, and `Proxy-Authorization`. \n", + "type": "boolean" + }, + "skip_hosts": { + "description": "skip_hosts: array\nModule: http\nBy default, all requests to this server will be logged if\naccess logging is enabled. This field lists the request\nhosts for which access logging should be disabled.\n", + "markdownDescription": "skip_hosts: `array` \nModule: `http` \nBy default, all requests to this server will be logged if\naccess logging is enabled. This field lists the request\nhosts for which access logging should be disabled. \n", + "type": "array", + "items": { + "description": "By default, all requests to this server will be logged if\naccess logging is enabled. This field lists the request\nhosts for which access logging should be disabled.\n", + "markdownDescription": "By default, all requests to this server will be logged if\naccess logging is enabled. This field lists the request\nhosts for which access logging should be disabled. \n", + "type": "string" + } + }, + "skip_unmapped_hosts": { + "description": "skip_unmapped_hosts: boolean\nModule: http\nIf true, requests to any host not appearing in the\nLoggerNames (logger_names) map will not be logged.\n", + "markdownDescription": "skip_unmapped_hosts: `boolean` \nModule: `http` \nIf true, requests to any host not appearing in the\nLoggerNames (logger_names) map will not be logged. \n", + "type": "boolean" + } + } + }, + "max_header_bytes": { + "description": "max_header_bytes: number\nModule: http\nMaxHeaderBytes is the maximum size to parse from a client's\nHTTP request headers.\n", + "markdownDescription": "max_header_bytes: `number` \nModule: `http` \nMaxHeaderBytes is the maximum size to parse from a client's\nHTTP request headers. \n", + "type": "number" + }, + "read_header_timeout": { + "description": "read_header_timeout: number\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nReadHeaderTimeout is like ReadTimeout but for request headers.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "read_header_timeout: `number` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nReadHeaderTimeout is like ReadTimeout but for request headers.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "read_timeout": { + "description": "read_timeout: number\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to allow a read from a client's upload. Setting this\nto a short, non-zero value can mitigate slowloris attacks, but\nmay also affect legitimately slow clients.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "read_timeout: `number` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to allow a read from a client's upload. Setting this\nto a short, non-zero value can mitigate slowloris attacks, but\nmay also affect legitimately slow clients.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "routes": { + "description": "routes: array\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nRoutes describes how this server will handle requests.\nRoutes are executed sequentially. First a route's matchers\nare evaluated, then its grouping. If it matches and has\nnot been mutually-excluded by its grouping, then its\nhandlers are executed sequentially. The sequence of invoked\nhandlers comprises a compiled middleware chain that flows\nfrom each matching route and its handlers to the next.\n\nBy default, all unrouted requests receive a 200 OK response\nto indicate the server is working.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "routes: `array` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nRoutes describes how this server will handle requests.\nRoutes are executed sequentially. First a route's matchers\nare evaluated, then its grouping. If it matches and has\nnot been mutually-excluded by its grouping, then its\nhandlers are executed sequentially. The sequence of invoked\nhandlers comprises a compiled middleware chain that flows\nfrom each matching route and its handlers to the next.\n\nBy default, all unrouted requests receive a 200 OK response\nto indicate the server is working.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nRoutes describes how this server will handle requests.\nRoutes are executed sequentially. First a route's matchers\nare evaluated, then its grouping. If it matches and has\nnot been mutually-excluded by its grouping, then its\nhandlers are executed sequentially. The sequence of invoked\nhandlers comprises a compiled middleware chain that flows\nfrom each matching route and its handlers to the next.\n\nBy default, all unrouted requests receive a 200 OK response\nto indicate the server is working.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nRoutes describes how this server will handle requests.\nRoutes are executed sequentially. First a route's matchers\nare evaluated, then its grouping. If it matches and has\nnot been mutually-excluded by its grouping, then its\nhandlers are executed sequentially. The sequence of invoked\nhandlers comprises a compiled middleware chain that flows\nfrom each matching route and its handlers to the next.\n\nBy default, all unrouted requests receive a 200 OK response\nto indicate the server is working.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "object", + "properties": { + "group": { + "description": "group: string\nModule: http\nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed.\n", + "markdownDescription": "group: `string` \nModule: `http` \nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed. \n", + "type": "string" + }, + "handle": { + "description": "handle: array\nModule: http.handlers\nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "handle: `array` \nModule: `http.handlers` \nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "type": "array", + "items": { + "description": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "encode" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.encode" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "metrics" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.metrics" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "request_body" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.request_body" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "rewrite" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.rewrite" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tracing" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.tracing" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "authentication" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.authentication" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "static_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.static_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "acme_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.acme_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response_headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response_headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "error" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.error" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "file_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.file_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "map" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.map" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "reverse_proxy" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.reverse_proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "templates" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.templates" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "push" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.push" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "vars" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.vars" + } + }, + { + "properties": { + "handler": { + "description": "key to identify handle module.\nhandler: string\nModule: http.handlers", + "markdownDescription": "key to identify `handle` module. \nhandler: `string` \nModule: `http.handlers`", + "type": "string", + "enum": [ + "encode", + "headers", + "metrics", + "request_body", + "rewrite", + "subroute", + "tracing", + "authentication", + "static_response", + "acme_server", + "copy_response", + "copy_response_headers", + "error", + "file_server", + "map", + "reverse_proxy", + "templates", + "push", + "vars" + ] + } + } + } + ] + } + }, + "match": { + "description": "match: array\nModule: http.matchers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "match: `array` \nModule: `http.matchers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "properties": { + "expression": { + "$ref": "#/definitions/http.matchers.expression" + }, + "file": { + "$ref": "#/definitions/http.matchers.file" + }, + "header": { + "$ref": "#/definitions/http.matchers.header" + }, + "header_regexp": { + "$ref": "#/definitions/http.matchers.header_regexp" + }, + "host": { + "$ref": "#/definitions/http.matchers.host" + }, + "method": { + "$ref": "#/definitions/http.matchers.method" + }, + "not": { + "$ref": "#/definitions/http.matchers.not" + }, + "path": { + "$ref": "#/definitions/http.matchers.path" + }, + "path_regexp": { + "$ref": "#/definitions/http.matchers.path_regexp" + }, + "protocol": { + "$ref": "#/definitions/http.matchers.protocol" + }, + "query": { + "$ref": "#/definitions/http.matchers.query" + }, + "remote_ip": { + "$ref": "#/definitions/http.matchers.remote_ip" + }, + "vars": { + "$ref": "#/definitions/http.matchers.vars" + }, + "vars_regexp": { + "$ref": "#/definitions/http.matchers.vars_regexp" + } + } + } + }, + "terminal": { + "description": "terminal: boolean\nModule: http\nIf true, no more routes will be executed after this one.\n", + "markdownDescription": "terminal: `boolean` \nModule: `http` \nIf true, no more routes will be executed after this one. \n", + "type": "boolean" + } + } + } + }, + "strict_sni_host": { + "description": "strict_sni_host: boolean\nModule: http\nIf true, will require that a request's Host header match\nthe value of the ServerName sent by the client's TLS\nClientHello; often a necessary safeguard when using TLS\nclient authentication.\n", + "markdownDescription": "strict_sni_host: `boolean` \nModule: `http` \nIf true, will require that a request's Host header match\nthe value of the ServerName sent by the client's TLS\nClientHello; often a necessary safeguard when using TLS\nclient authentication. \n", + "type": "boolean" + }, + "tls_connection_policies": { + "description": "tls_connection_policies: array\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy\nHow to handle TLS connections. At least one policy is\nrequired to enable HTTPS on this server if automatic\nHTTPS is disabled or does not apply.\n\n\nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used.\n", + "markdownDescription": "tls_connection_policies: `array` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy) \nHow to handle TLS connections. At least one policy is\nrequired to enable HTTPS on this server if automatic\nHTTPS is disabled or does not apply.\n\n\nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy\nHow to handle TLS connections. At least one policy is\nrequired to enable HTTPS on this server if automatic\nHTTPS is disabled or does not apply.\n\n\nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy) \nHow to handle TLS connections. At least one policy is\nrequired to enable HTTPS on this server if automatic\nHTTPS is disabled or does not apply.\n\n\nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used. \n", + "type": "object", + "properties": { + "alpn": { + "description": "alpn: array\nModule: http\nProtocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake.\n", + "markdownDescription": "alpn: `array` \nModule: `http` \nProtocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake. \n", + "type": "array", + "items": { + "description": "Protocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake.\n", + "markdownDescription": "Protocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake. \n", + "type": "string" + } + }, + "certificate_selection": { + "description": "certificate_selection: object\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CustomCertSelectionPolicy\nHow to choose a certificate if more than one matched\nthe given ServerName (SNI) value.\n\n\nCustomCertSelectionPolicy represents a policy for selecting the certificate\nused to complete a handshake when there may be multiple options. All fields\nspecified must match the candidate certificate for it to be chosen.\nThis was needed to solve https://github.com/caddyserver/caddy/issues/2588.\n", + "markdownDescription": "certificate_selection: `object` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CustomCertSelectionPolicy) \nHow to choose a certificate if more than one matched\nthe given ServerName (SNI) value.\n\n\nCustomCertSelectionPolicy represents a policy for selecting the certificate\nused to complete a handshake when there may be multiple options. All fields\nspecified must match the candidate certificate for it to be chosen.\nThis was needed to solve https://github.com/caddyserver/caddy/issues/2588. \n", + "type": "object", + "properties": { + "all_tags": { + "description": "all_tags: array\nModule: http\nThe certificate must have all of the tags in the list.\n", + "markdownDescription": "all_tags: `array` \nModule: `http` \nThe certificate must have all of the tags in the list. \n", + "type": "array", + "items": { + "description": "The certificate must have all of the tags in the list.\n", + "markdownDescription": "The certificate must have all of the tags in the list. \n", + "type": "string" + } + }, + "any_tag": { + "description": "any_tag: array\nModule: http\nThe certificate must have at least one of the tags in the list.\n", + "markdownDescription": "any_tag: `array` \nModule: `http` \nThe certificate must have at least one of the tags in the list. \n", + "type": "array", + "items": { + "description": "The certificate must have at least one of the tags in the list.\n", + "markdownDescription": "The certificate must have at least one of the tags in the list. \n", + "type": "string" + } + }, + "public_key_algorithm": { + "description": "public_key_algorithm: number\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#PublicKeyAlgorithm\nThe certificate must use this public key algorithm.\n\n\nPublicKeyAlgorithm is a JSON-unmarshalable wrapper type.\n", + "markdownDescription": "public_key_algorithm: `number` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#PublicKeyAlgorithm) \nThe certificate must use this public key algorithm.\n\n\nPublicKeyAlgorithm is a JSON-unmarshalable wrapper type. \n", + "type": "number" + }, + "serial_number": { + "description": "serial_number: array\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt\nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string.\n", + "markdownDescription": "serial_number: `array` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt) \nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt\nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt) \nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string. \n", + "type": "object" + } + }, + "subject_organization": { + "description": "subject_organization: array\nModule: http\nThe certificate must have one of these organization names.\n", + "markdownDescription": "subject_organization: `array` \nModule: `http` \nThe certificate must have one of these organization names. \n", + "type": "array", + "items": { + "description": "The certificate must have one of these organization names.\n", + "markdownDescription": "The certificate must have one of these organization names. \n", + "type": "string" + } + } + } + }, + "cipher_suites": { + "description": "cipher_suites: array\nModule: http\nThe list of cipher suites to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "cipher_suites: `array` \nModule: `http` \nThe list of cipher suites to support. Caddy's\ndefaults are modern and secure. \n", + "type": "array", + "items": { + "description": "The list of cipher suites to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "The list of cipher suites to support. Caddy's\ndefaults are modern and secure. \n", + "type": "string" + } + }, + "client_authentication": { + "description": "client_authentication: object\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ClientAuthentication\nEnables and configures TLS client authentication.\n\n\nClientAuthentication configures TLS client auth.\n", + "markdownDescription": "client_authentication: `object` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ClientAuthentication) \nEnables and configures TLS client authentication.\n\n\nClientAuthentication configures TLS client auth. \n", + "type": "object", + "properties": { + "mode": { + "description": "mode: string\nModule: http\nThe mode for authenticating the client. Allowed values are:\n\nMode | Description\n-----|---------------\n`request` | Ask clients for a certificate, but allow even if there isn't one; do not verify it\n`require` | Require clients to present a certificate, but do not verify it\n`verify_if_given` | Ask clients for a certificate; allow even if there isn't one, but verify it if there is\n`require_and_verify` | Require clients to present a valid certificate that is verified\n\nThe default mode is `require_and_verify` if any\nTrustedCACerts or TrustedCACertPEMFiles or TrustedLeafCerts\nare provided; otherwise, the default mode is `require`.\n", + "markdownDescription": "mode: `string` \nModule: `http` \nThe mode for authenticating the client. Allowed values are:\n\nMode | Description\n-----|---------------\n`request` | Ask clients for a certificate, but allow even if there isn't one; do not verify it\n`require` | Require clients to present a certificate, but do not verify it\n`verify_if_given` | Ask clients for a certificate; allow even if there isn't one, but verify it if there is\n`require_and_verify` | Require clients to present a valid certificate that is verified\n\nThe default mode is `require_and_verify` if any\nTrustedCACerts or TrustedCACertPEMFiles or TrustedLeafCerts\nare provided; otherwise, the default mode is `require`. \n", + "type": "string" + }, + "trusted_ca_certs": { + "description": "trusted_ca_certs: array\nModule: http\nA list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected.\n", + "markdownDescription": "trusted_ca_certs: `array` \nModule: `http` \nA list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected. \n", + "type": "array", + "items": { + "description": "A list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected.\n", + "markdownDescription": "A list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected. \n", + "type": "string" + } + }, + "trusted_ca_certs_pem_files": { + "description": "trusted_ca_certs_pem_files: array\nModule: http\nTrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected.\n", + "markdownDescription": "trusted_ca_certs_pem_files: `array` \nModule: `http` \nTrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected. \n", + "type": "array", + "items": { + "description": "TrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected.\n", + "markdownDescription": "TrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected. \n", + "type": "string" + } + }, + "trusted_leaf_certs": { + "description": "trusted_leaf_certs: array\nModule: http\nA list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected.\n", + "markdownDescription": "trusted_leaf_certs: `array` \nModule: `http` \nA list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected. \n", + "type": "array", + "items": { + "description": "A list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected.\n", + "markdownDescription": "A list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected. \n", + "type": "string" + } + }, + "verifiers": { + "description": "verifiers: array\nModule: tls.client_auth", + "markdownDescription": "verifiers: `array` \nModule: `tls.client_auth`", + "type": "array", + "items": { + "required": [ + "verifier" + ], + "allOf": [ + { + "if": { + "properties": { + "verifier": { + "const": "leaf" + } + } + }, + "then": { + "$ref": "#/definitions/tls.client_auth.leaf" + } + }, + { + "properties": { + "verifier": { + "description": "key to identify verifiers module.\nverifier: string\nModule: tls.client_auth", + "markdownDescription": "key to identify `verifiers` module. \nverifier: `string` \nModule: `tls.client_auth`", + "type": "string", + "enum": [ + "leaf" + ] + } + } + } + ] + } + } + } + }, + "curves": { + "description": "curves: array\nModule: http\nThe list of elliptic curves to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "curves: `array` \nModule: `http` \nThe list of elliptic curves to support. Caddy's\ndefaults are modern and secure. \n", + "type": "array", + "items": { + "description": "The list of elliptic curves to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "The list of elliptic curves to support. Caddy's\ndefaults are modern and secure. \n", + "type": "string" + } + }, + "default_sni": { + "description": "default_sni: string\nModule: http\nDefaultSNI becomes the ServerName in a ClientHello if there\nis no policy configured for the empty SNI value.\n", + "markdownDescription": "default_sni: `string` \nModule: `http` \nDefaultSNI becomes the ServerName in a ClientHello if there\nis no policy configured for the empty SNI value. \n", + "type": "string" + }, + "match": { + "description": "match: object\nModule: tls.handshake_match\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nHow to match this policy with a TLS ClientHello. If\nthis policy is the first to match, it will be used.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "match: `object` \nModule: `tls.handshake_match` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nHow to match this policy with a TLS ClientHello. If\nthis policy is the first to match, it will be used.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "object", + "properties": { + "alpn": { + "$ref": "#/definitions/tls.handshake_match.alpn" + }, + "remote_ip": { + "$ref": "#/definitions/tls.handshake_match.remote_ip" + }, + "sni": { + "$ref": "#/definitions/tls.handshake_match.sni" + } + } + }, + "protocol_max": { + "description": "protocol_max: string\nModule: http\nMaximum TLS protocol version to allow. Default: `tls1.3`\n", + "markdownDescription": "protocol_max: `string` \nModule: `http` \nMaximum TLS protocol version to allow. Default: `tls1.3` \n", + "type": "string" + }, + "protocol_min": { + "description": "protocol_min: string\nModule: http\nMinimum TLS protocol version to allow. Default: `tls1.2`\n", + "markdownDescription": "protocol_min: `string` \nModule: `http` \nMinimum TLS protocol version to allow. Default: `tls1.2` \n", + "type": "string" + } + } + } + }, + "write_timeout": { + "description": "write_timeout: number\nModule: http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nWriteTimeout is how long to allow a write to a client. Note\nthat setting this to a small value when serving large files\nmay negatively affect legitimately slow clients.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "write_timeout: `number` \nModule: `http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nWriteTimeout is how long to allow a write to a client. Note\nthat setting this to a small value when serving large files\nmay negatively affect legitimately slow clients.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + } + } + } + }, + "http.authentication.hashes.bcrypt": { + "description": "bcrypt: object\nModule: http.authentication.hashes.bcrypt\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#BcryptHash", + "markdownDescription": "bcrypt: `object` \nModule: `http.authentication.hashes.bcrypt` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#BcryptHash)", + "type": "object" + }, + "http.authentication.hashes.scrypt": { + "description": "scrypt: object\nModule: http.authentication.hashes.scrypt\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash", + "markdownDescription": "scrypt: `object` \nModule: `http.authentication.hashes.scrypt` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash)", + "type": "object", + "properties": { + "N": { + "description": "N: number\nModule: http.authentication.hashes.scrypt\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash", + "markdownDescription": "N: `number` \nModule: `http.authentication.hashes.scrypt` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash)", + "type": "number" + }, + "key_length": { + "description": "key_length: number\nModule: http.authentication.hashes.scrypt\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash", + "markdownDescription": "key_length: `number` \nModule: `http.authentication.hashes.scrypt` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash)", + "type": "number" + }, + "p": { + "description": "p: number\nModule: http.authentication.hashes.scrypt\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash", + "markdownDescription": "p: `number` \nModule: `http.authentication.hashes.scrypt` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash)", + "type": "number" + }, + "r": { + "description": "r: number\nModule: http.authentication.hashes.scrypt\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash", + "markdownDescription": "r: `number` \nModule: `http.authentication.hashes.scrypt` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#ScryptHash)", + "type": "number" + } + } + }, + "http.authentication.providers.http_basic": { + "description": "http_basic: object\nModule: http.authentication.providers.http_basic\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth", + "markdownDescription": "http_basic: `object` \nModule: `http.authentication.providers.http_basic` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth)", + "type": "object", + "properties": { + "accounts": { + "description": "accounts: array\nModule: http.authentication.providers.http_basic\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth", + "markdownDescription": "accounts: `array` \nModule: `http.authentication.providers.http_basic` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth)", + "type": "array", + "items": { + "type": "object", + "properties": { + "password": { + "description": "password: string\nModule: http.authentication.providers.http_basic\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth", + "markdownDescription": "password: `string` \nModule: `http.authentication.providers.http_basic` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth)", + "type": "string" + }, + "salt": { + "description": "salt: string\nModule: http.authentication.providers.http_basic\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth", + "markdownDescription": "salt: `string` \nModule: `http.authentication.providers.http_basic` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth)", + "type": "string" + }, + "username": { + "description": "username: string\nModule: http.authentication.providers.http_basic\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth", + "markdownDescription": "username: `string` \nModule: `http.authentication.providers.http_basic` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth)", + "type": "string" + } + } + } + }, + "hash": { + "description": "hash: object\nModule: http.authentication.hashes", + "markdownDescription": "hash: `object` \nModule: `http.authentication.hashes`", + "type": "object", + "required": [ + "algorithm" + ], + "allOf": [ + { + "if": { + "properties": { + "algorithm": { + "const": "bcrypt" + } + } + }, + "then": { + "$ref": "#/definitions/http.authentication.hashes.bcrypt" + } + }, + { + "if": { + "properties": { + "algorithm": { + "const": "scrypt" + } + } + }, + "then": { + "$ref": "#/definitions/http.authentication.hashes.scrypt" + } + }, + { + "properties": { + "algorithm": { + "description": "key to identify hash module.\nalgorithm: string\nModule: http.authentication.hashes", + "markdownDescription": "key to identify `hash` module. \nalgorithm: `string` \nModule: `http.authentication.hashes`", + "type": "string", + "enum": [ + "bcrypt", + "scrypt" + ] + } + } + } + ] + }, + "hash_cache": { + "description": "hash_cache: object\nModule: http.authentication.providers.http_basic\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth", + "markdownDescription": "hash_cache: `object` \nModule: `http.authentication.providers.http_basic` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth)", + "type": "object" + }, + "realm": { + "description": "realm: string\nModule: http.authentication.providers.http_basic\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth", + "markdownDescription": "realm: `string` \nModule: `http.authentication.providers.http_basic` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#HTTPBasicAuth)", + "type": "string" + } + } + }, + "http.encoders.gzip": { + "description": "gzip: object\nModule: http.encoders.gzip\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#Gzip", + "markdownDescription": "gzip: `object` \nModule: `http.encoders.gzip` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#Gzip)", + "type": "object", + "properties": { + "level": { + "description": "level: number\nModule: http.encoders.gzip\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#Gzip", + "markdownDescription": "level: `number` \nModule: `http.encoders.gzip` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#Gzip)", + "type": "number" + } + } + }, + "http.encoders.zstd": { + "description": "zstd: object\nModule: http.encoders.zstd\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd#Zstd", + "markdownDescription": "zstd: `object` \nModule: `http.encoders.zstd` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd#Zstd)", + "type": "object" + }, + "http.handlers.acme_server": { + "description": "acme_server: object\nModule: http.handlers.acme_server\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki/acmeserver#Handler\nHandler is an ACME server handler.\n\n", + "markdownDescription": "acme_server: `object` \nModule: `http.handlers.acme_server` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki/acmeserver#Handler) \nHandler is an ACME server handler.\n \n", + "type": "object", + "properties": { + "ca": { + "description": "ca: string\nModule: http.handlers.acme_server\nThe ID of the CA to use for signing. This refers to\nthe ID given to the CA in the `pki` app. If omitted,\nthe default ID is \"local\".\n", + "markdownDescription": "ca: `string` \nModule: `http.handlers.acme_server` \nThe ID of the CA to use for signing. This refers to\nthe ID given to the CA in the `pki` app. If omitted,\nthe default ID is \"local\". \n", + "type": "string" + }, + "host": { + "description": "host: string\nModule: http.handlers.acme_server\nThe hostname or IP address by which ACME clients\nwill access the server. This is used to populate\nthe ACME directory endpoint. If not set, the Host\nheader of the request will be used.\nCOMPATIBILITY NOTE / TODO: This property may go away in the\nfuture. Do not rely on this property long-term; check release notes.\n", + "markdownDescription": "host: `string` \nModule: `http.handlers.acme_server` \nThe hostname or IP address by which ACME clients\nwill access the server. This is used to populate\nthe ACME directory endpoint. If not set, the Host\nheader of the request will be used.\nCOMPATIBILITY NOTE / TODO: This property may go away in the\nfuture. Do not rely on this property long-term; check release notes. \n", + "type": "string" + }, + "path_prefix": { + "description": "path_prefix: string\nModule: http.handlers.acme_server\nThe path prefix under which to serve all ACME\nendpoints. All other requests will not be served\nby this handler and will be passed through to\nthe next one. Default: \"/acme/\".\nCOMPATIBILITY NOTE / TODO: This property may go away in the\nfuture, as it is currently only required due to\nlimitations in the underlying library. Do not rely\non this property long-term; check release notes.\n", + "markdownDescription": "path_prefix: `string` \nModule: `http.handlers.acme_server` \nThe path prefix under which to serve all ACME\nendpoints. All other requests will not be served\nby this handler and will be passed through to\nthe next one. Default: \"/acme/\".\nCOMPATIBILITY NOTE / TODO: This property may go away in the\nfuture, as it is currently only required due to\nlimitations in the underlying library. Do not rely\non this property long-term; check release notes. \n", + "type": "string" + }, + "sign_with_root": { + "description": "sign_with_root: boolean\nModule: http.handlers.acme_server\nIf true, the CA's root will be the issuer instead of\nthe intermediate. This is NOT recommended and should\nonly be used when devices/clients do not properly\nvalidate certificate chains. EXPERIMENTAL: Might be\nchanged or removed in the future.\n", + "markdownDescription": "sign_with_root: `boolean` \nModule: `http.handlers.acme_server` \nIf true, the CA's root will be the issuer instead of\nthe intermediate. This is NOT recommended and should\nonly be used when devices/clients do not properly\nvalidate certificate chains. EXPERIMENTAL: Might be\nchanged or removed in the future. \n", + "type": "boolean" + } + } + }, + "http.handlers.authentication": { + "description": "authentication: object\nModule: http.handlers.authentication\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#Authentication\nAuthentication is a middleware which provides user authentication.\nRejects requests with HTTP 401 if the request is not authenticated.\n\nAfter a successful authentication, the placeholder\n`{http.auth.user.id}` will be set to the username, and also\n`{http.auth.user.*}` placeholders may be set for any authentication\nmodules that provide user metadata.\n\nIts API is still experimental and may be subject to change.\n\n", + "markdownDescription": "authentication: `object` \nModule: `http.handlers.authentication` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth#Authentication) \nAuthentication is a middleware which provides user authentication.\nRejects requests with HTTP 401 if the request is not authenticated.\n\nAfter a successful authentication, the placeholder\n`{http.auth.user.id}` will be set to the username, and also\n`{http.auth.user.*}` placeholders may be set for any authentication\nmodules that provide user metadata.\n\nIts API is still experimental and may be subject to change.\n \n", + "type": "object", + "properties": { + "providers": { + "description": "providers: object\nModule: http.authentication.providers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nA set of authentication providers. If none are specified,\nall requests will always be unauthenticated.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "providers: `object` \nModule: `http.authentication.providers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nA set of authentication providers. If none are specified,\nall requests will always be unauthenticated.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "object", + "properties": { + "http_basic": { + "$ref": "#/definitions/http.authentication.providers.http_basic" + } + } + } + } + }, + "http.handlers.copy_response": { + "description": "copy_response: object\nModule: http.handlers.copy_response\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CopyResponseHandler\nCopyResponseHandler is a special HTTP handler which may\nonly be used within reverse_proxy's handle_response routes,\nto copy the proxy response. EXPERIMENTAL, subject to change.\n\n", + "markdownDescription": "copy_response: `object` \nModule: `http.handlers.copy_response` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CopyResponseHandler) \nCopyResponseHandler is a special HTTP handler which may\nonly be used within reverse_proxy's handle_response routes,\nto copy the proxy response. EXPERIMENTAL, subject to change.\n \n", + "type": "object", + "properties": { + "status_code": { + "description": "status_code: string\nModule: http.handlers.copy_response\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString\nTo write the upstream response's body but with a different\nstatus code, set this field to the desired status code.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned.\n", + "markdownDescription": "status_code: `string` \nModule: `http.handlers.copy_response` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString) \nTo write the upstream response's body but with a different\nstatus code, set this field to the desired status code.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned. \n", + "type": "string" + } + } + }, + "http.handlers.copy_response_headers": { + "description": "copy_response_headers: object\nModule: http.handlers.copy_response_headers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CopyResponseHeadersHandler\nCopyResponseHeadersHandler is a special HTTP handler which may\nonly be used within reverse_proxy's handle_response routes,\nto copy headers from the proxy response. EXPERIMENTAL;\nsubject to change.\n\n", + "markdownDescription": "copy_response_headers: `object` \nModule: `http.handlers.copy_response_headers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CopyResponseHeadersHandler) \nCopyResponseHeadersHandler is a special HTTP handler which may\nonly be used within reverse_proxy's handle_response routes,\nto copy headers from the proxy response. EXPERIMENTAL;\nsubject to change.\n \n", + "type": "object", + "properties": { + "exclude": { + "description": "exclude: array\nModule: http.handlers.copy_response_headers\nA list of header fields to skip copying from the response.\nCannot be defined at the same time as Include.\n", + "markdownDescription": "exclude: `array` \nModule: `http.handlers.copy_response_headers` \nA list of header fields to skip copying from the response.\nCannot be defined at the same time as Include. \n", + "type": "array", + "items": { + "description": "A list of header fields to skip copying from the response.\nCannot be defined at the same time as Include.\n", + "markdownDescription": "A list of header fields to skip copying from the response.\nCannot be defined at the same time as Include. \n", + "type": "string" + } + }, + "include": { + "description": "include: array\nModule: http.handlers.copy_response_headers\nA list of header fields to copy from the response.\nCannot be defined at the same time as Exclude.\n", + "markdownDescription": "include: `array` \nModule: `http.handlers.copy_response_headers` \nA list of header fields to copy from the response.\nCannot be defined at the same time as Exclude. \n", + "type": "array", + "items": { + "description": "A list of header fields to copy from the response.\nCannot be defined at the same time as Exclude.\n", + "markdownDescription": "A list of header fields to copy from the response.\nCannot be defined at the same time as Exclude. \n", + "type": "string" + } + } + } + }, + "http.handlers.encode": { + "description": "encode: object\nModule: http.handlers.encode\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode#Encode\nEncode is a middleware which can encode responses.\n\n", + "markdownDescription": "encode: `object` \nModule: `http.handlers.encode` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode#Encode) \nEncode is a middleware which can encode responses.\n \n", + "type": "object", + "properties": { + "encodings": { + "description": "encodings: object\nModule: http.encoders\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nSelection of compression algorithms to choose from. The best one\nwill be chosen based on the client's Accept-Encoding header.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "encodings: `object` \nModule: `http.encoders` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nSelection of compression algorithms to choose from. The best one\nwill be chosen based on the client's Accept-Encoding header.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "object", + "properties": { + "gzip": { + "$ref": "#/definitions/http.encoders.gzip" + }, + "zstd": { + "$ref": "#/definitions/http.encoders.zstd" + } + } + }, + "match": { + "description": "match: object\nModule: http.handlers.encode\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher\nOnly encode responses that match against this ResponseMmatcher.\nThe default is a collection of text-based Content-Type headers.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria.\n", + "markdownDescription": "match: `object` \nModule: `http.handlers.encode` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher) \nOnly encode responses that match against this ResponseMmatcher.\nThe default is a collection of text-based Content-Type headers.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria. \n", + "type": "object", + "properties": { + "headers": { + "description": "headers: object\nModule: http.handlers.encode\nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.encode` \nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "object", + "additionalProperties": { + "description": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "status_code": { + "description": "status_code: array\nModule: http.handlers.encode\nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "status_code: `array` \nModule: `http.handlers.encode` \nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "array", + "items": { + "description": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "number" + } + } + } + }, + "minimum_length": { + "description": "minimum_length: number\nModule: http.handlers.encode\nOnly encode responses that are at least this many bytes long.\n", + "markdownDescription": "minimum_length: `number` \nModule: `http.handlers.encode` \nOnly encode responses that are at least this many bytes long. \n", + "type": "number" + }, + "prefer": { + "description": "prefer: array\nModule: http.handlers.encode\nIf the client has no strong preference, choose these encodings in order.\n", + "markdownDescription": "prefer: `array` \nModule: `http.handlers.encode` \nIf the client has no strong preference, choose these encodings in order. \n", + "type": "array", + "items": { + "description": "If the client has no strong preference, choose these encodings in order.\n", + "markdownDescription": "If the client has no strong preference, choose these encodings in order. \n", + "type": "string" + } + } + } + }, + "http.handlers.error": { + "description": "error: object\nModule: http.handlers.error\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#StaticError\nStaticError implements a simple handler that returns an error.\nThis handler returns an error value, but does not write a response.\nThis is useful when you want the server to act as if an error\noccurred; for example, to invoke your custom error handling logic.\n\nSince this handler does not write a response, the error information\nis for use by the server to know how to handle the error.\n\n", + "markdownDescription": "error: `object` \nModule: `http.handlers.error` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#StaticError) \nStaticError implements a simple handler that returns an error.\nThis handler returns an error value, but does not write a response.\nThis is useful when you want the server to act as if an error\noccurred; for example, to invoke your custom error handling logic.\n\nSince this handler does not write a response, the error information\nis for use by the server to know how to handle the error.\n \n", + "type": "object", + "properties": { + "error": { + "description": "error: string\nModule: http.handlers.error\nThe error message. Optional. Default is no error message.\n", + "markdownDescription": "error: `string` \nModule: `http.handlers.error` \nThe error message. Optional. Default is no error message. \n", + "type": "string" + }, + "status_code": { + "description": "status_code: string\nModule: http.handlers.error\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString\nThe recommended HTTP status code. Can be either an integer or a\nstring if placeholders are needed. Optional. Default is 500.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned.\n", + "markdownDescription": "status_code: `string` \nModule: `http.handlers.error` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString) \nThe recommended HTTP status code. Can be either an integer or a\nstring if placeholders are needed. Optional. Default is 500.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned. \n", + "type": "string" + } + } + }, + "http.handlers.file_server": { + "description": "file_server: object\nModule: http.handlers.file_server\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver#FileServer\nFileServer implements a static file server responder for Caddy.\n\n", + "markdownDescription": "file_server: `object` \nModule: `http.handlers.file_server` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver#FileServer) \nFileServer implements a static file server responder for Caddy.\n \n", + "type": "object", + "properties": { + "browse": { + "description": "browse: object\nModule: http.handlers.file_server\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver#Browse\nEnables file listings if a directory was requested and no index\nfile is present.\n\n\nBrowse configures directory browsing.\n", + "markdownDescription": "browse: `object` \nModule: `http.handlers.file_server` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver#Browse) \nEnables file listings if a directory was requested and no index\nfile is present.\n\n\nBrowse configures directory browsing. \n", + "type": "object", + "properties": { + "template_file": { + "description": "template_file: string\nModule: http.handlers.file_server\nUse this template file instead of the default browse template.\n", + "markdownDescription": "template_file: `string` \nModule: `http.handlers.file_server` \nUse this template file instead of the default browse template. \n", + "type": "string" + } + } + }, + "canonical_uris": { + "description": "canonical_uris: boolean\nModule: http.handlers.file_server\nUse redirects to enforce trailing slashes for directories, or to\nremove trailing slash from URIs for files. Default is true.\n\nCanonicalization will not happen if the last element of the request's\npath (the filename) is changed in an internal rewrite, to avoid\nclobbering the explicit rewrite with implicit behavior.\n", + "markdownDescription": "canonical_uris: `boolean` \nModule: `http.handlers.file_server` \nUse redirects to enforce trailing slashes for directories, or to\nremove trailing slash from URIs for files. Default is true.\n\nCanonicalization will not happen if the last element of the request's\npath (the filename) is changed in an internal rewrite, to avoid\nclobbering the explicit rewrite with implicit behavior. \n", + "type": "boolean" + }, + "hide": { + "description": "hide: array\nModule: http.handlers.file_server\nA list of files or folders to hide; the file server will pretend as if\nthey don't exist. Accepts globular patterns like `*.ext` or `/foo/*/bar`\nas well as placeholders. Because site roots can be dynamic, this list\nuses file system paths, not request paths. To clarify, the base of\nrelative paths is the current working directory, NOT the site root.\n\nEntries without a path separator (`/` or `\\` depending on OS) will match\nany file or directory of that name regardless of its path. To hide only a\nspecific file with a name that may not be unique, always use a path\nseparator. For example, to hide all files or folder trees named \"hidden\",\nput \"hidden\" in the list. To hide only ./hidden, put \"./hidden\" in the list.\n\nWhen possible, all paths are resolved to their absolute form before\ncomparisons are made. For maximum clarity and explictness, use complete,\nabsolute paths; or, for greater portability, use relative paths instead.\n", + "markdownDescription": "hide: `array` \nModule: `http.handlers.file_server` \nA list of files or folders to hide; the file server will pretend as if\nthey don't exist. Accepts globular patterns like `*.ext` or `/foo/*/bar`\nas well as placeholders. Because site roots can be dynamic, this list\nuses file system paths, not request paths. To clarify, the base of\nrelative paths is the current working directory, NOT the site root.\n\nEntries without a path separator (`/` or `\\` depending on OS) will match\nany file or directory of that name regardless of its path. To hide only a\nspecific file with a name that may not be unique, always use a path\nseparator. For example, to hide all files or folder trees named \"hidden\",\nput \"hidden\" in the list. To hide only ./hidden, put \"./hidden\" in the list.\n\nWhen possible, all paths are resolved to their absolute form before\ncomparisons are made. For maximum clarity and explictness, use complete,\nabsolute paths; or, for greater portability, use relative paths instead. \n", + "type": "array", + "items": { + "description": "A list of files or folders to hide; the file server will pretend as if\nthey don't exist. Accepts globular patterns like `*.ext` or `/foo/*/bar`\nas well as placeholders. Because site roots can be dynamic, this list\nuses file system paths, not request paths. To clarify, the base of\nrelative paths is the current working directory, NOT the site root.\n\nEntries without a path separator (`/` or `\\` depending on OS) will match\nany file or directory of that name regardless of its path. To hide only a\nspecific file with a name that may not be unique, always use a path\nseparator. For example, to hide all files or folder trees named \"hidden\",\nput \"hidden\" in the list. To hide only ./hidden, put \"./hidden\" in the list.\n\nWhen possible, all paths are resolved to their absolute form before\ncomparisons are made. For maximum clarity and explictness, use complete,\nabsolute paths; or, for greater portability, use relative paths instead.\n", + "markdownDescription": "A list of files or folders to hide; the file server will pretend as if\nthey don't exist. Accepts globular patterns like `*.ext` or `/foo/*/bar`\nas well as placeholders. Because site roots can be dynamic, this list\nuses file system paths, not request paths. To clarify, the base of\nrelative paths is the current working directory, NOT the site root.\n\nEntries without a path separator (`/` or `\\` depending on OS) will match\nany file or directory of that name regardless of its path. To hide only a\nspecific file with a name that may not be unique, always use a path\nseparator. For example, to hide all files or folder trees named \"hidden\",\nput \"hidden\" in the list. To hide only ./hidden, put \"./hidden\" in the list.\n\nWhen possible, all paths are resolved to their absolute form before\ncomparisons are made. For maximum clarity and explictness, use complete,\nabsolute paths; or, for greater portability, use relative paths instead. \n", + "type": "string" + } + }, + "index_names": { + "description": "index_names: array\nModule: http.handlers.file_server\nThe names of files to try as index files if a folder is requested.\n", + "markdownDescription": "index_names: `array` \nModule: `http.handlers.file_server` \nThe names of files to try as index files if a folder is requested. \n", + "type": "array", + "items": { + "description": "The names of files to try as index files if a folder is requested.\n", + "markdownDescription": "The names of files to try as index files if a folder is requested. \n", + "type": "string" + } + }, + "pass_thru": { + "description": "pass_thru: boolean\nModule: http.handlers.file_server\nIf pass-thru mode is enabled and a requested file is not found,\nit will invoke the next handler in the chain instead of returning\na 404 error. By default, this is false (disabled).\n", + "markdownDescription": "pass_thru: `boolean` \nModule: `http.handlers.file_server` \nIf pass-thru mode is enabled and a requested file is not found,\nit will invoke the next handler in the chain instead of returning\na 404 error. By default, this is false (disabled). \n", + "type": "boolean" + }, + "precompressed": { + "description": "precompressed: object\nModule: http.precompressed\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nSelection of encoders to use to check for precompressed files.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "precompressed: `object` \nModule: `http.precompressed` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nSelection of encoders to use to check for precompressed files.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "object", + "properties": { + "br": { + "$ref": "#/definitions/http.precompressed.br" + }, + "gzip": { + "$ref": "#/definitions/http.precompressed.gzip" + }, + "zstd": { + "$ref": "#/definitions/http.precompressed.zstd" + } + } + }, + "precompressed_order": { + "description": "precompressed_order: array\nModule: http.handlers.file_server\nIf the client has no strong preference (q-factor), choose these encodings in order.\nIf no order specified here, the first encoding from the Accept-Encoding header\nthat both client and server support is used\n", + "markdownDescription": "precompressed_order: `array` \nModule: `http.handlers.file_server` \nIf the client has no strong preference (q-factor), choose these encodings in order.\nIf no order specified here, the first encoding from the Accept-Encoding header\nthat both client and server support is used \n", + "type": "array", + "items": { + "description": "If the client has no strong preference (q-factor), choose these encodings in order.\nIf no order specified here, the first encoding from the Accept-Encoding header\nthat both client and server support is used\n", + "markdownDescription": "If the client has no strong preference (q-factor), choose these encodings in order.\nIf no order specified here, the first encoding from the Accept-Encoding header\nthat both client and server support is used \n", + "type": "string" + } + }, + "root": { + "description": "root: string\nModule: http.handlers.file_server\nThe path to the root of the site. Default is `{http.vars.root}` if set,\nor current working directory otherwise.\n", + "markdownDescription": "root: `string` \nModule: `http.handlers.file_server` \nThe path to the root of the site. Default is `{http.vars.root}` if set,\nor current working directory otherwise. \n", + "type": "string" + }, + "status_code": { + "description": "status_code: string\nModule: http.handlers.file_server\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString\nOverride the status code written when successfully serving a file.\nParticularly useful when explicitly serving a file as display for\nan error, like a 404 page. A placeholder may be used. By default,\nthe status code will typically be 200, or 206 for partial content.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned.\n", + "markdownDescription": "status_code: `string` \nModule: `http.handlers.file_server` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString) \nOverride the status code written when successfully serving a file.\nParticularly useful when explicitly serving a file as display for\nan error, like a 404 page. A placeholder may be used. By default,\nthe status code will typically be 200, or 206 for partial content.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned. \n", + "type": "string" + } + } + }, + "http.handlers.headers": { + "description": "headers: object\nModule: http.handlers.headers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Handler\nHandler is a middleware which modifies request and response headers.\n\nChanges to headers are applied immediately, except for the response\nheaders when Deferred is true or when Required is set. In those cases,\nthe changes are applied when the headers are written to the response.\nNote that deferred changes do not take effect if an error occurs later\nin the middleware chain.\n\nProperties in this module accept placeholders.\n\nResponse header operations can be conditioned upon response status code\nand/or other header values.\n\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.headers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Handler) \nHandler is a middleware which modifies request and response headers.\n\nChanges to headers are applied immediately, except for the response\nheaders when Deferred is true or when Required is set. In those cases,\nthe changes are applied when the headers are written to the response.\nNote that deferred changes do not take effect if an error occurs later\nin the middleware chain.\n\nProperties in this module accept placeholders.\n\nResponse header operations can be conditioned upon response status code\nand/or other header values.\n \n", + "type": "object", + "properties": { + "request": { + "description": "request: object\nModule: http.handlers.headers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#HeaderOps\nHeaderOps defines manipulations for HTTP headers.\n\n", + "markdownDescription": "request: `object` \nModule: `http.handlers.headers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#HeaderOps) \nHeaderOps defines manipulations for HTTP headers.\n \n", + "type": "object", + "properties": { + "add": { + "description": "add: object\nModule: http.handlers.headers\nAdds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "add: `object` \nModule: `http.handlers.headers` \nAdds HTTP headers; does not replace any existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Adds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "Adds HTTP headers; does not replace any existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "delete": { + "description": "delete: array\nModule: http.handlers.headers\nNames of HTTP header fields to delete.\n", + "markdownDescription": "delete: `array` \nModule: `http.handlers.headers` \nNames of HTTP header fields to delete. \n", + "type": "array", + "items": { + "description": "Names of HTTP header fields to delete.\n", + "markdownDescription": "Names of HTTP header fields to delete. \n", + "type": "string" + } + }, + "replace": { + "description": "replace: object\nModule: http.handlers.headers\nPerforms substring replacements of HTTP headers in-situ.\n", + "markdownDescription": "replace: `object` \nModule: `http.handlers.headers` \nPerforms substring replacements of HTTP headers in-situ. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "object", + "properties": { + "replace": { + "description": "replace: string\nModule: http.handlers.headers\nThe string with which to replace matches.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.headers` \nThe string with which to replace matches. \n", + "type": "string" + }, + "search": { + "description": "search: string\nModule: http.handlers.headers\nThe substring to search for.\n", + "markdownDescription": "search: `string` \nModule: `http.handlers.headers` \nThe substring to search for. \n", + "type": "string" + }, + "search_regexp": { + "description": "search_regexp: string\nModule: http.handlers.headers\nThe regular expression to search with.\n", + "markdownDescription": "search_regexp: `string` \nModule: `http.handlers.headers` \nThe regular expression to search with. \n", + "type": "string" + } + } + } + } + }, + "set": { + "description": "set: object\nModule: http.handlers.headers\nSets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "set: `object` \nModule: `http.handlers.headers` \nSets HTTP headers; replaces existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Sets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "Sets HTTP headers; replaces existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "response": { + "description": "response: object\nModule: http.handlers.headers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#RespHeaderOps\nRespHeaderOps defines manipulations for response headers.\n\n", + "markdownDescription": "response: `object` \nModule: `http.handlers.headers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#RespHeaderOps) \nRespHeaderOps defines manipulations for response headers.\n \n", + "type": "object", + "properties": { + "add": { + "description": "add: object\nModule: http.handlers.headers\nAdds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "add: `object` \nModule: `http.handlers.headers` \nAdds HTTP headers; does not replace any existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Adds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "Adds HTTP headers; does not replace any existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "deferred": { + "description": "deferred: boolean\nModule: http.handlers.headers\nIf true, header operations will be deferred until\nthey are written out. Superceded if Require is set.\nUsually you will need to set this to true if any\nfields are being deleted.\n", + "markdownDescription": "deferred: `boolean` \nModule: `http.handlers.headers` \nIf true, header operations will be deferred until\nthey are written out. Superceded if Require is set.\nUsually you will need to set this to true if any\nfields are being deleted. \n", + "type": "boolean" + }, + "delete": { + "description": "delete: array\nModule: http.handlers.headers\nNames of HTTP header fields to delete.\n", + "markdownDescription": "delete: `array` \nModule: `http.handlers.headers` \nNames of HTTP header fields to delete. \n", + "type": "array", + "items": { + "description": "Names of HTTP header fields to delete.\n", + "markdownDescription": "Names of HTTP header fields to delete. \n", + "type": "string" + } + }, + "replace": { + "description": "replace: object\nModule: http.handlers.headers\nPerforms substring replacements of HTTP headers in-situ.\n", + "markdownDescription": "replace: `object` \nModule: `http.handlers.headers` \nPerforms substring replacements of HTTP headers in-situ. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "object", + "properties": { + "replace": { + "description": "replace: string\nModule: http.handlers.headers\nThe string with which to replace matches.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.headers` \nThe string with which to replace matches. \n", + "type": "string" + }, + "search": { + "description": "search: string\nModule: http.handlers.headers\nThe substring to search for.\n", + "markdownDescription": "search: `string` \nModule: `http.handlers.headers` \nThe substring to search for. \n", + "type": "string" + }, + "search_regexp": { + "description": "search_regexp: string\nModule: http.handlers.headers\nThe regular expression to search with.\n", + "markdownDescription": "search_regexp: `string` \nModule: `http.handlers.headers` \nThe regular expression to search with. \n", + "type": "string" + } + } + } + } + }, + "require": { + "description": "require: object\nModule: http.handlers.headers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher\nIf set, header operations will be deferred until\nthey are written out and only performed if the\nresponse matches these criteria.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria.\n", + "markdownDescription": "require: `object` \nModule: `http.handlers.headers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher) \nIf set, header operations will be deferred until\nthey are written out and only performed if the\nresponse matches these criteria.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria. \n", + "type": "object", + "properties": { + "headers": { + "description": "headers: object\nModule: http.handlers.headers\nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.headers` \nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "object", + "additionalProperties": { + "description": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "status_code": { + "description": "status_code: array\nModule: http.handlers.headers\nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "status_code: `array` \nModule: `http.handlers.headers` \nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "array", + "items": { + "description": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "number" + } + } + } + }, + "set": { + "description": "set: object\nModule: http.handlers.headers\nSets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "set: `object` \nModule: `http.handlers.headers` \nSets HTTP headers; replaces existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Sets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "Sets HTTP headers; replaces existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "http.handlers.map": { + "description": "map: object\nModule: http.handlers.map\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/map#Handler\nHandler implements a middleware that maps inputs to outputs. Specifically, it\ncompares a source value against the map inputs, and for one that matches, it\napplies the output values to each destination. Destinations become placeholder\nnames.\n\nMapped placeholders are not evaluated until they are used, so even for very\nlarge mappings, this handler is quite efficient.\n\n", + "markdownDescription": "map: `object` \nModule: `http.handlers.map` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/map#Handler) \nHandler implements a middleware that maps inputs to outputs. Specifically, it\ncompares a source value against the map inputs, and for one that matches, it\napplies the output values to each destination. Destinations become placeholder\nnames.\n\nMapped placeholders are not evaluated until they are used, so even for very\nlarge mappings, this handler is quite efficient.\n \n", + "type": "object", + "properties": { + "defaults": { + "description": "defaults: array\nModule: http.handlers.map\nIf no mappings match or if the mapped output is null/nil, the associated\ndefault output will be applied (optional).\n", + "markdownDescription": "defaults: `array` \nModule: `http.handlers.map` \nIf no mappings match or if the mapped output is null/nil, the associated\ndefault output will be applied (optional). \n", + "type": "array", + "items": { + "description": "If no mappings match or if the mapped output is null/nil, the associated\ndefault output will be applied (optional).\n", + "markdownDescription": "If no mappings match or if the mapped output is null/nil, the associated\ndefault output will be applied (optional). \n", + "type": "string" + } + }, + "destinations": { + "description": "destinations: array\nModule: http.handlers.map\nDestinations are the names of placeholders in which to store the outputs.\n", + "markdownDescription": "destinations: `array` \nModule: `http.handlers.map` \nDestinations are the names of placeholders in which to store the outputs. \n", + "type": "array", + "items": { + "description": "Destinations are the names of placeholders in which to store the outputs.\n", + "markdownDescription": "Destinations are the names of placeholders in which to store the outputs. \n", + "type": "string" + } + }, + "mappings": { + "description": "mappings: array\nModule: http.handlers.map\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/map#Mapping\nMappings from source values (inputs) to destination values (outputs).\nThe first matching, non-nil mapping will be applied.\n\n\nMapping describes a mapping from input to outputs.\n", + "markdownDescription": "mappings: `array` \nModule: `http.handlers.map` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/map#Mapping) \nMappings from source values (inputs) to destination values (outputs).\nThe first matching, non-nil mapping will be applied.\n\n\nMapping describes a mapping from input to outputs. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/map#Mapping\nMappings from source values (inputs) to destination values (outputs).\nThe first matching, non-nil mapping will be applied.\n\n\nMapping describes a mapping from input to outputs.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/map#Mapping) \nMappings from source values (inputs) to destination values (outputs).\nThe first matching, non-nil mapping will be applied.\n\n\nMapping describes a mapping from input to outputs. \n", + "type": "object", + "properties": { + "input": { + "description": "input: string\nModule: http.handlers.map\nThe input value to match. Must be distinct from other mappings.\nMutually exclusive to input_regexp.\n", + "markdownDescription": "input: `string` \nModule: `http.handlers.map` \nThe input value to match. Must be distinct from other mappings.\nMutually exclusive to input_regexp. \n", + "type": "string" + }, + "input_regexp": { + "description": "input_regexp: string\nModule: http.handlers.map\nThe input regular expression to match. Mutually exclusive to input.\n", + "markdownDescription": "input_regexp: `string` \nModule: `http.handlers.map` \nThe input regular expression to match. Mutually exclusive to input. \n", + "type": "string" + }, + "outputs": { + "description": "outputs: array\nModule: http.handlers.map\nUpon a match with the input, each output is positionally correlated\nwith each destination of the parent handler. An output that is null\n(nil) will be treated as if it was not mapped at all.\n", + "markdownDescription": "outputs: `array` \nModule: `http.handlers.map` \nUpon a match with the input, each output is positionally correlated\nwith each destination of the parent handler. An output that is null\n(nil) will be treated as if it was not mapped at all. \n", + "type": "array", + "items": { + "type": [ + "string", + "null" + ], + "description": "Upon a match with the input, each output is positionally correlated\nwith each destination of the parent handler. An output that is null\n(nil) will be treated as if it was not mapped at all.\n", + "markdownDescription": "Upon a match with the input, each output is positionally correlated\nwith each destination of the parent handler. An output that is null\n(nil) will be treated as if it was not mapped at all. \n" + } + } + } + } + }, + "source": { + "description": "source: string\nModule: http.handlers.map\nSource is the placeholder from which to get the input value.\n", + "markdownDescription": "source: `string` \nModule: `http.handlers.map` \nSource is the placeholder from which to get the input value. \n", + "type": "string" + } + } + }, + "http.handlers.metrics": { + "description": "metrics: object\nModule: http.handlers.metrics\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/metrics#Metrics\nMetrics is a module that serves a /metrics endpoint so that any gathered\nmetrics can be exposed for scraping. This module is configurable by end-users\nunlike AdminMetrics.\n\n", + "markdownDescription": "metrics: `object` \nModule: `http.handlers.metrics` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/metrics#Metrics) \nMetrics is a module that serves a /metrics endpoint so that any gathered\nmetrics can be exposed for scraping. This module is configurable by end-users\nunlike AdminMetrics.\n \n", + "type": "object", + "properties": { + "disable_openmetrics": { + "description": "disable_openmetrics: boolean\nModule: http.handlers.metrics\nDisable OpenMetrics negotiation, enabled by default. May be necessary if\nthe produced metrics cannot be parsed by the service scraping metrics.\n", + "markdownDescription": "disable_openmetrics: `boolean` \nModule: `http.handlers.metrics` \nDisable OpenMetrics negotiation, enabled by default. May be necessary if\nthe produced metrics cannot be parsed by the service scraping metrics. \n", + "type": "boolean" + } + } + }, + "http.handlers.push": { + "description": "push: object\nModule: http.handlers.push\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#Handler\nHandler is a middleware for manipulating the request body.\n\n", + "markdownDescription": "push: `object` \nModule: `http.handlers.push` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#Handler) \nHandler is a middleware for manipulating the request body.\n \n", + "type": "object", + "properties": { + "headers": { + "description": "headers: object\nModule: http.handlers.push\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#HeaderConfig\nHeaderConfig configures headers for synthetic push requests.\n\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.push` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#HeaderConfig) \nHeaderConfig configures headers for synthetic push requests.\n \n", + "type": "object", + "properties": { + "add": { + "description": "add: object\nModule: http.handlers.push\nAdds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "add: `object` \nModule: `http.handlers.push` \nAdds HTTP headers; does not replace any existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Adds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "Adds HTTP headers; does not replace any existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "delete": { + "description": "delete: array\nModule: http.handlers.push\nNames of HTTP header fields to delete.\n", + "markdownDescription": "delete: `array` \nModule: `http.handlers.push` \nNames of HTTP header fields to delete. \n", + "type": "array", + "items": { + "description": "Names of HTTP header fields to delete.\n", + "markdownDescription": "Names of HTTP header fields to delete. \n", + "type": "string" + } + }, + "replace": { + "description": "replace: object\nModule: http.handlers.push\nPerforms substring replacements of HTTP headers in-situ.\n", + "markdownDescription": "replace: `object` \nModule: `http.handlers.push` \nPerforms substring replacements of HTTP headers in-situ. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "object", + "properties": { + "replace": { + "description": "replace: string\nModule: http.handlers.push\nThe string with which to replace matches.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.push` \nThe string with which to replace matches. \n", + "type": "string" + }, + "search": { + "description": "search: string\nModule: http.handlers.push\nThe substring to search for.\n", + "markdownDescription": "search: `string` \nModule: `http.handlers.push` \nThe substring to search for. \n", + "type": "string" + }, + "search_regexp": { + "description": "search_regexp: string\nModule: http.handlers.push\nThe regular expression to search with.\n", + "markdownDescription": "search_regexp: `string` \nModule: `http.handlers.push` \nThe regular expression to search with. \n", + "type": "string" + } + } + } + } + }, + "set": { + "description": "set: object\nModule: http.handlers.push\nSets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "set: `object` \nModule: `http.handlers.push` \nSets HTTP headers; replaces existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Sets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "Sets HTTP headers; replaces existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "description": "resources: array\nModule: http.handlers.push\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#Resource\nResource represents a request for a resource to push.\n\n", + "markdownDescription": "resources: `array` \nModule: `http.handlers.push` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#Resource) \nResource represents a request for a resource to push.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#Resource\nResource represents a request for a resource to push.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/push#Resource) \nResource represents a request for a resource to push.\n \n", + "type": "object", + "properties": { + "method": { + "description": "method: string\nModule: http.handlers.push\nMethod is the request method, which must be GET or HEAD.\nDefault is GET.\n", + "markdownDescription": "method: `string` \nModule: `http.handlers.push` \nMethod is the request method, which must be GET or HEAD.\nDefault is GET. \n", + "type": "string" + }, + "target": { + "description": "target: string\nModule: http.handlers.push\nTarget is the path to the resource being pushed.\n", + "markdownDescription": "target: `string` \nModule: `http.handlers.push` \nTarget is the path to the resource being pushed. \n", + "type": "string" + } + } + } + } + } + }, + "http.handlers.request_body": { + "description": "request_body: object\nModule: http.handlers.request_body\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/requestbody#RequestBody\nRequestBody is a middleware for manipulating the request body.\n\n", + "markdownDescription": "request_body: `object` \nModule: `http.handlers.request_body` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/requestbody#RequestBody) \nRequestBody is a middleware for manipulating the request body.\n \n", + "type": "object", + "properties": { + "max_size": { + "description": "max_size: number\nModule: http.handlers.request_body\nThe maximum number of bytes to allow reading from the body by a later handler.\nIf more bytes are read, an error with HTTP status 413 is returned.\n", + "markdownDescription": "max_size: `number` \nModule: `http.handlers.request_body` \nThe maximum number of bytes to allow reading from the body by a later handler.\nIf more bytes are read, an error with HTTP status 413 is returned. \n", + "type": "number" + } + } + }, + "http.handlers.reverse_proxy": { + "description": "reverse_proxy: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#Handler\nHandler implements a highly configurable and production-ready reverse proxy.\n\nUpon proxying, this module sets the following placeholders (which can be used\nboth within and after this handler; for example, in response headers):\n\nPlaceholder | Description\n------------|-------------\n`{http.reverse_proxy.upstream.address}` | The full address to the upstream as given in the config\n`{http.reverse_proxy.upstream.hostport}` | The host:port of the upstream\n`{http.reverse_proxy.upstream.host}` | The host of the upstream\n`{http.reverse_proxy.upstream.port}` | The port of the upstream\n`{http.reverse_proxy.upstream.requests}` | The approximate current number of requests to the upstream\n`{http.reverse_proxy.upstream.max_requests}` | The maximum approximate number of requests allowed to the upstream\n`{http.reverse_proxy.upstream.fails}` | The number of recent failed requests to the upstream\n`{http.reverse_proxy.upstream.latency}` | How long it took the proxy upstream to write the response header.\n`{http.reverse_proxy.upstream.latency_ms}` | Same as 'latency', but in milliseconds.\n`{http.reverse_proxy.upstream.duration}` | Time spent proxying to the upstream, including writing response body to client.\n`{http.reverse_proxy.upstream.duration_ms}` | Same as 'upstream.duration', but in milliseconds.\n`{http.reverse_proxy.duration}` | Total time spent proxying, including selecting an upstream, retries, and writing response.\n`{http.reverse_proxy.duration_ms}` | Same as 'duration', but in milliseconds.\n\n", + "markdownDescription": "reverse_proxy: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#Handler) \nHandler implements a highly configurable and production-ready reverse proxy.\n\nUpon proxying, this module sets the following placeholders (which can be used\nboth within and after this handler; for example, in response headers):\n\nPlaceholder | Description\n------------|-------------\n`{http.reverse_proxy.upstream.address}` | The full address to the upstream as given in the config\n`{http.reverse_proxy.upstream.hostport}` | The host:port of the upstream\n`{http.reverse_proxy.upstream.host}` | The host of the upstream\n`{http.reverse_proxy.upstream.port}` | The port of the upstream\n`{http.reverse_proxy.upstream.requests}` | The approximate current number of requests to the upstream\n`{http.reverse_proxy.upstream.max_requests}` | The maximum approximate number of requests allowed to the upstream\n`{http.reverse_proxy.upstream.fails}` | The number of recent failed requests to the upstream\n`{http.reverse_proxy.upstream.latency}` | How long it took the proxy upstream to write the response header.\n`{http.reverse_proxy.upstream.latency_ms}` | Same as 'latency', but in milliseconds.\n`{http.reverse_proxy.upstream.duration}` | Time spent proxying to the upstream, including writing response body to client.\n`{http.reverse_proxy.upstream.duration_ms}` | Same as 'upstream.duration', but in milliseconds.\n`{http.reverse_proxy.duration}` | Total time spent proxying, including selecting an upstream, retries, and writing response.\n`{http.reverse_proxy.duration_ms}` | Same as 'duration', but in milliseconds.\n \n", + "type": "object", + "properties": { + "buffer_requests": { + "description": "buffer_requests: boolean\nModule: http.handlers.reverse_proxy\nIf true, the entire request body will be read and buffered\nin memory before being proxied to the backend. This should\nbe avoided if at all possible for performance reasons, but\ncould be useful if the backend is intolerant of read latency.\n", + "markdownDescription": "buffer_requests: `boolean` \nModule: `http.handlers.reverse_proxy` \nIf true, the entire request body will be read and buffered\nin memory before being proxied to the backend. This should\nbe avoided if at all possible for performance reasons, but\ncould be useful if the backend is intolerant of read latency. \n", + "type": "boolean" + }, + "buffer_responses": { + "description": "buffer_responses: boolean\nModule: http.handlers.reverse_proxy\nIf true, the entire response body will be read and buffered\nin memory before being proxied to the client. This should\nbe avoided if at all possible for performance reasons, but\ncould be useful if the backend has tighter memory constraints.\n", + "markdownDescription": "buffer_responses: `boolean` \nModule: `http.handlers.reverse_proxy` \nIf true, the entire response body will be read and buffered\nin memory before being proxied to the client. This should\nbe avoided if at all possible for performance reasons, but\ncould be useful if the backend has tighter memory constraints. \n", + "type": "boolean" + }, + "circuit_breaker": { + "description": "circuit_breaker: any\nModule: http.reverse_proxy.circuit_breakers\nA circuit breaker may be used to relieve pressure on a backend\nthat is beginning to exhibit symptoms of stress or latency.\nBy default, there is no circuit breaker.\n", + "markdownDescription": "circuit_breaker: `any` \nModule: `http.reverse_proxy.circuit_breakers` \nA circuit breaker may be used to relieve pressure on a backend\nthat is beginning to exhibit symptoms of stress or latency.\nBy default, there is no circuit breaker. \n" + }, + "dynamic_upstreams": { + "description": "dynamic_upstreams: object\nModule: http.reverse_proxy.upstreams\nA module for retrieving the list of upstreams dynamically. Dynamic\nupstreams are retrieved at every iteration of the proxy loop for\neach request (i.e. before every proxy attempt within every request).\nActive health checks do not work on dynamic upstreams, and passive\nhealth checks are only effective on dynamic upstreams if the proxy\nserver is busy enough that concurrent requests to the same backends\nare continuous. Instead of health checks for dynamic upstreams, it\nis recommended that the dynamic upstream module only return available\nbackends in the first place.\n", + "markdownDescription": "dynamic_upstreams: `object` \nModule: `http.reverse_proxy.upstreams` \nA module for retrieving the list of upstreams dynamically. Dynamic\nupstreams are retrieved at every iteration of the proxy loop for\neach request (i.e. before every proxy attempt within every request).\nActive health checks do not work on dynamic upstreams, and passive\nhealth checks are only effective on dynamic upstreams if the proxy\nserver is busy enough that concurrent requests to the same backends\nare continuous. Instead of health checks for dynamic upstreams, it\nis recommended that the dynamic upstream module only return available\nbackends in the first place. \n", + "type": "object", + "required": [ + "source" + ], + "allOf": [ + { + "if": { + "properties": { + "source": { + "const": "a" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.upstreams.a" + } + }, + { + "if": { + "properties": { + "source": { + "const": "srv" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.upstreams.srv" + } + }, + { + "properties": { + "source": { + "description": "key to identify dynamic_upstreams module.\nsource: string\nModule: http.reverse_proxy.upstreams", + "markdownDescription": "key to identify `dynamic_upstreams` module. \nsource: `string` \nModule: `http.reverse_proxy.upstreams`", + "type": "string", + "enum": [ + "a", + "srv" + ] + } + } + } + ] + }, + "flush_interval": { + "description": "flush_interval: number\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nAdjusts how often to flush the response buffer. By default,\nno periodic flushing is done. A negative value disables\nresponse buffering, and flushes immediately after each\nwrite to the client. This option is ignored when the upstream's\nresponse is recognized as a streaming response, or if its\ncontent length is -1; for such responses, writes are flushed\nto the client immediately.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "flush_interval: `number` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nAdjusts how often to flush the response buffer. By default,\nno periodic flushing is done. A negative value disables\nresponse buffering, and flushes immediately after each\nwrite to the client. This option is ignored when the upstream's\nresponse is recognized as a streaming response, or if its\ncontent length is -1; for such responses, writes are flushed\nto the client immediately.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "handle_response": { + "description": "handle_response: array\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseHandler\nList of handlers and their associated matchers to evaluate\nafter successful roundtrips. The first handler that matches\nthe response from a backend will be invoked. The response\nbody from the backend will not be written to the client;\nit is up to the handler to finish handling the response.\nIf passive health checks are enabled, any errors from the\nhandler chain will not affect the health status of the\nbackend.\n\nThree new placeholders are available in this handler chain:\n- `{http.reverse_proxy.status_code}` The status code from the response\n- `{http.reverse_proxy.status_text}` The status text from the response\n- `{http.reverse_proxy.header.*}` The headers from the response\n\n\nResponseHandler pairs a response matcher with custom handling\nlogic. Either the status code can be changed to something else\nwhile using the original response body, or, if a status code\nis not set, it can execute a custom route list; this is useful\nfor executing handler routes based on the properties of an HTTP\nresponse that has not been written out to the client yet.\n\nTo use this type, provision it at module load time, then when\nready to use, match the response against its matcher; if it\nmatches (or doesn't have a matcher), change the status code on\nthe response if configured; otherwise invoke the routes by\ncalling `rh.Routes.Compile(next).ServeHTTP(rw, req)` (or similar).\n", + "markdownDescription": "handle_response: `array` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseHandler) \nList of handlers and their associated matchers to evaluate\nafter successful roundtrips. The first handler that matches\nthe response from a backend will be invoked. The response\nbody from the backend will not be written to the client;\nit is up to the handler to finish handling the response.\nIf passive health checks are enabled, any errors from the\nhandler chain will not affect the health status of the\nbackend.\n\nThree new placeholders are available in this handler chain:\n- `{http.reverse_proxy.status_code}` The status code from the response\n- `{http.reverse_proxy.status_text}` The status text from the response\n- `{http.reverse_proxy.header.*}` The headers from the response\n\n\nResponseHandler pairs a response matcher with custom handling\nlogic. Either the status code can be changed to something else\nwhile using the original response body, or, if a status code\nis not set, it can execute a custom route list; this is useful\nfor executing handler routes based on the properties of an HTTP\nresponse that has not been written out to the client yet.\n\nTo use this type, provision it at module load time, then when\nready to use, match the response against its matcher; if it\nmatches (or doesn't have a matcher), change the status code on\nthe response if configured; otherwise invoke the routes by\ncalling `rh.Routes.Compile(next).ServeHTTP(rw, req)` (or similar). \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseHandler\nList of handlers and their associated matchers to evaluate\nafter successful roundtrips. The first handler that matches\nthe response from a backend will be invoked. The response\nbody from the backend will not be written to the client;\nit is up to the handler to finish handling the response.\nIf passive health checks are enabled, any errors from the\nhandler chain will not affect the health status of the\nbackend.\n\nThree new placeholders are available in this handler chain:\n- `{http.reverse_proxy.status_code}` The status code from the response\n- `{http.reverse_proxy.status_text}` The status text from the response\n- `{http.reverse_proxy.header.*}` The headers from the response\n\n\nResponseHandler pairs a response matcher with custom handling\nlogic. Either the status code can be changed to something else\nwhile using the original response body, or, if a status code\nis not set, it can execute a custom route list; this is useful\nfor executing handler routes based on the properties of an HTTP\nresponse that has not been written out to the client yet.\n\nTo use this type, provision it at module load time, then when\nready to use, match the response against its matcher; if it\nmatches (or doesn't have a matcher), change the status code on\nthe response if configured; otherwise invoke the routes by\ncalling `rh.Routes.Compile(next).ServeHTTP(rw, req)` (or similar).\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseHandler) \nList of handlers and their associated matchers to evaluate\nafter successful roundtrips. The first handler that matches\nthe response from a backend will be invoked. The response\nbody from the backend will not be written to the client;\nit is up to the handler to finish handling the response.\nIf passive health checks are enabled, any errors from the\nhandler chain will not affect the health status of the\nbackend.\n\nThree new placeholders are available in this handler chain:\n- `{http.reverse_proxy.status_code}` The status code from the response\n- `{http.reverse_proxy.status_text}` The status text from the response\n- `{http.reverse_proxy.header.*}` The headers from the response\n\n\nResponseHandler pairs a response matcher with custom handling\nlogic. Either the status code can be changed to something else\nwhile using the original response body, or, if a status code\nis not set, it can execute a custom route list; this is useful\nfor executing handler routes based on the properties of an HTTP\nresponse that has not been written out to the client yet.\n\nTo use this type, provision it at module load time, then when\nready to use, match the response against its matcher; if it\nmatches (or doesn't have a matcher), change the status code on\nthe response if configured; otherwise invoke the routes by\ncalling `rh.Routes.Compile(next).ServeHTTP(rw, req)` (or similar). \n", + "type": "object", + "properties": { + "match": { + "description": "match: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher\nThe response matcher for this handler. If empty/nil,\nit always matches.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria.\n", + "markdownDescription": "match: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher) \nThe response matcher for this handler. If empty/nil,\nit always matches.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria. \n", + "type": "object", + "properties": { + "headers": { + "description": "headers: object\nModule: http.handlers.reverse_proxy\nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.reverse_proxy` \nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "object", + "additionalProperties": { + "description": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "status_code": { + "description": "status_code: array\nModule: http.handlers.reverse_proxy\nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "status_code: `array` \nModule: `http.handlers.reverse_proxy` \nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "array", + "items": { + "description": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "number" + } + } + } + }, + "routes": { + "description": "routes: array\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe list of HTTP routes to execute if no status code is\nspecified. If evaluated, the original response body\nwill not be written.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "routes: `array` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe list of HTTP routes to execute if no status code is\nspecified. If evaluated, the original response body\nwill not be written.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe list of HTTP routes to execute if no status code is\nspecified. If evaluated, the original response body\nwill not be written.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe list of HTTP routes to execute if no status code is\nspecified. If evaluated, the original response body\nwill not be written.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "object", + "properties": { + "group": { + "description": "group: string\nModule: http.handlers.reverse_proxy\nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed.\n", + "markdownDescription": "group: `string` \nModule: `http.handlers.reverse_proxy` \nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed. \n", + "type": "string" + }, + "handle": { + "description": "handle: array\nModule: http.handlers\nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "handle: `array` \nModule: `http.handlers` \nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "type": "array", + "items": { + "description": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "static_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.static_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "authentication" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.authentication" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response_headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response_headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "error" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.error" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "file_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.file_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "map" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.map" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "reverse_proxy" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.reverse_proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "templates" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.templates" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "acme_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.acme_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "vars" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.vars" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "push" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.push" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "metrics" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.metrics" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "request_body" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.request_body" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "rewrite" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.rewrite" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tracing" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.tracing" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "encode" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.encode" + } + }, + { + "properties": { + "handler": { + "description": "key to identify handle module.\nhandler: string\nModule: http.handlers", + "markdownDescription": "key to identify `handle` module. \nhandler: `string` \nModule: `http.handlers`", + "type": "string", + "enum": [ + "static_response", + "authentication", + "copy_response", + "copy_response_headers", + "error", + "file_server", + "map", + "reverse_proxy", + "templates", + "acme_server", + "vars", + "push", + "headers", + "metrics", + "request_body", + "rewrite", + "subroute", + "tracing", + "encode" + ] + } + } + } + ] + } + }, + "match": { + "description": "match: array\nModule: http.matchers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "match: `array` \nModule: `http.matchers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "properties": { + "expression": { + "$ref": "#/definitions/http.matchers.expression" + }, + "file": { + "$ref": "#/definitions/http.matchers.file" + }, + "header": { + "$ref": "#/definitions/http.matchers.header" + }, + "header_regexp": { + "$ref": "#/definitions/http.matchers.header_regexp" + }, + "host": { + "$ref": "#/definitions/http.matchers.host" + }, + "method": { + "$ref": "#/definitions/http.matchers.method" + }, + "not": { + "$ref": "#/definitions/http.matchers.not" + }, + "path": { + "$ref": "#/definitions/http.matchers.path" + }, + "path_regexp": { + "$ref": "#/definitions/http.matchers.path_regexp" + }, + "protocol": { + "$ref": "#/definitions/http.matchers.protocol" + }, + "query": { + "$ref": "#/definitions/http.matchers.query" + }, + "remote_ip": { + "$ref": "#/definitions/http.matchers.remote_ip" + }, + "vars": { + "$ref": "#/definitions/http.matchers.vars" + }, + "vars_regexp": { + "$ref": "#/definitions/http.matchers.vars_regexp" + } + } + } + }, + "terminal": { + "description": "terminal: boolean\nModule: http.handlers.reverse_proxy\nIf true, no more routes will be executed after this one.\n", + "markdownDescription": "terminal: `boolean` \nModule: `http.handlers.reverse_proxy` \nIf true, no more routes will be executed after this one. \n", + "type": "boolean" + } + } + } + }, + "status_code": { + "description": "status_code: string\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString\nTo write the original response body but with a different\nstatus code, set this field to the desired status code.\nIf set, this takes priority over routes.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned.\n", + "markdownDescription": "status_code: `string` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString) \nTo write the original response body but with a different\nstatus code, set this field to the desired status code.\nIf set, this takes priority over routes.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned. \n", + "type": "string" + } + } + } + }, + "headers": { + "description": "headers: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Handler\nHeaders manipulates headers between Caddy and the backend.\nBy default, all headers are passed-thru without changes,\nwith the exceptions of special hop-by-hop headers.\n\nX-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host\nare also set implicitly.\n\n\nHandler is a middleware which modifies request and response headers.\n\nChanges to headers are applied immediately, except for the response\nheaders when Deferred is true or when Required is set. In those cases,\nthe changes are applied when the headers are written to the response.\nNote that deferred changes do not take effect if an error occurs later\nin the middleware chain.\n\nProperties in this module accept placeholders.\n\nResponse header operations can be conditioned upon response status code\nand/or other header values.\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Handler) \nHeaders manipulates headers between Caddy and the backend.\nBy default, all headers are passed-thru without changes,\nwith the exceptions of special hop-by-hop headers.\n\nX-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host\nare also set implicitly.\n\n\nHandler is a middleware which modifies request and response headers.\n\nChanges to headers are applied immediately, except for the response\nheaders when Deferred is true or when Required is set. In those cases,\nthe changes are applied when the headers are written to the response.\nNote that deferred changes do not take effect if an error occurs later\nin the middleware chain.\n\nProperties in this module accept placeholders.\n\nResponse header operations can be conditioned upon response status code\nand/or other header values. \n", + "type": "object", + "properties": { + "request": { + "description": "request: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#HeaderOps\nHeaderOps defines manipulations for HTTP headers.\n\n", + "markdownDescription": "request: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#HeaderOps) \nHeaderOps defines manipulations for HTTP headers.\n \n", + "type": "object", + "properties": { + "add": { + "description": "add: object\nModule: http.handlers.reverse_proxy\nAdds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "add: `object` \nModule: `http.handlers.reverse_proxy` \nAdds HTTP headers; does not replace any existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Adds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "Adds HTTP headers; does not replace any existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "delete": { + "description": "delete: array\nModule: http.handlers.reverse_proxy\nNames of HTTP header fields to delete.\n", + "markdownDescription": "delete: `array` \nModule: `http.handlers.reverse_proxy` \nNames of HTTP header fields to delete. \n", + "type": "array", + "items": { + "description": "Names of HTTP header fields to delete.\n", + "markdownDescription": "Names of HTTP header fields to delete. \n", + "type": "string" + } + }, + "replace": { + "description": "replace: object\nModule: http.handlers.reverse_proxy\nPerforms substring replacements of HTTP headers in-situ.\n", + "markdownDescription": "replace: `object` \nModule: `http.handlers.reverse_proxy` \nPerforms substring replacements of HTTP headers in-situ. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "object", + "properties": { + "replace": { + "description": "replace: string\nModule: http.handlers.reverse_proxy\nThe string with which to replace matches.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.reverse_proxy` \nThe string with which to replace matches. \n", + "type": "string" + }, + "search": { + "description": "search: string\nModule: http.handlers.reverse_proxy\nThe substring to search for.\n", + "markdownDescription": "search: `string` \nModule: `http.handlers.reverse_proxy` \nThe substring to search for. \n", + "type": "string" + }, + "search_regexp": { + "description": "search_regexp: string\nModule: http.handlers.reverse_proxy\nThe regular expression to search with.\n", + "markdownDescription": "search_regexp: `string` \nModule: `http.handlers.reverse_proxy` \nThe regular expression to search with. \n", + "type": "string" + } + } + } + } + }, + "set": { + "description": "set: object\nModule: http.handlers.reverse_proxy\nSets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "set: `object` \nModule: `http.handlers.reverse_proxy` \nSets HTTP headers; replaces existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Sets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "Sets HTTP headers; replaces existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "response": { + "description": "response: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#RespHeaderOps\nRespHeaderOps defines manipulations for response headers.\n\n", + "markdownDescription": "response: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#RespHeaderOps) \nRespHeaderOps defines manipulations for response headers.\n \n", + "type": "object", + "properties": { + "add": { + "description": "add: object\nModule: http.handlers.reverse_proxy\nAdds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "add: `object` \nModule: `http.handlers.reverse_proxy` \nAdds HTTP headers; does not replace any existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Adds HTTP headers; does not replace any existing header fields.\n", + "markdownDescription": "Adds HTTP headers; does not replace any existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "deferred": { + "description": "deferred: boolean\nModule: http.handlers.reverse_proxy\nIf true, header operations will be deferred until\nthey are written out. Superceded if Require is set.\nUsually you will need to set this to true if any\nfields are being deleted.\n", + "markdownDescription": "deferred: `boolean` \nModule: `http.handlers.reverse_proxy` \nIf true, header operations will be deferred until\nthey are written out. Superceded if Require is set.\nUsually you will need to set this to true if any\nfields are being deleted. \n", + "type": "boolean" + }, + "delete": { + "description": "delete: array\nModule: http.handlers.reverse_proxy\nNames of HTTP header fields to delete.\n", + "markdownDescription": "delete: `array` \nModule: `http.handlers.reverse_proxy` \nNames of HTTP header fields to delete. \n", + "type": "array", + "items": { + "description": "Names of HTTP header fields to delete.\n", + "markdownDescription": "Names of HTTP header fields to delete. \n", + "type": "string" + } + }, + "replace": { + "description": "replace: object\nModule: http.handlers.reverse_proxy\nPerforms substring replacements of HTTP headers in-situ.\n", + "markdownDescription": "replace: `object` \nModule: `http.handlers.reverse_proxy` \nPerforms substring replacements of HTTP headers in-situ. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement\nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/headers#Replacement) \nReplacement describes a string replacement,\neither a simple and fast substring search\nor a slower but more powerful regex search.\n \n", + "type": "object", + "properties": { + "replace": { + "description": "replace: string\nModule: http.handlers.reverse_proxy\nThe string with which to replace matches.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.reverse_proxy` \nThe string with which to replace matches. \n", + "type": "string" + }, + "search": { + "description": "search: string\nModule: http.handlers.reverse_proxy\nThe substring to search for.\n", + "markdownDescription": "search: `string` \nModule: `http.handlers.reverse_proxy` \nThe substring to search for. \n", + "type": "string" + }, + "search_regexp": { + "description": "search_regexp: string\nModule: http.handlers.reverse_proxy\nThe regular expression to search with.\n", + "markdownDescription": "search_regexp: `string` \nModule: `http.handlers.reverse_proxy` \nThe regular expression to search with. \n", + "type": "string" + } + } + } + } + }, + "require": { + "description": "require: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher\nIf set, header operations will be deferred until\nthey are written out and only performed if the\nresponse matches these criteria.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria.\n", + "markdownDescription": "require: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#ResponseMatcher) \nIf set, header operations will be deferred until\nthey are written out and only performed if the\nresponse matches these criteria.\n\n\nResponseMatcher is a type which can determine if an\nHTTP response matches some criteria. \n", + "type": "object", + "properties": { + "headers": { + "description": "headers: object\nModule: http.handlers.reverse_proxy\nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.reverse_proxy` \nIf set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "object", + "additionalProperties": { + "description": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/).\n", + "markdownDescription": "If set, each header specified must be one of the\nspecified values, with the same logic used by the\n[request header matcher](/docs/json/apps/http/servers/routes/match/header/). \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "status_code": { + "description": "status_code: array\nModule: http.handlers.reverse_proxy\nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "status_code: `array` \nModule: `http.handlers.reverse_proxy` \nIf set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "array", + "items": { + "description": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes).\n", + "markdownDescription": "If set, one of these status codes would be required.\nA one-digit status can be used to represent all codes\nin that class (e.g. 3 for all 3xx codes). \n", + "type": "number" + } + } + } + }, + "set": { + "description": "set: object\nModule: http.handlers.reverse_proxy\nSets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "set: `object` \nModule: `http.handlers.reverse_proxy` \nSets HTTP headers; replaces existing header fields. \n", + "type": "object", + "additionalProperties": { + "description": "Sets HTTP headers; replaces existing header fields.\n", + "markdownDescription": "Sets HTTP headers; replaces existing header fields. \n", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "health_checks": { + "description": "health_checks: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HealthChecks\nHealth checks update the status of backends, whether they are\nup or down. Down backends will not be proxied to.\n\n\nHealthChecks configures active and passive health checks.\n", + "markdownDescription": "health_checks: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HealthChecks) \nHealth checks update the status of backends, whether they are\nup or down. Down backends will not be proxied to.\n\n\nHealthChecks configures active and passive health checks. \n", + "type": "object", + "properties": { + "active": { + "description": "active: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#ActiveHealthChecks\nActive health checks run in the background on a timer. To\nminimally enable active health checks, set either path or\nport (or both). Note that active health check status\n(healthy/unhealthy) is stored per-proxy-handler, not\nglobally; this allows different handlers to use different\ncriteria to decide what defines a healthy backend.\n\nActive health checks do not run for dynamic upstreams.\n\n\nActiveHealthChecks holds configuration related to active\nhealth checks (that is, health checks which occur in a\nbackground goroutine independently).\n", + "markdownDescription": "active: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#ActiveHealthChecks) \nActive health checks run in the background on a timer. To\nminimally enable active health checks, set either path or\nport (or both). Note that active health check status\n(healthy/unhealthy) is stored per-proxy-handler, not\nglobally; this allows different handlers to use different\ncriteria to decide what defines a healthy backend.\n\nActive health checks do not run for dynamic upstreams.\n\n\nActiveHealthChecks holds configuration related to active\nhealth checks (that is, health checks which occur in a\nbackground goroutine independently). \n", + "type": "object", + "properties": { + "expect_body": { + "description": "expect_body: string\nModule: http.handlers.reverse_proxy\nA regular expression against which to match the response\nbody of a healthy backend.\n", + "markdownDescription": "expect_body: `string` \nModule: `http.handlers.reverse_proxy` \nA regular expression against which to match the response\nbody of a healthy backend. \n", + "type": "string" + }, + "expect_status": { + "description": "expect_status: number\nModule: http.handlers.reverse_proxy\nThe HTTP status code to expect from a healthy backend.\n", + "markdownDescription": "expect_status: `number` \nModule: `http.handlers.reverse_proxy` \nThe HTTP status code to expect from a healthy backend. \n", + "type": "number" + }, + "headers": { + "description": "headers: object\nModule: http.handlers.reverse_proxy\nHTTP headers to set on health check requests.\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.reverse_proxy` \nHTTP headers to set on health check requests. \n", + "type": "object", + "additionalProperties": { + "description": "HTTP headers to set on health check requests.\n", + "markdownDescription": "HTTP headers to set on health check requests. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "interval": { + "description": "interval: number\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow frequently to perform active health checks (default 30s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "interval: `number` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow frequently to perform active health checks (default 30s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "max_size": { + "description": "max_size: number\nModule: http.handlers.reverse_proxy\nThe maximum response body to download from the backend\nduring a health check.\n", + "markdownDescription": "max_size: `number` \nModule: `http.handlers.reverse_proxy` \nThe maximum response body to download from the backend\nduring a health check. \n", + "type": "number" + }, + "path": { + "description": "path: string\nModule: http.handlers.reverse_proxy\nDEPRECATED: Use 'uri' instead. This field will be removed. TODO: remove this field\n", + "markdownDescription": "path: `string` \nModule: `http.handlers.reverse_proxy` \nDEPRECATED: Use 'uri' instead. This field will be removed. TODO: remove this field \n", + "type": "string" + }, + "port": { + "description": "port: number\nModule: http.handlers.reverse_proxy\nThe port to use (if different from the upstream's dial\naddress) for health checks.\n", + "markdownDescription": "port: `number` \nModule: `http.handlers.reverse_proxy` \nThe port to use (if different from the upstream's dial\naddress) for health checks. \n", + "type": "number" + }, + "timeout": { + "description": "timeout: number\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to wait for a response from a backend before\nconsidering it unhealthy (default 5s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "timeout: `number` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to wait for a response from a backend before\nconsidering it unhealthy (default 5s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "uri": { + "description": "uri: string\nModule: http.handlers.reverse_proxy\nThe URI (path and query) to use for health checks\n", + "markdownDescription": "uri: `string` \nModule: `http.handlers.reverse_proxy` \nThe URI (path and query) to use for health checks \n", + "type": "string" + } + } + }, + "passive": { + "description": "passive: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#PassiveHealthChecks\nPassive health checks monitor proxied requests for errors or timeouts.\nTo minimally enable passive health checks, specify at least an empty\nconfig object. Passive health check state is shared (stored globally),\nso a failure from one handler will be counted by all handlers; but\nthe tolerances or standards for what defines healthy/unhealthy backends\nis configured per-proxy-handler.\n\nPassive health checks technically do operate on dynamic upstreams,\nbut are only effective for very busy proxies where the list of\nupstreams is mostly stable. This is because the shared/global\nstate of upstreams is cleaned up when the upstreams are no longer\nused. Since dynamic upstreams are allocated dynamically at each\nrequest (specifically, each iteration of the proxy loop per request),\nthey are also cleaned up after every request. Thus, if there is a\nmoment when no requests are actively referring to a particular\nupstream host, the passive health check state will be reset because\nit will be garbage-collected. It is usually better for the dynamic\nupstream module to only return healthy, available backends instead.\n\n\nPassiveHealthChecks holds configuration related to passive\nhealth checks (that is, health checks which occur during\nthe normal flow of request proxying).\n", + "markdownDescription": "passive: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#PassiveHealthChecks) \nPassive health checks monitor proxied requests for errors or timeouts.\nTo minimally enable passive health checks, specify at least an empty\nconfig object. Passive health check state is shared (stored globally),\nso a failure from one handler will be counted by all handlers; but\nthe tolerances or standards for what defines healthy/unhealthy backends\nis configured per-proxy-handler.\n\nPassive health checks technically do operate on dynamic upstreams,\nbut are only effective for very busy proxies where the list of\nupstreams is mostly stable. This is because the shared/global\nstate of upstreams is cleaned up when the upstreams are no longer\nused. Since dynamic upstreams are allocated dynamically at each\nrequest (specifically, each iteration of the proxy loop per request),\nthey are also cleaned up after every request. Thus, if there is a\nmoment when no requests are actively referring to a particular\nupstream host, the passive health check state will be reset because\nit will be garbage-collected. It is usually better for the dynamic\nupstream module to only return healthy, available backends instead.\n\n\nPassiveHealthChecks holds configuration related to passive\nhealth checks (that is, health checks which occur during\nthe normal flow of request proxying). \n", + "type": "object", + "properties": { + "fail_duration": { + "description": "fail_duration: number\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to remember a failed request to a backend. A duration \u003e 0\nenables passive health checking. Default is 0.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "fail_duration: `number` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to remember a failed request to a backend. A duration \u003e 0\nenables passive health checking. Default is 0.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "max_fails": { + "description": "max_fails: number\nModule: http.handlers.reverse_proxy\nThe number of failed requests within the FailDuration window to\nconsider a backend as \"down\". Must be \u003e= 1; default is 1. Requires\nthat FailDuration be \u003e 0.\n", + "markdownDescription": "max_fails: `number` \nModule: `http.handlers.reverse_proxy` \nThe number of failed requests within the FailDuration window to\nconsider a backend as \"down\". Must be \u003e= 1; default is 1. Requires\nthat FailDuration be \u003e 0. \n", + "type": "number" + }, + "unhealthy_latency": { + "description": "unhealthy_latency: number\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nCount the request as failed if the response takes at least this\nlong to receive.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "unhealthy_latency: `number` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nCount the request as failed if the response takes at least this\nlong to receive.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "unhealthy_request_count": { + "description": "unhealthy_request_count: number\nModule: http.handlers.reverse_proxy\nLimits the number of simultaneous requests to a backend by\nmarking the backend as \"down\" if it has this many concurrent\nrequests or more.\n", + "markdownDescription": "unhealthy_request_count: `number` \nModule: `http.handlers.reverse_proxy` \nLimits the number of simultaneous requests to a backend by\nmarking the backend as \"down\" if it has this many concurrent\nrequests or more. \n", + "type": "number" + }, + "unhealthy_status": { + "description": "unhealthy_status: array\nModule: http.handlers.reverse_proxy\nCount the request as failed if the response comes back with\none of these status codes.\n", + "markdownDescription": "unhealthy_status: `array` \nModule: `http.handlers.reverse_proxy` \nCount the request as failed if the response comes back with\none of these status codes. \n", + "type": "array", + "items": { + "description": "Count the request as failed if the response comes back with\none of these status codes.\n", + "markdownDescription": "Count the request as failed if the response comes back with\none of these status codes. \n", + "type": "number" + } + } + } + } + } + }, + "load_balancing": { + "description": "load_balancing: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#LoadBalancing\nLoad balancing distributes load/requests between backends.\n\n\nLoadBalancing has parameters related to load balancing.\n", + "markdownDescription": "load_balancing: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#LoadBalancing) \nLoad balancing distributes load/requests between backends.\n\n\nLoadBalancing has parameters related to load balancing. \n", + "type": "object", + "properties": { + "retry_match": { + "description": "retry_match: array\nModule: http.matchers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nA list of matcher sets that restricts with which requests retries are\nallowed. A request must match any of the given matcher sets in order\nto be retried if the connection to the upstream succeeded but the\nsubsequent round-trip failed. If the connection to the upstream failed,\na retry is always allowed. If unspecified, only GET requests will be\nallowed to be retried. Note that a retry is done with the next available\nhost according to the load balancing policy.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "retry_match: `array` \nModule: `http.matchers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nA list of matcher sets that restricts with which requests retries are\nallowed. A request must match any of the given matcher sets in order\nto be retried if the connection to the upstream succeeded but the\nsubsequent round-trip failed. If the connection to the upstream failed,\na retry is always allowed. If unspecified, only GET requests will be\nallowed to be retried. Note that a retry is done with the next available\nhost according to the load balancing policy.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nA list of matcher sets that restricts with which requests retries are\nallowed. A request must match any of the given matcher sets in order\nto be retried if the connection to the upstream succeeded but the\nsubsequent round-trip failed. If the connection to the upstream failed,\na retry is always allowed. If unspecified, only GET requests will be\nallowed to be retried. Note that a retry is done with the next available\nhost according to the load balancing policy.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nA list of matcher sets that restricts with which requests retries are\nallowed. A request must match any of the given matcher sets in order\nto be retried if the connection to the upstream succeeded but the\nsubsequent round-trip failed. If the connection to the upstream failed,\na retry is always allowed. If unspecified, only GET requests will be\nallowed to be retried. Note that a retry is done with the next available\nhost according to the load balancing policy.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "properties": { + "expression": { + "$ref": "#/definitions/http.matchers.expression" + }, + "file": { + "$ref": "#/definitions/http.matchers.file" + }, + "header": { + "$ref": "#/definitions/http.matchers.header" + }, + "header_regexp": { + "$ref": "#/definitions/http.matchers.header_regexp" + }, + "host": { + "$ref": "#/definitions/http.matchers.host" + }, + "method": { + "$ref": "#/definitions/http.matchers.method" + }, + "not": { + "$ref": "#/definitions/http.matchers.not" + }, + "path": { + "$ref": "#/definitions/http.matchers.path" + }, + "path_regexp": { + "$ref": "#/definitions/http.matchers.path_regexp" + }, + "protocol": { + "$ref": "#/definitions/http.matchers.protocol" + }, + "query": { + "$ref": "#/definitions/http.matchers.query" + }, + "remote_ip": { + "$ref": "#/definitions/http.matchers.remote_ip" + }, + "vars": { + "$ref": "#/definitions/http.matchers.vars" + }, + "vars_regexp": { + "$ref": "#/definitions/http.matchers.vars_regexp" + } + } + } + }, + "selection_policy": { + "description": "selection_policy: object\nModule: http.reverse_proxy.selection_policies\nA selection policy is how to choose an available backend.\nThe default policy is random selection.\n", + "markdownDescription": "selection_policy: `object` \nModule: `http.reverse_proxy.selection_policies` \nA selection policy is how to choose an available backend.\nThe default policy is random selection. \n", + "type": "object", + "required": [ + "policy" + ], + "allOf": [ + { + "if": { + "properties": { + "policy": { + "const": "first" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.first" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "ip_hash" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.ip_hash" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "uri_hash" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.uri_hash" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "cookie" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.cookie" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "header" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.header" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "least_conn" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.least_conn" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "random" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.random" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "random_choose" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.random_choose" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "round_robin" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.selection_policies.round_robin" + } + }, + { + "properties": { + "policy": { + "description": "key to identify selection_policy module.\npolicy: string\nModule: http.reverse_proxy.selection_policies", + "markdownDescription": "key to identify `selection_policy` module. \npolicy: `string` \nModule: `http.reverse_proxy.selection_policies`", + "type": "string", + "enum": [ + "first", + "ip_hash", + "uri_hash", + "cookie", + "header", + "least_conn", + "random", + "random_choose", + "round_robin" + ] + } + } + } + ] + }, + "try_duration": { + "description": "try_duration: number\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to try selecting available backends for each request\nif the next available host is down. By default, this retry is\ndisabled. Clients will wait for up to this long while the load\nbalancer tries to find an available upstream host.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "try_duration: `number` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to try selecting available backends for each request\nif the next available host is down. By default, this retry is\ndisabled. Clients will wait for up to this long while the load\nbalancer tries to find an available upstream host.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "try_interval": { + "description": "try_interval: number\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to wait between selecting the next host from the pool. Default\nis 250ms. Only relevant when a request to an upstream host fails. Be\naware that setting this to 0 with a non-zero try_duration can cause the\nCPU to spin if all backends are down and latency is very low.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "try_interval: `number` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to wait between selecting the next host from the pool. Default\nis 250ms. Only relevant when a request to an upstream host fails. Be\naware that setting this to 0 with a non-zero try_duration can cause the\nCPU to spin if all backends are down and latency is very low.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "max_buffer_size": { + "description": "max_buffer_size: number\nModule: http.handlers.reverse_proxy\nIf body buffering is enabled, the maximum size of the buffers\nused for the requests and responses (in bytes).\n", + "markdownDescription": "max_buffer_size: `number` \nModule: `http.handlers.reverse_proxy` \nIf body buffering is enabled, the maximum size of the buffers\nused for the requests and responses (in bytes). \n", + "type": "number" + }, + "rewrite": { + "description": "rewrite: object\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#Rewrite\nIf configured, rewrites the copy of the upstream request.\nAllows changing the request method and URI (path and query).\nSince the rewrite is applied to the copy, it does not persist\npast the reverse proxy handler.\nIf the method is changed to `GET` or `HEAD`, the request body\nwill not be copied to the backend. This allows a later request\nhandler -- either in a `handle_response` route, or after -- to\nread the body.\nBy default, no rewrite is performed, and the method and URI\nfrom the incoming request is used as-is for proxying.\n\n\nRewrite is a middleware which can rewrite HTTP requests.\n\nThe Method and URI properties are \"setters\": the request URI\nwill be set to the given values. Other properties are \"modifiers\":\nthey modify existing files but do not explicitly specify what the\nresult will be. It is atypical to combine the use of setters and\nmodifiers in a single rewrite.\n", + "markdownDescription": "rewrite: `object` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#Rewrite) \nIf configured, rewrites the copy of the upstream request.\nAllows changing the request method and URI (path and query).\nSince the rewrite is applied to the copy, it does not persist\npast the reverse proxy handler.\nIf the method is changed to `GET` or `HEAD`, the request body\nwill not be copied to the backend. This allows a later request\nhandler -- either in a `handle_response` route, or after -- to\nread the body.\nBy default, no rewrite is performed, and the method and URI\nfrom the incoming request is used as-is for proxying.\n\n\nRewrite is a middleware which can rewrite HTTP requests.\n\nThe Method and URI properties are \"setters\": the request URI\nwill be set to the given values. Other properties are \"modifiers\":\nthey modify existing files but do not explicitly specify what the\nresult will be. It is atypical to combine the use of setters and\nmodifiers in a single rewrite. \n", + "type": "object", + "properties": { + "method": { + "description": "method: string\nModule: http.handlers.reverse_proxy\nChanges the request's HTTP verb.\n", + "markdownDescription": "method: `string` \nModule: `http.handlers.reverse_proxy` \nChanges the request's HTTP verb. \n", + "type": "string" + }, + "path_regexp": { + "description": "path_regexp: array\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer\nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression.\n", + "markdownDescription": "path_regexp: `array` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer) \nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer\nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer) \nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression. \n", + "type": "object", + "properties": { + "find": { + "description": "find: string\nModule: http.handlers.reverse_proxy\nThe regular expression to find.\n", + "markdownDescription": "find: `string` \nModule: `http.handlers.reverse_proxy` \nThe regular expression to find. \n", + "type": "string" + }, + "replace": { + "description": "replace: string\nModule: http.handlers.reverse_proxy\nThe substring to replace with. Supports placeholders and\nregular expression capture groups.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.reverse_proxy` \nThe substring to replace with. Supports placeholders and\nregular expression capture groups. \n", + "type": "string" + } + } + } + }, + "strip_path_prefix": { + "description": "strip_path_prefix: string\nModule: http.handlers.reverse_proxy\nStrips the given prefix from the beginning of the URI path.\n", + "markdownDescription": "strip_path_prefix: `string` \nModule: `http.handlers.reverse_proxy` \nStrips the given prefix from the beginning of the URI path. \n", + "type": "string" + }, + "strip_path_suffix": { + "description": "strip_path_suffix: string\nModule: http.handlers.reverse_proxy\nStrips the given suffix from the end of the URI path.\n", + "markdownDescription": "strip_path_suffix: `string` \nModule: `http.handlers.reverse_proxy` \nStrips the given suffix from the end of the URI path. \n", + "type": "string" + }, + "uri": { + "description": "uri: string\nModule: http.handlers.reverse_proxy\nChanges the request's URI, which consists of path and query string.\nOnly components of the URI that are specified will be changed.\nFor example, a value of \"/foo.html\" or \"foo.html\" will only change\nthe path and will preserve any existing query string. Similarly, a\nvalue of \"?a=b\" will only change the query string and will not affect\nthe path. Both can also be changed: \"/foo?a=b\" - this sets both the\npath and query string at the same time.\n\nYou can also use placeholders. For example, to preserve the existing\nquery string, you might use: \"?{http.request.uri.query}\u0026a=b\". Any\nkey-value pairs you add to the query string will not overwrite\nexisting values (individual pairs are append-only).\n\nTo clear the query string, explicitly set an empty one: \"?\"\n", + "markdownDescription": "uri: `string` \nModule: `http.handlers.reverse_proxy` \nChanges the request's URI, which consists of path and query string.\nOnly components of the URI that are specified will be changed.\nFor example, a value of \"/foo.html\" or \"foo.html\" will only change\nthe path and will preserve any existing query string. Similarly, a\nvalue of \"?a=b\" will only change the query string and will not affect\nthe path. Both can also be changed: \"/foo?a=b\" - this sets both the\npath and query string at the same time.\n\nYou can also use placeholders. For example, to preserve the existing\nquery string, you might use: \"?{http.request.uri.query}\u0026a=b\". Any\nkey-value pairs you add to the query string will not overwrite\nexisting values (individual pairs are append-only).\n\nTo clear the query string, explicitly set an empty one: \"?\" \n", + "type": "string" + }, + "uri_substring": { + "description": "uri_substring: array\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer\nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement.\n", + "markdownDescription": "uri_substring: `array` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer) \nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer\nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer) \nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement. \n", + "type": "object", + "properties": { + "find": { + "description": "find: string\nModule: http.handlers.reverse_proxy\nA substring to find. Supports placeholders.\n", + "markdownDescription": "find: `string` \nModule: `http.handlers.reverse_proxy` \nA substring to find. Supports placeholders. \n", + "type": "string" + }, + "limit": { + "description": "limit: number\nModule: http.handlers.reverse_proxy\nMaximum number of replacements per string.\nSet to \u003c= 0 for no limit (default).\n", + "markdownDescription": "limit: `number` \nModule: `http.handlers.reverse_proxy` \nMaximum number of replacements per string.\nSet to \u003c= 0 for no limit (default). \n", + "type": "number" + }, + "replace": { + "description": "replace: string\nModule: http.handlers.reverse_proxy\nThe substring to replace with. Supports placeholders.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.reverse_proxy` \nThe substring to replace with. Supports placeholders. \n", + "type": "string" + } + } + } + } + } + }, + "transport": { + "description": "transport: object\nModule: http.reverse_proxy.transport\nConfigures the method of transport for the proxy. A transport\nis what performs the actual \"round trip\" to the backend.\nThe default transport is plaintext HTTP.\n", + "markdownDescription": "transport: `object` \nModule: `http.reverse_proxy.transport` \nConfigures the method of transport for the proxy. A transport\nis what performs the actual \"round trip\" to the backend.\nThe default transport is plaintext HTTP. \n", + "type": "object", + "required": [ + "protocol" + ], + "allOf": [ + { + "if": { + "properties": { + "protocol": { + "const": "fastcgi" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.transport.fastcgi" + } + }, + { + "if": { + "properties": { + "protocol": { + "const": "http" + } + } + }, + "then": { + "$ref": "#/definitions/http.reverse_proxy.transport.http" + } + }, + { + "properties": { + "protocol": { + "description": "key to identify transport module.\nprotocol: string\nModule: http.reverse_proxy.transport", + "markdownDescription": "key to identify `transport` module. \nprotocol: `string` \nModule: `http.reverse_proxy.transport`", + "type": "string", + "enum": [ + "fastcgi", + "http" + ] + } + } + } + ] + }, + "trusted_proxies": { + "description": "trusted_proxies: array\nModule: http.handlers.reverse_proxy\nA list of IP ranges (supports CIDR notation) from which\nX-Forwarded-* header values should be trusted. By default,\nno proxies are trusted, so existing values will be ignored\nwhen setting these headers. If the proxy is trusted, then\nexisting values will be used when constructing the final\nheader values.\n", + "markdownDescription": "trusted_proxies: `array` \nModule: `http.handlers.reverse_proxy` \nA list of IP ranges (supports CIDR notation) from which\nX-Forwarded-* header values should be trusted. By default,\nno proxies are trusted, so existing values will be ignored\nwhen setting these headers. If the proxy is trusted, then\nexisting values will be used when constructing the final\nheader values. \n", + "type": "array", + "items": { + "description": "A list of IP ranges (supports CIDR notation) from which\nX-Forwarded-* header values should be trusted. By default,\nno proxies are trusted, so existing values will be ignored\nwhen setting these headers. If the proxy is trusted, then\nexisting values will be used when constructing the final\nheader values.\n", + "markdownDescription": "A list of IP ranges (supports CIDR notation) from which\nX-Forwarded-* header values should be trusted. By default,\nno proxies are trusted, so existing values will be ignored\nwhen setting these headers. If the proxy is trusted, then\nexisting values will be used when constructing the final\nheader values. \n", + "type": "string" + } + }, + "upstreams": { + "description": "upstreams: array\nModule: http.handlers.reverse_proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#Upstream\nUpstreams is the static list of backends to proxy to.\n\n\nUpstream bridges this proxy's configuration to the\nstate of the backend host it is correlated with.\nUpstream values must not be copied.\n", + "markdownDescription": "upstreams: `array` \nModule: `http.handlers.reverse_proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#Upstream) \nUpstreams is the static list of backends to proxy to.\n\n\nUpstream bridges this proxy's configuration to the\nstate of the backend host it is correlated with.\nUpstream values must not be copied. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#Upstream\nUpstreams is the static list of backends to proxy to.\n\n\nUpstream bridges this proxy's configuration to the\nstate of the backend host it is correlated with.\nUpstream values must not be copied.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#Upstream) \nUpstreams is the static list of backends to proxy to.\n\n\nUpstream bridges this proxy's configuration to the\nstate of the backend host it is correlated with.\nUpstream values must not be copied. \n", + "type": "object", + "properties": { + "dial": { + "description": "dial: string\nModule: http.handlers.reverse_proxy\nThe [network address](/docs/conventions#network-addresses)\nto dial to connect to the upstream. Must represent precisely\none socket (i.e. no port ranges). A valid network address\neither has a host and port or is a unix socket address.\n\nPlaceholders may be used to make the upstream dynamic, but be\naware of the health check implications of this: a single\nupstream that represents numerous (perhaps arbitrary) backends\ncan be considered down if one or enough of the arbitrary\nbackends is down. Also be aware of open proxy vulnerabilities.\n", + "markdownDescription": "dial: `string` \nModule: `http.handlers.reverse_proxy` \nThe [network address](/docs/conventions#network-addresses)\nto dial to connect to the upstream. Must represent precisely\none socket (i.e. no port ranges). A valid network address\neither has a host and port or is a unix socket address.\n\nPlaceholders may be used to make the upstream dynamic, but be\naware of the health check implications of this: a single\nupstream that represents numerous (perhaps arbitrary) backends\ncan be considered down if one or enough of the arbitrary\nbackends is down. Also be aware of open proxy vulnerabilities. \n", + "type": "string" + }, + "lookup_srv": { + "description": "lookup_srv: string\nModule: http.handlers.reverse_proxy\nDEPRECATED: Use the SRVUpstreams module instead\n(http.reverse_proxy.upstreams.srv). This field will be\nremoved in a future version of Caddy. TODO: Remove this field.\n\nIf DNS SRV records are used for service discovery with this\nupstream, specify the DNS name for which to look up SRV\nrecords here, instead of specifying a dial address.\n", + "markdownDescription": "lookup_srv: `string` \nModule: `http.handlers.reverse_proxy` \nDEPRECATED: Use the SRVUpstreams module instead\n(http.reverse_proxy.upstreams.srv). This field will be\nremoved in a future version of Caddy. TODO: Remove this field.\n\nIf DNS SRV records are used for service discovery with this\nupstream, specify the DNS name for which to look up SRV\nrecords here, instead of specifying a dial address. \n", + "type": "string" + }, + "max_requests": { + "description": "max_requests: number\nModule: http.handlers.reverse_proxy\nThe maximum number of simultaneous requests to allow to\nthis upstream. If set, overrides the global passive health\ncheck UnhealthyRequestCount value.\n", + "markdownDescription": "max_requests: `number` \nModule: `http.handlers.reverse_proxy` \nThe maximum number of simultaneous requests to allow to\nthis upstream. If set, overrides the global passive health\ncheck UnhealthyRequestCount value. \n", + "type": "number" + } + } + } + } + } + }, + "http.handlers.rewrite": { + "description": "rewrite: object\nModule: http.handlers.rewrite\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#Rewrite\nRewrite is a middleware which can rewrite HTTP requests.\n\nThe Method and URI properties are \"setters\": the request URI\nwill be set to the given values. Other properties are \"modifiers\":\nthey modify existing files but do not explicitly specify what the\nresult will be. It is atypical to combine the use of setters and\nmodifiers in a single rewrite.\n\n", + "markdownDescription": "rewrite: `object` \nModule: `http.handlers.rewrite` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#Rewrite) \nRewrite is a middleware which can rewrite HTTP requests.\n\nThe Method and URI properties are \"setters\": the request URI\nwill be set to the given values. Other properties are \"modifiers\":\nthey modify existing files but do not explicitly specify what the\nresult will be. It is atypical to combine the use of setters and\nmodifiers in a single rewrite.\n \n", + "type": "object", + "properties": { + "method": { + "description": "method: string\nModule: http.handlers.rewrite\nChanges the request's HTTP verb.\n", + "markdownDescription": "method: `string` \nModule: `http.handlers.rewrite` \nChanges the request's HTTP verb. \n", + "type": "string" + }, + "path_regexp": { + "description": "path_regexp: array\nModule: http.handlers.rewrite\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer\nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression.\n", + "markdownDescription": "path_regexp: `array` \nModule: `http.handlers.rewrite` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer) \nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer\nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#regexReplacer) \nPerforms regular expression replacements on the URI path.\n\n\nregexReplacer describes a replacement using a regular expression. \n", + "type": "object", + "properties": { + "find": { + "description": "find: string\nModule: http.handlers.rewrite\nThe regular expression to find.\n", + "markdownDescription": "find: `string` \nModule: `http.handlers.rewrite` \nThe regular expression to find. \n", + "type": "string" + }, + "replace": { + "description": "replace: string\nModule: http.handlers.rewrite\nThe substring to replace with. Supports placeholders and\nregular expression capture groups.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.rewrite` \nThe substring to replace with. Supports placeholders and\nregular expression capture groups. \n", + "type": "string" + } + } + } + }, + "strip_path_prefix": { + "description": "strip_path_prefix: string\nModule: http.handlers.rewrite\nStrips the given prefix from the beginning of the URI path.\n", + "markdownDescription": "strip_path_prefix: `string` \nModule: `http.handlers.rewrite` \nStrips the given prefix from the beginning of the URI path. \n", + "type": "string" + }, + "strip_path_suffix": { + "description": "strip_path_suffix: string\nModule: http.handlers.rewrite\nStrips the given suffix from the end of the URI path.\n", + "markdownDescription": "strip_path_suffix: `string` \nModule: `http.handlers.rewrite` \nStrips the given suffix from the end of the URI path. \n", + "type": "string" + }, + "uri": { + "description": "uri: string\nModule: http.handlers.rewrite\nChanges the request's URI, which consists of path and query string.\nOnly components of the URI that are specified will be changed.\nFor example, a value of \"/foo.html\" or \"foo.html\" will only change\nthe path and will preserve any existing query string. Similarly, a\nvalue of \"?a=b\" will only change the query string and will not affect\nthe path. Both can also be changed: \"/foo?a=b\" - this sets both the\npath and query string at the same time.\n\nYou can also use placeholders. For example, to preserve the existing\nquery string, you might use: \"?{http.request.uri.query}\u0026a=b\". Any\nkey-value pairs you add to the query string will not overwrite\nexisting values (individual pairs are append-only).\n\nTo clear the query string, explicitly set an empty one: \"?\"\n", + "markdownDescription": "uri: `string` \nModule: `http.handlers.rewrite` \nChanges the request's URI, which consists of path and query string.\nOnly components of the URI that are specified will be changed.\nFor example, a value of \"/foo.html\" or \"foo.html\" will only change\nthe path and will preserve any existing query string. Similarly, a\nvalue of \"?a=b\" will only change the query string and will not affect\nthe path. Both can also be changed: \"/foo?a=b\" - this sets both the\npath and query string at the same time.\n\nYou can also use placeholders. For example, to preserve the existing\nquery string, you might use: \"?{http.request.uri.query}\u0026a=b\". Any\nkey-value pairs you add to the query string will not overwrite\nexisting values (individual pairs are append-only).\n\nTo clear the query string, explicitly set an empty one: \"?\" \n", + "type": "string" + }, + "uri_substring": { + "description": "uri_substring: array\nModule: http.handlers.rewrite\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer\nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement.\n", + "markdownDescription": "uri_substring: `array` \nModule: `http.handlers.rewrite` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer) \nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer\nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite#substrReplacer) \nPerforms substring replacements on the URI.\n\n\nsubstrReplacer describes either a simple and fast substring replacement. \n", + "type": "object", + "properties": { + "find": { + "description": "find: string\nModule: http.handlers.rewrite\nA substring to find. Supports placeholders.\n", + "markdownDescription": "find: `string` \nModule: `http.handlers.rewrite` \nA substring to find. Supports placeholders. \n", + "type": "string" + }, + "limit": { + "description": "limit: number\nModule: http.handlers.rewrite\nMaximum number of replacements per string.\nSet to \u003c= 0 for no limit (default).\n", + "markdownDescription": "limit: `number` \nModule: `http.handlers.rewrite` \nMaximum number of replacements per string.\nSet to \u003c= 0 for no limit (default). \n", + "type": "number" + }, + "replace": { + "description": "replace: string\nModule: http.handlers.rewrite\nThe substring to replace with. Supports placeholders.\n", + "markdownDescription": "replace: `string` \nModule: `http.handlers.rewrite` \nThe substring to replace with. Supports placeholders. \n", + "type": "string" + } + } + } + } + } + }, + "http.handlers.static_response": { + "description": "static_response: object\nModule: http.handlers.static_response\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#StaticResponse\nStaticResponse implements a simple responder for static responses.\n\n", + "markdownDescription": "static_response: `object` \nModule: `http.handlers.static_response` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#StaticResponse) \nStaticResponse implements a simple responder for static responses.\n \n", + "type": "object", + "properties": { + "abort": { + "description": "abort: boolean\nModule: http.handlers.static_response\nImmediately and forcefully closes the connection without\nwriting a response. Interrupts any other HTTP streams on\nthe same connection.\n", + "markdownDescription": "abort: `boolean` \nModule: `http.handlers.static_response` \nImmediately and forcefully closes the connection without\nwriting a response. Interrupts any other HTTP streams on\nthe same connection. \n", + "type": "boolean" + }, + "body": { + "description": "body: string\nModule: http.handlers.static_response\nThe response body.\n", + "markdownDescription": "body: `string` \nModule: `http.handlers.static_response` \nThe response body. \n", + "type": "string" + }, + "close": { + "description": "close: boolean\nModule: http.handlers.static_response\nIf true, the server will close the client's connection\nafter writing the response.\n", + "markdownDescription": "close: `boolean` \nModule: `http.handlers.static_response` \nIf true, the server will close the client's connection\nafter writing the response. \n", + "type": "boolean" + }, + "headers": { + "description": "headers: object\nModule: http.handlers.static_response\nHeader fields to set on the response.\n", + "markdownDescription": "headers: `object` \nModule: `http.handlers.static_response` \nHeader fields to set on the response. \n", + "type": "object", + "additionalProperties": { + "description": "Header fields to set on the response.\n", + "markdownDescription": "Header fields to set on the response. \n", + "type": "array", + "items": { + "type": "string" + } + } + }, + "status_code": { + "description": "status_code: string\nModule: http.handlers.static_response\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString\nThe HTTP status code to respond with. Can be an integer or,\nif needing to use a placeholder, a string.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned.\n", + "markdownDescription": "status_code: `string` \nModule: `http.handlers.static_response` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#WeakString) \nThe HTTP status code to respond with. Can be an integer or,\nif needing to use a placeholder, a string.\n\n\nWeakString is a type that unmarshals any JSON value\nas a string literal, with the following exceptions:\n\n1. actual string values are decoded as strings; and\n2. null is decoded as empty string;\n\nand provides methods for getting the value as various\nprimitive types. However, using this type removes any\ntype safety as far as deserializing JSON is concerned. \n", + "type": "string" + } + } + }, + "http.handlers.subroute": { + "description": "subroute: object\nModule: http.handlers.subroute\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Subroute\nSubroute implements a handler that compiles and executes routes.\nThis is useful for a batch of routes that all inherit the same\nmatchers, or for multiple routes that should be treated as a\nsingle route.\n\nYou can also use subroutes to handle errors from its handlers.\nFirst the primary routes will be executed, and if they return an\nerror, the errors routes will be executed; in that case, an error\nis only returned to the entry point at the server if there is an\nadditional error returned from the errors routes.\n\n", + "markdownDescription": "subroute: `object` \nModule: `http.handlers.subroute` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Subroute) \nSubroute implements a handler that compiles and executes routes.\nThis is useful for a batch of routes that all inherit the same\nmatchers, or for multiple routes that should be treated as a\nsingle route.\n\nYou can also use subroutes to handle errors from its handlers.\nFirst the primary routes will be executed, and if they return an\nerror, the errors routes will be executed; in that case, an error\nis only returned to the entry point at the server if there is an\nadditional error returned from the errors routes.\n \n", + "type": "object", + "properties": { + "errors": { + "description": "errors: object\nModule: http.handlers.subroute\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#HTTPErrorConfig\nIf the primary routes return an error, error handling\ncan be promoted to this configuration instead.\n\n\nHTTPErrorConfig determines how to handle errors\nfrom the HTTP handlers.\n", + "markdownDescription": "errors: `object` \nModule: `http.handlers.subroute` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#HTTPErrorConfig) \nIf the primary routes return an error, error handling\ncan be promoted to this configuration instead.\n\n\nHTTPErrorConfig determines how to handle errors\nfrom the HTTP handlers. \n", + "type": "object", + "properties": { + "routes": { + "description": "routes: array\nModule: http.handlers.subroute\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "routes: `array` \nModule: `http.handlers.subroute` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe routes to evaluate after the primary handler\nchain returns an error. In an error route, extra\nplaceholders are available:\n\nPlaceholder | Description\n------------|---------------\n`{http.error.status_code}` | The recommended HTTP status code\n`{http.error.status_text}` | The status text associated with the recommended status code\n`{http.error.message}` | The error message\n`{http.error.trace}` | The origin of the error\n`{http.error.id}` | An identifier for this occurrence of the error\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "object", + "properties": { + "group": { + "description": "group: string\nModule: http.handlers.subroute\nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed.\n", + "markdownDescription": "group: `string` \nModule: `http.handlers.subroute` \nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed. \n", + "type": "string" + }, + "handle": { + "description": "handle: array\nModule: http.handlers\nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "handle: `array` \nModule: `http.handlers` \nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "type": "array", + "items": { + "description": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "authentication" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.authentication" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "static_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.static_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "file_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.file_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "map" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.map" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "reverse_proxy" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.reverse_proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "templates" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.templates" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "acme_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.acme_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response_headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response_headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "error" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.error" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "push" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.push" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "vars" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.vars" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "rewrite" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.rewrite" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tracing" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.tracing" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "encode" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.encode" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "metrics" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.metrics" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "request_body" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.request_body" + } + }, + { + "properties": { + "handler": { + "description": "key to identify handle module.\nhandler: string\nModule: http.handlers", + "markdownDescription": "key to identify `handle` module. \nhandler: `string` \nModule: `http.handlers`", + "type": "string", + "enum": [ + "authentication", + "static_response", + "file_server", + "map", + "reverse_proxy", + "templates", + "acme_server", + "copy_response", + "copy_response_headers", + "error", + "push", + "vars", + "rewrite", + "subroute", + "tracing", + "encode", + "headers", + "metrics", + "request_body" + ] + } + } + } + ] + } + }, + "match": { + "description": "match: array\nModule: http.matchers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "match: `array` \nModule: `http.matchers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "properties": { + "expression": { + "$ref": "#/definitions/http.matchers.expression" + }, + "file": { + "$ref": "#/definitions/http.matchers.file" + }, + "header": { + "$ref": "#/definitions/http.matchers.header" + }, + "header_regexp": { + "$ref": "#/definitions/http.matchers.header_regexp" + }, + "host": { + "$ref": "#/definitions/http.matchers.host" + }, + "method": { + "$ref": "#/definitions/http.matchers.method" + }, + "not": { + "$ref": "#/definitions/http.matchers.not" + }, + "path": { + "$ref": "#/definitions/http.matchers.path" + }, + "path_regexp": { + "$ref": "#/definitions/http.matchers.path_regexp" + }, + "protocol": { + "$ref": "#/definitions/http.matchers.protocol" + }, + "query": { + "$ref": "#/definitions/http.matchers.query" + }, + "remote_ip": { + "$ref": "#/definitions/http.matchers.remote_ip" + }, + "vars": { + "$ref": "#/definitions/http.matchers.vars" + }, + "vars_regexp": { + "$ref": "#/definitions/http.matchers.vars_regexp" + } + } + } + }, + "terminal": { + "description": "terminal: boolean\nModule: http.handlers.subroute\nIf true, no more routes will be executed after this one.\n", + "markdownDescription": "terminal: `boolean` \nModule: `http.handlers.subroute` \nIf true, no more routes will be executed after this one. \n", + "type": "boolean" + } + } + } + } + } + }, + "routes": { + "description": "routes: array\nModule: http.handlers.subroute\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe primary list of routes to compile and execute.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "routes: `array` \nModule: `http.handlers.subroute` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe primary list of routes to compile and execute.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route\nThe primary list of routes to compile and execute.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#Route) \nThe primary list of routes to compile and execute.\n\n\nRoute consists of a set of rules for matching HTTP requests,\na list of handlers to execute, and optional flow control\nparameters which customize the handling of HTTP requests\nin a highly flexible and performant manner. \n", + "type": "object", + "properties": { + "group": { + "description": "group: string\nModule: http.handlers.subroute\nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed.\n", + "markdownDescription": "group: `string` \nModule: `http.handlers.subroute` \nGroup is an optional name for a group to which this\nroute belongs. Grouping a route makes it mutually\nexclusive with others in its group; if a route belongs\nto a group, only the first matching route in that group\nwill be executed. \n", + "type": "string" + }, + "handle": { + "description": "handle: array\nModule: http.handlers\nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "handle: `array` \nModule: `http.handlers` \nThe list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "type": "array", + "items": { + "description": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes.\n", + "markdownDescription": "The list of handlers for this route. Upon matching a request, they are chained\ntogether in a middleware fashion: requests flow from the first handler to the last\n(top of the list to the bottom), with the possibility that any handler could stop\nthe chain and/or return an error. Responses flow back through the chain (bottom of\nthe list to the top) as they are written out to the client.\n\nNot all handlers call the next handler in the chain. For example, the reverse_proxy\nhandler always sends a request upstream or returns an error. Thus, configuring\nhandlers after reverse_proxy in the same route is illogical, since they would never\nbe executed. You will want to put handlers which originate the response at the very\nend of your route(s). The documentation for a module should state whether it invokes\nthe next handler, but sometimes it is common sense.\n\nSome handlers manipulate the response. Remember that requests flow down the list, and\nresponses flow up the list.\n\nFor example, if you wanted to use both `templates` and `encode` handlers, you would\nneed to put `templates` after `encode` in your route, because responses flow up.\nThus, `templates` will be able to parse and execute the plain-text response as a\ntemplate, and then return it up to the `encode` handler which will then compress it\ninto a binary format.\n\nIf `templates` came before `encode`, then `encode` would write a compressed,\nbinary-encoded response to `templates` which would not be able to parse the response\nproperly.\n\nThe correct order, then, is this:\n\n [\n {\"handler\": \"encode\"},\n {\"handler\": \"templates\"},\n {\"handler\": \"file_server\"}\n ]\n\nThe request flows ⬇️ DOWN (`encode` -\u003e `templates` -\u003e `file_server`).\n\n1. First, `encode` will choose how to `encode` the response and wrap the response.\n2. Then, `templates` will wrap the response with a buffer.\n3. Finally, `file_server` will originate the content from a file.\n\nThe response flows ⬆️ UP (`file_server` -\u003e `templates` -\u003e `encode`):\n\n1. First, `file_server` will write the file to the response.\n2. That write will be buffered and then executed by `templates`.\n3. Lastly, the write from `templates` will flow into `encode` which will compress the stream.\n\nIf you think of routes in this way, it will be easy and even fun to solve the puzzle of writing correct routes. \n", + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "reverse_proxy" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.reverse_proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "templates" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.templates" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "acme_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.acme_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "copy_response_headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.copy_response_headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "error" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.error" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "file_server" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.file_server" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "map" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.map" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "push" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.push" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "vars" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.vars" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tracing" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.tracing" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "encode" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.encode" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "headers" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.headers" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "metrics" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.metrics" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "request_body" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.request_body" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "rewrite" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.rewrite" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "authentication" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.authentication" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "static_response" + } + } + }, + "then": { + "$ref": "#/definitions/http.handlers.static_response" + } + }, + { + "properties": { + "handler": { + "description": "key to identify handle module.\nhandler: string\nModule: http.handlers", + "markdownDescription": "key to identify `handle` module. \nhandler: `string` \nModule: `http.handlers`", + "type": "string", + "enum": [ + "reverse_proxy", + "templates", + "acme_server", + "copy_response", + "copy_response_headers", + "error", + "file_server", + "map", + "push", + "vars", + "tracing", + "encode", + "headers", + "metrics", + "request_body", + "rewrite", + "subroute", + "authentication", + "static_response" + ] + } + } + } + ] + } + }, + "match": { + "description": "match: array\nModule: http.matchers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "match: `array` \nModule: `http.matchers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nThe matcher sets which will be used to qualify this\nroute for a request (essentially the \"if\" statement\nof this route). Each matcher set is OR'ed, but matchers\nwithin a set are AND'ed together.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "properties": { + "expression": { + "$ref": "#/definitions/http.matchers.expression" + }, + "file": { + "$ref": "#/definitions/http.matchers.file" + }, + "header": { + "$ref": "#/definitions/http.matchers.header" + }, + "header_regexp": { + "$ref": "#/definitions/http.matchers.header_regexp" + }, + "host": { + "$ref": "#/definitions/http.matchers.host" + }, + "method": { + "$ref": "#/definitions/http.matchers.method" + }, + "not": { + "$ref": "#/definitions/http.matchers.not" + }, + "path": { + "$ref": "#/definitions/http.matchers.path" + }, + "path_regexp": { + "$ref": "#/definitions/http.matchers.path_regexp" + }, + "protocol": { + "$ref": "#/definitions/http.matchers.protocol" + }, + "query": { + "$ref": "#/definitions/http.matchers.query" + }, + "remote_ip": { + "$ref": "#/definitions/http.matchers.remote_ip" + }, + "vars": { + "$ref": "#/definitions/http.matchers.vars" + }, + "vars_regexp": { + "$ref": "#/definitions/http.matchers.vars_regexp" + } + } + } + }, + "terminal": { + "description": "terminal: boolean\nModule: http.handlers.subroute\nIf true, no more routes will be executed after this one.\n", + "markdownDescription": "terminal: `boolean` \nModule: `http.handlers.subroute` \nIf true, no more routes will be executed after this one. \n", + "type": "boolean" + } + } + } + } + } + }, + "http.handlers.templates": { + "description": "templates: object\nModule: http.handlers.templates\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/templates#Templates\nTemplates is a middleware which executes response bodies as Go templates.\nThe syntax is documented in the Go standard library's\n[text/template package](https://golang.org/pkg/text/template/).\n\n⚠️ Template functions/actions are still experimental, so they are subject to change.\n\nCustom template functions can be registered by creating a plugin module under the `http.handlers.templates.functions.*` namespace that implements the `CustomFunctions` interface.\n\n[All Sprig functions](https://masterminds.github.io/sprig/) are supported.\n\nIn addition to the standard functions and the Sprig library, Caddy adds\nextra functions and data that are available to a template:\n\n##### `.Args`\n\nA slice of arguments passed to this page/context, for example as the result of a `include`.\n\n```\n{{index .Args 0}} // first argument\n```\n\n##### `.Cookie`\n\nGets the value of a cookie by name.\n\n```\n{{.Cookie \"cookiename\"}}\n```\n\n##### `env`\n\nGets an environment variable.\n\n```\n{{env \"VAR_NAME\"}}\n```\n\n##### `placeholder`\n\nGets an [placeholder variable](/docs/conventions#placeholders).\nThe braces (`{}`) have to be omitted.\n\n```\n{{placeholder \"http.request.uri.path\"}}\n{{placeholder \"http.error.status_code\"}}\n```\n\n##### `.Host`\n\nReturns the hostname portion (no port) of the Host header of the HTTP request.\n\n```\n{{.Host}}\n```\n\n##### `httpInclude`\n\nIncludes the contents of another file by making a virtual HTTP request (also known as a sub-request). The URI path must exist on the same virtual server because the request does not use sockets; instead, the request is crafted in memory and the handler is invoked directly for increased efficiency.\n\n```\n{{httpInclude \"/foo/bar?q=val\"}}\n```\n\n##### `import`\n\nImports the contents of another file and adds any template definitions to the template stack. If there are no defitions, the filepath will be the defition name. Any {{ define }} blocks will be accessible by {{ template }} or {{ block }}. Imports must happen before the template or block action is called\n\n**filename.html**\n```\n{{ define \"main\" }}\ncontent\n{{ end }}\n```\n\n**index.html**\n```\n{{ import \"/path/to/file.html\" }}\n{{ template \"main\" }}\n```\n\n##### `include`\n\nIncludes the contents of another file and renders in-place. Optionally can pass key-value pairs as arguments to be accessed by the included file.\n\n```\n{{include \"path/to/file.html\"}} // no arguments\n{{include \"path/to/file.html\" \"arg1\" 2 \"value 3\"}} // with arguments\n```\n\n##### `listFiles`\n\nReturns a list of the files in the given directory, which is relative to the template context's file root.\n\n```\n{{listFiles \"/mydir\"}}\n```\n\n##### `markdown`\n\nRenders the given Markdown text as HTML. This uses the\n[Goldmark](https://github.com/yuin/goldmark) library,\nwhich is CommonMark compliant. It also has these plugins\nenabled: Github Flavored Markdown, Footnote and syntax\nhighlighting provided by [Chroma](https://github.com/alecthomas/chroma).\n\n```\n{{markdown \"My _markdown_ text\"}}\n```\n\n##### `.RemoteIP`\n\nReturns the client's IP address.\n\n```\n{{.RemoteIP}}\n```\n\n##### `.Req`\n\nAccesses the current HTTP request, which has various fields, including:\n\n - `.Method` - the method\n - `.URL` - the URL, which in turn has component fields (Scheme, Host, Path, etc.)\n - `.Header` - the header fields\n - `.Host` - the Host or :authority header of the request\n\n```\n{{.Req.Header.Get \"User-Agent\"}}\n```\n\n##### `.OriginalReq`\n\nLike .Req, except it accesses the original HTTP request before rewrites or other internal modifications.\n\n##### `.RespHeader.Add`\n\nAdds a header field to the HTTP response.\n\n```\n{{.RespHeader.Add \"Field-Name\" \"val\"}}\n```\n\n##### `.RespHeader.Del`\n\nDeletes a header field on the HTTP response.\n\n```\n{{.RespHeader.Del \"Field-Name\"}}\n```\n\n##### `.RespHeader.Set`\n\nSets a header field on the HTTP response, replacing any existing value.\n\n```\n{{.RespHeader.Set \"Field-Name\" \"val\"}}\n```\n\n##### `splitFrontMatter`\n\nSplits front matter out from the body. Front matter is metadata that appears at the very beginning of a file or string. Front matter can be in YAML, TOML, or JSON formats:\n\n**TOML** front matter starts and ends with `+++`:\n\n```\n+++\ntemplate = \"blog\"\ntitle = \"Blog Homepage\"\nsitename = \"A Caddy site\"\n+++\n```\n\n**YAML** is surrounded by `---`:\n\n```\n---\ntemplate: blog\ntitle: Blog Homepage\nsitename: A Caddy site\n---\n```\n\n**JSON** is simply `{` and `}`:\n\n```\n{\n\t\"template\": \"blog\",\n\t\"title\": \"Blog Homepage\",\n\t\"sitename\": \"A Caddy site\"\n}\n```\n\nThe resulting front matter will be made available like so:\n\n- `.Meta` to access the metadata fields, for example: `{{$parsed.Meta.title}}`\n- `.Body` to access the body after the front matter, for example: `{{markdown $parsed.Body}}`\n\n##### `stripHTML`\n\nRemoves HTML from a string.\n\n```\n{{stripHTML \"Shows \u003cb\u003eonly\u003c/b\u003e text content\"}}\n```\n\n", + "markdownDescription": "templates: `object` \nModule: `http.handlers.templates` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/templates#Templates) \nTemplates is a middleware which executes response bodies as Go templates.\nThe syntax is documented in the Go standard library's\n[text/template package](https://golang.org/pkg/text/template/).\n\n⚠️ Template functions/actions are still experimental, so they are subject to change.\n\nCustom template functions can be registered by creating a plugin module under the `http.handlers.templates.functions.*` namespace that implements the `CustomFunctions` interface.\n\n[All Sprig functions](https://masterminds.github.io/sprig/) are supported.\n\nIn addition to the standard functions and the Sprig library, Caddy adds\nextra functions and data that are available to a template:\n\n##### `.Args`\n\nA slice of arguments passed to this page/context, for example as the result of a `include`.\n\n```\n{{index .Args 0}} // first argument\n```\n\n##### `.Cookie`\n\nGets the value of a cookie by name.\n\n```\n{{.Cookie \"cookiename\"}}\n```\n\n##### `env`\n\nGets an environment variable.\n\n```\n{{env \"VAR_NAME\"}}\n```\n\n##### `placeholder`\n\nGets an [placeholder variable](/docs/conventions#placeholders).\nThe braces (`{}`) have to be omitted.\n\n```\n{{placeholder \"http.request.uri.path\"}}\n{{placeholder \"http.error.status_code\"}}\n```\n\n##### `.Host`\n\nReturns the hostname portion (no port) of the Host header of the HTTP request.\n\n```\n{{.Host}}\n```\n\n##### `httpInclude`\n\nIncludes the contents of another file by making a virtual HTTP request (also known as a sub-request). The URI path must exist on the same virtual server because the request does not use sockets; instead, the request is crafted in memory and the handler is invoked directly for increased efficiency.\n\n```\n{{httpInclude \"/foo/bar?q=val\"}}\n```\n\n##### `import`\n\nImports the contents of another file and adds any template definitions to the template stack. If there are no defitions, the filepath will be the defition name. Any {{ define }} blocks will be accessible by {{ template }} or {{ block }}. Imports must happen before the template or block action is called\n\n**filename.html**\n```\n{{ define \"main\" }}\ncontent\n{{ end }}\n```\n\n**index.html**\n```\n{{ import \"/path/to/file.html\" }}\n{{ template \"main\" }}\n```\n\n##### `include`\n\nIncludes the contents of another file and renders in-place. Optionally can pass key-value pairs as arguments to be accessed by the included file.\n\n```\n{{include \"path/to/file.html\"}} // no arguments\n{{include \"path/to/file.html\" \"arg1\" 2 \"value 3\"}} // with arguments\n```\n\n##### `listFiles`\n\nReturns a list of the files in the given directory, which is relative to the template context's file root.\n\n```\n{{listFiles \"/mydir\"}}\n```\n\n##### `markdown`\n\nRenders the given Markdown text as HTML. This uses the\n[Goldmark](https://github.com/yuin/goldmark) library,\nwhich is CommonMark compliant. It also has these plugins\nenabled: Github Flavored Markdown, Footnote and syntax\nhighlighting provided by [Chroma](https://github.com/alecthomas/chroma).\n\n```\n{{markdown \"My _markdown_ text\"}}\n```\n\n##### `.RemoteIP`\n\nReturns the client's IP address.\n\n```\n{{.RemoteIP}}\n```\n\n##### `.Req`\n\nAccesses the current HTTP request, which has various fields, including:\n\n - `.Method` - the method\n - `.URL` - the URL, which in turn has component fields (Scheme, Host, Path, etc.)\n - `.Header` - the header fields\n - `.Host` - the Host or :authority header of the request\n\n```\n{{.Req.Header.Get \"User-Agent\"}}\n```\n\n##### `.OriginalReq`\n\nLike .Req, except it accesses the original HTTP request before rewrites or other internal modifications.\n\n##### `.RespHeader.Add`\n\nAdds a header field to the HTTP response.\n\n```\n{{.RespHeader.Add \"Field-Name\" \"val\"}}\n```\n\n##### `.RespHeader.Del`\n\nDeletes a header field on the HTTP response.\n\n```\n{{.RespHeader.Del \"Field-Name\"}}\n```\n\n##### `.RespHeader.Set`\n\nSets a header field on the HTTP response, replacing any existing value.\n\n```\n{{.RespHeader.Set \"Field-Name\" \"val\"}}\n```\n\n##### `splitFrontMatter`\n\nSplits front matter out from the body. Front matter is metadata that appears at the very beginning of a file or string. Front matter can be in YAML, TOML, or JSON formats:\n\n**TOML** front matter starts and ends with `+++`:\n\n```\n+++\ntemplate = \"blog\"\ntitle = \"Blog Homepage\"\nsitename = \"A Caddy site\"\n+++\n```\n\n**YAML** is surrounded by `---`:\n\n```\n---\ntemplate: blog\ntitle: Blog Homepage\nsitename: A Caddy site\n---\n```\n\n**JSON** is simply `{` and `}`:\n\n```\n{\n\t\"template\": \"blog\",\n\t\"title\": \"Blog Homepage\",\n\t\"sitename\": \"A Caddy site\"\n}\n```\n\nThe resulting front matter will be made available like so:\n\n- `.Meta` to access the metadata fields, for example: `{{$parsed.Meta.title}}`\n- `.Body` to access the body after the front matter, for example: `{{markdown $parsed.Body}}`\n\n##### `stripHTML`\n\nRemoves HTML from a string.\n\n```\n{{stripHTML \"Shows \u003cb\u003eonly\u003c/b\u003e text content\"}}\n```\n \n", + "type": "object", + "properties": { + "delimiters": { + "description": "delimiters: array\nModule: http.handlers.templates\nThe template action delimiters. If set, must be precisely two elements:\nthe opening and closing delimiters. Default: `[\"{{\", \"}}\"]`\n", + "markdownDescription": "delimiters: `array` \nModule: `http.handlers.templates` \nThe template action delimiters. If set, must be precisely two elements:\nthe opening and closing delimiters. Default: `[\"{{\", \"}}\"]` \n", + "type": "array", + "items": { + "description": "The template action delimiters. If set, must be precisely two elements:\nthe opening and closing delimiters. Default: `[\"{{\", \"}}\"]`\n", + "markdownDescription": "The template action delimiters. If set, must be precisely two elements:\nthe opening and closing delimiters. Default: `[\"{{\", \"}}\"]` \n", + "type": "string" + } + }, + "file_root": { + "description": "file_root: string\nModule: http.handlers.templates\nThe root path from which to load files. Required if template functions\naccessing the file system are used (such as include). Default is\n`{http.vars.root}` if set, or current working directory otherwise.\n", + "markdownDescription": "file_root: `string` \nModule: `http.handlers.templates` \nThe root path from which to load files. Required if template functions\naccessing the file system are used (such as include). Default is\n`{http.vars.root}` if set, or current working directory otherwise. \n", + "type": "string" + }, + "mime_types": { + "description": "mime_types: array\nModule: http.handlers.templates\nThe MIME types for which to render templates. It is important to use\nthis if the route matchers do not exclude images or other binary files.\nDefault is text/plain, text/markdown, and text/html.\n", + "markdownDescription": "mime_types: `array` \nModule: `http.handlers.templates` \nThe MIME types for which to render templates. It is important to use\nthis if the route matchers do not exclude images or other binary files.\nDefault is text/plain, text/markdown, and text/html. \n", + "type": "array", + "items": { + "description": "The MIME types for which to render templates. It is important to use\nthis if the route matchers do not exclude images or other binary files.\nDefault is text/plain, text/markdown, and text/html.\n", + "markdownDescription": "The MIME types for which to render templates. It is important to use\nthis if the route matchers do not exclude images or other binary files.\nDefault is text/plain, text/markdown, and text/html. \n", + "type": "string" + } + } + } + }, + "http.handlers.tracing": { + "description": "tracing: object\nModule: http.handlers.tracing\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/tracing#Tracing\nTracing implements an HTTP handler that adds support for distributed tracing,\nusing OpenTelemetry. This module is responsible for the injection and\npropagation of the trace context. Configure this module via environment\nvariables (see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md).\nSome values can be overwritten in the configuration file.\n\n", + "markdownDescription": "tracing: `object` \nModule: `http.handlers.tracing` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/tracing#Tracing) \nTracing implements an HTTP handler that adds support for distributed tracing,\nusing OpenTelemetry. This module is responsible for the injection and\npropagation of the trace context. Configure this module via environment\nvariables (see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md).\nSome values can be overwritten in the configuration file.\n \n", + "type": "object", + "properties": { + "span": { + "description": "span: string\nModule: http.handlers.tracing\nSpanName is a span name. It should follow the naming guidelines here:\nhttps://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span\n", + "markdownDescription": "span: `string` \nModule: `http.handlers.tracing` \nSpanName is a span name. It should follow the naming guidelines here:\nhttps://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span \n", + "type": "string" + } + } + }, + "http.handlers.vars": { + "description": "vars: object\nModule: http.handlers.vars\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#VarsMiddleware\nVarsMiddleware is an HTTP middleware which sets variables to\nhave values that can be used in the HTTP request handler\nchain. The primary way to access variables is with placeholders,\nwhich have the form: `{http.vars.variable_name}`, or with\nthe `vars` and `vars_regexp` request matchers.\n\nThe key is the variable name, and the value is the value of the\nvariable. Both the name and value may use or contain placeholders.\n\n", + "markdownDescription": "vars: `object` \nModule: `http.handlers.vars` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#VarsMiddleware) \nVarsMiddleware is an HTTP middleware which sets variables to\nhave values that can be used in the HTTP request handler\nchain. The primary way to access variables is with placeholders,\nwhich have the form: `{http.vars.variable_name}`, or with\nthe `vars` and `vars_regexp` request matchers.\n\nThe key is the variable name, and the value is the value of the\nvariable. Both the name and value may use or contain placeholders.\n \n", + "type": "object", + "additionalProperties": {} + }, + "http.matchers.expression": { + "description": "expression: string\nModule: http.matchers.expression\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchExpression\nMatchExpression matches requests by evaluating a\n[CEL](https://github.com/google/cel-spec) expression.\nThis enables complex logic to be expressed using a comfortable,\nfamiliar syntax. Please refer to\n[the standard definitions of CEL functions and operators](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions).\n\nThis matcher's JSON interface is actually a string, not a struct.\nThe generated docs are not correct because this type has custom\nmarshaling logic.\n\nCOMPATIBILITY NOTE: This module is still experimental and is not\nsubject to Caddy's compatibility guarantee.\n\n", + "markdownDescription": "expression: `string` \nModule: `http.matchers.expression` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchExpression) \nMatchExpression matches requests by evaluating a\n[CEL](https://github.com/google/cel-spec) expression.\nThis enables complex logic to be expressed using a comfortable,\nfamiliar syntax. Please refer to\n[the standard definitions of CEL functions and operators](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions).\n\nThis matcher's JSON interface is actually a string, not a struct.\nThe generated docs are not correct because this type has custom\nmarshaling logic.\n\nCOMPATIBILITY NOTE: This module is still experimental and is not\nsubject to Caddy's compatibility guarantee.\n \n", + "type": "string" + }, + "http.matchers.file": { + "description": "file: object\nModule: http.matchers.file\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver#MatchFile\nMatchFile is an HTTP request matcher that can match\nrequests based upon file existence.\n\nUpon matching, three new placeholders will be made\navailable:\n\n- `{http.matchers.file.relative}` The root-relative\npath of the file. This is often useful when rewriting\nrequests.\n- `{http.matchers.file.absolute}` The absolute path\nof the matched file.\n- `{http.matchers.file.type}` Set to \"directory\" if\nthe matched file is a directory, \"file\" otherwise.\n- `{http.matchers.file.remainder}` Set to the remainder\nof the path if the path was split by `split_path`.\n\n", + "markdownDescription": "file: `object` \nModule: `http.matchers.file` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver#MatchFile) \nMatchFile is an HTTP request matcher that can match\nrequests based upon file existence.\n\nUpon matching, three new placeholders will be made\navailable:\n\n- `{http.matchers.file.relative}` The root-relative\npath of the file. This is often useful when rewriting\nrequests.\n- `{http.matchers.file.absolute}` The absolute path\nof the matched file.\n- `{http.matchers.file.type}` Set to \"directory\" if\nthe matched file is a directory, \"file\" otherwise.\n- `{http.matchers.file.remainder}` Set to the remainder\nof the path if the path was split by `split_path`.\n \n", + "type": "object", + "properties": { + "root": { + "description": "root: string\nModule: http.matchers.file\nThe root directory, used for creating absolute\nfile paths, and required when working with\nrelative paths; if not specified, `{http.vars.root}`\nwill be used, if set; otherwise, the current\ndirectory is assumed. Accepts placeholders.\n", + "markdownDescription": "root: `string` \nModule: `http.matchers.file` \nThe root directory, used for creating absolute\nfile paths, and required when working with\nrelative paths; if not specified, `{http.vars.root}`\nwill be used, if set; otherwise, the current\ndirectory is assumed. Accepts placeholders. \n", + "type": "string" + }, + "split_path": { + "description": "split_path: array\nModule: http.matchers.file\nA list of delimiters to use to split the path in two\nwhen trying files. If empty, no splitting will\noccur, and the path will be tried as-is. For each\nsplit value, the left-hand side of the split,\nincluding the split value, will be the path tried.\nFor example, the path `/remote.php/dav/` using the\nsplit value `.php` would try the file `/remote.php`.\nEach delimiter must appear at the end of a URI path\ncomponent in order to be used as a split delimiter.\n", + "markdownDescription": "split_path: `array` \nModule: `http.matchers.file` \nA list of delimiters to use to split the path in two\nwhen trying files. If empty, no splitting will\noccur, and the path will be tried as-is. For each\nsplit value, the left-hand side of the split,\nincluding the split value, will be the path tried.\nFor example, the path `/remote.php/dav/` using the\nsplit value `.php` would try the file `/remote.php`.\nEach delimiter must appear at the end of a URI path\ncomponent in order to be used as a split delimiter. \n", + "type": "array", + "items": { + "description": "A list of delimiters to use to split the path in two\nwhen trying files. If empty, no splitting will\noccur, and the path will be tried as-is. For each\nsplit value, the left-hand side of the split,\nincluding the split value, will be the path tried.\nFor example, the path `/remote.php/dav/` using the\nsplit value `.php` would try the file `/remote.php`.\nEach delimiter must appear at the end of a URI path\ncomponent in order to be used as a split delimiter.\n", + "markdownDescription": "A list of delimiters to use to split the path in two\nwhen trying files. If empty, no splitting will\noccur, and the path will be tried as-is. For each\nsplit value, the left-hand side of the split,\nincluding the split value, will be the path tried.\nFor example, the path `/remote.php/dav/` using the\nsplit value `.php` would try the file `/remote.php`.\nEach delimiter must appear at the end of a URI path\ncomponent in order to be used as a split delimiter. \n", + "type": "string" + } + }, + "try_files": { + "description": "try_files: array\nModule: http.matchers.file\nThe list of files to try. Each path here is\nconsidered related to Root. If nil, the request\nURL's path will be assumed. Files and\ndirectories are treated distinctly, so to match\na directory, the filepath MUST end in a forward\nslash `/`. To match a regular file, there must\nbe no trailing slash. Accepts placeholders. If\nthe policy is \"first_exist\", then an error may\nbe triggered as a fallback by configuring \"=\"\nfollowed by a status code number,\nfor example \"=404\".\n", + "markdownDescription": "try_files: `array` \nModule: `http.matchers.file` \nThe list of files to try. Each path here is\nconsidered related to Root. If nil, the request\nURL's path will be assumed. Files and\ndirectories are treated distinctly, so to match\na directory, the filepath MUST end in a forward\nslash `/`. To match a regular file, there must\nbe no trailing slash. Accepts placeholders. If\nthe policy is \"first_exist\", then an error may\nbe triggered as a fallback by configuring \"=\"\nfollowed by a status code number,\nfor example \"=404\". \n", + "type": "array", + "items": { + "description": "The list of files to try. Each path here is\nconsidered related to Root. If nil, the request\nURL's path will be assumed. Files and\ndirectories are treated distinctly, so to match\na directory, the filepath MUST end in a forward\nslash `/`. To match a regular file, there must\nbe no trailing slash. Accepts placeholders. If\nthe policy is \"first_exist\", then an error may\nbe triggered as a fallback by configuring \"=\"\nfollowed by a status code number,\nfor example \"=404\".\n", + "markdownDescription": "The list of files to try. Each path here is\nconsidered related to Root. If nil, the request\nURL's path will be assumed. Files and\ndirectories are treated distinctly, so to match\na directory, the filepath MUST end in a forward\nslash `/`. To match a regular file, there must\nbe no trailing slash. Accepts placeholders. If\nthe policy is \"first_exist\", then an error may\nbe triggered as a fallback by configuring \"=\"\nfollowed by a status code number,\nfor example \"=404\". \n", + "type": "string" + } + }, + "try_policy": { + "description": "try_policy: string\nModule: http.matchers.file\nHow to choose a file in TryFiles. Can be:\n\n- first_exist\n- smallest_size\n- largest_size\n- most_recently_modified\n\nDefault is first_exist.\n", + "markdownDescription": "try_policy: `string` \nModule: `http.matchers.file` \nHow to choose a file in TryFiles. Can be:\n\n- first_exist\n- smallest_size\n- largest_size\n- most_recently_modified\n\nDefault is first_exist. \n", + "type": "string" + } + } + }, + "http.matchers.header": { + "description": "header: object\nModule: http.matchers.header\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchHeader\nMatchHeader matches requests by header fields. The key is the field\nname and the array is the list of field values. It performs fast,\nexact string comparisons of the field values. Fast prefix, suffix,\nand substring matches can also be done by suffixing, prefixing, or\nsurrounding the value with the wildcard `*` character, respectively.\nIf a list is null, the header must not exist. If the list is empty,\nthe field must simply exist, regardless of its value.\n\n", + "markdownDescription": "header: `object` \nModule: `http.matchers.header` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchHeader) \nMatchHeader matches requests by header fields. The key is the field\nname and the array is the list of field values. It performs fast,\nexact string comparisons of the field values. Fast prefix, suffix,\nand substring matches can also be done by suffixing, prefixing, or\nsurrounding the value with the wildcard `*` character, respectively.\nIf a list is null, the header must not exist. If the list is empty,\nthe field must simply exist, regardless of its value.\n \n", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "http.matchers.header_regexp": { + "description": "header_regexp: object\nModule: http.matchers.header_regexp\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp\nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n\n", + "markdownDescription": "header_regexp: `object` \nModule: `http.matchers.header_regexp` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp) \nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp\nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp) \nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n \n", + "properties": { + "name": { + "description": "name: string\nModule: http.matchers.header_regexp\nA unique name for this regular expression. Optional,\nbut useful to prevent overwriting captures from other\nregexp matchers.\n", + "markdownDescription": "name: `string` \nModule: `http.matchers.header_regexp` \nA unique name for this regular expression. Optional,\nbut useful to prevent overwriting captures from other\nregexp matchers. \n", + "type": "string" + }, + "pattern": { + "description": "pattern: string\nModule: http.matchers.header_regexp\nThe regular expression to evaluate, in RE2 syntax,\nwhich is the same general syntax used by Go, Perl,\nand Python. For details, see\n[Go's regexp package](https://golang.org/pkg/regexp/).\nCaptures are accessible via placeholders. Unnamed\ncapture groups are exposed as their numeric, 1-based\nindex, while named capture groups are available by\nthe capture group name.\n", + "markdownDescription": "pattern: `string` \nModule: `http.matchers.header_regexp` \nThe regular expression to evaluate, in RE2 syntax,\nwhich is the same general syntax used by Go, Perl,\nand Python. For details, see\n[Go's regexp package](https://golang.org/pkg/regexp/).\nCaptures are accessible via placeholders. Unnamed\ncapture groups are exposed as their numeric, 1-based\nindex, while named capture groups are available by\nthe capture group name. \n", + "type": "string" + } + } + } + }, + "http.matchers.host": { + "description": "host: array\nModule: http.matchers.host\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchHost\nMatchHost matches requests by the Host value (case-insensitive).\n\nWhen used in a top-level HTTP route,\n[qualifying domain names](/docs/automatic-https#hostname-requirements)\nmay trigger [automatic HTTPS](/docs/automatic-https), which automatically\nprovisions and renews certificates for you. Before doing this, you\nshould ensure that DNS records for these domains are properly configured,\nespecially A/AAAA pointed at your server.\n\nAutomatic HTTPS can be\n[customized or disabled](/docs/modules/http#servers/automatic_https).\n\nWildcards (`*`) may be used to represent exactly one label of the\nhostname, in accordance with RFC 1034 (because host matchers are also\nused for automatic HTTPS which influences TLS certificates). Thus,\na host of `*` matches hosts like `localhost` or `internal` but not\n`example.com`. To catch all hosts, omit the host matcher entirely.\n\nThe wildcard can be useful for matching all subdomains, for example:\n`*.example.com` matches `foo.example.com` but not `foo.bar.example.com`.\n\nDuplicate entries will return an error.\n\n", + "markdownDescription": "host: `array` \nModule: `http.matchers.host` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchHost) \nMatchHost matches requests by the Host value (case-insensitive).\n\nWhen used in a top-level HTTP route,\n[qualifying domain names](/docs/automatic-https#hostname-requirements)\nmay trigger [automatic HTTPS](/docs/automatic-https), which automatically\nprovisions and renews certificates for you. Before doing this, you\nshould ensure that DNS records for these domains are properly configured,\nespecially A/AAAA pointed at your server.\n\nAutomatic HTTPS can be\n[customized or disabled](/docs/modules/http#servers/automatic_https).\n\nWildcards (`*`) may be used to represent exactly one label of the\nhostname, in accordance with RFC 1034 (because host matchers are also\nused for automatic HTTPS which influences TLS certificates). Thus,\na host of `*` matches hosts like `localhost` or `internal` but not\n`example.com`. To catch all hosts, omit the host matcher entirely.\n\nThe wildcard can be useful for matching all subdomains, for example:\n`*.example.com` matches `foo.example.com` but not `foo.bar.example.com`.\n\nDuplicate entries will return an error.\n \n", + "type": "array", + "items": { + "type": "string" + } + }, + "http.matchers.method": { + "description": "method: array\nModule: http.matchers.method\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchMethod\nMatchMethod matches requests by the method.\n\n", + "markdownDescription": "method: `array` \nModule: `http.matchers.method` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchMethod) \nMatchMethod matches requests by the method.\n \n", + "type": "array", + "items": { + "type": "string" + } + }, + "http.matchers.not": { + "description": "not: array\nModule: http.matchers.not\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchNot\nMatchNot matches requests by negating the results of its matcher\nsets. A single \"not\" matcher takes one or more matcher sets. Each\nmatcher set is OR'ed; in other words, if any matcher set returns\ntrue, the final result of the \"not\" matcher is false. Individual\nmatchers within a set work the same (i.e. different matchers in\nthe same set are AND'ed).\n\nNOTE: The generated docs which describe the structure of this\nmodule are wrong because of how this type unmarshals JSON in a\ncustom way. The correct structure is:\n\n```json\n[\n\t{},\n\t{}\n]\n```\n\nwhere each of the array elements is a matcher set, i.e. an\nobject keyed by matcher name.\n\n", + "markdownDescription": "not: `array` \nModule: `http.matchers.not` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchNot) \nMatchNot matches requests by negating the results of its matcher\nsets. A single \"not\" matcher takes one or more matcher sets. Each\nmatcher set is OR'ed; in other words, if any matcher set returns\ntrue, the final result of the \"not\" matcher is false. Individual\nmatchers within a set work the same (i.e. different matchers in\nthe same set are AND'ed).\n\nNOTE: The generated docs which describe the structure of this\nmodule are wrong because of how this type unmarshals JSON in a\ncustom way. The correct structure is:\n\n```json\n[\n\t{},\n\t{}\n]\n```\n\nwhere each of the array elements is a matcher set, i.e. an\nobject keyed by matcher name.\n \n", + "type": "array", + "items": { + "properties": { + "expression": { + "$ref": "#/definitions/http.matchers.expression" + }, + "file": { + "$ref": "#/definitions/http.matchers.file" + }, + "header": { + "$ref": "#/definitions/http.matchers.header" + }, + "header_regexp": { + "$ref": "#/definitions/http.matchers.header_regexp" + }, + "host": { + "$ref": "#/definitions/http.matchers.host" + }, + "method": { + "$ref": "#/definitions/http.matchers.method" + }, + "not": { + "$ref": "#/definitions/http.matchers.not" + }, + "path": { + "$ref": "#/definitions/http.matchers.path" + }, + "path_regexp": { + "$ref": "#/definitions/http.matchers.path_regexp" + }, + "protocol": { + "$ref": "#/definitions/http.matchers.protocol" + }, + "query": { + "$ref": "#/definitions/http.matchers.query" + }, + "remote_ip": { + "$ref": "#/definitions/http.matchers.remote_ip" + }, + "vars": { + "$ref": "#/definitions/http.matchers.vars" + }, + "vars_regexp": { + "$ref": "#/definitions/http.matchers.vars_regexp" + } + } + } + }, + "http.matchers.path": { + "description": "path: array\nModule: http.matchers.path\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchPath\nMatchPath matches requests by the URI's path (case-insensitive). Path\nmatches are exact, but wildcards may be used:\n\n- At the end, for a prefix match (`/prefix/*`)\n- At the beginning, for a suffix match (`*.suffix`)\n- On both sides, for a substring match (`*/contains/*`)\n- In the middle, for a globular match (`/accounts/*/info`)\n\nThis matcher is fast, so it does not support regular expressions or\ncapture groups. For slower but more powerful matching, use the\npath_regexp matcher.\n\n", + "markdownDescription": "path: `array` \nModule: `http.matchers.path` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchPath) \nMatchPath matches requests by the URI's path (case-insensitive). Path\nmatches are exact, but wildcards may be used:\n\n- At the end, for a prefix match (`/prefix/*`)\n- At the beginning, for a suffix match (`*.suffix`)\n- On both sides, for a substring match (`*/contains/*`)\n- In the middle, for a globular match (`/accounts/*/info`)\n\nThis matcher is fast, so it does not support regular expressions or\ncapture groups. For slower but more powerful matching, use the\npath_regexp matcher.\n \n", + "type": "array", + "items": { + "type": "string" + } + }, + "http.matchers.path_regexp": { + "description": "path_regexp: object\nModule: http.matchers.path_regexp\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchPathRE\nMatchPathRE matches requests by a regular expression on the URI's path.\n\nUpon a match, it adds placeholders to the request: `{http.regexp.name.capture_group}`\nwhere `name` is the regular expression's name, and `capture_group` is either\nthe named or positional capture group from the expression itself. If no name\nis given, then the placeholder omits the name: `{http.regexp.capture_group}`\n(potentially leading to collisions).\n\n", + "markdownDescription": "path_regexp: `object` \nModule: `http.matchers.path_regexp` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchPathRE) \nMatchPathRE matches requests by a regular expression on the URI's path.\n\nUpon a match, it adds placeholders to the request: `{http.regexp.name.capture_group}`\nwhere `name` is the regular expression's name, and `capture_group` is either\nthe named or positional capture group from the expression itself. If no name\nis given, then the placeholder omits the name: `{http.regexp.capture_group}`\n(potentially leading to collisions).\n \n", + "type": "object", + "properties": { + "name": { + "description": "name: string\nModule: http.matchers.path_regexp\nA unique name for this regular expression. Optional,\nbut useful to prevent overwriting captures from other\nregexp matchers.\n", + "markdownDescription": "name: `string` \nModule: `http.matchers.path_regexp` \nA unique name for this regular expression. Optional,\nbut useful to prevent overwriting captures from other\nregexp matchers. \n", + "type": "string" + }, + "pattern": { + "description": "pattern: string\nModule: http.matchers.path_regexp\nThe regular expression to evaluate, in RE2 syntax,\nwhich is the same general syntax used by Go, Perl,\nand Python. For details, see\n[Go's regexp package](https://golang.org/pkg/regexp/).\nCaptures are accessible via placeholders. Unnamed\ncapture groups are exposed as their numeric, 1-based\nindex, while named capture groups are available by\nthe capture group name.\n", + "markdownDescription": "pattern: `string` \nModule: `http.matchers.path_regexp` \nThe regular expression to evaluate, in RE2 syntax,\nwhich is the same general syntax used by Go, Perl,\nand Python. For details, see\n[Go's regexp package](https://golang.org/pkg/regexp/).\nCaptures are accessible via placeholders. Unnamed\ncapture groups are exposed as their numeric, 1-based\nindex, while named capture groups are available by\nthe capture group name. \n", + "type": "string" + } + } + }, + "http.matchers.protocol": { + "description": "protocol: string\nModule: http.matchers.protocol\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchProtocol\nMatchProtocol matches requests by protocol. Recognized values are\n\"http\", \"https\", and \"grpc\".\n\n", + "markdownDescription": "protocol: `string` \nModule: `http.matchers.protocol` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchProtocol) \nMatchProtocol matches requests by protocol. Recognized values are\n\"http\", \"https\", and \"grpc\".\n \n", + "type": "string" + }, + "http.matchers.query": { + "description": "query: object\nModule: http.matchers.query\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchQuery\nMatchQuery matches requests by the URI's query string. It takes a JSON object\nkeyed by the query keys, with an array of string values to match for that key.\nQuery key matches are exact, but wildcards may be used for value matches. Both\nkeys and values may be placeholders.\nAn example of the structure to match `?key=value\u0026topic=api\u0026query=something` is:\n\n```json\n{\n\t\"key\": [\"value\"],\n\t\"topic\": [\"api\"],\n\t\"query\": [\"*\"]\n}\n```\n\n", + "markdownDescription": "query: `object` \nModule: `http.matchers.query` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchQuery) \nMatchQuery matches requests by the URI's query string. It takes a JSON object\nkeyed by the query keys, with an array of string values to match for that key.\nQuery key matches are exact, but wildcards may be used for value matches. Both\nkeys and values may be placeholders.\nAn example of the structure to match `?key=value\u0026topic=api\u0026query=something` is:\n\n```json\n{\n\t\"key\": [\"value\"],\n\t\"topic\": [\"api\"],\n\t\"query\": [\"*\"]\n}\n```\n \n", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "http.matchers.remote_ip": { + "description": "remote_ip: object\nModule: http.matchers.remote_ip\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRemoteIP\nMatchRemoteIP matches requests by client IP (or CIDR range).\n\n", + "markdownDescription": "remote_ip: `object` \nModule: `http.matchers.remote_ip` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRemoteIP) \nMatchRemoteIP matches requests by client IP (or CIDR range).\n \n", + "type": "object", + "properties": { + "forwarded": { + "description": "forwarded: boolean\nModule: http.matchers.remote_ip\nIf true, prefer the first IP in the request's X-Forwarded-For\nheader, if present, rather than the immediate peer's IP, as\nthe reference IP against which to match. Note that it is easy\nto spoof request headers. Default: false\n", + "markdownDescription": "forwarded: `boolean` \nModule: `http.matchers.remote_ip` \nIf true, prefer the first IP in the request's X-Forwarded-For\nheader, if present, rather than the immediate peer's IP, as\nthe reference IP against which to match. Note that it is easy\nto spoof request headers. Default: false \n", + "type": "boolean" + }, + "ranges": { + "description": "ranges: array\nModule: http.matchers.remote_ip\nThe IPs or CIDR ranges to match.\n", + "markdownDescription": "ranges: `array` \nModule: `http.matchers.remote_ip` \nThe IPs or CIDR ranges to match. \n", + "type": "array", + "items": { + "description": "The IPs or CIDR ranges to match.\n", + "markdownDescription": "The IPs or CIDR ranges to match. \n", + "type": "string" + } + } + } + }, + "http.matchers.vars": { + "description": "vars: object\nModule: http.matchers.vars\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#VarsMatcher\nVarsMatcher is an HTTP request matcher which can match\nrequests based on variables in the context. The key is\nthe name of the variable, and the values are possible\nvalues the variable can be in order to match (OR'ed).\n\nAs a special case, this matcher can also match on\nplaceholders generally. If the key is not an HTTP chain\nvariable, it will be checked to see if it is a\nplaceholder name, and if so, will compare its value.\n\n", + "markdownDescription": "vars: `object` \nModule: `http.matchers.vars` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#VarsMatcher) \nVarsMatcher is an HTTP request matcher which can match\nrequests based on variables in the context. The key is\nthe name of the variable, and the values are possible\nvalues the variable can be in order to match (OR'ed).\n\nAs a special case, this matcher can also match on\nplaceholders generally. If the key is not an HTTP chain\nvariable, it will be checked to see if it is a\nplaceholder name, and if so, will compare its value.\n \n", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "http.matchers.vars_regexp": { + "description": "vars_regexp: object\nModule: http.matchers.vars_regexp\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp\nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n\n", + "markdownDescription": "vars_regexp: `object` \nModule: `http.matchers.vars_regexp` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp) \nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp\nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp#MatchRegexp) \nMatchRegexp is an embedable type for matching\nusing regular expressions. It adds placeholders\nto the request's replacer.\n \n", + "properties": { + "name": { + "description": "name: string\nModule: http.matchers.vars_regexp\nA unique name for this regular expression. Optional,\nbut useful to prevent overwriting captures from other\nregexp matchers.\n", + "markdownDescription": "name: `string` \nModule: `http.matchers.vars_regexp` \nA unique name for this regular expression. Optional,\nbut useful to prevent overwriting captures from other\nregexp matchers. \n", + "type": "string" + }, + "pattern": { + "description": "pattern: string\nModule: http.matchers.vars_regexp\nThe regular expression to evaluate, in RE2 syntax,\nwhich is the same general syntax used by Go, Perl,\nand Python. For details, see\n[Go's regexp package](https://golang.org/pkg/regexp/).\nCaptures are accessible via placeholders. Unnamed\ncapture groups are exposed as their numeric, 1-based\nindex, while named capture groups are available by\nthe capture group name.\n", + "markdownDescription": "pattern: `string` \nModule: `http.matchers.vars_regexp` \nThe regular expression to evaluate, in RE2 syntax,\nwhich is the same general syntax used by Go, Perl,\nand Python. For details, see\n[Go's regexp package](https://golang.org/pkg/regexp/).\nCaptures are accessible via placeholders. Unnamed\ncapture groups are exposed as their numeric, 1-based\nindex, while named capture groups are available by\nthe capture group name. \n", + "type": "string" + } + } + } + }, + "http.precompressed.br": { + "description": "br: object\nModule: http.precompressed.br\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/brotli#BrotliPrecompressed", + "markdownDescription": "br: `object` \nModule: `http.precompressed.br` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/brotli#BrotliPrecompressed)", + "type": "object" + }, + "http.precompressed.gzip": { + "description": "gzip: object\nModule: http.precompressed.gzip\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#GzipPrecompressed", + "markdownDescription": "gzip: `object` \nModule: `http.precompressed.gzip` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#GzipPrecompressed)", + "type": "object", + "properties": { + "level": { + "description": "level: number\nModule: http.precompressed.gzip\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#GzipPrecompressed", + "markdownDescription": "level: `number` \nModule: `http.precompressed.gzip` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip#GzipPrecompressed)", + "type": "number" + } + } + }, + "http.precompressed.zstd": { + "description": "zstd: object\nModule: http.precompressed.zstd\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd#ZstdPrecompressed", + "markdownDescription": "zstd: `object` \nModule: `http.precompressed.zstd` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd#ZstdPrecompressed)", + "type": "object" + }, + "http.reverse_proxy.selection_policies.cookie": { + "description": "cookie: object\nModule: http.reverse_proxy.selection_policies.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CookieHashSelection", + "markdownDescription": "cookie: `object` \nModule: `http.reverse_proxy.selection_policies.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CookieHashSelection)", + "type": "object", + "properties": { + "name": { + "description": "name: string\nModule: http.reverse_proxy.selection_policies.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CookieHashSelection", + "markdownDescription": "name: `string` \nModule: `http.reverse_proxy.selection_policies.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CookieHashSelection)", + "type": "string" + }, + "secret": { + "description": "secret: string\nModule: http.reverse_proxy.selection_policies.cookie\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CookieHashSelection", + "markdownDescription": "secret: `string` \nModule: `http.reverse_proxy.selection_policies.cookie` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#CookieHashSelection)", + "type": "string" + } + } + }, + "http.reverse_proxy.selection_policies.first": { + "description": "first: object\nModule: http.reverse_proxy.selection_policies.first\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#FirstSelection", + "markdownDescription": "first: `object` \nModule: `http.reverse_proxy.selection_policies.first` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#FirstSelection)", + "type": "object" + }, + "http.reverse_proxy.selection_policies.header": { + "description": "header: object\nModule: http.reverse_proxy.selection_policies.header\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HeaderHashSelection", + "markdownDescription": "header: `object` \nModule: `http.reverse_proxy.selection_policies.header` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HeaderHashSelection)", + "type": "object", + "properties": { + "field": { + "description": "field: string\nModule: http.reverse_proxy.selection_policies.header\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HeaderHashSelection", + "markdownDescription": "field: `string` \nModule: `http.reverse_proxy.selection_policies.header` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HeaderHashSelection)", + "type": "string" + } + } + }, + "http.reverse_proxy.selection_policies.ip_hash": { + "description": "ip_hash: object\nModule: http.reverse_proxy.selection_policies.ip_hash\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#IPHashSelection", + "markdownDescription": "ip_hash: `object` \nModule: `http.reverse_proxy.selection_policies.ip_hash` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#IPHashSelection)", + "type": "object" + }, + "http.reverse_proxy.selection_policies.least_conn": { + "description": "least_conn: object\nModule: http.reverse_proxy.selection_policies.least_conn\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#LeastConnSelection", + "markdownDescription": "least_conn: `object` \nModule: `http.reverse_proxy.selection_policies.least_conn` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#LeastConnSelection)", + "type": "object" + }, + "http.reverse_proxy.selection_policies.random": { + "description": "random: object\nModule: http.reverse_proxy.selection_policies.random\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RandomSelection", + "markdownDescription": "random: `object` \nModule: `http.reverse_proxy.selection_policies.random` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RandomSelection)", + "type": "object" + }, + "http.reverse_proxy.selection_policies.random_choose": { + "description": "random_choose: object\nModule: http.reverse_proxy.selection_policies.random_choose\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RandomChoiceSelection", + "markdownDescription": "random_choose: `object` \nModule: `http.reverse_proxy.selection_policies.random_choose` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RandomChoiceSelection)", + "type": "object", + "properties": { + "choose": { + "description": "choose: number\nModule: http.reverse_proxy.selection_policies.random_choose\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RandomChoiceSelection", + "markdownDescription": "choose: `number` \nModule: `http.reverse_proxy.selection_policies.random_choose` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RandomChoiceSelection)", + "type": "number" + } + } + }, + "http.reverse_proxy.selection_policies.round_robin": { + "description": "round_robin: object\nModule: http.reverse_proxy.selection_policies.round_robin\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RoundRobinSelection", + "markdownDescription": "round_robin: `object` \nModule: `http.reverse_proxy.selection_policies.round_robin` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#RoundRobinSelection)", + "type": "object" + }, + "http.reverse_proxy.selection_policies.uri_hash": { + "description": "uri_hash: object\nModule: http.reverse_proxy.selection_policies.uri_hash\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#URIHashSelection", + "markdownDescription": "uri_hash: `object` \nModule: `http.reverse_proxy.selection_policies.uri_hash` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#URIHashSelection)", + "type": "object" + }, + "http.reverse_proxy.transport.fastcgi": { + "description": "fastcgi: object\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "fastcgi: `object` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "object", + "properties": { + "dial_timeout": { + "description": "dial_timeout: number\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "dial_timeout: `number` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "number" + }, + "env": { + "description": "env: object\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "env: `object` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "object", + "additionalProperties": {} + }, + "read_timeout": { + "description": "read_timeout: number\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "read_timeout: `number` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "number" + }, + "resolve_root_symlink": { + "description": "resolve_root_symlink: boolean\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "resolve_root_symlink: `boolean` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "boolean" + }, + "root": { + "description": "root: string\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "root: `string` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "string" + }, + "split_path": { + "description": "split_path: array\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "split_path: `array` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "array", + "items": { + "type": "string" + } + }, + "write_timeout": { + "description": "write_timeout: number\nModule: http.reverse_proxy.transport.fastcgi\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport", + "markdownDescription": "write_timeout: `number` \nModule: `http.reverse_proxy.transport.fastcgi` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi#Transport)", + "type": "number" + } + } + }, + "http.reverse_proxy.transport.http": { + "description": "http: object\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "http: `object` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "object", + "properties": { + "compression": { + "description": "compression: boolean\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "compression: `boolean` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "boolean" + }, + "dial_fallback_delay": { + "description": "dial_fallback_delay: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "dial_fallback_delay: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "dial_timeout": { + "description": "dial_timeout: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "dial_timeout: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "expect_continue_timeout": { + "description": "expect_continue_timeout: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "expect_continue_timeout: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "keep_alive": { + "description": "keep_alive: object\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "keep_alive: `object` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "object", + "properties": { + "enabled": { + "description": "enabled: boolean\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "enabled: `boolean` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "boolean" + }, + "idle_timeout": { + "description": "idle_timeout: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "idle_timeout: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "max_idle_conns": { + "description": "max_idle_conns: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "max_idle_conns: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "max_idle_conns_per_host": { + "description": "max_idle_conns_per_host: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "max_idle_conns_per_host: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "probe_interval": { + "description": "probe_interval: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "probe_interval: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + } + } + }, + "max_conns_per_host": { + "description": "max_conns_per_host: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "max_conns_per_host: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "max_response_header_size": { + "description": "max_response_header_size: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "max_response_header_size: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "read_buffer_size": { + "description": "read_buffer_size: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "read_buffer_size: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "resolver": { + "description": "resolver: object\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "resolver: `object` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "object", + "properties": { + "addresses": { + "description": "addresses: array\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "addresses: `array` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "response_header_timeout": { + "description": "response_header_timeout: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "response_header_timeout: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "tls": { + "description": "tls: object\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "tls: `object` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "object", + "properties": { + "client_certificate_automate": { + "description": "client_certificate_automate: string\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "client_certificate_automate: `string` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "string" + }, + "client_certificate_file": { + "description": "client_certificate_file: string\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "client_certificate_file: `string` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "string" + }, + "client_certificate_key_file": { + "description": "client_certificate_key_file: string\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "client_certificate_key_file: `string` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "string" + }, + "except_ports": { + "description": "except_ports: array\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "except_ports: `array` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "array", + "items": { + "type": "string" + } + }, + "handshake_timeout": { + "description": "handshake_timeout: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "handshake_timeout: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + }, + "insecure_skip_verify": { + "description": "insecure_skip_verify: boolean\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "insecure_skip_verify: `boolean` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "boolean" + }, + "renegotiation": { + "description": "renegotiation: string\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "renegotiation: `string` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "string" + }, + "root_ca_pem_files": { + "description": "root_ca_pem_files: array\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "root_ca_pem_files: `array` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "array", + "items": { + "type": "string" + } + }, + "root_ca_pool": { + "description": "root_ca_pool: array\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "root_ca_pool: `array` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "array", + "items": { + "type": "string" + } + }, + "server_name": { + "description": "server_name: string\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "server_name: `string` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "string" + } + } + }, + "versions": { + "description": "versions: array\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "versions: `array` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "array", + "items": { + "type": "string" + } + }, + "write_buffer_size": { + "description": "write_buffer_size: number\nModule: http.reverse_proxy.transport.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport", + "markdownDescription": "write_buffer_size: `number` \nModule: `http.reverse_proxy.transport.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#HTTPTransport)", + "type": "number" + } + } + }, + "http.reverse_proxy.upstreams.a": { + "description": "a: object\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "a: `object` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "object", + "properties": { + "dial_fallback_delay": { + "description": "dial_fallback_delay: number\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "dial_fallback_delay: `number` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "number" + }, + "dial_timeout": { + "description": "dial_timeout: number\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "dial_timeout: `number` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "number" + }, + "name": { + "description": "name: string\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "name: `string` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "string" + }, + "port": { + "description": "port: string\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "port: `string` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "string" + }, + "refresh": { + "description": "refresh: number\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "refresh: `number` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "number" + }, + "resolver": { + "description": "resolver: object\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "resolver: `object` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "object", + "properties": { + "addresses": { + "description": "addresses: array\nModule: http.reverse_proxy.upstreams.a\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams", + "markdownDescription": "addresses: `array` \nModule: `http.reverse_proxy.upstreams.a` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#AUpstreams)", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "http.reverse_proxy.upstreams.srv": { + "description": "srv: object\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "srv: `object` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "object", + "properties": { + "dial_fallback_delay": { + "description": "dial_fallback_delay: number\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "dial_fallback_delay: `number` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "number" + }, + "dial_timeout": { + "description": "dial_timeout: number\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "dial_timeout: `number` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "number" + }, + "name": { + "description": "name: string\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "name: `string` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "string" + }, + "proto": { + "description": "proto: string\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "proto: `string` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "string" + }, + "refresh": { + "description": "refresh: number\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "refresh: `number` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "number" + }, + "resolver": { + "description": "resolver: object\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "resolver: `object` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "object", + "properties": { + "addresses": { + "description": "addresses: array\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "addresses: `array` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "service": { + "description": "service: string\nModule: http.reverse_proxy.upstreams.srv\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams", + "markdownDescription": "service: `string` \nModule: `http.reverse_proxy.upstreams.srv` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#SRVUpstreams)", + "type": "string" + } + } + }, + "layer4": { + "description": "layer4: object\nModule: layer4\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/layer4#App\nApp is a Caddy app that operates closest to layer 4 of the OSI model.\n\n", + "markdownDescription": "layer4: `object` \nModule: `layer4` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#App) \nApp is a Caddy app that operates closest to layer 4 of the OSI model.\n \n", + "type": "object", + "properties": { + "servers": { + "description": "servers: object\nModule: layer4\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Server\nServer represents a Caddy layer4 server.\n\n", + "markdownDescription": "servers: `object` \nModule: `layer4` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Server) \nServer represents a Caddy layer4 server.\n \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Server\nServer represents a Caddy layer4 server.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Server) \nServer represents a Caddy layer4 server.\n \n", + "properties": { + "listen": { + "description": "listen: array\nModule: layer4\n", + "markdownDescription": "listen: `array` \nModule: `layer4` \n", + "type": "array", + "items": { + "type": "string" + } + }, + "routes": { + "description": "routes: array\nModule: layer4\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Route\nRoute represents a collection of handlers that are gated\nby matching and other kinds of logic.\n\n", + "markdownDescription": "routes: `array` \nModule: `layer4` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Route) \nRoute represents a collection of handlers that are gated\nby matching and other kinds of logic.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Route\nRoute represents a collection of handlers that are gated\nby matching and other kinds of logic.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#Route) \nRoute represents a collection of handlers that are gated\nby matching and other kinds of logic.\n \n", + "type": "object", + "properties": { + "handle": { + "description": "handle: array\nModule: layer4.handlers\n", + "markdownDescription": "handle: `array` \nModule: `layer4.handlers` \n", + "type": "array", + "items": { + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "throttle" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.throttle" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tls" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.tls" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "echo" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.echo" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "proxy" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "proxy_protocol" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.proxy_protocol" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tee" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.tee" + } + }, + { + "properties": { + "handler": { + "description": "key to identify handle module.\nhandler: string\nModule: layer4.handlers", + "markdownDescription": "key to identify `handle` module. \nhandler: `string` \nModule: `layer4.handlers`", + "type": "string", + "enum": [ + "throttle", + "tls", + "echo", + "proxy", + "proxy_protocol", + "subroute", + "tee" + ] + } + } + } + ] + } + }, + "match": { + "description": "match: array\nModule: layer4.matchers\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n\n", + "markdownDescription": "match: `array` \nModule: `layer4.matchers` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n \n", + "properties": { + "http": { + "$ref": "#/definitions/layer4.matchers.http" + }, + "ip": { + "$ref": "#/definitions/layer4.matchers.ip" + }, + "proxy_protocol": { + "$ref": "#/definitions/layer4.matchers.proxy_protocol" + }, + "ssh": { + "$ref": "#/definitions/layer4.matchers.ssh" + }, + "tls": { + "$ref": "#/definitions/layer4.matchers.tls" + }, + "xmpp": { + "$ref": "#/definitions/layer4.matchers.xmpp" + } + } + } + } + } + } + } + } + } + } + } + }, + "layer4.handlers.echo": { + "description": "echo: object\nModule: layer4.handlers.echo\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4echo#Handler\nHandler is a simple handler that writes what it reads.\n\n", + "markdownDescription": "echo: `object` \nModule: `layer4.handlers.echo` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4echo#Handler) \nHandler is a simple handler that writes what it reads.\n \n", + "type": "object" + }, + "layer4.handlers.proxy": { + "description": "proxy: object\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Handler\nHandler is a handler that can proxy connections.\n\n", + "markdownDescription": "proxy: `object` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Handler) \nHandler is a handler that can proxy connections.\n \n", + "type": "object", + "properties": { + "health_checks": { + "description": "health_checks: object\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#HealthChecks\nHealth checks update the status of backends, whether they are\nup or down. Down backends will not be proxied to.\n\n\nHealthChecks configures active and passive health checks.\n", + "markdownDescription": "health_checks: `object` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#HealthChecks) \nHealth checks update the status of backends, whether they are\nup or down. Down backends will not be proxied to.\n\n\nHealthChecks configures active and passive health checks. \n", + "type": "object", + "properties": { + "active": { + "description": "active: object\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#ActiveHealthChecks\nActive health checks run in the background on a timer. To\nminimally enable active health checks, set either path or\nport (or both).\n\n\nActiveHealthChecks holds configuration related to active health\nchecks (that is, health checks which occur independently in a\nbackground goroutine).\n", + "markdownDescription": "active: `object` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#ActiveHealthChecks) \nActive health checks run in the background on a timer. To\nminimally enable active health checks, set either path or\nport (or both).\n\n\nActiveHealthChecks holds configuration related to active health\nchecks (that is, health checks which occur independently in a\nbackground goroutine). \n", + "type": "object", + "properties": { + "interval": { + "description": "interval: number\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow frequently to perform active health checks (default 30s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "interval: `number` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow frequently to perform active health checks (default 30s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "port": { + "description": "port: number\nModule: layer4.handlers.proxy\nThe port to use (if different from the upstream's dial\naddress) for health checks.\n", + "markdownDescription": "port: `number` \nModule: `layer4.handlers.proxy` \nThe port to use (if different from the upstream's dial\naddress) for health checks. \n", + "type": "number" + }, + "timeout": { + "description": "timeout: number\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to wait for a connection to be established with\npeer before considering it unhealthy (default 5s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "timeout: `number` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to wait for a connection to be established with\npeer before considering it unhealthy (default 5s).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "passive": { + "description": "passive: object\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#PassiveHealthChecks\nPassive health checks monitor proxied connections for errors or timeouts.\nTo minimally enable passive health checks, specify at least an empty\nconfig object.\n\n\nPassiveHealthChecks holds configuration related to passive\nhealth checks (that is, health checks which occur during\nthe normal flow of connection proxying).\n", + "markdownDescription": "passive: `object` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#PassiveHealthChecks) \nPassive health checks monitor proxied connections for errors or timeouts.\nTo minimally enable passive health checks, specify at least an empty\nconfig object.\n\n\nPassiveHealthChecks holds configuration related to passive\nhealth checks (that is, health checks which occur during\nthe normal flow of connection proxying). \n", + "type": "object", + "properties": { + "fail_duration": { + "description": "fail_duration: number\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to remember a failed connection to a backend. A\nduration \u003e 0 enables passive health checking. Default 0.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "fail_duration: `number` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to remember a failed connection to a backend. A\nduration \u003e 0 enables passive health checking. Default 0.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "max_fails": { + "description": "max_fails: number\nModule: layer4.handlers.proxy\nThe number of failed connections within the FailDuration window to\nconsider a backend as \"down\". Must be \u003e= 1; default is 1. Requires\nthat FailDuration be \u003e 0.\n", + "markdownDescription": "max_fails: `number` \nModule: `layer4.handlers.proxy` \nThe number of failed connections within the FailDuration window to\nconsider a backend as \"down\". Must be \u003e= 1; default is 1. Requires\nthat FailDuration be \u003e 0. \n", + "type": "number" + }, + "unhealthy_connnection_count": { + "description": "unhealthy_connnection_count: number\nModule: layer4.handlers.proxy\nLimits the number of simultaneous connections to a backend by\nmarking the backend as \"down\" if it has this many or more\nconcurrent connections.\n", + "markdownDescription": "unhealthy_connnection_count: `number` \nModule: `layer4.handlers.proxy` \nLimits the number of simultaneous connections to a backend by\nmarking the backend as \"down\" if it has this many or more\nconcurrent connections. \n", + "type": "number" + } + } + } + } + }, + "load_balancing": { + "description": "load_balancing: object\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#LoadBalancing\nLoad balancing distributes load/connections between backends.\n\n\nLoadBalancing has parameters related to load balancing.\n", + "markdownDescription": "load_balancing: `object` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#LoadBalancing) \nLoad balancing distributes load/connections between backends.\n\n\nLoadBalancing has parameters related to load balancing. \n", + "type": "object", + "properties": { + "selection": { + "description": "selection: object\nModule: layer4.proxy.selection_policies\nA selection policy is how to choose an available backend.\nThe default policy is random selection.\n", + "markdownDescription": "selection: `object` \nModule: `layer4.proxy.selection_policies` \nA selection policy is how to choose an available backend.\nThe default policy is random selection. \n", + "type": "object", + "required": [ + "policy" + ], + "allOf": [ + { + "if": { + "properties": { + "policy": { + "const": "random" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.proxy.selection_policies.random" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "random_choose" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.proxy.selection_policies.random_choose" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "round_robin" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.proxy.selection_policies.round_robin" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "first" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.proxy.selection_policies.first" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "ip_hash" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.proxy.selection_policies.ip_hash" + } + }, + { + "if": { + "properties": { + "policy": { + "const": "least_conn" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.proxy.selection_policies.least_conn" + } + }, + { + "properties": { + "policy": { + "description": "key to identify selection module.\npolicy: string\nModule: layer4.proxy.selection_policies", + "markdownDescription": "key to identify `selection` module. \npolicy: `string` \nModule: `layer4.proxy.selection_policies`", + "type": "string", + "enum": [ + "random", + "random_choose", + "round_robin", + "first", + "ip_hash", + "least_conn" + ] + } + } + } + ] + }, + "try_duration": { + "description": "try_duration: number\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to try selecting available backends for each connection\nif the next available host is down. By default, this retry is\ndisabled. Clients will wait for up to this long while the load\nbalancer tries to find an available upstream host.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "try_duration: `number` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to try selecting available backends for each connection\nif the next available host is down. By default, this retry is\ndisabled. Clients will wait for up to this long while the load\nbalancer tries to find an available upstream host.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "try_interval": { + "description": "try_interval: number\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to wait between selecting the next host from the pool. Default\nis 250ms. Only relevant when a connection to an upstream host fails. Be\naware that setting this to 0 with a non-zero try_duration can cause the\nCPU to spin if all backends are down and latency is very low.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "try_interval: `number` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to wait between selecting the next host from the pool. Default\nis 250ms. Only relevant when a connection to an upstream host fails. Be\naware that setting this to 0 with a non-zero try_duration can cause the\nCPU to spin if all backends are down and latency is very low.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "proxy_protocol": { + "description": "proxy_protocol: string\nModule: layer4.handlers.proxy\nSpecifies the version of the Proxy Protocol header to add, either \"v1\" or \"v2\".\nRef: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt\n", + "markdownDescription": "proxy_protocol: `string` \nModule: `layer4.handlers.proxy` \nSpecifies the version of the Proxy Protocol header to add, either \"v1\" or \"v2\".\nRef: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt \n", + "type": "string" + }, + "upstreams": { + "description": "upstreams: array\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Upstream\nUpstreams is the list of backends to proxy to.\n\n\nUpstream represents a proxy upstream.\n", + "markdownDescription": "upstreams: `array` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Upstream) \nUpstreams is the list of backends to proxy to.\n\n\nUpstream represents a proxy upstream. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Upstream\nUpstreams is the list of backends to proxy to.\n\n\nUpstream represents a proxy upstream.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Upstream) \nUpstreams is the list of backends to proxy to.\n\n\nUpstream represents a proxy upstream. \n", + "type": "object", + "properties": { + "dial": { + "description": "dial: array\nModule: layer4.handlers.proxy\nThe network addresses to dial. Supports placeholders, but not port\nranges currently (each address must be exactly 1 socket).\n", + "markdownDescription": "dial: `array` \nModule: `layer4.handlers.proxy` \nThe network addresses to dial. Supports placeholders, but not port\nranges currently (each address must be exactly 1 socket). \n", + "type": "array", + "items": { + "description": "The network addresses to dial. Supports placeholders, but not port\nranges currently (each address must be exactly 1 socket).\n", + "markdownDescription": "The network addresses to dial. Supports placeholders, but not port\nranges currently (each address must be exactly 1 socket). \n", + "type": "string" + } + }, + "max_connections": { + "description": "max_connections: number\nModule: layer4.handlers.proxy\nHow many connections this upstream is allowed to\nhave before being marked as unhealthy (if \u003e 0).\n", + "markdownDescription": "max_connections: `number` \nModule: `layer4.handlers.proxy` \nHow many connections this upstream is allowed to\nhave before being marked as unhealthy (if \u003e 0). \n", + "type": "number" + }, + "tls": { + "description": "tls: object\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#TLSConfig\nSet this field to enable TLS to the upstream.\n\n\nTLSConfig holds configuration related to the TLS configuration for the\ntransport/client.\n", + "markdownDescription": "tls: `object` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy#TLSConfig) \nSet this field to enable TLS to the upstream.\n\n\nTLSConfig holds configuration related to the TLS configuration for the\ntransport/client. \n", + "type": "object", + "properties": { + "client_certificate_automate": { + "description": "client_certificate_automate: string\nModule: layer4.handlers.proxy\nIf specified, Caddy will use and automate a client certificate\nwith this subject name.\n", + "markdownDescription": "client_certificate_automate: `string` \nModule: `layer4.handlers.proxy` \nIf specified, Caddy will use and automate a client certificate\nwith this subject name. \n", + "type": "string" + }, + "client_certificate_file": { + "description": "client_certificate_file: string\nModule: layer4.handlers.proxy\nPEM-encoded client certificate filename to present to servers.\n", + "markdownDescription": "client_certificate_file: `string` \nModule: `layer4.handlers.proxy` \nPEM-encoded client certificate filename to present to servers. \n", + "type": "string" + }, + "client_certificate_key_file": { + "description": "client_certificate_key_file: string\nModule: layer4.handlers.proxy\nPEM-encoded key to use with the client certificate.\n", + "markdownDescription": "client_certificate_key_file: `string` \nModule: `layer4.handlers.proxy` \nPEM-encoded key to use with the client certificate. \n", + "type": "string" + }, + "except_ports": { + "description": "except_ports: array\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Handler", + "markdownDescription": "except_ports: `array` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Handler)", + "type": "array", + "items": { + "type": "string" + } + }, + "handshake_timeout": { + "description": "handshake_timeout: number\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nThe duration to allow a TLS handshake to a server. Default: No timeout.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "handshake_timeout: `number` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nThe duration to allow a TLS handshake to a server. Default: No timeout.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "insecure_skip_verify": { + "description": "insecure_skip_verify: boolean\nModule: layer4.handlers.proxy\nIf true, TLS verification of server certificates will be disabled.\nThis is insecure and may be removed in the future. Do not use this\noption except in testing or local development environments.\n", + "markdownDescription": "insecure_skip_verify: `boolean` \nModule: `layer4.handlers.proxy` \nIf true, TLS verification of server certificates will be disabled.\nThis is insecure and may be removed in the future. Do not use this\noption except in testing or local development environments. \n", + "type": "boolean" + }, + "renegotiation": { + "description": "renegotiation: string\nModule: layer4.handlers.proxy\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Handler", + "markdownDescription": "renegotiation: `string` \nModule: `layer4.handlers.proxy` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#Handler)", + "type": "string" + }, + "root_ca_pem_files": { + "description": "root_ca_pem_files: array\nModule: layer4.handlers.proxy\nList of PEM-encoded CA certificate files to add to the same trust\nstore as RootCAPool (or root_ca_pool in the JSON).\n", + "markdownDescription": "root_ca_pem_files: `array` \nModule: `layer4.handlers.proxy` \nList of PEM-encoded CA certificate files to add to the same trust\nstore as RootCAPool (or root_ca_pool in the JSON). \n", + "type": "array", + "items": { + "description": "List of PEM-encoded CA certificate files to add to the same trust\nstore as RootCAPool (or root_ca_pool in the JSON).\n", + "markdownDescription": "List of PEM-encoded CA certificate files to add to the same trust\nstore as RootCAPool (or root_ca_pool in the JSON). \n", + "type": "string" + } + }, + "root_ca_pool": { + "description": "root_ca_pool: array\nModule: layer4.handlers.proxy\nOptional list of base64-encoded DER-encoded CA certificates to trust.\n", + "markdownDescription": "root_ca_pool: `array` \nModule: `layer4.handlers.proxy` \nOptional list of base64-encoded DER-encoded CA certificates to trust. \n", + "type": "array", + "items": { + "description": "Optional list of base64-encoded DER-encoded CA certificates to trust.\n", + "markdownDescription": "Optional list of base64-encoded DER-encoded CA certificates to trust. \n", + "type": "string" + } + }, + "server_name": { + "description": "server_name: string\nModule: layer4.handlers.proxy\nThe server name (SNI) to use in TLS handshakes.\n", + "markdownDescription": "server_name: `string` \nModule: `layer4.handlers.proxy` \nThe server name (SNI) to use in TLS handshakes. \n", + "type": "string" + } + } + } + } + } + } + } + }, + "layer4.handlers.proxy_protocol": { + "description": "proxy_protocol: object\nModule: layer4.handlers.proxy_protocol\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxyprotocol#Handler\nHandler is a connection handler that accepts the PROXY protocol.\n\n", + "markdownDescription": "proxy_protocol: `object` \nModule: `layer4.handlers.proxy_protocol` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxyprotocol#Handler) \nHandler is a connection handler that accepts the PROXY protocol.\n \n", + "type": "object", + "properties": { + "allow": { + "description": "allow: array\nModule: layer4.handlers.proxy_protocol\nAn optional list of CIDR ranges to allow/require PROXY headers from.\n", + "markdownDescription": "allow: `array` \nModule: `layer4.handlers.proxy_protocol` \nAn optional list of CIDR ranges to allow/require PROXY headers from. \n", + "type": "array", + "items": { + "description": "An optional list of CIDR ranges to allow/require PROXY headers from.\n", + "markdownDescription": "An optional list of CIDR ranges to allow/require PROXY headers from. \n", + "type": "string" + } + }, + "timeout": { + "description": "timeout: number\nModule: layer4.handlers.proxy_protocol\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to wait for the PROXY protocol header to be received.\nDefaults to zero, which means timeout is disabled.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "timeout: `number` \nModule: `layer4.handlers.proxy_protocol` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to wait for the PROXY protocol header to be received.\nDefaults to zero, which means timeout is disabled.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "layer4.handlers.subroute": { + "description": "subroute: object\nModule: layer4.handlers.subroute\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4subroute#Handler", + "markdownDescription": "subroute: `object` \nModule: `layer4.handlers.subroute` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4subroute#Handler)", + "type": "object", + "properties": { + "routes": { + "description": "routes: array\nModule: layer4.handlers.subroute\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4subroute#Handler", + "markdownDescription": "routes: `array` \nModule: `layer4.handlers.subroute` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4subroute#Handler)", + "type": "array", + "items": { + "type": "object", + "properties": { + "handle": { + "description": "handle: array\nModule: layer4.handlers", + "markdownDescription": "handle: `array` \nModule: `layer4.handlers`", + "type": "array", + "items": { + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "echo" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.echo" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "proxy" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "proxy_protocol" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.proxy_protocol" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tee" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.tee" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "throttle" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.throttle" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tls" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.tls" + } + }, + { + "properties": { + "handler": { + "description": "key to identify handle module.\nhandler: string\nModule: layer4.handlers", + "markdownDescription": "key to identify `handle` module. \nhandler: `string` \nModule: `layer4.handlers`", + "type": "string", + "enum": [ + "echo", + "proxy", + "proxy_protocol", + "subroute", + "tee", + "throttle", + "tls" + ] + } + } + } + ] + } + }, + "match": { + "description": "match: array\nModule: layer4.matchers", + "markdownDescription": "match: `array` \nModule: `layer4.matchers`", + "type": "array", + "items": { + "properties": { + "http": { + "$ref": "#/definitions/layer4.matchers.http" + }, + "ip": { + "$ref": "#/definitions/layer4.matchers.ip" + }, + "proxy_protocol": { + "$ref": "#/definitions/layer4.matchers.proxy_protocol" + }, + "ssh": { + "$ref": "#/definitions/layer4.matchers.ssh" + }, + "tls": { + "$ref": "#/definitions/layer4.matchers.tls" + }, + "xmpp": { + "$ref": "#/definitions/layer4.matchers.xmpp" + } + } + } + } + } + } + } + } + }, + "layer4.handlers.tee": { + "description": "tee: object\nModule: layer4.handlers.tee\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tee#Handler\nHandler is a layer4 handler that replicates a connection so\nthat a branch of handlers can concurrently handle it. Reads\nhappen in lock-step with all concurrent branches so as to\navoid buffering: if one of the branches (including the main\nhandler chain) stops reading from the connection, it will\nblock all branches.\n\n", + "markdownDescription": "tee: `object` \nModule: `layer4.handlers.tee` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tee#Handler) \nHandler is a layer4 handler that replicates a connection so\nthat a branch of handlers can concurrently handle it. Reads\nhappen in lock-step with all concurrent branches so as to\navoid buffering: if one of the branches (including the main\nhandler chain) stops reading from the connection, it will\nblock all branches.\n \n", + "type": "object", + "properties": { + "branch": { + "description": "branch: array\nModule: layer4.handlers\nHandlers is the list of handlers that constitute this\nconcurrent branch. Any handlers that do connection\nmatching (which involves recording and rewinding the\nstream) are unsafe to tee, so do all connection\nmatching before teeing.\n", + "markdownDescription": "branch: `array` \nModule: `layer4.handlers` \nHandlers is the list of handlers that constitute this\nconcurrent branch. Any handlers that do connection\nmatching (which involves recording and rewinding the\nstream) are unsafe to tee, so do all connection\nmatching before teeing. \n", + "type": "array", + "items": { + "description": "Handlers is the list of handlers that constitute this\nconcurrent branch. Any handlers that do connection\nmatching (which involves recording and rewinding the\nstream) are unsafe to tee, so do all connection\nmatching before teeing.\n", + "markdownDescription": "Handlers is the list of handlers that constitute this\nconcurrent branch. Any handlers that do connection\nmatching (which involves recording and rewinding the\nstream) are unsafe to tee, so do all connection\nmatching before teeing. \n", + "required": [ + "handler" + ], + "allOf": [ + { + "if": { + "properties": { + "handler": { + "const": "subroute" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.subroute" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tee" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.tee" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "throttle" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.throttle" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "tls" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.tls" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "echo" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.echo" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "proxy" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.proxy" + } + }, + { + "if": { + "properties": { + "handler": { + "const": "proxy_protocol" + } + } + }, + "then": { + "$ref": "#/definitions/layer4.handlers.proxy_protocol" + } + }, + { + "properties": { + "handler": { + "description": "key to identify branch module.\nhandler: string\nModule: layer4.handlers", + "markdownDescription": "key to identify `branch` module. \nhandler: `string` \nModule: `layer4.handlers`", + "type": "string", + "enum": [ + "subroute", + "tee", + "throttle", + "tls", + "echo", + "proxy", + "proxy_protocol" + ] + } + } + } + ] + } + } + } + }, + "layer4.handlers.throttle": { + "description": "throttle: object\nModule: layer4.handlers.throttle\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4throttle#Handler\nHandler throttles connections using leaky bucket rate limiting.\n\n", + "markdownDescription": "throttle: `object` \nModule: `layer4.handlers.throttle` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4throttle#Handler) \nHandler throttles connections using leaky bucket rate limiting.\n \n", + "type": "object", + "properties": { + "latency": { + "description": "latency: number\nModule: layer4.handlers.throttle\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nDelay before initial read on each connection.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "latency: `number` \nModule: `layer4.handlers.throttle` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nDelay before initial read on each connection.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "read_burst_size": { + "description": "read_burst_size: number\nModule: layer4.handlers.throttle\nThe maximum number of bytes to read at once (rate permitting) per connection.\nIf a rate is specified, burst must be greater than zero; default is same as\nthe rate (truncated to integer).\n", + "markdownDescription": "read_burst_size: `number` \nModule: `layer4.handlers.throttle` \nThe maximum number of bytes to read at once (rate permitting) per connection.\nIf a rate is specified, burst must be greater than zero; default is same as\nthe rate (truncated to integer). \n", + "type": "number" + }, + "read_bytes_per_second": { + "description": "read_bytes_per_second: object\nModule: layer4.handlers.throttle\nThe number of bytes to read per second, per connection.\n", + "markdownDescription": "read_bytes_per_second: `object` \nModule: `layer4.handlers.throttle` \nThe number of bytes to read per second, per connection. \n", + "type": "object" + }, + "total_read_burst_size": { + "description": "total_read_burst_size: number\nModule: layer4.handlers.throttle\nThe maximum number of bytes to read at once (rate permitting) across all\nconnections (\"per handler\"). If a rate is specified, burst must be greater\nthan zero; default is same as the rate (truncated to integer).\n", + "markdownDescription": "total_read_burst_size: `number` \nModule: `layer4.handlers.throttle` \nThe maximum number of bytes to read at once (rate permitting) across all\nconnections (\"per handler\"). If a rate is specified, burst must be greater\nthan zero; default is same as the rate (truncated to integer). \n", + "type": "number" + }, + "total_read_bytes_per_second": { + "description": "total_read_bytes_per_second: object\nModule: layer4.handlers.throttle\nThe number of bytes to read per second, across all connections (\"per handler\").\n", + "markdownDescription": "total_read_bytes_per_second: `object` \nModule: `layer4.handlers.throttle` \nThe number of bytes to read per second, across all connections (\"per handler\"). \n", + "type": "object" + } + } + }, + "layer4.handlers.tls": { + "description": "tls: object\nModule: layer4.handlers.tls\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tls#Handler\nHandler is a connection handler that terminates TLS.\n\n", + "markdownDescription": "tls: `object` \nModule: `layer4.handlers.tls` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tls#Handler) \nHandler is a connection handler that terminates TLS.\n \n", + "type": "object", + "properties": { + "connection_policies": { + "description": "connection_policies: array\nModule: layer4.handlers.tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy\nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used.\n\n", + "markdownDescription": "connection_policies: `array` \nModule: `layer4.handlers.tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy) \nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy\nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ConnectionPolicy) \nConnectionPolicy specifies the logic for handling a TLS handshake.\nAn empty policy is valid; safe and sensible defaults will be used.\n \n", + "type": "object", + "properties": { + "alpn": { + "description": "alpn: array\nModule: layer4.handlers.tls\nProtocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake.\n", + "markdownDescription": "alpn: `array` \nModule: `layer4.handlers.tls` \nProtocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake. \n", + "type": "array", + "items": { + "description": "Protocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake.\n", + "markdownDescription": "Protocols to use for Application-Layer Protocol\nNegotiation (ALPN) during the handshake. \n", + "type": "string" + } + }, + "certificate_selection": { + "description": "certificate_selection: object\nModule: layer4.handlers.tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CustomCertSelectionPolicy\nHow to choose a certificate if more than one matched\nthe given ServerName (SNI) value.\n\n\nCustomCertSelectionPolicy represents a policy for selecting the certificate\nused to complete a handshake when there may be multiple options. All fields\nspecified must match the candidate certificate for it to be chosen.\nThis was needed to solve https://github.com/caddyserver/caddy/issues/2588.\n", + "markdownDescription": "certificate_selection: `object` \nModule: `layer4.handlers.tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CustomCertSelectionPolicy) \nHow to choose a certificate if more than one matched\nthe given ServerName (SNI) value.\n\n\nCustomCertSelectionPolicy represents a policy for selecting the certificate\nused to complete a handshake when there may be multiple options. All fields\nspecified must match the candidate certificate for it to be chosen.\nThis was needed to solve https://github.com/caddyserver/caddy/issues/2588. \n", + "type": "object", + "properties": { + "all_tags": { + "description": "all_tags: array\nModule: layer4.handlers.tls\nThe certificate must have all of the tags in the list.\n", + "markdownDescription": "all_tags: `array` \nModule: `layer4.handlers.tls` \nThe certificate must have all of the tags in the list. \n", + "type": "array", + "items": { + "description": "The certificate must have all of the tags in the list.\n", + "markdownDescription": "The certificate must have all of the tags in the list. \n", + "type": "string" + } + }, + "any_tag": { + "description": "any_tag: array\nModule: layer4.handlers.tls\nThe certificate must have at least one of the tags in the list.\n", + "markdownDescription": "any_tag: `array` \nModule: `layer4.handlers.tls` \nThe certificate must have at least one of the tags in the list. \n", + "type": "array", + "items": { + "description": "The certificate must have at least one of the tags in the list.\n", + "markdownDescription": "The certificate must have at least one of the tags in the list. \n", + "type": "string" + } + }, + "public_key_algorithm": { + "description": "public_key_algorithm: number\nModule: layer4.handlers.tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#PublicKeyAlgorithm\nThe certificate must use this public key algorithm.\n\n\nPublicKeyAlgorithm is a JSON-unmarshalable wrapper type.\n", + "markdownDescription": "public_key_algorithm: `number` \nModule: `layer4.handlers.tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#PublicKeyAlgorithm) \nThe certificate must use this public key algorithm.\n\n\nPublicKeyAlgorithm is a JSON-unmarshalable wrapper type. \n", + "type": "number" + }, + "serial_number": { + "description": "serial_number: array\nModule: layer4.handlers.tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt\nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string.\n", + "markdownDescription": "serial_number: `array` \nModule: `layer4.handlers.tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt) \nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt\nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#bigInt) \nThe certificate must have one of these serial numbers.\n\n\nbigInt is a big.Int type that interops with JSON encodings as a string. \n", + "type": "object" + } + }, + "subject_organization": { + "description": "subject_organization: array\nModule: layer4.handlers.tls\nThe certificate must have one of these organization names.\n", + "markdownDescription": "subject_organization: `array` \nModule: `layer4.handlers.tls` \nThe certificate must have one of these organization names. \n", + "type": "array", + "items": { + "description": "The certificate must have one of these organization names.\n", + "markdownDescription": "The certificate must have one of these organization names. \n", + "type": "string" + } + } + } + }, + "cipher_suites": { + "description": "cipher_suites: array\nModule: layer4.handlers.tls\nThe list of cipher suites to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "cipher_suites: `array` \nModule: `layer4.handlers.tls` \nThe list of cipher suites to support. Caddy's\ndefaults are modern and secure. \n", + "type": "array", + "items": { + "description": "The list of cipher suites to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "The list of cipher suites to support. Caddy's\ndefaults are modern and secure. \n", + "type": "string" + } + }, + "client_authentication": { + "description": "client_authentication: object\nModule: layer4.handlers.tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ClientAuthentication\nEnables and configures TLS client authentication.\n\n\nClientAuthentication configures TLS client auth.\n", + "markdownDescription": "client_authentication: `object` \nModule: `layer4.handlers.tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ClientAuthentication) \nEnables and configures TLS client authentication.\n\n\nClientAuthentication configures TLS client auth. \n", + "type": "object", + "properties": { + "mode": { + "description": "mode: string\nModule: layer4.handlers.tls\nThe mode for authenticating the client. Allowed values are:\n\nMode | Description\n-----|---------------\n`request` | Ask clients for a certificate, but allow even if there isn't one; do not verify it\n`require` | Require clients to present a certificate, but do not verify it\n`verify_if_given` | Ask clients for a certificate; allow even if there isn't one, but verify it if there is\n`require_and_verify` | Require clients to present a valid certificate that is verified\n\nThe default mode is `require_and_verify` if any\nTrustedCACerts or TrustedCACertPEMFiles or TrustedLeafCerts\nare provided; otherwise, the default mode is `require`.\n", + "markdownDescription": "mode: `string` \nModule: `layer4.handlers.tls` \nThe mode for authenticating the client. Allowed values are:\n\nMode | Description\n-----|---------------\n`request` | Ask clients for a certificate, but allow even if there isn't one; do not verify it\n`require` | Require clients to present a certificate, but do not verify it\n`verify_if_given` | Ask clients for a certificate; allow even if there isn't one, but verify it if there is\n`require_and_verify` | Require clients to present a valid certificate that is verified\n\nThe default mode is `require_and_verify` if any\nTrustedCACerts or TrustedCACertPEMFiles or TrustedLeafCerts\nare provided; otherwise, the default mode is `require`. \n", + "type": "string" + }, + "trusted_ca_certs": { + "description": "trusted_ca_certs: array\nModule: layer4.handlers.tls\nA list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected.\n", + "markdownDescription": "trusted_ca_certs: `array` \nModule: `layer4.handlers.tls` \nA list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected. \n", + "type": "array", + "items": { + "description": "A list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected.\n", + "markdownDescription": "A list of base64 DER-encoded CA certificates\nagainst which to validate client certificates.\nClient certs which are not signed by any of\nthese CAs will be rejected. \n", + "type": "string" + } + }, + "trusted_ca_certs_pem_files": { + "description": "trusted_ca_certs_pem_files: array\nModule: layer4.handlers.tls\nTrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected.\n", + "markdownDescription": "trusted_ca_certs_pem_files: `array` \nModule: `layer4.handlers.tls` \nTrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected. \n", + "type": "array", + "items": { + "description": "TrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected.\n", + "markdownDescription": "TrustedCACertPEMFiles is a list of PEM file names\nfrom which to load certificates of trusted CAs.\nClient certificates which are not signed by any of\nthese CA certificates will be rejected. \n", + "type": "string" + } + }, + "trusted_leaf_certs": { + "description": "trusted_leaf_certs: array\nModule: layer4.handlers.tls\nA list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected.\n", + "markdownDescription": "trusted_leaf_certs: `array` \nModule: `layer4.handlers.tls` \nA list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected. \n", + "type": "array", + "items": { + "description": "A list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected.\n", + "markdownDescription": "A list of base64 DER-encoded client leaf certs\nto accept. If this list is not empty, client certs\nwhich are not in this list will be rejected. \n", + "type": "string" + } + }, + "verifiers": { + "description": "verifiers: array\nModule: tls.client_auth", + "markdownDescription": "verifiers: `array` \nModule: `tls.client_auth`", + "type": "array", + "items": { + "required": [ + "verifier" + ], + "allOf": [ + { + "if": { + "properties": { + "verifier": { + "const": "leaf" + } + } + }, + "then": { + "$ref": "#/definitions/tls.client_auth.leaf" + } + }, + { + "properties": { + "verifier": { + "description": "key to identify verifiers module.\nverifier: string\nModule: tls.client_auth", + "markdownDescription": "key to identify `verifiers` module. \nverifier: `string` \nModule: `tls.client_auth`", + "type": "string", + "enum": [ + "leaf" + ] + } + } + } + ] + } + } + } + }, + "curves": { + "description": "curves: array\nModule: layer4.handlers.tls\nThe list of elliptic curves to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "curves: `array` \nModule: `layer4.handlers.tls` \nThe list of elliptic curves to support. Caddy's\ndefaults are modern and secure. \n", + "type": "array", + "items": { + "description": "The list of elliptic curves to support. Caddy's\ndefaults are modern and secure.\n", + "markdownDescription": "The list of elliptic curves to support. Caddy's\ndefaults are modern and secure. \n", + "type": "string" + } + }, + "default_sni": { + "description": "default_sni: string\nModule: layer4.handlers.tls\nDefaultSNI becomes the ServerName in a ClientHello if there\nis no policy configured for the empty SNI value.\n", + "markdownDescription": "default_sni: `string` \nModule: `layer4.handlers.tls` \nDefaultSNI becomes the ServerName in a ClientHello if there\nis no policy configured for the empty SNI value. \n", + "type": "string" + }, + "match": { + "description": "match: object\nModule: tls.handshake_match\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nHow to match this policy with a TLS ClientHello. If\nthis policy is the first to match, it will be used.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "match: `object` \nModule: `tls.handshake_match` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nHow to match this policy with a TLS ClientHello. If\nthis policy is the first to match, it will be used.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "object", + "properties": { + "alpn": { + "$ref": "#/definitions/tls.handshake_match.alpn" + }, + "remote_ip": { + "$ref": "#/definitions/tls.handshake_match.remote_ip" + }, + "sni": { + "$ref": "#/definitions/tls.handshake_match.sni" + } + } + }, + "protocol_max": { + "description": "protocol_max: string\nModule: layer4.handlers.tls\nMaximum TLS protocol version to allow. Default: `tls1.3`\n", + "markdownDescription": "protocol_max: `string` \nModule: `layer4.handlers.tls` \nMaximum TLS protocol version to allow. Default: `tls1.3` \n", + "type": "string" + }, + "protocol_min": { + "description": "protocol_min: string\nModule: layer4.handlers.tls\nMinimum TLS protocol version to allow. Default: `tls1.2`\n", + "markdownDescription": "protocol_min: `string` \nModule: `layer4.handlers.tls` \nMinimum TLS protocol version to allow. Default: `tls1.2` \n", + "type": "string" + } + } + } + } + } + }, + "layer4.matchers.http": { + "description": "http: any\nModule: layer4.matchers.http\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4http#MatchHTTP\nMatchHTTP is able to match HTTP connections. The auto-generated\ndocumentation for this type is wrong; instead of an object, it\nis an array of matcher set objects.\n\n", + "markdownDescription": "http: `any` \nModule: `layer4.matchers.http` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4http#MatchHTTP) \nMatchHTTP is able to match HTTP connections. The auto-generated\ndocumentation for this type is wrong; instead of an object, it\nis an array of matcher set objects.\n \n" + }, + "layer4.matchers.ip": { + "description": "ip: object\nModule: layer4.matchers.ip\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/layer4#MatchIP\nMatchIP matches requests by remote IP (or CIDR range).\n\n", + "markdownDescription": "ip: `object` \nModule: `layer4.matchers.ip` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/layer4#MatchIP) \nMatchIP matches requests by remote IP (or CIDR range).\n \n", + "type": "object", + "properties": { + "ranges": { + "description": "ranges: array\nModule: layer4.matchers.ip\n", + "markdownDescription": "ranges: `array` \nModule: `layer4.matchers.ip` \n", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "layer4.matchers.proxy_protocol": { + "description": "proxy_protocol: object\nModule: layer4.matchers.proxy_protocol\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxyprotocol#MatchProxyProtocol", + "markdownDescription": "proxy_protocol: `object` \nModule: `layer4.matchers.proxy_protocol` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxyprotocol#MatchProxyProtocol)", + "type": "object" + }, + "layer4.matchers.ssh": { + "description": "ssh: object\nModule: layer4.matchers.ssh\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4ssh#MatchSSH\nMatchSSH is able to match SSH connections.\n\n", + "markdownDescription": "ssh: `object` \nModule: `layer4.matchers.ssh` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4ssh#MatchSSH) \nMatchSSH is able to match SSH connections.\n \n", + "type": "object" + }, + "layer4.matchers.tls": { + "description": "tls: any\nModule: layer4.matchers.tls\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tls#MatchTLS\nMatchTLS is able to match TLS connections. Its structure\nis different from the auto-generated documentation. This\nvalue should be a map of matcher names to their values.\n\n", + "markdownDescription": "tls: `any` \nModule: `layer4.matchers.tls` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tls#MatchTLS) \nMatchTLS is able to match TLS connections. Its structure\nis different from the auto-generated documentation. This\nvalue should be a map of matcher names to their values.\n \n" + }, + "layer4.matchers.xmpp": { + "description": "xmpp: object\nModule: layer4.matchers.xmpp\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4xmpp#MatchXMPP\nMatchXMPP is able to match XMPP connections.\n\n", + "markdownDescription": "xmpp: `object` \nModule: `layer4.matchers.xmpp` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4xmpp#MatchXMPP) \nMatchXMPP is able to match XMPP connections.\n \n", + "type": "object" + }, + "layer4.proxy.selection_policies.first": { + "description": "first: object\nModule: layer4.proxy.selection_policies.first\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#FirstSelection", + "markdownDescription": "first: `object` \nModule: `layer4.proxy.selection_policies.first` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#FirstSelection)", + "type": "object" + }, + "layer4.proxy.selection_policies.ip_hash": { + "description": "ip_hash: object\nModule: layer4.proxy.selection_policies.ip_hash\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#IPHashSelection", + "markdownDescription": "ip_hash: `object` \nModule: `layer4.proxy.selection_policies.ip_hash` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#IPHashSelection)", + "type": "object" + }, + "layer4.proxy.selection_policies.least_conn": { + "description": "least_conn: object\nModule: layer4.proxy.selection_policies.least_conn\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#LeastConnSelection", + "markdownDescription": "least_conn: `object` \nModule: `layer4.proxy.selection_policies.least_conn` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#LeastConnSelection)", + "type": "object" + }, + "layer4.proxy.selection_policies.random": { + "description": "random: object\nModule: layer4.proxy.selection_policies.random\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RandomSelection", + "markdownDescription": "random: `object` \nModule: `layer4.proxy.selection_policies.random` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RandomSelection)", + "type": "object" + }, + "layer4.proxy.selection_policies.random_choose": { + "description": "random_choose: object\nModule: layer4.proxy.selection_policies.random_choose\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RandomChoiceSelection", + "markdownDescription": "random_choose: `object` \nModule: `layer4.proxy.selection_policies.random_choose` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RandomChoiceSelection)", + "type": "object", + "properties": { + "choose": { + "description": "choose: number\nModule: layer4.proxy.selection_policies.random_choose\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RandomChoiceSelection", + "markdownDescription": "choose: `number` \nModule: `layer4.proxy.selection_policies.random_choose` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RandomChoiceSelection)", + "type": "number" + } + } + }, + "layer4.proxy.selection_policies.round_robin": { + "description": "round_robin: object\nModule: layer4.proxy.selection_policies.round_robin\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RoundRobinSelection", + "markdownDescription": "round_robin: `object` \nModule: `layer4.proxy.selection_policies.round_robin` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4proxy#RoundRobinSelection)", + "type": "object" + }, + "pki": { + "description": "pki: object\nModule: pki\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#PKI\nPKI provides Public Key Infrastructure facilities for Caddy.\n\nThis app can define certificate authorities (CAs) which are capable\nof signing certificates. Other modules can be configured to use\nthe CAs defined by this app for issuing certificates or getting\nkey information needed for establishing trust.\n\n", + "markdownDescription": "pki: `object` \nModule: `pki` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#PKI) \nPKI provides Public Key Infrastructure facilities for Caddy.\n\nThis app can define certificate authorities (CAs) which are capable\nof signing certificates. Other modules can be configured to use\nthe CAs defined by this app for issuing certificates or getting\nkey information needed for establishing trust.\n \n", + "type": "object", + "properties": { + "certificate_authorities": { + "description": "certificate_authorities: object\nModule: pki\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#CA\nThe certificate authorities to manage. Each CA is keyed by an\nID that is used to uniquely identify it from other CAs.\nAt runtime, the GetCA() method should be used instead to ensure\nthe default CA is provisioned if it hadn't already been.\nThe default CA ID is \"local\".\n\n\nCA describes a certificate authority, which consists of\nroot/signing certificates and various settings pertaining\nto the issuance of certificates and trusting them.\n", + "markdownDescription": "certificate_authorities: `object` \nModule: `pki` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#CA) \nThe certificate authorities to manage. Each CA is keyed by an\nID that is used to uniquely identify it from other CAs.\nAt runtime, the GetCA() method should be used instead to ensure\nthe default CA is provisioned if it hadn't already been.\nThe default CA ID is \"local\".\n\n\nCA describes a certificate authority, which consists of\nroot/signing certificates and various settings pertaining\nto the issuance of certificates and trusting them. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#CA\nThe certificate authorities to manage. Each CA is keyed by an\nID that is used to uniquely identify it from other CAs.\nAt runtime, the GetCA() method should be used instead to ensure\nthe default CA is provisioned if it hadn't already been.\nThe default CA ID is \"local\".\n\n\nCA describes a certificate authority, which consists of\nroot/signing certificates and various settings pertaining\nto the issuance of certificates and trusting them.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#CA) \nThe certificate authorities to manage. Each CA is keyed by an\nID that is used to uniquely identify it from other CAs.\nAt runtime, the GetCA() method should be used instead to ensure\nthe default CA is provisioned if it hadn't already been.\nThe default CA ID is \"local\".\n\n\nCA describes a certificate authority, which consists of\nroot/signing certificates and various settings pertaining\nto the issuance of certificates and trusting them. \n", + "properties": { + "install_trust": { + "description": "install_trust: boolean\nModule: pki\nWhether Caddy will attempt to install the CA's root\ninto the system trust store, as well as into Java\nand Mozilla Firefox trust stores. Default: true.\n", + "markdownDescription": "install_trust: `boolean` \nModule: `pki` \nWhether Caddy will attempt to install the CA's root\ninto the system trust store, as well as into Java\nand Mozilla Firefox trust stores. Default: true. \n", + "type": "boolean" + }, + "intermediate": { + "description": "intermediate: object\nModule: pki\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#KeyPair\nThe intermediate (signing) certificate; if null, one will be generated.\n\n\nKeyPair represents a public-private key pair, where the\npublic key is also called a certificate.\n", + "markdownDescription": "intermediate: `object` \nModule: `pki` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#KeyPair) \nThe intermediate (signing) certificate; if null, one will be generated.\n\n\nKeyPair represents a public-private key pair, where the\npublic key is also called a certificate. \n", + "type": "object", + "properties": { + "certificate": { + "description": "certificate: string\nModule: pki\nThe certificate. By default, this should be the path to\na PEM file unless format is something else.\n", + "markdownDescription": "certificate: `string` \nModule: `pki` \nThe certificate. By default, this should be the path to\na PEM file unless format is something else. \n", + "type": "string" + }, + "format": { + "description": "format: string\nModule: pki\nThe format in which the certificate and private\nkey are provided. Default: pem_file\n", + "markdownDescription": "format: `string` \nModule: `pki` \nThe format in which the certificate and private\nkey are provided. Default: pem_file \n", + "type": "string" + }, + "private_key": { + "description": "private_key: string\nModule: pki\nThe private key. By default, this should be the path to\na PEM file unless format is something else.\n", + "markdownDescription": "private_key: `string` \nModule: `pki` \nThe private key. By default, this should be the path to\na PEM file unless format is something else. \n", + "type": "string" + } + } + }, + "intermediate_common_name": { + "description": "intermediate_common_name: string\nModule: pki\nThe name to put in the CommonName field of the\nintermediate certificates.\n", + "markdownDescription": "intermediate_common_name: `string` \nModule: `pki` \nThe name to put in the CommonName field of the\nintermediate certificates. \n", + "type": "string" + }, + "name": { + "description": "name: string\nModule: pki\nThe user-facing name of the certificate authority.\n", + "markdownDescription": "name: `string` \nModule: `pki` \nThe user-facing name of the certificate authority. \n", + "type": "string" + }, + "root": { + "description": "root: object\nModule: pki\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#KeyPair\nThe root certificate to use; if null, one will be generated.\n\n\nKeyPair represents a public-private key pair, where the\npublic key is also called a certificate.\n", + "markdownDescription": "root: `object` \nModule: `pki` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddypki#KeyPair) \nThe root certificate to use; if null, one will be generated.\n\n\nKeyPair represents a public-private key pair, where the\npublic key is also called a certificate. \n", + "type": "object", + "properties": { + "certificate": { + "description": "certificate: string\nModule: pki\nThe certificate. By default, this should be the path to\na PEM file unless format is something else.\n", + "markdownDescription": "certificate: `string` \nModule: `pki` \nThe certificate. By default, this should be the path to\na PEM file unless format is something else. \n", + "type": "string" + }, + "format": { + "description": "format: string\nModule: pki\nThe format in which the certificate and private\nkey are provided. Default: pem_file\n", + "markdownDescription": "format: `string` \nModule: `pki` \nThe format in which the certificate and private\nkey are provided. Default: pem_file \n", + "type": "string" + }, + "private_key": { + "description": "private_key: string\nModule: pki\nThe private key. By default, this should be the path to\na PEM file unless format is something else.\n", + "markdownDescription": "private_key: `string` \nModule: `pki` \nThe private key. By default, this should be the path to\na PEM file unless format is something else. \n", + "type": "string" + } + } + }, + "root_common_name": { + "description": "root_common_name: string\nModule: pki\nThe name to put in the CommonName field of the\nroot certificate.\n", + "markdownDescription": "root_common_name: `string` \nModule: `pki` \nThe name to put in the CommonName field of the\nroot certificate. \n", + "type": "string" + }, + "storage": { + "description": "storage: object\nModule: caddy.storage\nOptionally configure a separate storage module associated with this\nissuer, instead of using Caddy's global/default-configured storage.\nThis can be useful if you want to keep your signing keys in a\nseparate location from your leaf certificates.\n", + "markdownDescription": "storage: `object` \nModule: `caddy.storage` \nOptionally configure a separate storage module associated with this\nissuer, instead of using Caddy's global/default-configured storage.\nThis can be useful if you want to keep your signing keys in a\nseparate location from your leaf certificates. \n", + "type": "object", + "required": [ + "module" + ], + "allOf": [ + { + "if": { + "properties": { + "module": { + "const": "consul" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.consul" + } + }, + { + "if": { + "properties": { + "module": { + "const": "file_system" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.file_system" + } + }, + { + "properties": { + "module": { + "description": "key to identify storage module.\nmodule: string\nModule: caddy.storage", + "markdownDescription": "key to identify `storage` module. \nmodule: `string` \nModule: `caddy.storage`", + "type": "string", + "enum": [ + "consul", + "file_system" + ] + } + } + } + ] + } + } + } + } + } + }, + "tls": { + "description": "tls: object\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#TLS\nTLS provides TLS facilities including certificate\nloading and management, client auth, and more.\n\n", + "markdownDescription": "tls: `object` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#TLS) \nTLS provides TLS facilities including certificate\nloading and management, client auth, and more.\n \n", + "type": "object", + "properties": { + "automation": { + "description": "automation: object\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomationConfig\nConfigures certificate automation.\n\n\nAutomationConfig governs the automated management of TLS certificates.\n", + "markdownDescription": "automation: `object` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomationConfig) \nConfigures certificate automation.\n\n\nAutomationConfig governs the automated management of TLS certificates. \n", + "type": "object", + "properties": { + "ocsp_interval": { + "description": "ocsp_interval: number\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nCaddy staples OCSP (and caches the response) for all\nqualifying certificates by default. This setting\nchanges how often it scans responses for freshness,\nand updates them if they are getting stale. Default: 1h\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "ocsp_interval: `number` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nCaddy staples OCSP (and caches the response) for all\nqualifying certificates by default. This setting\nchanges how often it scans responses for freshness,\nand updates them if they are getting stale. Default: 1h\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "on_demand": { + "description": "on_demand: object\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#OnDemandConfig\nOn-Demand TLS defers certificate operations to the\nmoment they are needed, e.g. during a TLS handshake.\nUseful when you don't know all the hostnames at\nconfig-time, or when you are not in control of the\ndomain names you are managing certificates for.\nIn 2015, Caddy became the first web server to\nimplement this experimental technology.\n\nNote that this field does not enable on-demand TLS;\nit only configures it for when it is used. To enable\nit, create an automation policy with `on_demand`.\n\n\nOnDemandConfig configures on-demand TLS, for obtaining\nneeded certificates at handshake-time. Because this\nfeature can easily be abused, you should use this to\nestablish rate limits and/or an internal endpoint that\nCaddy can \"ask\" if it should be allowed to manage\ncertificates for a given hostname.\n", + "markdownDescription": "on_demand: `object` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#OnDemandConfig) \nOn-Demand TLS defers certificate operations to the\nmoment they are needed, e.g. during a TLS handshake.\nUseful when you don't know all the hostnames at\nconfig-time, or when you are not in control of the\ndomain names you are managing certificates for.\nIn 2015, Caddy became the first web server to\nimplement this experimental technology.\n\nNote that this field does not enable on-demand TLS;\nit only configures it for when it is used. To enable\nit, create an automation policy with `on_demand`.\n\n\nOnDemandConfig configures on-demand TLS, for obtaining\nneeded certificates at handshake-time. Because this\nfeature can easily be abused, you should use this to\nestablish rate limits and/or an internal endpoint that\nCaddy can \"ask\" if it should be allowed to manage\ncertificates for a given hostname. \n", + "type": "object", + "properties": { + "ask": { + "description": "ask: string\nModule: tls\nIf Caddy needs to obtain or renew a certificate\nduring a TLS handshake, it will perform a quick\nHTTP request to this URL to check if it should be\nallowed to try to get a certificate for the name\nin the \"domain\" query string parameter, like so:\n`?domain=example.com`. The endpoint must return a\n200 OK status if a certificate is allowed;\nanything else will cause it to be denied.\nRedirects are not followed.\n", + "markdownDescription": "ask: `string` \nModule: `tls` \nIf Caddy needs to obtain or renew a certificate\nduring a TLS handshake, it will perform a quick\nHTTP request to this URL to check if it should be\nallowed to try to get a certificate for the name\nin the \"domain\" query string parameter, like so:\n`?domain=example.com`. The endpoint must return a\n200 OK status if a certificate is allowed;\nanything else will cause it to be denied.\nRedirects are not followed. \n", + "type": "string" + }, + "rate_limit": { + "description": "rate_limit: object\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#RateLimit\nAn optional rate limit to throttle the\nissuance of certificates from handshakes.\n\n\nRateLimit specifies an interval with optional burst size.\n", + "markdownDescription": "rate_limit: `object` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#RateLimit) \nAn optional rate limit to throttle the\nissuance of certificates from handshakes.\n\n\nRateLimit specifies an interval with optional burst size. \n", + "type": "object", + "properties": { + "burst": { + "description": "burst: number\nModule: tls\nHow many times during an interval a certificate can be obtained.\n", + "markdownDescription": "burst: `number` \nModule: `tls` \nHow many times during an interval a certificate can be obtained. \n", + "type": "number" + }, + "interval": { + "description": "interval: number\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nA duration value. A certificate may be obtained 'burst'\ntimes during this interval.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "interval: `number` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nA duration value. A certificate may be obtained 'burst'\ntimes during this interval.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + } + } + }, + "policies": { + "description": "policies: array\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomationPolicy\nThe list of automation policies. The first policy matching\na certificate or subject name will be applied.\n\n\nAutomationPolicy designates the policy for automating the\nmanagement (obtaining, renewal, and revocation) of managed\nTLS certificates.\n\nAn AutomationPolicy value is not valid until it has been\nprovisioned; use the `AddAutomationPolicy()` method on the\nTLS app to properly provision a new policy.\n", + "markdownDescription": "policies: `array` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomationPolicy) \nThe list of automation policies. The first policy matching\na certificate or subject name will be applied.\n\n\nAutomationPolicy designates the policy for automating the\nmanagement (obtaining, renewal, and revocation) of managed\nTLS certificates.\n\nAn AutomationPolicy value is not valid until it has been\nprovisioned; use the `AddAutomationPolicy()` method on the\nTLS app to properly provision a new policy. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomationPolicy\nThe list of automation policies. The first policy matching\na certificate or subject name will be applied.\n\n\nAutomationPolicy designates the policy for automating the\nmanagement (obtaining, renewal, and revocation) of managed\nTLS certificates.\n\nAn AutomationPolicy value is not valid until it has been\nprovisioned; use the `AddAutomationPolicy()` method on the\nTLS app to properly provision a new policy.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomationPolicy) \nThe list of automation policies. The first policy matching\na certificate or subject name will be applied.\n\n\nAutomationPolicy designates the policy for automating the\nmanagement (obtaining, renewal, and revocation) of managed\nTLS certificates.\n\nAn AutomationPolicy value is not valid until it has been\nprovisioned; use the `AddAutomationPolicy()` method on the\nTLS app to properly provision a new policy. \n", + "type": "object", + "properties": { + "disable_ocsp_stapling": { + "description": "disable_ocsp_stapling: boolean\nModule: tls\nDisables OCSP stapling. Disabling OCSP stapling puts clients at\ngreater risk, reduces their privacy, and usually lowers client\nperformance. It is NOT recommended to disable this unless you\nare able to justify the costs.\nEXPERIMENTAL. Subject to change.\n", + "markdownDescription": "disable_ocsp_stapling: `boolean` \nModule: `tls` \nDisables OCSP stapling. Disabling OCSP stapling puts clients at\ngreater risk, reduces their privacy, and usually lowers client\nperformance. It is NOT recommended to disable this unless you\nare able to justify the costs.\nEXPERIMENTAL. Subject to change. \n", + "type": "boolean" + }, + "get_certificate": { + "description": "get_certificate: array\nModule: tls.get_certificate\nModules that can get a custom certificate to use for any\ngiven TLS handshake at handshake-time. Custom certificates\ncan be useful if another entity is managing certificates\nand Caddy need only get it and serve it.\n\nTODO: This is an EXPERIMENTAL feature. It is subject to change or removal.\n", + "markdownDescription": "get_certificate: `array` \nModule: `tls.get_certificate` \nModules that can get a custom certificate to use for any\ngiven TLS handshake at handshake-time. Custom certificates\ncan be useful if another entity is managing certificates\nand Caddy need only get it and serve it.\n\nTODO: This is an EXPERIMENTAL feature. It is subject to change or removal. \n", + "type": "array", + "items": { + "description": "Modules that can get a custom certificate to use for any\ngiven TLS handshake at handshake-time. Custom certificates\ncan be useful if another entity is managing certificates\nand Caddy need only get it and serve it.\n\nTODO: This is an EXPERIMENTAL feature. It is subject to change or removal.\n", + "markdownDescription": "Modules that can get a custom certificate to use for any\ngiven TLS handshake at handshake-time. Custom certificates\ncan be useful if another entity is managing certificates\nand Caddy need only get it and serve it.\n\nTODO: This is an EXPERIMENTAL feature. It is subject to change or removal. \n", + "required": [ + "via" + ], + "allOf": [ + { + "if": { + "properties": { + "via": { + "const": "http" + } + } + }, + "then": { + "$ref": "#/definitions/tls.get_certificate.http" + } + }, + { + "if": { + "properties": { + "via": { + "const": "tailscale" + } + } + }, + "then": { + "$ref": "#/definitions/tls.get_certificate.tailscale" + } + }, + { + "properties": { + "via": { + "description": "key to identify get_certificate module.\nvia: string\nModule: tls.get_certificate", + "markdownDescription": "key to identify `get_certificate` module. \nvia: `string` \nModule: `tls.get_certificate`", + "type": "string", + "enum": [ + "http", + "tailscale" + ] + } + } + } + ] + } + }, + "issuers": { + "description": "issuers: array\nModule: tls.issuance\nThe modules that may issue certificates. Default: internal if all\nsubjects do not qualify for public certificates; othewise acme and\nzerossl.\n", + "markdownDescription": "issuers: `array` \nModule: `tls.issuance` \nThe modules that may issue certificates. Default: internal if all\nsubjects do not qualify for public certificates; othewise acme and\nzerossl. \n", + "type": "array", + "items": { + "description": "The modules that may issue certificates. Default: internal if all\nsubjects do not qualify for public certificates; othewise acme and\nzerossl.\n", + "markdownDescription": "The modules that may issue certificates. Default: internal if all\nsubjects do not qualify for public certificates; othewise acme and\nzerossl. \n", + "required": [ + "module" + ], + "allOf": [ + { + "if": { + "properties": { + "module": { + "const": "zerossl" + } + } + }, + "then": { + "$ref": "#/definitions/tls.issuance.zerossl" + } + }, + { + "if": { + "properties": { + "module": { + "const": "acme" + } + } + }, + "then": { + "$ref": "#/definitions/tls.issuance.acme" + } + }, + { + "if": { + "properties": { + "module": { + "const": "internal" + } + } + }, + "then": { + "$ref": "#/definitions/tls.issuance.internal" + } + }, + { + "properties": { + "module": { + "description": "key to identify issuers module.\nmodule: string\nModule: tls.issuance", + "markdownDescription": "key to identify `issuers` module. \nmodule: `string` \nModule: `tls.issuance`", + "type": "string", + "enum": [ + "zerossl", + "acme", + "internal" + ] + } + } + } + ] + } + }, + "key_type": { + "description": "key_type: string\nModule: tls\nThe type of key to generate for certificates.\nSupported values: `ed25519`, `p256`, `p384`, `rsa2048`, `rsa4096`.\n", + "markdownDescription": "key_type: `string` \nModule: `tls` \nThe type of key to generate for certificates.\nSupported values: `ed25519`, `p256`, `p384`, `rsa2048`, `rsa4096`. \n", + "type": "string" + }, + "must_staple": { + "description": "must_staple: boolean\nModule: tls\nIf true, certificates will be requested with MustStaple. Not all\nCAs support this, and there are potentially serious consequences\nof enabling this feature without proper threat modeling.\n", + "markdownDescription": "must_staple: `boolean` \nModule: `tls` \nIf true, certificates will be requested with MustStaple. Not all\nCAs support this, and there are potentially serious consequences\nof enabling this feature without proper threat modeling. \n", + "type": "boolean" + }, + "ocsp_overrides": { + "description": "ocsp_overrides: object\nModule: tls\nOverrides the URLs of OCSP responders embedded in certificates.\nEach key is a OCSP server URL to override, and its value is the\nreplacement. An empty value will disable querying of that server.\nEXPERIMENTAL. Subject to change.\n", + "markdownDescription": "ocsp_overrides: `object` \nModule: `tls` \nOverrides the URLs of OCSP responders embedded in certificates.\nEach key is a OCSP server URL to override, and its value is the\nreplacement. An empty value will disable querying of that server.\nEXPERIMENTAL. Subject to change. \n", + "type": "object", + "additionalProperties": { + "description": "Overrides the URLs of OCSP responders embedded in certificates.\nEach key is a OCSP server URL to override, and its value is the\nreplacement. An empty value will disable querying of that server.\nEXPERIMENTAL. Subject to change.\n", + "markdownDescription": "Overrides the URLs of OCSP responders embedded in certificates.\nEach key is a OCSP server URL to override, and its value is the\nreplacement. An empty value will disable querying of that server.\nEXPERIMENTAL. Subject to change. \n" + } + }, + "on_demand": { + "description": "on_demand: boolean\nModule: tls\nIf true, certificates will be managed \"on demand\"; that is, during\nTLS handshakes or when needed, as opposed to at startup or config\nload. This enables On-Demand TLS for this policy.\n", + "markdownDescription": "on_demand: `boolean` \nModule: `tls` \nIf true, certificates will be managed \"on demand\"; that is, during\nTLS handshakes or when needed, as opposed to at startup or config\nload. This enables On-Demand TLS for this policy. \n", + "type": "boolean" + }, + "renewal_window_ratio": { + "description": "renewal_window_ratio: object\nModule: tls\nHow long before a certificate's expiration to try renewing it,\nas a function of its total lifetime. As a general and conservative\nrule, it is a good idea to renew a certificate when it has about\n1/3 of its total lifetime remaining. This utilizes the majority\nof the certificate's lifetime while still saving time to\ntroubleshoot problems. However, for extremely short-lived certs,\nyou may wish to increase the ratio to ~1/2.\n", + "markdownDescription": "renewal_window_ratio: `object` \nModule: `tls` \nHow long before a certificate's expiration to try renewing it,\nas a function of its total lifetime. As a general and conservative\nrule, it is a good idea to renew a certificate when it has about\n1/3 of its total lifetime remaining. This utilizes the majority\nof the certificate's lifetime while still saving time to\ntroubleshoot problems. However, for extremely short-lived certs,\nyou may wish to increase the ratio to ~1/2. \n", + "type": "object" + }, + "storage": { + "description": "storage: object\nModule: caddy.storage\nOptionally configure a separate storage module associated with this\nmanager, instead of using Caddy's global/default-configured storage.\n", + "markdownDescription": "storage: `object` \nModule: `caddy.storage` \nOptionally configure a separate storage module associated with this\nmanager, instead of using Caddy's global/default-configured storage. \n", + "type": "object", + "required": [ + "module" + ], + "allOf": [ + { + "if": { + "properties": { + "module": { + "const": "consul" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.consul" + } + }, + { + "if": { + "properties": { + "module": { + "const": "file_system" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.file_system" + } + }, + { + "properties": { + "module": { + "description": "key to identify storage module.\nmodule: string\nModule: caddy.storage", + "markdownDescription": "key to identify `storage` module. \nmodule: `string` \nModule: `caddy.storage`", + "type": "string", + "enum": [ + "consul", + "file_system" + ] + } + } + } + ] + }, + "subjects": { + "description": "subjects: array\nModule: tls\nWhich subjects (hostnames or IP addresses) this policy applies to.\n", + "markdownDescription": "subjects: `array` \nModule: `tls` \nWhich subjects (hostnames or IP addresses) this policy applies to. \n", + "type": "array", + "items": { + "description": "Which subjects (hostnames or IP addresses) this policy applies to.\n", + "markdownDescription": "Which subjects (hostnames or IP addresses) this policy applies to. \n", + "type": "string" + } + } + } + } + }, + "renew_interval": { + "description": "renew_interval: number\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nEvery so often, Caddy will scan all loaded, managed\ncertificates for expiration. This setting changes how\nfrequently the scan for expiring certificates is\nperformed. Default: 10m\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "renew_interval: `number` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nEvery so often, Caddy will scan all loaded, managed\ncertificates for expiration. This setting changes how\nfrequently the scan for expiring certificates is\nperformed. Default: 10m\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "storage_clean_interval": { + "description": "storage_clean_interval: number\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow often to scan storage units for old or expired\nassets and remove them. These scans exert lots of\nreads (and list operations) on the storage module, so\nchoose a longer interval for large deployments.\nDefault: 24h\n\nStorage will always be cleaned when the process first\nstarts. Then, a new cleaning will be started this\nduration after the previous cleaning started if the\nprevious cleaning finished in less than half the time\nof this interval (otherwise next start will be skipped).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "storage_clean_interval: `number` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow often to scan storage units for old or expired\nassets and remove them. These scans exert lots of\nreads (and list operations) on the storage module, so\nchoose a longer interval for large deployments.\nDefault: 24h\n\nStorage will always be cleaned when the process first\nstarts. Then, a new cleaning will be started this\nduration after the previous cleaning started if the\nprevious cleaning finished in less than half the time\nof this interval (otherwise next start will be skipped).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "cache": { + "description": "cache: object\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertCacheOptions\nConfigures the in-memory certificate cache.\n\n\nCertCacheOptions configures the certificate cache.\n", + "markdownDescription": "cache: `object` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertCacheOptions) \nConfigures the in-memory certificate cache.\n\n\nCertCacheOptions configures the certificate cache. \n", + "type": "object", + "properties": { + "capacity": { + "description": "capacity: number\nModule: tls\nMaximum number of certificates to allow in the\ncache. If reached, certificates will be randomly\nevicted to make room for new ones. Default: 10,000\n", + "markdownDescription": "capacity: `number` \nModule: `tls` \nMaximum number of certificates to allow in the\ncache. If reached, certificates will be randomly\nevicted to make room for new ones. Default: 10,000 \n", + "type": "number" + } + } + }, + "certificates": { + "description": "certificates: object\nModule: tls.certificates\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nCaches certificates in memory for quick use during\nTLS handshakes. Each key is the name of a certificate\nloader module. All loaded certificates get pooled\ninto the same cache and may be used to complete TLS\nhandshakes for the relevant server names (SNI).\nCertificates loaded manually (anything other than\n\"automate\") are not automatically managed and will\nhave to be refreshed manually before they expire.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "certificates: `object` \nModule: `tls.certificates` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nCaches certificates in memory for quick use during\nTLS handshakes. Each key is the name of a certificate\nloader module. All loaded certificates get pooled\ninto the same cache and may be used to complete TLS\nhandshakes for the relevant server names (SNI).\nCertificates loaded manually (anything other than\n\"automate\") are not automatically managed and will\nhave to be refreshed manually before they expire.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "object", + "properties": { + "automate": { + "$ref": "#/definitions/tls.certificates.automate" + }, + "load_files": { + "$ref": "#/definitions/tls.certificates.load_files" + }, + "load_folders": { + "$ref": "#/definitions/tls.certificates.load_folders" + }, + "load_pem": { + "$ref": "#/definitions/tls.certificates.load_pem" + }, + "load_storage": { + "$ref": "#/definitions/tls.certificates.load_storage" + } + } + }, + "disable_ocsp_stapling": { + "description": "disable_ocsp_stapling: boolean\nModule: tls\nDisables OCSP stapling for manually-managed certificates only.\nTo configure OCSP stapling for automated certificates, use an\nautomation policy instead.\n\nDisabling OCSP stapling puts clients at greater risk, reduces their\nprivacy, and usually lowers client performance. It is NOT recommended\nto disable this unless you are able to justify the costs.\nEXPERIMENTAL. Subject to change.\n", + "markdownDescription": "disable_ocsp_stapling: `boolean` \nModule: `tls` \nDisables OCSP stapling for manually-managed certificates only.\nTo configure OCSP stapling for automated certificates, use an\nautomation policy instead.\n\nDisabling OCSP stapling puts clients at greater risk, reduces their\nprivacy, and usually lowers client performance. It is NOT recommended\nto disable this unless you are able to justify the costs.\nEXPERIMENTAL. Subject to change. \n", + "type": "boolean" + }, + "session_tickets": { + "description": "session_tickets: object\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#SessionTicketService\nConfigures session ticket ephemeral keys (STEKs).\n\n\nSessionTicketService configures and manages TLS session tickets.\n", + "markdownDescription": "session_tickets: `object` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#SessionTicketService) \nConfigures session ticket ephemeral keys (STEKs).\n\n\nSessionTicketService configures and manages TLS session tickets. \n", + "type": "object", + "properties": { + "disable_rotation": { + "description": "disable_rotation: boolean\nModule: tls\nDisables STEK rotation.\n", + "markdownDescription": "disable_rotation: `boolean` \nModule: `tls` \nDisables STEK rotation. \n", + "type": "boolean" + }, + "disabled": { + "description": "disabled: boolean\nModule: tls\nDisables TLS session resumption by tickets.\n", + "markdownDescription": "disabled: `boolean` \nModule: `tls` \nDisables TLS session resumption by tickets. \n", + "type": "boolean" + }, + "key_source": { + "description": "key_source: object\nModule: tls.stek\nKeySource is the method by which Caddy produces or obtains\nTLS session ticket keys (STEKs). By default, Caddy generates\nthem internally using a secure pseudorandom source.\n", + "markdownDescription": "key_source: `object` \nModule: `tls.stek` \nKeySource is the method by which Caddy produces or obtains\nTLS session ticket keys (STEKs). By default, Caddy generates\nthem internally using a secure pseudorandom source. \n", + "type": "object", + "required": [ + "provider" + ], + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "distributed" + } + } + }, + "then": { + "$ref": "#/definitions/tls.stek.distributed" + } + }, + { + "if": { + "properties": { + "provider": { + "const": "standard" + } + } + }, + "then": { + "$ref": "#/definitions/tls.stek.standard" + } + }, + { + "properties": { + "provider": { + "description": "key to identify key_source module.\nprovider: string\nModule: tls.stek", + "markdownDescription": "key to identify `key_source` module. \nprovider: `string` \nModule: `tls.stek`", + "type": "string", + "enum": [ + "distributed", + "standard" + ] + } + } + } + ] + }, + "max_keys": { + "description": "max_keys: number\nModule: tls\nThe maximum number of keys to keep in rotation. Default: 4.\n", + "markdownDescription": "max_keys: `number` \nModule: `tls` \nThe maximum number of keys to keep in rotation. Default: 4. \n", + "type": "number" + }, + "rotation_interval": { + "description": "rotation_interval: number\nModule: tls\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow often Caddy rotates STEKs. Default: 12h.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "rotation_interval: `number` \nModule: `tls` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow often Caddy rotates STEKs. Default: 12h.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + } + } + }, + "tls.certificates.automate": { + "description": "automate: array\nModule: tls.certificates.automate\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomateLoader\nAutomateLoader will automatically manage certificates for the names in the\nlist, including obtaining and renewing certificates. Automated certificates\nare managed according to their matching automation policy, configured\nelsewhere in this app.\n\nTechnically, this is a no-op certificate loader module that is treated as\na special case: it uses this app's automation features to load certificates\nfor the list of hostnames, rather than loading certificates manually.\n\n", + "markdownDescription": "automate: `array` \nModule: `tls.certificates.automate` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#AutomateLoader) \nAutomateLoader will automatically manage certificates for the names in the\nlist, including obtaining and renewing certificates. Automated certificates\nare managed according to their matching automation policy, configured\nelsewhere in this app.\n\nTechnically, this is a no-op certificate loader module that is treated as\na special case: it uses this app's automation features to load certificates\nfor the list of hostnames, rather than loading certificates manually.\n \n", + "type": "array", + "items": { + "type": "string" + } + }, + "tls.certificates.load_files": { + "description": "load_files: array\nModule: tls.certificates.load_files\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair\nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk.\n\n", + "markdownDescription": "load_files: `array` \nModule: `tls.certificates.load_files` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair) \nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair\nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair) \nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk.\n \n", + "type": "object", + "properties": { + "certificate": { + "description": "certificate: string\nModule: tls.certificates.load_files\nPath to the certificate (public key) file.\n", + "markdownDescription": "certificate: `string` \nModule: `tls.certificates.load_files` \nPath to the certificate (public key) file. \n", + "type": "string" + }, + "format": { + "description": "format: string\nModule: tls.certificates.load_files\nThe format of the cert and key. Can be \"pem\". Default: \"pem\"\n", + "markdownDescription": "format: `string` \nModule: `tls.certificates.load_files` \nThe format of the cert and key. Can be \"pem\". Default: \"pem\" \n", + "type": "string" + }, + "key": { + "description": "key: string\nModule: tls.certificates.load_files\nPath to the private key file.\n", + "markdownDescription": "key: `string` \nModule: `tls.certificates.load_files` \nPath to the private key file. \n", + "type": "string" + }, + "tags": { + "description": "tags: array\nModule: tls.certificates.load_files\nArbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates.\n", + "markdownDescription": "tags: `array` \nModule: `tls.certificates.load_files` \nArbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates. \n", + "type": "array", + "items": { + "description": "Arbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates.\n", + "markdownDescription": "Arbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates. \n", + "type": "string" + } + } + } + } + }, + "tls.certificates.load_folders": { + "description": "load_folders: array\nModule: tls.certificates.load_folders\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#FolderLoader\nFolderLoader loads certificates and their associated keys from disk\nby recursively walking the specified directories, looking for PEM\nfiles which contain both a certificate and a key.\n\n", + "markdownDescription": "load_folders: `array` \nModule: `tls.certificates.load_folders` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#FolderLoader) \nFolderLoader loads certificates and their associated keys from disk\nby recursively walking the specified directories, looking for PEM\nfiles which contain both a certificate and a key.\n \n", + "type": "array", + "items": { + "type": "string" + } + }, + "tls.certificates.load_pem": { + "description": "load_pem: array\nModule: tls.certificates.load_pem\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyPEMPair\nCertKeyPEMPair pairs certificate and key PEM blocks.\n\n", + "markdownDescription": "load_pem: `array` \nModule: `tls.certificates.load_pem` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyPEMPair) \nCertKeyPEMPair pairs certificate and key PEM blocks.\n \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyPEMPair\nCertKeyPEMPair pairs certificate and key PEM blocks.\n\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyPEMPair) \nCertKeyPEMPair pairs certificate and key PEM blocks.\n \n", + "type": "object", + "properties": { + "certificate": { + "description": "certificate: string\nModule: tls.certificates.load_pem\nThe certificate (public key) in PEM format.\n", + "markdownDescription": "certificate: `string` \nModule: `tls.certificates.load_pem` \nThe certificate (public key) in PEM format. \n", + "type": "string" + }, + "key": { + "description": "key: string\nModule: tls.certificates.load_pem\nThe private key in PEM format.\n", + "markdownDescription": "key: `string` \nModule: `tls.certificates.load_pem` \nThe private key in PEM format. \n", + "type": "string" + }, + "tags": { + "description": "tags: array\nModule: tls.certificates.load_pem\nArbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates.\n", + "markdownDescription": "tags: `array` \nModule: `tls.certificates.load_pem` \nArbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates. \n", + "type": "array", + "items": { + "description": "Arbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates.\n", + "markdownDescription": "Arbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates. \n", + "type": "string" + } + } + } + } + }, + "tls.certificates.load_storage": { + "description": "load_storage: object\nModule: tls.certificates.load_storage\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#StorageLoader\nStorageLoader loads certificates and their associated keys\nfrom the globally configured storage module.\n\n", + "markdownDescription": "load_storage: `object` \nModule: `tls.certificates.load_storage` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#StorageLoader) \nStorageLoader loads certificates and their associated keys\nfrom the globally configured storage module.\n \n", + "type": "object", + "properties": { + "pairs": { + "description": "pairs: array\nModule: tls.certificates.load_storage\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair\nA list of pairs of certificate and key file names along with their\nencoding format so that they can be loaded from storage.\n\n\nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk.\n", + "markdownDescription": "pairs: `array` \nModule: `tls.certificates.load_storage` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair) \nA list of pairs of certificate and key file names along with their\nencoding format so that they can be loaded from storage.\n\n\nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair\nA list of pairs of certificate and key file names along with their\nencoding format so that they can be loaded from storage.\n\n\nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#CertKeyFilePair) \nA list of pairs of certificate and key file names along with their\nencoding format so that they can be loaded from storage.\n\n\nCertKeyFilePair pairs certificate and key file names along with their\nencoding format so that they can be loaded from disk. \n", + "type": "object", + "properties": { + "certificate": { + "description": "certificate: string\nModule: tls.certificates.load_storage\nPath to the certificate (public key) file.\n", + "markdownDescription": "certificate: `string` \nModule: `tls.certificates.load_storage` \nPath to the certificate (public key) file. \n", + "type": "string" + }, + "format": { + "description": "format: string\nModule: tls.certificates.load_storage\nThe format of the cert and key. Can be \"pem\". Default: \"pem\"\n", + "markdownDescription": "format: `string` \nModule: `tls.certificates.load_storage` \nThe format of the cert and key. Can be \"pem\". Default: \"pem\" \n", + "type": "string" + }, + "key": { + "description": "key: string\nModule: tls.certificates.load_storage\nPath to the private key file.\n", + "markdownDescription": "key: `string` \nModule: `tls.certificates.load_storage` \nPath to the private key file. \n", + "type": "string" + }, + "tags": { + "description": "tags: array\nModule: tls.certificates.load_storage\nArbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates.\n", + "markdownDescription": "tags: `array` \nModule: `tls.certificates.load_storage` \nArbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates. \n", + "type": "array", + "items": { + "description": "Arbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates.\n", + "markdownDescription": "Arbitrary values to associate with this certificate.\nCan be useful when you want to select a particular\ncertificate when there may be multiple valid candidates. \n", + "type": "string" + } + } + } + } + } + } + }, + "tls.client_auth.leaf": { + "description": "leaf: any\nModule: tls.client_auth.leaf\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#LeafCertClientAuth", + "markdownDescription": "leaf: `any` \nModule: `tls.client_auth.leaf` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#LeafCertClientAuth)" + }, + "tls.get_certificate.http": { + "description": "http: object\nModule: tls.get_certificate.http\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#HTTPCertGetter\nHTTPCertGetter can get a certificate via HTTP(S) request.\n\n", + "markdownDescription": "http: `object` \nModule: `tls.get_certificate.http` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#HTTPCertGetter) \nHTTPCertGetter can get a certificate via HTTP(S) request.\n \n", + "type": "object", + "properties": { + "url": { + "description": "url: string\nModule: tls.get_certificate.http\nThe URL from which to download the certificate. Required.\n\nThe URL will be augmented with query string parameters taken\nfrom the TLS handshake:\n\n- server_name: The SNI value\n- signature_schemes: Comma-separated list of hex IDs of signatures\n- cipher_suites: Comma-separated list of hex IDs of cipher suites\n\nTo be valid, the response must be HTTP 200 with a PEM body\nconsisting of blocks for the certificate chain and the private\nkey.\n", + "markdownDescription": "url: `string` \nModule: `tls.get_certificate.http` \nThe URL from which to download the certificate. Required.\n\nThe URL will be augmented with query string parameters taken\nfrom the TLS handshake:\n\n- server_name: The SNI value\n- signature_schemes: Comma-separated list of hex IDs of signatures\n- cipher_suites: Comma-separated list of hex IDs of cipher suites\n\nTo be valid, the response must be HTTP 200 with a PEM body\nconsisting of blocks for the certificate chain and the private\nkey. \n", + "type": "string" + } + } + }, + "tls.get_certificate.tailscale": { + "description": "tailscale: object\nModule: tls.get_certificate.tailscale\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#Tailscale\nTailscale is a module that can get certificates from the local Tailscale process.\n\n", + "markdownDescription": "tailscale: `object` \nModule: `tls.get_certificate.tailscale` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#Tailscale) \nTailscale is a module that can get certificates from the local Tailscale process.\n \n", + "type": "object", + "properties": { + "optional": { + "description": "optional: boolean\nModule: tls.get_certificate.tailscale\nIf true, this module will operate in \"best-effort\" mode and\nignore \"soft\" errors; i.e. try Tailscale, and if it doesn't connect\nor return a certificate, oh well. Failure to connect to Tailscale\nresults in a no-op instead of an error. Intended for the use case\nwhere this module is added implicitly for convenience, even if\nTailscale isn't necessarily running.\n", + "markdownDescription": "optional: `boolean` \nModule: `tls.get_certificate.tailscale` \nIf true, this module will operate in \"best-effort\" mode and\nignore \"soft\" errors; i.e. try Tailscale, and if it doesn't connect\nor return a certificate, oh well. Failure to connect to Tailscale\nresults in a no-op instead of an error. Intended for the use case\nwhere this module is added implicitly for convenience, even if\nTailscale isn't necessarily running. \n", + "type": "boolean" + } + } + }, + "tls.handshake_match.alpn": { + "description": "alpn: array\nModule: tls.handshake_match.alpn\nhttps://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tls#MatchALPN", + "markdownDescription": "alpn: `array` \nModule: `tls.handshake_match.alpn` \n[godoc](https://pkg.go.dev/github.com/mholt/caddy-l4/modules/l4tls#MatchALPN)", + "type": "array", + "items": { + "type": "string" + } + }, + "tls.handshake_match.remote_ip": { + "description": "remote_ip: object\nModule: tls.handshake_match.remote_ip\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#MatchRemoteIP\nMatchRemoteIP matches based on the remote IP of the\nconnection. Specific IPs or CIDR ranges can be specified.\n\nNote that IPs can sometimes be spoofed, so do not rely\non this as a replacement for actual authentication.\n\n", + "markdownDescription": "remote_ip: `object` \nModule: `tls.handshake_match.remote_ip` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#MatchRemoteIP) \nMatchRemoteIP matches based on the remote IP of the\nconnection. Specific IPs or CIDR ranges can be specified.\n\nNote that IPs can sometimes be spoofed, so do not rely\non this as a replacement for actual authentication.\n \n", + "type": "object", + "properties": { + "not_ranges": { + "description": "not_ranges: array\nModule: tls.handshake_match.remote_ip\nThe IPs or CIDR ranges to *NOT* match.\n", + "markdownDescription": "not_ranges: `array` \nModule: `tls.handshake_match.remote_ip` \nThe IPs or CIDR ranges to *NOT* match. \n", + "type": "array", + "items": { + "description": "The IPs or CIDR ranges to *NOT* match.\n", + "markdownDescription": "The IPs or CIDR ranges to *NOT* match. \n", + "type": "string" + } + }, + "ranges": { + "description": "ranges: array\nModule: tls.handshake_match.remote_ip\nThe IPs or CIDR ranges to match.\n", + "markdownDescription": "ranges: `array` \nModule: `tls.handshake_match.remote_ip` \nThe IPs or CIDR ranges to match. \n", + "type": "array", + "items": { + "description": "The IPs or CIDR ranges to match.\n", + "markdownDescription": "The IPs or CIDR ranges to match. \n", + "type": "string" + } + } + } + }, + "tls.handshake_match.sni": { + "description": "sni: array\nModule: tls.handshake_match.sni\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#MatchServerName\nMatchServerName matches based on SNI. Names in\nthis list may use left-most-label wildcards,\nsimilar to wildcard certificates.\n\n", + "markdownDescription": "sni: `array` \nModule: `tls.handshake_match.sni` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#MatchServerName) \nMatchServerName matches based on SNI. Names in\nthis list may use left-most-label wildcards,\nsimilar to wildcard certificates.\n \n", + "type": "array", + "items": { + "type": "string" + } + }, + "tls.issuance.acme": { + "description": "acme: object\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ACMEIssuer\nACMEIssuer manages certificates using the ACME protocol (RFC 8555).\n\n", + "markdownDescription": "acme: `object` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ACMEIssuer) \nACMEIssuer manages certificates using the ACME protocol (RFC 8555).\n \n", + "type": "object", + "properties": { + "account_key": { + "description": "account_key: string\nModule: tls.issuance.acme\nIf you have an existing account with the ACME server, put\nthe private key here in PEM format. The ACME client will\nlook up your account information with this key first before\ntrying to create a new one. You can use placeholders here,\nfor example if you have it in an environment variable.\n", + "markdownDescription": "account_key: `string` \nModule: `tls.issuance.acme` \nIf you have an existing account with the ACME server, put\nthe private key here in PEM format. The ACME client will\nlook up your account information with this key first before\ntrying to create a new one. You can use placeholders here,\nfor example if you have it in an environment variable. \n", + "type": "string" + }, + "acme_timeout": { + "description": "acme_timeout: number\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nTime to wait before timing out an ACME operation.\nDefault: 0 (no timeout)\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "acme_timeout: `number` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nTime to wait before timing out an ACME operation.\nDefault: 0 (no timeout)\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "ca": { + "description": "ca: string\nModule: tls.issuance.acme\nThe URL to the CA's ACME directory endpoint. Default:\nhttps://acme-v02.api.letsencrypt.org/directory\n", + "markdownDescription": "ca: `string` \nModule: `tls.issuance.acme` \nThe URL to the CA's ACME directory endpoint. Default:\nhttps://acme-v02.api.letsencrypt.org/directory \n", + "type": "string" + }, + "challenges": { + "description": "challenges: object\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChallengesConfig\nConfigures the various ACME challenge types.\n\n\nChallengesConfig configures the ACME challenges.\n", + "markdownDescription": "challenges: `object` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChallengesConfig) \nConfigures the various ACME challenge types.\n\n\nChallengesConfig configures the ACME challenges. \n", + "type": "object", + "properties": { + "bind_host": { + "description": "bind_host: string\nModule: tls.issuance.acme\nOptionally customize the host to which a listener\nis bound if required for solving a challenge.\n", + "markdownDescription": "bind_host: `string` \nModule: `tls.issuance.acme` \nOptionally customize the host to which a listener\nis bound if required for solving a challenge. \n", + "type": "string" + }, + "dns": { + "description": "dns: object\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#DNSChallengeConfig\nConfigures the ACME DNS challenge. Because this\nchallenge typically requires credentials for\ninterfacing with a DNS provider, this challenge is\nnot enabled by default. This is the only challenge\ntype which does not require a direct connection\nto Caddy from an external server.\n\nNOTE: DNS providers are currently being upgraded,\nand this API is subject to change, but should be\nstabilized soon.\n\n\nDNSChallengeConfig configures the ACME DNS challenge.\n\nNOTE: This API is still experimental and is subject to change.\n", + "markdownDescription": "dns: `object` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#DNSChallengeConfig) \nConfigures the ACME DNS challenge. Because this\nchallenge typically requires credentials for\ninterfacing with a DNS provider, this challenge is\nnot enabled by default. This is the only challenge\ntype which does not require a direct connection\nto Caddy from an external server.\n\nNOTE: DNS providers are currently being upgraded,\nand this API is subject to change, but should be\nstabilized soon.\n\n\nDNSChallengeConfig configures the ACME DNS challenge.\n\nNOTE: This API is still experimental and is subject to change. \n", + "type": "object", + "properties": { + "override_domain": { + "description": "override_domain: string\nModule: tls.issuance.acme\nOverride the domain to use for the DNS challenge. This\nis to delegate the challenge to a different domain,\ne.g. one that updates faster or one with a provider API.\n", + "markdownDescription": "override_domain: `string` \nModule: `tls.issuance.acme` \nOverride the domain to use for the DNS challenge. This\nis to delegate the challenge to a different domain,\ne.g. one that updates faster or one with a provider API. \n", + "type": "string" + }, + "propagation_delay": { + "description": "propagation_delay: number\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to wait before starting propagation checks.\nDefault: 0 (no wait).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "propagation_delay: `number` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to wait before starting propagation checks.\nDefault: 0 (no wait).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "propagation_timeout": { + "description": "propagation_timeout: number\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nMaximum time to wait for temporary DNS record to appear.\nSet to -1 to disable propagation checks.\nDefault: 2 minutes.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "propagation_timeout: `number` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nMaximum time to wait for temporary DNS record to appear.\nSet to -1 to disable propagation checks.\nDefault: 2 minutes.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "provider": { + "description": "provider: any\nModule: dns.providers\nThe DNS provider module to use which will manage\nthe DNS records relevant to the ACME challenge.\n", + "markdownDescription": "provider: `any` \nModule: `dns.providers` \nThe DNS provider module to use which will manage\nthe DNS records relevant to the ACME challenge. \n" + }, + "resolvers": { + "description": "resolvers: array\nModule: tls.issuance.acme\nCustom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS.\n", + "markdownDescription": "resolvers: `array` \nModule: `tls.issuance.acme` \nCustom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS. \n", + "type": "array", + "items": { + "description": "Custom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS.\n", + "markdownDescription": "Custom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS. \n", + "type": "string" + } + }, + "ttl": { + "description": "ttl: number\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nThe TTL of the TXT record used for the DNS challenge.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "ttl: `number` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nThe TTL of the TXT record used for the DNS challenge.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "http": { + "description": "http: object\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#HTTPChallengeConfig\nHTTP configures the ACME HTTP challenge. This\nchallenge is enabled and used automatically\nand by default.\n\n\nHTTPChallengeConfig configures the ACME HTTP challenge.\n", + "markdownDescription": "http: `object` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#HTTPChallengeConfig) \nHTTP configures the ACME HTTP challenge. This\nchallenge is enabled and used automatically\nand by default.\n\n\nHTTPChallengeConfig configures the ACME HTTP challenge. \n", + "type": "object", + "properties": { + "alternate_port": { + "description": "alternate_port: number\nModule: tls.issuance.acme\nAn alternate port on which to service this\nchallenge. Note that the HTTP challenge port is\nhard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard HTTP challenge port to this one.\n", + "markdownDescription": "alternate_port: `number` \nModule: `tls.issuance.acme` \nAn alternate port on which to service this\nchallenge. Note that the HTTP challenge port is\nhard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard HTTP challenge port to this one. \n", + "type": "number" + }, + "disabled": { + "description": "disabled: boolean\nModule: tls.issuance.acme\nIf true, the HTTP challenge will be disabled.\n", + "markdownDescription": "disabled: `boolean` \nModule: `tls.issuance.acme` \nIf true, the HTTP challenge will be disabled. \n", + "type": "boolean" + } + } + }, + "tls-alpn": { + "description": "tls-alpn: object\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#TLSALPNChallengeConfig\nTLSALPN configures the ACME TLS-ALPN challenge.\nThis challenge is enabled and used automatically\nand by default.\n\n\nTLSALPNChallengeConfig configures the ACME TLS-ALPN challenge.\n", + "markdownDescription": "tls-alpn: `object` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#TLSALPNChallengeConfig) \nTLSALPN configures the ACME TLS-ALPN challenge.\nThis challenge is enabled and used automatically\nand by default.\n\n\nTLSALPNChallengeConfig configures the ACME TLS-ALPN challenge. \n", + "type": "object", + "properties": { + "alternate_port": { + "description": "alternate_port: number\nModule: tls.issuance.acme\nAn alternate port on which to service this\nchallenge. Note that the TLS-ALPN challenge port\nis hard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard TLS-ALPN challenge port to this one.\n", + "markdownDescription": "alternate_port: `number` \nModule: `tls.issuance.acme` \nAn alternate port on which to service this\nchallenge. Note that the TLS-ALPN challenge port\nis hard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard TLS-ALPN challenge port to this one. \n", + "type": "number" + }, + "disabled": { + "description": "disabled: boolean\nModule: tls.issuance.acme\nIf true, the TLS-ALPN challenge will be disabled.\n", + "markdownDescription": "disabled: `boolean` \nModule: `tls.issuance.acme` \nIf true, the TLS-ALPN challenge will be disabled. \n", + "type": "boolean" + } + } + } + } + }, + "email": { + "description": "email: string\nModule: tls.issuance.acme\nYour email address, so the CA can contact you if necessary.\nNot required, but strongly recommended to provide one so\nyou can be reached if there is a problem. Your email is\nnot sent to any Caddy mothership or used for any purpose\nother than ACME transactions.\n", + "markdownDescription": "email: `string` \nModule: `tls.issuance.acme` \nYour email address, so the CA can contact you if necessary.\nNot required, but strongly recommended to provide one so\nyou can be reached if there is a problem. Your email is\nnot sent to any Caddy mothership or used for any purpose\nother than ACME transactions. \n", + "type": "string" + }, + "external_account": { + "description": "external_account: object\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/mholt/acmez/acme#EAB\nIf using an ACME CA that requires an external account\nbinding, specify the CA-provided credentials here.\n\n\nEAB (External Account Binding) contains information\nnecessary to bind or map an ACME account to some\nother account known by the CA.\n\nExternal account bindings are \"used to associate an\nACME account with an existing account in a non-ACME\nsystem, such as a CA customer database.\"\n\n\"To enable ACME account binding, the CA operating the\nACME server needs to provide the ACME client with a\nMAC key and a key identifier, using some mechanism\noutside of ACME.\" §7.3.4\n", + "markdownDescription": "external_account: `object` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/mholt/acmez/acme#EAB) \nIf using an ACME CA that requires an external account\nbinding, specify the CA-provided credentials here.\n\n\nEAB (External Account Binding) contains information\nnecessary to bind or map an ACME account to some\nother account known by the CA.\n\nExternal account bindings are \"used to associate an\nACME account with an existing account in a non-ACME\nsystem, such as a CA customer database.\"\n\n\"To enable ACME account binding, the CA operating the\nACME server needs to provide the ACME client with a\nMAC key and a key identifier, using some mechanism\noutside of ACME.\" §7.3.4 \n", + "type": "object", + "properties": { + "key_id": { + "description": "key_id: string\nModule: tls.issuance.acme\n\"The key identifier MUST be an ASCII string.\" §7.3.4\n", + "markdownDescription": "key_id: `string` \nModule: `tls.issuance.acme` \n\"The key identifier MUST be an ASCII string.\" §7.3.4 \n", + "type": "string" + }, + "mac_key": { + "description": "mac_key: string\nModule: tls.issuance.acme\n\"The MAC key SHOULD be provided in base64url-encoded\nform, to maximize compatibility between non-ACME\nprovisioning systems and ACME clients.\" §7.3.4\n", + "markdownDescription": "mac_key: `string` \nModule: `tls.issuance.acme` \n\"The MAC key SHOULD be provided in base64url-encoded\nform, to maximize compatibility between non-ACME\nprovisioning systems and ACME clients.\" §7.3.4 \n", + "type": "string" + } + } + }, + "preferred_chains": { + "description": "preferred_chains: object\nModule: tls.issuance.acme\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChainPreference\nPreferences for selecting alternate certificate chains, if offered\nby the CA. By default, the first offered chain will be selected.\nIf configured, the chains may be sorted and the first matching chain\nwill be selected.\n\n\nChainPreference describes the client's preferred certificate chain,\nuseful if the CA offers alternate chains. The first matching chain\nwill be selected.\n", + "markdownDescription": "preferred_chains: `object` \nModule: `tls.issuance.acme` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChainPreference) \nPreferences for selecting alternate certificate chains, if offered\nby the CA. By default, the first offered chain will be selected.\nIf configured, the chains may be sorted and the first matching chain\nwill be selected.\n\n\nChainPreference describes the client's preferred certificate chain,\nuseful if the CA offers alternate chains. The first matching chain\nwill be selected. \n", + "type": "object", + "properties": { + "any_common_name": { + "description": "any_common_name: array\nModule: tls.issuance.acme\nSelect first chain that has any issuer with one\nof these common names.\n", + "markdownDescription": "any_common_name: `array` \nModule: `tls.issuance.acme` \nSelect first chain that has any issuer with one\nof these common names. \n", + "type": "array", + "items": { + "description": "Select first chain that has any issuer with one\nof these common names.\n", + "markdownDescription": "Select first chain that has any issuer with one\nof these common names. \n", + "type": "string" + } + }, + "root_common_name": { + "description": "root_common_name: array\nModule: tls.issuance.acme\nSelect first chain having a root with one of\nthese common names.\n", + "markdownDescription": "root_common_name: `array` \nModule: `tls.issuance.acme` \nSelect first chain having a root with one of\nthese common names. \n", + "type": "array", + "items": { + "description": "Select first chain having a root with one of\nthese common names.\n", + "markdownDescription": "Select first chain having a root with one of\nthese common names. \n", + "type": "string" + } + }, + "smallest": { + "description": "smallest: boolean\nModule: tls.issuance.acme\nPrefer chains with the fewest number of bytes.\n", + "markdownDescription": "smallest: `boolean` \nModule: `tls.issuance.acme` \nPrefer chains with the fewest number of bytes. \n", + "type": "boolean" + } + } + }, + "test_ca": { + "description": "test_ca: string\nModule: tls.issuance.acme\nThe URL to the test CA's ACME directory endpoint.\nThis endpoint is only used during retries if there\nis a failure using the primary CA. Default:\nhttps://acme-staging-v02.api.letsencrypt.org/directory\n", + "markdownDescription": "test_ca: `string` \nModule: `tls.issuance.acme` \nThe URL to the test CA's ACME directory endpoint.\nThis endpoint is only used during retries if there\nis a failure using the primary CA. Default:\nhttps://acme-staging-v02.api.letsencrypt.org/directory \n", + "type": "string" + }, + "trusted_roots_pem_files": { + "description": "trusted_roots_pem_files: array\nModule: tls.issuance.acme\nAn array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes.\n", + "markdownDescription": "trusted_roots_pem_files: `array` \nModule: `tls.issuance.acme` \nAn array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes. \n", + "type": "array", + "items": { + "description": "An array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes.\n", + "markdownDescription": "An array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes. \n", + "type": "string" + } + } + } + }, + "tls.issuance.internal": { + "description": "internal: object\nModule: tls.issuance.internal\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#InternalIssuer\nInternalIssuer is a certificate issuer that generates\ncertificates internally using a locally-configured\nCA which can be customized using the `pki` app.\n\n", + "markdownDescription": "internal: `object` \nModule: `tls.issuance.internal` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#InternalIssuer) \nInternalIssuer is a certificate issuer that generates\ncertificates internally using a locally-configured\nCA which can be customized using the `pki` app.\n \n", + "type": "object", + "properties": { + "ca": { + "description": "ca: string\nModule: tls.issuance.internal\nThe ID of the CA to use for signing. The default\nCA ID is \"local\". The CA can be configured with the\n`pki` app.\n", + "markdownDescription": "ca: `string` \nModule: `tls.issuance.internal` \nThe ID of the CA to use for signing. The default\nCA ID is \"local\". The CA can be configured with the\n`pki` app. \n", + "type": "string" + }, + "lifetime": { + "description": "lifetime: number\nModule: tls.issuance.internal\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nThe validity period of certificates.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "lifetime: `number` \nModule: `tls.issuance.internal` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nThe validity period of certificates.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "sign_with_root": { + "description": "sign_with_root: boolean\nModule: tls.issuance.internal\nIf true, the root will be the issuer instead of\nthe intermediate. This is NOT recommended and should\nonly be used when devices/clients do not properly\nvalidate certificate chains.\n", + "markdownDescription": "sign_with_root: `boolean` \nModule: `tls.issuance.internal` \nIf true, the root will be the issuer instead of\nthe intermediate. This is NOT recommended and should\nonly be used when devices/clients do not properly\nvalidate certificate chains. \n", + "type": "boolean" + } + } + }, + "tls.issuance.zerossl": { + "description": "zerossl: object\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ZeroSSLIssuer\nZeroSSLIssuer makes an ACME manager\nfor managing certificates using ACME.\n\n", + "markdownDescription": "zerossl: `object` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ZeroSSLIssuer) \nZeroSSLIssuer makes an ACME manager\nfor managing certificates using ACME.\n \n", + "type": "object", + "properties": { + "account_key": { + "description": "account_key: string\nModule: tls.issuance.zerossl\nIf you have an existing account with the ACME server, put\nthe private key here in PEM format. The ACME client will\nlook up your account information with this key first before\ntrying to create a new one. You can use placeholders here,\nfor example if you have it in an environment variable.\n", + "markdownDescription": "account_key: `string` \nModule: `tls.issuance.zerossl` \nIf you have an existing account with the ACME server, put\nthe private key here in PEM format. The ACME client will\nlook up your account information with this key first before\ntrying to create a new one. You can use placeholders here,\nfor example if you have it in an environment variable. \n", + "type": "string" + }, + "acme_timeout": { + "description": "acme_timeout: number\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nTime to wait before timing out an ACME operation.\nDefault: 0 (no timeout)\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "acme_timeout: `number` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nTime to wait before timing out an ACME operation.\nDefault: 0 (no timeout)\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "api_key": { + "description": "api_key: string\nModule: tls.issuance.zerossl\nThe API key (or \"access key\") for using the ZeroSSL API.\n", + "markdownDescription": "api_key: `string` \nModule: `tls.issuance.zerossl` \nThe API key (or \"access key\") for using the ZeroSSL API. \n", + "type": "string" + }, + "ca": { + "description": "ca: string\nModule: tls.issuance.zerossl\nThe URL to the CA's ACME directory endpoint. Default:\nhttps://acme-v02.api.letsencrypt.org/directory\n", + "markdownDescription": "ca: `string` \nModule: `tls.issuance.zerossl` \nThe URL to the CA's ACME directory endpoint. Default:\nhttps://acme-v02.api.letsencrypt.org/directory \n", + "type": "string" + }, + "challenges": { + "description": "challenges: object\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChallengesConfig\nConfigures the various ACME challenge types.\n\n\nChallengesConfig configures the ACME challenges.\n", + "markdownDescription": "challenges: `object` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChallengesConfig) \nConfigures the various ACME challenge types.\n\n\nChallengesConfig configures the ACME challenges. \n", + "type": "object", + "properties": { + "bind_host": { + "description": "bind_host: string\nModule: tls.issuance.zerossl\nOptionally customize the host to which a listener\nis bound if required for solving a challenge.\n", + "markdownDescription": "bind_host: `string` \nModule: `tls.issuance.zerossl` \nOptionally customize the host to which a listener\nis bound if required for solving a challenge. \n", + "type": "string" + }, + "dns": { + "description": "dns: object\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#DNSChallengeConfig\nConfigures the ACME DNS challenge. Because this\nchallenge typically requires credentials for\ninterfacing with a DNS provider, this challenge is\nnot enabled by default. This is the only challenge\ntype which does not require a direct connection\nto Caddy from an external server.\n\nNOTE: DNS providers are currently being upgraded,\nand this API is subject to change, but should be\nstabilized soon.\n\n\nDNSChallengeConfig configures the ACME DNS challenge.\n\nNOTE: This API is still experimental and is subject to change.\n", + "markdownDescription": "dns: `object` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#DNSChallengeConfig) \nConfigures the ACME DNS challenge. Because this\nchallenge typically requires credentials for\ninterfacing with a DNS provider, this challenge is\nnot enabled by default. This is the only challenge\ntype which does not require a direct connection\nto Caddy from an external server.\n\nNOTE: DNS providers are currently being upgraded,\nand this API is subject to change, but should be\nstabilized soon.\n\n\nDNSChallengeConfig configures the ACME DNS challenge.\n\nNOTE: This API is still experimental and is subject to change. \n", + "type": "object", + "properties": { + "override_domain": { + "description": "override_domain: string\nModule: tls.issuance.zerossl\nOverride the domain to use for the DNS challenge. This\nis to delegate the challenge to a different domain,\ne.g. one that updates faster or one with a provider API.\n", + "markdownDescription": "override_domain: `string` \nModule: `tls.issuance.zerossl` \nOverride the domain to use for the DNS challenge. This\nis to delegate the challenge to a different domain,\ne.g. one that updates faster or one with a provider API. \n", + "type": "string" + }, + "propagation_delay": { + "description": "propagation_delay: number\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nHow long to wait before starting propagation checks.\nDefault: 0 (no wait).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "propagation_delay: `number` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nHow long to wait before starting propagation checks.\nDefault: 0 (no wait).\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "propagation_timeout": { + "description": "propagation_timeout: number\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nMaximum time to wait for temporary DNS record to appear.\nSet to -1 to disable propagation checks.\nDefault: 2 minutes.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "propagation_timeout: `number` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nMaximum time to wait for temporary DNS record to appear.\nSet to -1 to disable propagation checks.\nDefault: 2 minutes.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + }, + "provider": { + "description": "provider: any\nModule: dns.providers\nThe DNS provider module to use which will manage\nthe DNS records relevant to the ACME challenge.\n", + "markdownDescription": "provider: `any` \nModule: `dns.providers` \nThe DNS provider module to use which will manage\nthe DNS records relevant to the ACME challenge. \n" + }, + "resolvers": { + "description": "resolvers: array\nModule: tls.issuance.zerossl\nCustom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS.\n", + "markdownDescription": "resolvers: `array` \nModule: `tls.issuance.zerossl` \nCustom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS. \n", + "type": "array", + "items": { + "description": "Custom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS.\n", + "markdownDescription": "Custom DNS resolvers to prefer over system/built-in defaults.\nOften necessary to configure when using split-horizon DNS. \n", + "type": "string" + } + }, + "ttl": { + "description": "ttl: number\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration\nThe TTL of the TXT record used for the DNS challenge.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`.\n", + "markdownDescription": "ttl: `number` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Duration) \nThe TTL of the TXT record used for the DNS challenge.\n\n\nDuration can be an integer or a string. An integer is\ninterpreted as nanoseconds. If a string, it is a Go\ntime.Duration value such as `300ms`, `1.5h`, or `2h45m`;\nvalid units are `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`, and `d`. \n", + "type": "number" + } + } + }, + "http": { + "description": "http: object\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#HTTPChallengeConfig\nHTTP configures the ACME HTTP challenge. This\nchallenge is enabled and used automatically\nand by default.\n\n\nHTTPChallengeConfig configures the ACME HTTP challenge.\n", + "markdownDescription": "http: `object` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#HTTPChallengeConfig) \nHTTP configures the ACME HTTP challenge. This\nchallenge is enabled and used automatically\nand by default.\n\n\nHTTPChallengeConfig configures the ACME HTTP challenge. \n", + "type": "object", + "properties": { + "alternate_port": { + "description": "alternate_port: number\nModule: tls.issuance.zerossl\nAn alternate port on which to service this\nchallenge. Note that the HTTP challenge port is\nhard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard HTTP challenge port to this one.\n", + "markdownDescription": "alternate_port: `number` \nModule: `tls.issuance.zerossl` \nAn alternate port on which to service this\nchallenge. Note that the HTTP challenge port is\nhard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard HTTP challenge port to this one. \n", + "type": "number" + }, + "disabled": { + "description": "disabled: boolean\nModule: tls.issuance.zerossl\nIf true, the HTTP challenge will be disabled.\n", + "markdownDescription": "disabled: `boolean` \nModule: `tls.issuance.zerossl` \nIf true, the HTTP challenge will be disabled. \n", + "type": "boolean" + } + } + }, + "tls-alpn": { + "description": "tls-alpn: object\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#TLSALPNChallengeConfig\nTLSALPN configures the ACME TLS-ALPN challenge.\nThis challenge is enabled and used automatically\nand by default.\n\n\nTLSALPNChallengeConfig configures the ACME TLS-ALPN challenge.\n", + "markdownDescription": "tls-alpn: `object` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#TLSALPNChallengeConfig) \nTLSALPN configures the ACME TLS-ALPN challenge.\nThis challenge is enabled and used automatically\nand by default.\n\n\nTLSALPNChallengeConfig configures the ACME TLS-ALPN challenge. \n", + "type": "object", + "properties": { + "alternate_port": { + "description": "alternate_port: number\nModule: tls.issuance.zerossl\nAn alternate port on which to service this\nchallenge. Note that the TLS-ALPN challenge port\nis hard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard TLS-ALPN challenge port to this one.\n", + "markdownDescription": "alternate_port: `number` \nModule: `tls.issuance.zerossl` \nAn alternate port on which to service this\nchallenge. Note that the TLS-ALPN challenge port\nis hard-coded into the spec and cannot be changed,\nso you would have to forward packets from the\nstandard TLS-ALPN challenge port to this one. \n", + "type": "number" + }, + "disabled": { + "description": "disabled: boolean\nModule: tls.issuance.zerossl\nIf true, the TLS-ALPN challenge will be disabled.\n", + "markdownDescription": "disabled: `boolean` \nModule: `tls.issuance.zerossl` \nIf true, the TLS-ALPN challenge will be disabled. \n", + "type": "boolean" + } + } + } + } + }, + "email": { + "description": "email: string\nModule: tls.issuance.zerossl\nYour email address, so the CA can contact you if necessary.\nNot required, but strongly recommended to provide one so\nyou can be reached if there is a problem. Your email is\nnot sent to any Caddy mothership or used for any purpose\nother than ACME transactions.\n", + "markdownDescription": "email: `string` \nModule: `tls.issuance.zerossl` \nYour email address, so the CA can contact you if necessary.\nNot required, but strongly recommended to provide one so\nyou can be reached if there is a problem. Your email is\nnot sent to any Caddy mothership or used for any purpose\nother than ACME transactions. \n", + "type": "string" + }, + "external_account": { + "description": "external_account: object\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/mholt/acmez/acme#EAB\nIf using an ACME CA that requires an external account\nbinding, specify the CA-provided credentials here.\n\n\nEAB (External Account Binding) contains information\nnecessary to bind or map an ACME account to some\nother account known by the CA.\n\nExternal account bindings are \"used to associate an\nACME account with an existing account in a non-ACME\nsystem, such as a CA customer database.\"\n\n\"To enable ACME account binding, the CA operating the\nACME server needs to provide the ACME client with a\nMAC key and a key identifier, using some mechanism\noutside of ACME.\" §7.3.4\n", + "markdownDescription": "external_account: `object` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/mholt/acmez/acme#EAB) \nIf using an ACME CA that requires an external account\nbinding, specify the CA-provided credentials here.\n\n\nEAB (External Account Binding) contains information\nnecessary to bind or map an ACME account to some\nother account known by the CA.\n\nExternal account bindings are \"used to associate an\nACME account with an existing account in a non-ACME\nsystem, such as a CA customer database.\"\n\n\"To enable ACME account binding, the CA operating the\nACME server needs to provide the ACME client with a\nMAC key and a key identifier, using some mechanism\noutside of ACME.\" §7.3.4 \n", + "type": "object", + "properties": { + "key_id": { + "description": "key_id: string\nModule: tls.issuance.zerossl\n\"The key identifier MUST be an ASCII string.\" §7.3.4\n", + "markdownDescription": "key_id: `string` \nModule: `tls.issuance.zerossl` \n\"The key identifier MUST be an ASCII string.\" §7.3.4 \n", + "type": "string" + }, + "mac_key": { + "description": "mac_key: string\nModule: tls.issuance.zerossl\n\"The MAC key SHOULD be provided in base64url-encoded\nform, to maximize compatibility between non-ACME\nprovisioning systems and ACME clients.\" §7.3.4\n", + "markdownDescription": "mac_key: `string` \nModule: `tls.issuance.zerossl` \n\"The MAC key SHOULD be provided in base64url-encoded\nform, to maximize compatibility between non-ACME\nprovisioning systems and ACME clients.\" §7.3.4 \n", + "type": "string" + } + } + }, + "preferred_chains": { + "description": "preferred_chains: object\nModule: tls.issuance.zerossl\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChainPreference\nPreferences for selecting alternate certificate chains, if offered\nby the CA. By default, the first offered chain will be selected.\nIf configured, the chains may be sorted and the first matching chain\nwill be selected.\n\n\nChainPreference describes the client's preferred certificate chain,\nuseful if the CA offers alternate chains. The first matching chain\nwill be selected.\n", + "markdownDescription": "preferred_chains: `object` \nModule: `tls.issuance.zerossl` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls#ChainPreference) \nPreferences for selecting alternate certificate chains, if offered\nby the CA. By default, the first offered chain will be selected.\nIf configured, the chains may be sorted and the first matching chain\nwill be selected.\n\n\nChainPreference describes the client's preferred certificate chain,\nuseful if the CA offers alternate chains. The first matching chain\nwill be selected. \n", + "type": "object", + "properties": { + "any_common_name": { + "description": "any_common_name: array\nModule: tls.issuance.zerossl\nSelect first chain that has any issuer with one\nof these common names.\n", + "markdownDescription": "any_common_name: `array` \nModule: `tls.issuance.zerossl` \nSelect first chain that has any issuer with one\nof these common names. \n", + "type": "array", + "items": { + "description": "Select first chain that has any issuer with one\nof these common names.\n", + "markdownDescription": "Select first chain that has any issuer with one\nof these common names. \n", + "type": "string" + } + }, + "root_common_name": { + "description": "root_common_name: array\nModule: tls.issuance.zerossl\nSelect first chain having a root with one of\nthese common names.\n", + "markdownDescription": "root_common_name: `array` \nModule: `tls.issuance.zerossl` \nSelect first chain having a root with one of\nthese common names. \n", + "type": "array", + "items": { + "description": "Select first chain having a root with one of\nthese common names.\n", + "markdownDescription": "Select first chain having a root with one of\nthese common names. \n", + "type": "string" + } + }, + "smallest": { + "description": "smallest: boolean\nModule: tls.issuance.zerossl\nPrefer chains with the fewest number of bytes.\n", + "markdownDescription": "smallest: `boolean` \nModule: `tls.issuance.zerossl` \nPrefer chains with the fewest number of bytes. \n", + "type": "boolean" + } + } + }, + "test_ca": { + "description": "test_ca: string\nModule: tls.issuance.zerossl\nThe URL to the test CA's ACME directory endpoint.\nThis endpoint is only used during retries if there\nis a failure using the primary CA. Default:\nhttps://acme-staging-v02.api.letsencrypt.org/directory\n", + "markdownDescription": "test_ca: `string` \nModule: `tls.issuance.zerossl` \nThe URL to the test CA's ACME directory endpoint.\nThis endpoint is only used during retries if there\nis a failure using the primary CA. Default:\nhttps://acme-staging-v02.api.letsencrypt.org/directory \n", + "type": "string" + }, + "trusted_roots_pem_files": { + "description": "trusted_roots_pem_files: array\nModule: tls.issuance.zerossl\nAn array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes.\n", + "markdownDescription": "trusted_roots_pem_files: `array` \nModule: `tls.issuance.zerossl` \nAn array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes. \n", + "type": "array", + "items": { + "description": "An array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes.\n", + "markdownDescription": "An array of files of CA certificates to accept when connecting to the\nACME CA. Generally, you should only use this if the ACME CA endpoint\nis internal or for development/testing purposes. \n", + "type": "string" + } + } + } + }, + "tls.stek.distributed": { + "description": "distributed: object\nModule: tls.stek.distributed\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls/distributedstek#Provider\nProvider implements a distributed STEK provider. This\nmodule will obtain STEKs from a storage module instead\nof generating STEKs internally. This allows STEKs to be\ncoordinated, improving TLS session resumption in a cluster.\n\n", + "markdownDescription": "distributed: `object` \nModule: `tls.stek.distributed` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2/modules/caddytls/distributedstek#Provider) \nProvider implements a distributed STEK provider. This\nmodule will obtain STEKs from a storage module instead\nof generating STEKs internally. This allows STEKs to be\ncoordinated, improving TLS session resumption in a cluster.\n \n", + "type": "object", + "properties": { + "storage": { + "description": "storage: object\nModule: caddy.storage\nThe storage module wherein to store and obtain session\nticket keys. If unset, Caddy's default/global-configured\nstorage module will be used.\n", + "markdownDescription": "storage: `object` \nModule: `caddy.storage` \nThe storage module wherein to store and obtain session\nticket keys. If unset, Caddy's default/global-configured\nstorage module will be used. \n", + "type": "object", + "required": [ + "module" + ], + "allOf": [ + { + "if": { + "properties": { + "module": { + "const": "consul" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.consul" + } + }, + { + "if": { + "properties": { + "module": { + "const": "file_system" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.file_system" + } + }, + { + "properties": { + "module": { + "description": "key to identify storage module.\nmodule: string\nModule: caddy.storage", + "markdownDescription": "key to identify `storage` module. \nmodule: `string` \nModule: `caddy.storage`", + "type": "string", + "enum": [ + "consul", + "file_system" + ] + } + } + } + ] + } + } + }, + "tls.stek.standard": { + "description": "standard: object\nModule: tls.stek.standard", + "markdownDescription": "standard: `object` \nModule: `tls.stek.standard`", + "type": "object" + } + }, + "properties": { + "admin": { + "description": "admin: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminConfig\nAdminConfig configures Caddy's API endpoint, which is used\nto manage Caddy while it is running.\n\n", + "markdownDescription": "admin: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminConfig) \nAdminConfig configures Caddy's API endpoint, which is used\nto manage Caddy while it is running.\n \n", + "type": "object", + "properties": { + "config": { + "description": "config: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ConfigSettings\nOptions pertaining to configuration management.\n\n\nConfigSettings configures the management of configuration.\n", + "markdownDescription": "config: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ConfigSettings) \nOptions pertaining to configuration management.\n\n\nConfigSettings configures the management of configuration. \n", + "type": "object", + "properties": { + "load": { + "description": "load: object\nModule: caddy.config_loaders\nLoads a configuration to use. This is helpful if your configs are\nmanaged elsewhere, and you want Caddy to pull its config dynamically\nwhen it starts. The pulled config completely replaces the current\none, just like any other config load. It is an error if a pulled\nconfig is configured to pull another config.\n\nEXPERIMENTAL: Subject to change.\n", + "markdownDescription": "load: `object` \nModule: `caddy.config_loaders` \nLoads a configuration to use. This is helpful if your configs are\nmanaged elsewhere, and you want Caddy to pull its config dynamically\nwhen it starts. The pulled config completely replaces the current\none, just like any other config load. It is an error if a pulled\nconfig is configured to pull another config.\n\nEXPERIMENTAL: Subject to change. \n", + "type": "object", + "required": [ + "module" + ], + "allOf": [ + { + "if": { + "properties": { + "module": { + "const": "http" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.config_loaders.http" + } + }, + { + "properties": { + "module": { + "description": "key to identify load module.\nmodule: string\nModule: caddy.config_loaders", + "markdownDescription": "key to identify `load` module. \nmodule: `string` \nModule: `caddy.config_loaders`", + "type": "string", + "enum": [ + "http" + ] + } + } + } + ] + }, + "load_delay": { + "description": "load_delay: number", + "markdownDescription": "load_delay: `number`", + "type": "number" + }, + "persist": { + "description": "persist: boolean\nWhether to keep a copy of the active config on disk. Default is true.\nNote that \"pulled\" dynamic configs (using the neighboring \"load\" module)\nare not persisted; only configs that are pushed to Caddy get persisted.\n", + "markdownDescription": "persist: `boolean` \nWhether to keep a copy of the active config on disk. Default is true.\nNote that \"pulled\" dynamic configs (using the neighboring \"load\" module)\nare not persisted; only configs that are pushed to Caddy get persisted. \n", + "type": "boolean" + } + } + }, + "disabled": { + "description": "disabled: boolean\nIf true, the admin endpoint will be completely disabled.\nNote that this makes any runtime changes to the config\nimpossible, since the interface to do so is through the\nadmin endpoint.\n", + "markdownDescription": "disabled: `boolean` \nIf true, the admin endpoint will be completely disabled.\nNote that this makes any runtime changes to the config\nimpossible, since the interface to do so is through the\nadmin endpoint. \n", + "type": "boolean" + }, + "enforce_origin": { + "description": "enforce_origin: boolean\nIf true, CORS headers will be emitted, and requests to the\nAPI will be rejected if their `Host` and `Origin` headers\ndo not match the expected value(s). Use `origins` to\ncustomize which origins/hosts are allowed. If `origins` is\nnot set, the listen address is the only value allowed by\ndefault. Enforced only on local (plaintext) endpoint.\n", + "markdownDescription": "enforce_origin: `boolean` \nIf true, CORS headers will be emitted, and requests to the\nAPI will be rejected if their `Host` and `Origin` headers\ndo not match the expected value(s). Use `origins` to\ncustomize which origins/hosts are allowed. If `origins` is\nnot set, the listen address is the only value allowed by\ndefault. Enforced only on local (plaintext) endpoint. \n", + "type": "boolean" + }, + "identity": { + "description": "identity: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#IdentityConfig\nOptions that establish this server's identity. Identity refers to\ncredentials which can be used to uniquely identify and authenticate\nthis server instance. This is required if remote administration is\nenabled (but does not require remote administration to be enabled).\nDefault: no identity management.\n\n\nIdentityConfig configures management of this server's identity. An identity\nconsists of credentials that uniquely verify this instance; for example,\nTLS certificates (public + private key pairs).\n", + "markdownDescription": "identity: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#IdentityConfig) \nOptions that establish this server's identity. Identity refers to\ncredentials which can be used to uniquely identify and authenticate\nthis server instance. This is required if remote administration is\nenabled (but does not require remote administration to be enabled).\nDefault: no identity management.\n\n\nIdentityConfig configures management of this server's identity. An identity\nconsists of credentials that uniquely verify this instance; for example,\nTLS certificates (public + private key pairs). \n", + "type": "object", + "properties": { + "identifiers": { + "description": "identifiers: array\nList of names or IP addresses which refer to this server.\nCertificates will be obtained for these identifiers so\nsecure TLS connections can be made using them.\n", + "markdownDescription": "identifiers: `array` \nList of names or IP addresses which refer to this server.\nCertificates will be obtained for these identifiers so\nsecure TLS connections can be made using them. \n", + "type": "array", + "items": { + "description": "List of names or IP addresses which refer to this server.\nCertificates will be obtained for these identifiers so\nsecure TLS connections can be made using them.\n", + "markdownDescription": "List of names or IP addresses which refer to this server.\nCertificates will be obtained for these identifiers so\nsecure TLS connections can be made using them. \n", + "type": "string" + } + }, + "issuers": { + "description": "issuers: array\nModule: tls.issuance\nIssuers that can provide this admin endpoint its identity\ncertificate(s). Default: ACME issuers configured for\nZeroSSL and Let's Encrypt. Be sure to change this if you\nrequire credentials for private identifiers.\n", + "markdownDescription": "issuers: `array` \nModule: `tls.issuance` \nIssuers that can provide this admin endpoint its identity\ncertificate(s). Default: ACME issuers configured for\nZeroSSL and Let's Encrypt. Be sure to change this if you\nrequire credentials for private identifiers. \n", + "type": "array", + "items": { + "description": "Issuers that can provide this admin endpoint its identity\ncertificate(s). Default: ACME issuers configured for\nZeroSSL and Let's Encrypt. Be sure to change this if you\nrequire credentials for private identifiers.\n", + "markdownDescription": "Issuers that can provide this admin endpoint its identity\ncertificate(s). Default: ACME issuers configured for\nZeroSSL and Let's Encrypt. Be sure to change this if you\nrequire credentials for private identifiers. \n", + "required": [ + "module" + ], + "allOf": [ + { + "if": { + "properties": { + "module": { + "const": "acme" + } + } + }, + "then": { + "$ref": "#/definitions/tls.issuance.acme" + } + }, + { + "if": { + "properties": { + "module": { + "const": "internal" + } + } + }, + "then": { + "$ref": "#/definitions/tls.issuance.internal" + } + }, + { + "if": { + "properties": { + "module": { + "const": "zerossl" + } + } + }, + "then": { + "$ref": "#/definitions/tls.issuance.zerossl" + } + }, + { + "properties": { + "module": { + "description": "key to identify issuers module.\nmodule: string\nModule: tls.issuance", + "markdownDescription": "key to identify `issuers` module. \nmodule: `string` \nModule: `tls.issuance`", + "type": "string", + "enum": [ + "acme", + "internal", + "zerossl" + ] + } + } + } + ] + } + } + } + }, + "listen": { + "description": "listen: string\nThe address to which the admin endpoint's listener should\nbind itself. Can be any single network address that can be\nparsed by Caddy. Default: localhost:2019\n", + "markdownDescription": "listen: `string` \nThe address to which the admin endpoint's listener should\nbind itself. Can be any single network address that can be\nparsed by Caddy. Default: localhost:2019 \n", + "type": "string" + }, + "origins": { + "description": "origins: array\nThe list of allowed origins/hosts for API requests. Only needed\nif accessing the admin endpoint from a host different from the\nsocket's network interface or if `enforce_origin` is true. If not\nset, the listener address will be the default value. If set but\nempty, no origins will be allowed. Enforced only on local\n(plaintext) endpoint.\n", + "markdownDescription": "origins: `array` \nThe list of allowed origins/hosts for API requests. Only needed\nif accessing the admin endpoint from a host different from the\nsocket's network interface or if `enforce_origin` is true. If not\nset, the listener address will be the default value. If set but\nempty, no origins will be allowed. Enforced only on local\n(plaintext) endpoint. \n", + "type": "array", + "items": { + "description": "The list of allowed origins/hosts for API requests. Only needed\nif accessing the admin endpoint from a host different from the\nsocket's network interface or if `enforce_origin` is true. If not\nset, the listener address will be the default value. If set but\nempty, no origins will be allowed. Enforced only on local\n(plaintext) endpoint.\n", + "markdownDescription": "The list of allowed origins/hosts for API requests. Only needed\nif accessing the admin endpoint from a host different from the\nsocket's network interface or if `enforce_origin` is true. If not\nset, the listener address will be the default value. If set but\nempty, no origins will be allowed. Enforced only on local\n(plaintext) endpoint. \n", + "type": "string" + } + }, + "remote": { + "description": "remote: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#RemoteAdmin\nOptions pertaining to remote administration. By default, remote\nadministration is disabled. If enabled, identity management must\nalso be configured, as that is how the endpoint is secured.\nSee the neighboring \"identity\" object.\n\nEXPERIMENTAL: This feature is subject to change.\n\n\nRemoteAdmin enables and configures remote administration. If enabled,\na secure listener enforcing mutual TLS authentication will be started\non a different port from the standard plaintext admin server.\n\nThis endpoint is secured using identity management, which must be\nconfigured separately (because identity management does not depend\non remote administration). See the admin/identity config struct.\n\nEXPERIMENTAL: Subject to change.\n", + "markdownDescription": "remote: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#RemoteAdmin) \nOptions pertaining to remote administration. By default, remote\nadministration is disabled. If enabled, identity management must\nalso be configured, as that is how the endpoint is secured.\nSee the neighboring \"identity\" object.\n\nEXPERIMENTAL: This feature is subject to change.\n\n\nRemoteAdmin enables and configures remote administration. If enabled,\na secure listener enforcing mutual TLS authentication will be started\non a different port from the standard plaintext admin server.\n\nThis endpoint is secured using identity management, which must be\nconfigured separately (because identity management does not depend\non remote administration). See the admin/identity config struct.\n\nEXPERIMENTAL: Subject to change. \n", + "type": "object", + "properties": { + "access_control": { + "description": "access_control: array\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminAccess\nList of access controls for this secure admin endpoint.\nThis configures TLS mutual authentication (i.e. authorized\nclient certificates), but also application-layer permissions\nlike which paths and methods each identity is authorized for.\n\n\nAdminAccess specifies what permissions an identity or group\nof identities are granted.\n", + "markdownDescription": "access_control: `array` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminAccess) \nList of access controls for this secure admin endpoint.\nThis configures TLS mutual authentication (i.e. authorized\nclient certificates), but also application-layer permissions\nlike which paths and methods each identity is authorized for.\n\n\nAdminAccess specifies what permissions an identity or group\nof identities are granted. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminAccess\nList of access controls for this secure admin endpoint.\nThis configures TLS mutual authentication (i.e. authorized\nclient certificates), but also application-layer permissions\nlike which paths and methods each identity is authorized for.\n\n\nAdminAccess specifies what permissions an identity or group\nof identities are granted.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminAccess) \nList of access controls for this secure admin endpoint.\nThis configures TLS mutual authentication (i.e. authorized\nclient certificates), but also application-layer permissions\nlike which paths and methods each identity is authorized for.\n\n\nAdminAccess specifies what permissions an identity or group\nof identities are granted. \n", + "type": "object", + "properties": { + "permissions": { + "description": "permissions: array\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminPermissions\nLimits what the associated identities are allowed to do.\nIf unspecified, all permissions are granted.\n\n\nAdminPermissions specifies what kinds of requests are allowed\nto be made to the admin endpoint.\n", + "markdownDescription": "permissions: `array` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminPermissions) \nLimits what the associated identities are allowed to do.\nIf unspecified, all permissions are granted.\n\n\nAdminPermissions specifies what kinds of requests are allowed\nto be made to the admin endpoint. \n", + "type": "array", + "items": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminPermissions\nLimits what the associated identities are allowed to do.\nIf unspecified, all permissions are granted.\n\n\nAdminPermissions specifies what kinds of requests are allowed\nto be made to the admin endpoint.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#AdminPermissions) \nLimits what the associated identities are allowed to do.\nIf unspecified, all permissions are granted.\n\n\nAdminPermissions specifies what kinds of requests are allowed\nto be made to the admin endpoint. \n", + "type": "object", + "properties": { + "methods": { + "description": "methods: array\nThe HTTP methods allowed for the given paths.\n", + "markdownDescription": "methods: `array` \nThe HTTP methods allowed for the given paths. \n", + "type": "array", + "items": { + "description": "The HTTP methods allowed for the given paths.\n", + "markdownDescription": "The HTTP methods allowed for the given paths. \n", + "type": "string" + } + }, + "paths": { + "description": "paths: array\nThe API paths allowed. Paths are simple prefix matches.\nAny subpath of the specified paths will be allowed.\n", + "markdownDescription": "paths: `array` \nThe API paths allowed. Paths are simple prefix matches.\nAny subpath of the specified paths will be allowed. \n", + "type": "array", + "items": { + "description": "The API paths allowed. Paths are simple prefix matches.\nAny subpath of the specified paths will be allowed.\n", + "markdownDescription": "The API paths allowed. Paths are simple prefix matches.\nAny subpath of the specified paths will be allowed. \n", + "type": "string" + } + } + } + } + }, + "public_keys": { + "description": "public_keys: array\nBase64-encoded DER certificates containing public keys to accept.\n(The contents of PEM certificate blocks are base64-encoded DER.)\nAny of these public keys can appear in any part of a verified chain.\n", + "markdownDescription": "public_keys: `array` \nBase64-encoded DER certificates containing public keys to accept.\n(The contents of PEM certificate blocks are base64-encoded DER.)\nAny of these public keys can appear in any part of a verified chain. \n", + "type": "array", + "items": { + "description": "Base64-encoded DER certificates containing public keys to accept.\n(The contents of PEM certificate blocks are base64-encoded DER.)\nAny of these public keys can appear in any part of a verified chain.\n", + "markdownDescription": "Base64-encoded DER certificates containing public keys to accept.\n(The contents of PEM certificate blocks are base64-encoded DER.)\nAny of these public keys can appear in any part of a verified chain. \n", + "type": "string" + } + } + } + } + }, + "listen": { + "description": "listen: string\nThe address on which to start the secure listener.\nDefault: :2021\n", + "markdownDescription": "listen: `string` \nThe address on which to start the secure listener.\nDefault: :2021 \n", + "type": "string" + } + } + } + } + }, + "apps": { + "description": "apps: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap\nAppsRaw are the apps that Caddy will load and run. The\napp module name is the key, and the app's config is the\nassociated value.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage.\n", + "markdownDescription": "apps: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#ModuleMap) \nAppsRaw are the apps that Caddy will load and run. The\napp module name is the key, and the app's config is the\nassociated value.\n\n\nModuleMap is a map that can contain multiple modules,\nwhere the map key is the module's name. (The namespace\nis usually read from an associated field's struct tag.)\nBecause the module's name is given as the key in a\nmodule map, the name does not have to be given in the\njson.RawMessage. \n", + "type": "object", + "properties": { + "http": { + "$ref": "#/definitions/http" + }, + "layer4": { + "$ref": "#/definitions/layer4" + }, + "pki": { + "$ref": "#/definitions/pki" + }, + "tls": { + "$ref": "#/definitions/tls" + } + } + }, + "logging": { + "description": "logging: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Logging\nLogging facilitates logging within Caddy. The default log is\ncalled \"default\" and you can customize it. You can also define\nadditional logs.\n\nBy default, all logs at INFO level and higher are written to\nstandard error (\"stderr\" writer) in a human-readable format\n(\"console\" encoder if stdout is an interactive terminal, \"json\"\nencoder otherwise).\n\nAll defined logs accept all log entries by default, but you\ncan filter by level and module/logger names. A logger's name\nis the same as the module's name, but a module may append to\nlogger names for more specificity. For example, you can\nfilter logs emitted only by HTTP handlers using the name\n\"http.handlers\", because all HTTP handler module names have\nthat prefix.\n\nCaddy logs (except the sink) are zero-allocation, so they are\nvery high-performing in terms of memory and CPU time. Enabling\nsampling can further increase throughput on extremely high-load\nservers.\n\n", + "markdownDescription": "logging: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#Logging) \nLogging facilitates logging within Caddy. The default log is\ncalled \"default\" and you can customize it. You can also define\nadditional logs.\n\nBy default, all logs at INFO level and higher are written to\nstandard error (\"stderr\" writer) in a human-readable format\n(\"console\" encoder if stdout is an interactive terminal, \"json\"\nencoder otherwise).\n\nAll defined logs accept all log entries by default, but you\ncan filter by level and module/logger names. A logger's name\nis the same as the module's name, but a module may append to\nlogger names for more specificity. For example, you can\nfilter logs emitted only by HTTP handlers using the name\n\"http.handlers\", because all HTTP handler module names have\nthat prefix.\n\nCaddy logs (except the sink) are zero-allocation, so they are\nvery high-performing in terms of memory and CPU time. Enabling\nsampling can further increase throughput on extremely high-load\nservers.\n \n", + "type": "object", + "properties": { + "logs": { + "description": "logs: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#CustomLog\nLogs are your logs, keyed by an arbitrary name of your\nchoosing. The default log can be customized by defining\na log called \"default\". You can further define other logs\nand filter what kinds of entries they accept.\n\n\nCustomLog represents a custom logger configuration.\n\nBy default, a log will emit all log entries. Some entries\nwill be skipped if sampling is enabled. Further, the Include\nand Exclude parameters define which loggers (by name) are\nallowed or rejected from emitting in this log. If both Include\nand Exclude are populated, their values must be mutually\nexclusive, and longer namespaces have priority. If neither\nare populated, all logs are emitted.\n", + "markdownDescription": "logs: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#CustomLog) \nLogs are your logs, keyed by an arbitrary name of your\nchoosing. The default log can be customized by defining\na log called \"default\". You can further define other logs\nand filter what kinds of entries they accept.\n\n\nCustomLog represents a custom logger configuration.\n\nBy default, a log will emit all log entries. Some entries\nwill be skipped if sampling is enabled. Further, the Include\nand Exclude parameters define which loggers (by name) are\nallowed or rejected from emitting in this log. If both Include\nand Exclude are populated, their values must be mutually\nexclusive, and longer namespaces have priority. If neither\nare populated, all logs are emitted. \n", + "type": "object", + "additionalProperties": { + "description": "https://pkg.go.dev/github.com/caddyserver/caddy/v2#CustomLog\nLogs are your logs, keyed by an arbitrary name of your\nchoosing. The default log can be customized by defining\na log called \"default\". You can further define other logs\nand filter what kinds of entries they accept.\n\n\nCustomLog represents a custom logger configuration.\n\nBy default, a log will emit all log entries. Some entries\nwill be skipped if sampling is enabled. Further, the Include\nand Exclude parameters define which loggers (by name) are\nallowed or rejected from emitting in this log. If both Include\nand Exclude are populated, their values must be mutually\nexclusive, and longer namespaces have priority. If neither\nare populated, all logs are emitted.\n", + "markdownDescription": "[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#CustomLog) \nLogs are your logs, keyed by an arbitrary name of your\nchoosing. The default log can be customized by defining\na log called \"default\". You can further define other logs\nand filter what kinds of entries they accept.\n\n\nCustomLog represents a custom logger configuration.\n\nBy default, a log will emit all log entries. Some entries\nwill be skipped if sampling is enabled. Further, the Include\nand Exclude parameters define which loggers (by name) are\nallowed or rejected from emitting in this log. If both Include\nand Exclude are populated, their values must be mutually\nexclusive, and longer namespaces have priority. If neither\nare populated, all logs are emitted. \n", + "properties": { + "encoder": { + "description": "encoder: object\nModule: caddy.logging.encoders\nThe encoder is how the log entries are formatted or encoded.\n", + "markdownDescription": "encoder: `object` \nModule: `caddy.logging.encoders` \nThe encoder is how the log entries are formatted or encoded. \n", + "type": "object", + "required": [ + "format" + ], + "allOf": [ + { + "if": { + "properties": { + "format": { + "const": "console" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.console" + } + }, + { + "if": { + "properties": { + "format": { + "const": "filter" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.filter" + } + }, + { + "if": { + "properties": { + "format": { + "const": "json" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.encoders.json" + } + }, + { + "properties": { + "format": { + "description": "key to identify encoder module.\nformat: string\nModule: caddy.logging.encoders", + "markdownDescription": "key to identify `encoder` module. \nformat: `string` \nModule: `caddy.logging.encoders`", + "type": "string", + "enum": [ + "console", + "filter", + "json" + ] + } + } + } + ] + }, + "exclude": { + "description": "exclude: array\nExclude defines the names of loggers that should be\nskipped by this log. For example, to exclude only\nHTTP access logs, you would exclude \"http.log.access\".\n", + "markdownDescription": "exclude: `array` \nExclude defines the names of loggers that should be\nskipped by this log. For example, to exclude only\nHTTP access logs, you would exclude \"http.log.access\". \n", + "type": "array", + "items": { + "description": "Exclude defines the names of loggers that should be\nskipped by this log. For example, to exclude only\nHTTP access logs, you would exclude \"http.log.access\".\n", + "markdownDescription": "Exclude defines the names of loggers that should be\nskipped by this log. For example, to exclude only\nHTTP access logs, you would exclude \"http.log.access\". \n", + "type": "string" + } + }, + "include": { + "description": "include: array\nInclude defines the names of loggers to emit in this\nlog. For example, to include only logs emitted by the\nadmin API, you would include \"admin.api\".\n", + "markdownDescription": "include: `array` \nInclude defines the names of loggers to emit in this\nlog. For example, to include only logs emitted by the\nadmin API, you would include \"admin.api\". \n", + "type": "array", + "items": { + "description": "Include defines the names of loggers to emit in this\nlog. For example, to include only logs emitted by the\nadmin API, you would include \"admin.api\".\n", + "markdownDescription": "Include defines the names of loggers to emit in this\nlog. For example, to include only logs emitted by the\nadmin API, you would include \"admin.api\". \n", + "type": "string" + } + }, + "level": { + "description": "level: string\nLevel is the minimum level to emit, and is inclusive.\nPossible levels: DEBUG, INFO, WARN, ERROR, PANIC, and FATAL\n", + "markdownDescription": "level: `string` \nLevel is the minimum level to emit, and is inclusive.\nPossible levels: DEBUG, INFO, WARN, ERROR, PANIC, and FATAL \n", + "type": "string" + }, + "sampling": { + "description": "sampling: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#LogSampling\nSampling configures log entry sampling. If enabled,\nonly some log entries will be emitted. This is useful\nfor improving performance on extremely high-pressure\nservers.\n\n\nLogSampling configures log entry sampling.\n", + "markdownDescription": "sampling: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#LogSampling) \nSampling configures log entry sampling. If enabled,\nonly some log entries will be emitted. This is useful\nfor improving performance on extremely high-pressure\nservers.\n\n\nLogSampling configures log entry sampling. \n", + "type": "object", + "properties": { + "first": { + "description": "first: number\nLog this many entries within a given level and\nmessage for each interval.\n", + "markdownDescription": "first: `number` \nLog this many entries within a given level and\nmessage for each interval. \n", + "type": "number" + }, + "interval": { + "description": "interval: number\nhttps://pkg.go.dev/time#Duration\nThe window over which to conduct sampling.\n\n\nA Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years.\n", + "markdownDescription": "interval: `number` \n[godoc](https://pkg.go.dev/time#Duration) \nThe window over which to conduct sampling.\n\n\nA Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years. \n", + "type": "number" + }, + "thereafter": { + "description": "thereafter: number\nIf more entries with the same level and message\nare seen during the same interval, keep one in\nthis many entries until the end of the interval.\n", + "markdownDescription": "thereafter: `number` \nIf more entries with the same level and message\nare seen during the same interval, keep one in\nthis many entries until the end of the interval. \n", + "type": "number" + } + } + }, + "writer": { + "description": "writer: object\nModule: caddy.logging.writers\nThe writer defines where log entries are emitted.\n", + "markdownDescription": "writer: `object` \nModule: `caddy.logging.writers` \nThe writer defines where log entries are emitted. \n", + "type": "object", + "required": [ + "output" + ], + "allOf": [ + { + "if": { + "properties": { + "output": { + "const": "discard" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.discard" + } + }, + { + "if": { + "properties": { + "output": { + "const": "file" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.file" + } + }, + { + "if": { + "properties": { + "output": { + "const": "net" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.net" + } + }, + { + "if": { + "properties": { + "output": { + "const": "stderr" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.stderr" + } + }, + { + "if": { + "properties": { + "output": { + "const": "stdout" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.stdout" + } + }, + { + "properties": { + "output": { + "description": "key to identify writer module.\noutput: string\nModule: caddy.logging.writers", + "markdownDescription": "key to identify `writer` module. \noutput: `string` \nModule: `caddy.logging.writers`", + "type": "string", + "enum": [ + "discard", + "file", + "net", + "stderr", + "stdout" + ] + } + } + } + ] + } + } + } + }, + "sink": { + "description": "sink: object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#StandardLibLog\nSink is the destination for all unstructured logs emitted\nfrom Go's standard library logger. These logs are common\nin dependencies that are not designed specifically for use\nin Caddy. Because it is global and unstructured, the sink\nlacks most advanced features and customizations.\n\n\nStandardLibLog configures the default Go standard library\nglobal logger in the log package. This is necessary because\nmodule dependencies which are not built specifically for\nCaddy will use the standard logger. This is also known as\nthe \"sink\" logger.\n", + "markdownDescription": "sink: `object` \n[godoc](https://pkg.go.dev/github.com/caddyserver/caddy/v2#StandardLibLog) \nSink is the destination for all unstructured logs emitted\nfrom Go's standard library logger. These logs are common\nin dependencies that are not designed specifically for use\nin Caddy. Because it is global and unstructured, the sink\nlacks most advanced features and customizations.\n\n\nStandardLibLog configures the default Go standard library\nglobal logger in the log package. This is necessary because\nmodule dependencies which are not built specifically for\nCaddy will use the standard logger. This is also known as\nthe \"sink\" logger. \n", + "type": "object", + "properties": { + "writer": { + "description": "writer: object\nModule: caddy.logging.writers\nThe module that writes out log entries for the sink.\n", + "markdownDescription": "writer: `object` \nModule: `caddy.logging.writers` \nThe module that writes out log entries for the sink. \n", + "type": "object", + "required": [ + "output" + ], + "allOf": [ + { + "if": { + "properties": { + "output": { + "const": "net" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.net" + } + }, + { + "if": { + "properties": { + "output": { + "const": "stderr" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.stderr" + } + }, + { + "if": { + "properties": { + "output": { + "const": "stdout" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.stdout" + } + }, + { + "if": { + "properties": { + "output": { + "const": "discard" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.discard" + } + }, + { + "if": { + "properties": { + "output": { + "const": "file" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.logging.writers.file" + } + }, + { + "properties": { + "output": { + "description": "key to identify writer module.\noutput: string\nModule: caddy.logging.writers", + "markdownDescription": "key to identify `writer` module. \noutput: `string` \nModule: `caddy.logging.writers`", + "type": "string", + "enum": [ + "net", + "stderr", + "stdout", + "discard", + "file" + ] + } + } + } + ] + } + } + } + } + }, + "storage": { + "description": "storage: object\nModule: caddy.storage\nStorageRaw is a storage module that defines how/where Caddy\nstores assets (such as TLS certificates). The default storage\nmodule is `caddy.storage.file_system` (the local file system),\nand the default path\n[depends on the OS and environment](/docs/conventions#data-directory).\n", + "markdownDescription": "storage: `object` \nModule: `caddy.storage` \nStorageRaw is a storage module that defines how/where Caddy\nstores assets (such as TLS certificates). The default storage\nmodule is `caddy.storage.file_system` (the local file system),\nand the default path\n[depends on the OS and environment](/docs/conventions#data-directory). \n", + "type": "object", + "required": [ + "module" + ], + "allOf": [ + { + "if": { + "properties": { + "module": { + "const": "consul" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.consul" + } + }, + { + "if": { + "properties": { + "module": { + "const": "file_system" + } + } + }, + "then": { + "$ref": "#/definitions/caddy.storage.file_system" + } + }, + { + "properties": { + "module": { + "description": "key to identify storage module.\nmodule: string\nModule: caddy.storage", + "markdownDescription": "key to identify `storage` module. \nmodule: `string` \nModule: `caddy.storage`", + "type": "string", + "enum": [ + "consul", + "file_system" + ] + } + } + } + ] + } + }, + "additionalItems": true +} diff --git a/modules/terminal-life/.local/share/scripts/base16.sh b/modules/terminal-life/.local/share/scripts/base16.sh new file mode 100644 index 0000000..ee33516 --- /dev/null +++ b/modules/terminal-life/.local/share/scripts/base16.sh @@ -0,0 +1,126 @@ +#!/bin/sh +# base16-shell (https://github.com/chriskempson/base16-shell) +# Base16 Shell template by Chris Kempson (http://chriskempson.com) +# Burn scheme by Benjamin Bädorf + +color00="1a/18/1a" # Base 00 - Black +color01="f8/5e/84" # Base 08 - Red +color02="9e/cd/6f" # Base 0B - Green +color03="e5/c4/63" # Base 0A - Yellow +color04="7a/cc/d7" # Base 0D - Blue +color05="ab/9d/f2" # Base 0E - Magenta +color06="ef/90/62" # Base 0C - Cyan +color07="e3/e1/e4" # Base 05 - White +color08="94/94/94" # Base 03 - Bright Black +color09=$color01 # Base 08 - Bright Red +color10=$color02 # Base 0B - Bright Green +color11=$color03 # Base 0A - Bright Yellow +color12=$color04 # Base 0D - Bright Blue +color13=$color05 # Base 0E - Bright Magenta +color14=$color06 # Base 0C - Bright Cyan +color15="ff/5f/5f" # Base 07 - Bright White +color16="df/59/23" # Base 09 +color17="d7/00/00" # Base 0F +color18="2d/2a/2e" # Base 01 +color19="30/30/30" # Base 02 +color20="d3/d1/d4" # Base 04 +color21="30/30/30" # Base 06 +color_foreground="e3/e1/e4" # Base 05 +color_background="1a/18/1a" # Base 00 + +if [ -n "$TMUX" ]; then + # Tell tmux to pass the escape sequences through + # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) + put_template() { printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $@; } + put_template_var() { printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $@; } + put_template_custom() { printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $@; } +elif [ "${TERM%%[-.]*}" = "screen" ]; then + # GNU screen (screen, screen-256color, screen-256color-bce) + put_template() { printf '\033P\033]4;%d;rgb:%s\007\033\\' $@; } + put_template_var() { printf '\033P\033]%d;rgb:%s\007\033\\' $@; } + put_template_custom() { printf '\033P\033]%s%s\007\033\\' $@; } +elif [ "${TERM%%-*}" = "linux" ]; then + put_template() { [ $1 -lt 16 ] && printf "\e]P%x%s" $1 $(echo $2 | sed 's/\///g'); } + put_template_var() { true; } + put_template_custom() { true; } +else + put_template() { printf '\033]4;%d;rgb:%s\033\\' $@; } + put_template_var() { printf '\033]%d;rgb:%s\033\\' $@; } + put_template_custom() { printf '\033]%s%s\033\\' $@; } +fi + +# 16 color space +put_template 0 $color00 +put_template 1 $color01 +put_template 2 $color02 +put_template 3 $color03 +put_template 4 $color04 +put_template 5 $color05 +put_template 6 $color06 +put_template 7 $color07 +put_template 8 $color08 +put_template 9 $color09 +put_template 10 $color10 +put_template 11 $color11 +put_template 12 $color12 +put_template 13 $color13 +put_template 14 $color14 +put_template 15 $color15 + +# 256 color space +put_template 16 $color16 +put_template 17 $color17 +put_template 18 $color18 +put_template 19 $color19 +put_template 20 $color20 +put_template 21 $color21 + +# foreground / background / cursor color +if [ -n "$ITERM_SESSION_ID" ]; then + # iTerm2 proprietary escape codes + put_template_custom Pg e3e1e4 # foreground + put_template_custom Ph 1a181a # background + put_template_custom Pi e3e1e4 # bold color + put_template_custom Pj 303030 # selection color + put_template_custom Pk e3e1e4 # selected text color + put_template_custom Pl e3e1e4 # cursor + put_template_custom Pm 1a181a # cursor text +else + put_template_var 10 $color_foreground + if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then + put_template_var 11 $color_background + if [ "${TERM%%-*}" = "rxvt" ]; then + put_template_var 708 $color_background # internal border (rxvt) + fi + fi + put_template_custom 12 ";7" # cursor (reverse video) +fi + +# clean up +unset -f put_template +unset -f put_template_var +unset -f put_template_custom +unset color00 +unset color01 +unset color02 +unset color03 +unset color04 +unset color05 +unset color06 +unset color07 +unset color08 +unset color09 +unset color10 +unset color11 +unset color12 +unset color13 +unset color14 +unset color15 +unset color16 +unset color17 +unset color18 +unset color19 +unset color20 +unset color21 +unset color_foreground +unset color_background diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix new file mode 100644 index 0000000..df9ee43 --- /dev/null +++ b/modules/terminal-life/bash/default.nix @@ -0,0 +1,114 @@ +{ + config, + flake, + pkgs, + ... +}: let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in { + enable = true; + + historyControl = ["ignorespace"]; + + # Run when initializing a login shell + profileExtra = '' + [ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.sway-service}/bin/sway-service + ''; + + # Run when initializing an interactive shell + initExtra = '' + # Use fzf's CTRL-R history widget + source ${pkgs.fzf}/share/fzf/key-bindings.bash + # Show current directory at the top in Alacritty + PROMPT_COMMAND='echo -e -n "\e]2;$(basename "$PWD" | sed "s/${psCfg.user.name}/~/")\e\\"' + + # If a command is not found, show me where it is + source ${pkgs.nix-index}/etc/profile.d/command-not-found.bash + + # Helps you navigate directories faster + # https://github.com/gsamokovarov/jump + eval "$(${pkgs.jump}/bin/jump shell --bind=z)" + + eval "$(${pkgs.direnv}/bin/direnv hook bash)" + + bind 'set show-all-if-ambiguous on' + + # Syntax highlighting, auto suggestions, vim modes, etc. + # https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs + source "$(blesh-share)"/ble.sh --attach=none + # ctrl + space to accept autocomplete suggestion + ble-bind -m 'auto_complete' -f 'C-@' 'auto_complete/insert-on-end' + # Meta (Alt) + Backspace to delete a word + ble-bind -m 'vi_imap' -f 'M-C-?' 'kill-backward-cword' + # Meta (Alt) + p to jump one word backwards + ble-bind -m 'vi_imap' -f M-p '@nomarked backward-uword' + ble-bind -m 'vi_imap' -f M-left '@nomarked backward-uword' + # Meta (Alt) + n to jump one word forwards + ble-bind -m 'vi_imap' -f M-n '@nomarked forward-uword' + ble-bind -m 'vi_imap' -f M-right '@nomarked forward-uword' + # Arrow up and Ctrl + p searches history for entered input + ble-bind -m 'vi_imap' -f up 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end' + ble-bind -m 'vi_imap' -f C-p 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end' + # Arrow down and Ctrl + n searches history for entered input + ble-bind -m 'vi_imap' -f down 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' + ble-bind -m 'vi_imap' -f C-n 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' + + ble-face region_insert='fg=black,bg=navy' + + function my/complete-load-hook { + bleopt complete_auto_delay=250 + } + blehook/eval-after-load complete my/complete-load-hook + + bleopt exec_elapsed_mark= + bleopt exec_errexit_mark= + bleopt filename_ls_colors="$LS_COLORS" + + bleopt complete_menu_style=desc + + # Bash vim mode keybindings + if [[ $- == *i* ]]; then # in interactive session + set -o vi + + ble-bind -m vi_imap -f 'ENTER' 'vi_imap/complete' + ble-bind -m vi_imap -f 'TAB' 'vi_imap/complete' + + ble-bind -m vi_imap -f 'j j' 'vi_imap/normal-mode' + ble-bind -m vi_imap -f 'ESC' 'vi_imap/normal-mode' + + ble-bind -m vi_nmap -f 'h' 'vi_nmap/insert-mode' + ble-bind -m vi_nmap -f 'i' 'vi-command/backward-line' + ble-bind -m vi_nmap -f 'j' 'vi-command/backward-char' + ble-bind -m vi_nmap -f 'k' 'vi-command/forward-line' + ble-bind -m vi_nmap -f 'l' 'vi-command/forward-char' + + ble-bind -m vi_imap -f 'C-c' discard-line + fi + + # end of .bashrc + # Somehow we need to ensure starship starts later than ble.sh + # (possible packaging issue?) + # https://github.com/akinomyoga/ble.sh/issues/333 + eval "$(${pkgs.starship}/bin/starship init bash)" + + [[ ''${BLE_VERSION-} ]] && ble-attach + ''; + + shellAliases = { + nano = "nvim"; + vi = "nvim"; + vim = "nvim"; + mutt = "neomutt"; + ls = "eza"; + la = "eza --group-directories-first -lag"; + wget = "wget --hsts-file=$XDG_CACHE_HOME/wget-hsts"; + irssi = "irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_DATA_HOME/irssi"; + drone = "DRONE_TOKEN=$(secret-tool lookup drone token) drone"; + no = "manix \"\" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview=\"manix '{}'\" | xargs manix"; + # fix nixos-option + nixos-option = "nixos-option -I nixpkgs=${flake.self}/lib/compat"; + myip = "dig +short myip.opendns.com @208.67.222.222 2>&1"; + nnn = "nnn -d -e -H -r"; + }; +} diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix new file mode 100644 index 0000000..43ed55a --- /dev/null +++ b/modules/terminal-life/default.nix @@ -0,0 +1,113 @@ +{ + lib, + config, + pkgs, + flake, + ... +}: +with lib; let + psCfg = config.pub-solar; + cfg = config.pub-solar.terminal-life; +in { + options.pub-solar.terminal-life = { + full = mkOption { + description = '' + Enable a full version, which includes more nvim plugins and lsps. + ''; + default = false; + type = types.bool; + }; + }; + + config = { + programs.command-not-found.enable = false; + programs.nix-index.enable = true; + # We do this manually in modules/terminal-life/bash/default.nix + # until https://github.com/nix-community/nix-index/pull/227 is merged + programs.nix-index.enableBashIntegration = false; + + users.users."${psCfg.user.name}".packages = with pkgs; [ + ack + asciinema + bat + blesh + eza + fd + jump + (nnn.overrideAttrs (o: { + patches = + (o.patches or []) + ++ [ + ./nnn/0001-feat-use-wasd-keybindings-for-jkli.patch + ]; + })) + powerline + screen + silver-searcher + watson + ]; + + home-manager.users."${psCfg.user.name}" = { + xdg.dataFile."scripts/base16.sh".source = .local/share/scripts/base16.sh; + + programs.less = { + enable = true; + keys = '' + k forw-line + i back-line + K forw-scroll + I back-scroll + ''; + }; + + # Starship is a fast and featureful shell prompt + # starship.toml has sane defaults that can be changed there + programs.starship = { + enable = true; + settings = import ./starship.toml.nix; + }; + + programs.bash = import ./bash { + inherit config; + inherit pkgs; + inherit lib; + inherit flake; + }; + + programs.fzf = import ./fzf { + inherit config; + inherit pkgs; + }; + + programs.neovim = import ./nvim { + inherit config; + inherit pkgs; + inherit lib; + }; + # Ensure nvim backup directory gets created + # Workaround for E510: Can't make backup file (add ! to override) + xdg.dataFile."nvim/backup/.keep".text = ""; + xdg.dataFile."nvim/json-schemas/.keep".text = ""; + # Generated with: + # docker run -it --name caddy-json-schema registry.greenbaum.cloud/gc/caddy-l4:2.5.2 caddy json-schema -output /srv/caddy_schema.json + xdg.dataFile."nvim/json-schemas/caddy_schema.json".source = .local/share/nvim/json-schemas/caddy_schema.json; + xdg.dataFile."nvim/templates/.keep".text = ""; + + programs.git = import ./git {}; + xdg.configFile."git/config".text = import ./.config/git/config.nix { + inherit config; + inherit pkgs; + }; + xdg.configFile."git/gitmessage".text = import ./.config/git/gitmessage.nix { + inherit config; + inherit pkgs; + }; + xdg.configFile."git/global_gitignore".text = import ./.config/git/global_gitignore.nix { + inherit config; + inherit pkgs; + }; + + programs.direnv = import ./direnv {}; + }; + }; +} diff --git a/modules/terminal-life/direnv/default.nix b/modules/terminal-life/direnv/default.nix new file mode 100644 index 0000000..dbaa385 --- /dev/null +++ b/modules/terminal-life/direnv/default.nix @@ -0,0 +1,6 @@ +{...}: { + enable = true; + nix-direnv = { + enable = true; + }; +} diff --git a/modules/terminal-life/fzf/default.nix b/modules/terminal-life/fzf/default.nix new file mode 100644 index 0000000..88e6059 --- /dev/null +++ b/modules/terminal-life/fzf/default.nix @@ -0,0 +1,17 @@ +{ + config, + pkgs, + ... +}: { + enable = true; + defaultCommand = "fd --hidden --type f --exclude .git"; + defaultOptions = [ + "--color=bg+:#2d2a2e,bg:#1a181a,spinner:#ef9062,hl:#7accd7" + "--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062" + "--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7" + ]; + # Use ble.sh for completions, see + # modules/terminal-life/bash/default.nix -> bleopt complete_menu_style=desc + # and https://github.com/akinomyoga/ble.sh/wiki/Manual-%C2%A77-Completion + enableBashIntegration = false; +} diff --git a/modules/terminal-life/git/default.nix b/modules/terminal-life/git/default.nix new file mode 100644 index 0000000..13c8720 --- /dev/null +++ b/modules/terminal-life/git/default.nix @@ -0,0 +1,40 @@ +{...}: { + enable = true; + + extraConfig = { + pull.rebase = false; + }; + + aliases = { + a = "add -p"; + co = "checkout"; + cob = "checkout -b"; + f = "fetch -p"; + c = "commit"; + p = "push"; + ba = "branch -a"; + bd = "branch -d"; + bD = "branch -D"; + d = "diff"; + dc = "diff --cached"; + ds = "diff --staged"; + r = "restore"; + rs = "restore --staged"; + st = "status -sb"; + + # reset + soft = "reset --soft"; + hard = "reset --hard"; + s1ft = "soft HEAD~1"; + h1rd = "hard HEAD~1"; + + # logging + lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'"; + tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative"; + rank = "shortlog -sn --no-merges"; + + # delete merged branches + bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"; + }; +} diff --git a/modules/terminal-life/nnn/0001-feat-use-wasd-keybindings-for-jkli.patch b/modules/terminal-life/nnn/0001-feat-use-wasd-keybindings-for-jkli.patch new file mode 100644 index 0000000..f06cb04 --- /dev/null +++ b/modules/terminal-life/nnn/0001-feat-use-wasd-keybindings-for-jkli.patch @@ -0,0 +1,38 @@ +From a81ee68923412c0fb8fab46f2f918a7ec865b384 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= +Date: Sun, 9 Jul 2023 04:19:51 +0200 +Subject: [PATCH] feat: use wasd keybindings for jkli + +--- + src/nnn.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/nnn.h b/src/nnn.h +index d476ddd2..5f106987 100644 +--- a/src/nnn.h ++++ b/src/nnn.h +@@ -131,7 +131,7 @@ struct key { + static struct key bindings[] = { + /* Back */ + { KEY_LEFT, SEL_BACK }, +- { 'h', SEL_BACK }, ++ { 'j', SEL_BACK }, + /* Inside or select */ + { KEY_ENTER, SEL_OPEN }, + { '\r', SEL_OPEN }, +@@ -139,10 +139,10 @@ static struct key bindings[] = { + { KEY_RIGHT, SEL_NAV_IN }, + { 'l', SEL_NAV_IN }, + /* Next */ +- { 'j', SEL_NEXT }, ++ { 'k', SEL_NEXT }, + { KEY_DOWN, SEL_NEXT }, + /* Previous */ +- { 'k', SEL_PREV }, ++ { 'i', SEL_PREV }, + { KEY_UP, SEL_PREV }, + /* Page down */ + { KEY_NPAGE, SEL_PGDN }, +-- +2.40.1 + diff --git a/modules/terminal-life/nvim/clipboard.vim b/modules/terminal-life/nvim/clipboard.vim new file mode 100644 index 0000000..ee9cd4c --- /dev/null +++ b/modules/terminal-life/nvim/clipboard.vim @@ -0,0 +1,20 @@ +" Wayland clipboard provider that strips carriage returns (GTK3 issue). +" This is needed because currently there's an issue where GTK3 applications on +" Wayland contain carriage returns at the end of the lines (this is a root +" issue that needs to be fixed). +let g:clipboard = { + \ 'name': 'wayland-strip-carriage', + \ 'copy': { + \ '+': 'wl-copy --foreground --type text/plain --trim-newline', + \ '*': 'wl-copy --foreground --type text/plain --primary --trim-newline', + \ }, + \ 'paste': { + \ '+': {-> systemlist('wl-paste --no-newline | tr -d "\r"')}, + \ '*': {-> systemlist('wl-paste --no-newline --primary | tr -d "\r"')}, + \ }, + \ 'cache_enabled': 1, + \ } + +" Copy filenames +nnor yfp :let @+=expand("%:p") " Mnemonic: Yank File path +nnor yfn :let @+=expand("%") " Mnemonic: Yank File name diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix new file mode 100644 index 0000000..717741a --- /dev/null +++ b/modules/terminal-life/nvim/default.nix @@ -0,0 +1,199 @@ +{ + config, + pkgs, + lib, + ... +}: let + psCfg = config.pub-solar; + cfg = config.pub-solar.terminal-life; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; + + preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs); +in { + enable = true; + + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + + withNodeJs = true; + withRuby = true; + withPython3 = true; + + extraPackages = with pkgs; + lib.mkIf (cfg.full) [ + ansible-language-server + ccls + gopls + nixd + nodejs + nodePackages.bash-language-server + nodePackages.dockerfile-language-server-nodejs + nodePackages.svelte-language-server + nodePackages.typescript + nodePackages.typescript-language-server + nodePackages.vim-language-server + nodePackages.vue-language-server + nodePackages.vscode-langservers-extracted + nodePackages.yaml-language-server + python3Packages.python-lsp-server + python3Full + rust-analyzer + solargraph + terraform-ls + universal-ctags + ]; + + plugins = with pkgs.vimPlugins; + lib.mkIf cfg.full [ + (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ + p.ini + p.json + p.json5 + p.markdown + p.nix + p.toml + p.yaml + + p.css + p.graphql + p.html + p.javascript + p.scss + p.tsx + p.typescript + p.vue + + p.c + p.cpp + p.go + p.gomod + p.gosum + p.haskell + p.lua + p.php + p.python + p.ruby + p.rust + + p.vim + p.vimdoc + + p.passwd + p.sql + + p.diff + p.gitcommit + p.gitignore + p.git_config + p.gitattributes + p.git_rebase + + p.bash + p.dockerfile + p.make + p.ninja + p.terraform + ])) + + # Dependencies for nvim-lspconfig + nvim-cmp + cmp-nvim-lsp + cmp_luasnip + luasnip + + # Quickstart configs for neovim LSP + lsp_extensions-nvim + nvim-lspconfig + + # Collaborative editing in Neovim using built-in capabilities + instant-nvim-nvfetcher + + # Search functionality behind :Ack + ack-vim + + # The status bar in the bottom of the screen with the mode indication and file location + vim-airline + + # Automatically load editorconfig files in repos to configure nvim settings + editorconfig-vim + + # File browser. Use n to access + nnn-vim + + # Highlight characters when using f, F, t, and T + quick-scope + + # Get sudo in vim; :SudaWrite + suda-vim + + # Undo history etc. per project + vim-workspace-nvfetcher + + # JSON schemas + SchemaStore-nvim + + # Work with tags files + vim-gutentags + + # Neovim colorschemes / themes + sonokai + vim-hybrid-material + vim-airline-themes + vim-apprentice-nvfetcher + + # Git integrations + # A Git wrapper so awesome, it should be illegal + fugitive + # Shows git diff markers in the sign column + vim-gitgutter + # GitHub extension for fugitive + vim-rhubarb + # Ease your git workflow within Vim + vimagit-nvfetcher + + # FZF fuzzy finder + fzf-vim + fzfWrapper + # Make the yanked region apparent + vim-highlightedyank + + # :Beautify Code beautifier + vim-beautify-nvfetcher + + # Unload, delete or wipe a buffer without closing the window + vim-bufkill + # Defaults everyone can agree on + vim-sensible + + # emmet for vim: http://emmet.io/ + emmet-vim + # Caddyfile syntax support for Vim + vim-caddyfile-nvfetcher + + # Fix TOFU hashes when writing nix derivations without leaving neovim + vim-nixhash + ]; + + extraConfig = builtins.concatStringsSep "\n" [ + '' + " Persistent undo + set undofile + set undodir=${xdg.cacheHome}/nvim/undo + + set backupdir=${xdg.dataHome}/nvim/backup + set directory=${xdg.dataHome}/nvim/swap/ + '' + (builtins.readFile ./init.vim) + (builtins.readFile ./plugins.vim) + (builtins.readFile ./clipboard.vim) + (builtins.readFile ./ui.vim) + (builtins.readFile ./quickfixopenall.vim) + (builtins.readFile ./lsp.vim) + '' + " fzf with file preview + command! -bang -nargs=? -complete=dir Files + \ call fzf#vim#files(, { 'options': ['--keep-right', '--cycle', '--layout', 'reverse', '--preview', '${preview-file}/bin/preview-file {}'] }, 0) + '' + ]; +} diff --git a/modules/terminal-life/nvim/init.vim b/modules/terminal-life/nvim/init.vim new file mode 100644 index 0000000..6cea1bf --- /dev/null +++ b/modules/terminal-life/nvim/init.vim @@ -0,0 +1,108 @@ +set nocompatible " be iMproved, required +filetype indent plugin on " required + +set modeline +set modelines=1 +set nowrap + +set viminfo='100,<100,s20 " vim file history + +set hidden + +set expandtab +set shiftwidth=2 +set number +set relativenumber +set mouse= +set autoindent +set smartindent + +set undolevels=1000 +set undoreload=10000 + +set updatetime=300 + +let mapleader = " " + +nmap :w +imap :w +vmap gv + +noremap y "+y +noremap p "+p + +noremap i +noremap j +noremap k +noremap h i + +vnoremap K L +vnoremap I H +vnoremap H I + +nnoremap K L +nnoremap I H +nnoremap H I + +map i :wincmd k +map j :wincmd h +map k :wincmd j +map l :wincmd l + +map I :wincmd K +map J :wincmd H +map K :wincmd J +map L :wincmd L + +" replay macro for each line of a visual selection +xnoremap @q :normal @q +xnoremap @@ :normal @@ + +" reselect and re-yank any text that is pasted in visual mode +xnoremap p pgvy + +" Escape overwrite +inoremap jj + +" Open new buffer +nmap T :enew + +" Move to the next buffer +nmap l :bnext + +" Move to the previous buffer +nmap j :bprevious + +" Close the current buffer and move to the previous one +" This replicates the idea of closing a tab +nmap q :bp bd # + +" Show all open buffers and their status +nmap bl :ls + +" Mapping selecting mappings +nmap (fzf-maps-n) +xmap (fzf-maps-x) +omap (fzf-maps-o) + +nmap :Files +imap :Files + +" Insert mode completion +imap (fzf-complete-word) +imap (fzf-complete-path) +imap (fzf-complete-file) +imap (fzf-complete-line) + +" Clear quickfix shortcut +nmap c :ccl + +" Remember cursor position +" Vim jumps to the last position when reopening a file +if has("autocmd") + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +endif + +nmap - :NnnPicker % +nmap n :NnnPicker % +nmap N :NnnPicker diff --git a/modules/terminal-life/nvim/lsp.vim b/modules/terminal-life/nvim/lsp.vim new file mode 100644 index 0000000..f0ffcdb --- /dev/null +++ b/modules/terminal-life/nvim/lsp.vim @@ -0,0 +1,258 @@ +" Set completeopt to have a better completion experience +" :help completeopt +" menuone: popup even when there's only one match +" noinsert: Do not insert text until a selection is made +" noselect: Do not select, force user to select one from the menu +set completeopt=menuone,noinsert,noselect + +" Avoid showing extra messages when using completion +set shortmess+=c + +function AddTemplate(tmpl_file) + exe "0read " . a:tmpl_file + set nomodified + 6 +endfunction + +autocmd BufNewFile shell.nix call AddTemplate("$XDG_DATA_HOME/nvim/templates/shell.nix.tmpl") + +" Configure neovim 0.6+ experimental LSPs +" https://github.com/neovim/nvim-lspconfig +" https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md +" https://github.com/neovim/nvim-lspconfig/wiki/UI-Customization +" https://gitlab.com/Iron_E/dotfiles/-/blob/master/.config/nvim/lua/_config/plugin/nvim_lsp.lua +lua <e', 'lua vim.diagnostic.open_float()', opts) + vim.api.nvim_set_keymap('n', 'g[', 'lua vim.diagnostic.goto_prev()', opts) + vim.api.nvim_set_keymap('n', 'g]', 'lua vim.diagnostic.goto_next()', opts) + vim.api.nvim_set_keymap('n', 'dq', 'lua vim.diagnostic.setloclist()', opts) + vim.api.nvim_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) + + -- Use an on_attach function to only map the following keys + -- after the language server attaches to the current buffer + local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings (available if LSP is configured and attached to buffer) + -- See `:help vim.lsp.*` for documentation on any of the below functions + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) + + -- Show diagnostic popup on cursor hold + vim.api.nvim_create_autocmd("CursorHold", { + buffer = bufnr, + callback = function() + local opts = { + focusable = false, + close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, + border = 'rounded', + source = 'always', + prefix = ' ', + scope = 'cursor', + } + vim.diagnostic.open_float(nil, opts) + end + }) + + end + + -- Add additional capabilities supported by nvim-cmp + local capabilities = require('cmp_nvim_lsp').default_capabilities() + -- vscode HTML lsp needs this https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#html + capabilities.textDocument.completion.completionItem.snippetSupport = true + + -- vscode HTML lsp needs this https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#html + capabilities.textDocument.completion.completionItem.snippetSupport = true + + local use_denols_for_typescript = not(os.getenv('NVIM_USE_DENOLS') == nil) + + for lsp_key, lsp_settings in pairs({ + 'ansiblels', ---------------------------- Ansible + 'bashls', ------------------------------- Bash + 'ccls', --------------------------------- C / C++ / Objective-C + 'cssls', -------------------------------- CSS / SCSS / LESS + 'dockerls', ----------------------------- Docker + ['gopls'] = { --------------------------- Go + ['settings'] = { + ['gopls'] = { + ['analyses'] = { + ['unusedparams'] = true, + }, + ['staticcheck'] = true + }, + }, + }, + 'html', --------------------------------- HTML + ['jdtls'] = { --------------------------- Java + ['root_dir'] = nvim_lsp.util.root_pattern('.git', 'pom.xml', 'build.xml'), + ['init_options'] = { + ['jvm_args'] = {['java.format.settings.url'] = vim.fn.stdpath('config')..'/eclipse-formatter.xml'}, + ['workspace'] = vim.fn.stdpath('cache')..'/java-workspaces' + } + }, + ['jsonls'] = { -------------------------- JSON + ['settings'] = { + ['json'] = { + ['schemas' ] = vim.list_extend( + { + { + ['description'] = 'JSON schema for Caddy v2', + ['fileMatch'] = { '*caddy*.json' }, + ['name'] = 'caddy_schema.json', + ['url'] = vim.fn.stdpath('data')..'/json-schemas/caddy_schema.json', + }, + }, + require('schemastore').json.schemas() + ), + ['validate'] = { ['enable'] = true } + } + } + }, + 'nixd', --------------------------------- Nix + 'phpactor', ----------------------------- PHP + 'pylsp', -------------------------------- Python + 'solargraph', --------------------------- Ruby + 'rust_analyzer', ------------------------ Rust + ['sqlls'] = { + ['cmd'] = {vim.fn.stdpath('data')..'/nvm/versions/node/v12.19.0/bin/sql-language-server', 'up', '--method', 'stdio'} + }, + ['terraformls'] = { --------------------- Terraform + ['filetypes'] = { 'terraform', 'hcl', 'tf' } + }, + + -- The TS/JS server is chosen depending on an environment variable, + -- since denols is nicer for Deno based projects + ------------------------ Deno TS/JS + ------------------------------------ Typescript / JavaScript + (use_denols_for_typescript and 'denols' or 'tsserver'), + + 'vuels', -------------------------------- Vue + 'svelte', ------------------------------- Svelte + ['yamlls'] = { -------------------------- YAML + ['settings'] = { + ['yaml'] = { + ['schemas'] = { + ['https://json.schemastore.org/github-workflow'] = '.github/workflows/*.{yml,yaml}', + ['https://json.schemastore.org/github-action'] = '.github/action.{yml,yaml}', + ['https://json.schemastore.org/drone'] = '*.drone.{yml,yaml}', + ['https://json.schemastore.org/swagger-2.0'] = 'swagger.{yml,yaml}', + } + } + } + } + }) do -- Setup all of the language servers. † + if type(lsp_key) == 'number' then -- Enable the LSP with defaults. + -- The `lsp` is an index in this case. + nvim_lsp[lsp_settings].setup{ + on_attach = on_attach, + flags = { + debounce_text_changes = 150, + }, + capabilities = capabilities, + } + else -- Use the LSP's configuration. + lsp_settings.on_attach = on_attach + lsp_settings.capabilities = capabilities + + nvim_lsp[lsp_key].setup(lsp_settings) + end + end -- ‡ + + -- configure floating diagnostics appearance, symbols + local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + end + + -- Set completeopt to have a better completion experience + vim.o.completeopt = 'menuone,noselect' + + -- luasnip setup + local luasnip = require 'luasnip' + + -- nvim-cmp setup + local cmp = require 'cmp' + cmp.setup { + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + mapping = { + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }, + [''] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, + [''] = function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, + } + + -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#denols + vim.g.markdown_fenced_languages = { + "ts=typescript" + } + + -- Configure diagnostics + vim.diagnostic.config({ + virtual_text = false, + signs = true, + underline = true, + update_in_insert = false, + severity_sort = false, + }) + + -- Change diagnostic symbols in the sign column (gutter) + local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + end +EOF + +" have a fixed column for the diagnostics to appear in +" this removes the jitter when warnings/errors flow in +set signcolumn=yes:2 diff --git a/modules/terminal-life/nvim/plugins.vim b/modules/terminal-life/nvim/plugins.vim new file mode 100644 index 0000000..85891b1 --- /dev/null +++ b/modules/terminal-life/nvim/plugins.vim @@ -0,0 +1,87 @@ +" Happy yaml configuration +au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml +autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab + +let g:gutentags_file_list_command = 'git ls-files' + +" quick-scope +" https://github.com/unblevable/quick-scope +let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] + +" Golang +" Go test, Def, Decls shortcut +nmap got :GoTest:botright copen +autocmd FileType go nmap gd :GoDef +autocmd FileType go nmap gD :GoDecls + +" Go formatting +autocmd FileType go setlocal noexpandtab shiftwidth=4 tabstop=4 softtabstop=4 nolist + +" Caddyfile indentation +autocmd FileType caddyfile setlocal noexpandtab shiftwidth=8 tabstop=8 softtabstop=8 nolist + +" vim-go disable text-objects +let g:go_textobj_enabled = 0 + +" disable vim-go :GoDef short cut (gd) +" this is handled by LanguageClient [LC] +let g:go_def_mapping_enabled = 0 + +" GitGutter and vim Magit +" inspired by: https://jakobgm.com/posts/vim/git-integration/ +" Don't map gitgutter keys automatically, set them ourselves +let g:gitgutter_map_keys = 0 + +" Jump between hunks +nmap gn (GitGutterNextHunk) " git next +nmap gp (GitGutterPrevHunk) " git previous + +" Hunk-add and hunk-revert for chunk staging +nmap ga (GitGutterStageHunk) " git add (chunk) +nmap gu (GitGutterUndoHunk) " git undo (chunk) + +" Open vimagit pane +nnoremap gs :Magit " git status + +" Push to remote +nnoremap gP :! git push " git Push + +" Quick conflict resolution in git mergetool nvim +" http://vimcasts.org/episodes/fugitive-vim-resolving-merge-conflicts-with-vimdiff/ +nmap [ :diffget //2 +nmap ] :diffget //3 + +" netrw +let g:netrw_fastbrowse=0 + +" Auto-FMT rust code on save +let g:rustfmt_autosave = 1 + +" Indenting in html template tags +let g:html_indent_style1 = "inc" + +" yank highlight duration +let g:highlightedyank_highlight_duration = 200 + +" Markdown options +let g:vim_markdown_folding_disabled = 1 + +" Haskell options +let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` +let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` +let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` +let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` +let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles +let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` +let g:haskell_backpack = 1 " to enable highlighting of backpack keywords + +" Emmet +let g:user_emmet_leader_key='' + +" Ack +if executable('ag') + let g:ackprg = 'ag --vimgrep' +endif + +" nnn +let g:nnn#command = 'nnn -d -e -H -r' diff --git a/modules/terminal-life/nvim/preview-file.nix b/modules/terminal-life/nvim/preview-file.nix new file mode 100644 index 0000000..2a52bdd --- /dev/null +++ b/modules/terminal-life/nvim/preview-file.nix @@ -0,0 +1,36 @@ +self: +with self; '' + IFS=':' read -r -a INPUT <<< "$1" + FILE=''${INPUT[0]} + CENTER=''${INPUT[1]} + + if [[ "$1" =~ ^[A-Za-z]:\\ ]]; then + FILE=$FILE:''${INPUT[1]} + CENTER=''${INPUT[2]} + fi + + if [[ -n "$CENTER" && ! "$CENTER" =~ ^[0-9] ]]; then + exit 1 + fi + CENTER=''${CENTER/[^0-9]*/} + + FILE="''${FILE/#\~\//$HOME/}" + if [ ! -r "$FILE" ]; then + echo "File not found ''${FILE}" + exit 1 + fi + + if [ -z "$CENTER" ]; then + CENTER=0 + fi + + exec cat "$FILE" \ + | sed -e '/[#|\/\/ ?]-- copyright/,/[#\/\/]++/c\\' \ + | ${pkgs.coreutils}/bin/tr -s '\n' \ + | ${pkgs.bat}/bin/bat \ + --style="''${BAT_STYLE:-numbers}" \ + --color=always \ + --pager=never \ + --file-name="''$FILE" \ + --highlight-line=$CENTER +'' diff --git a/modules/terminal-life/nvim/quickfixopenall.vim b/modules/terminal-life/nvim/quickfixopenall.vim new file mode 100644 index 0000000..6b4d844 --- /dev/null +++ b/modules/terminal-life/nvim/quickfixopenall.vim @@ -0,0 +1,20 @@ +"Usage: +" 1. Perform a vimgrep search +" :vimgrep /def/ *.rb +" 2. Issue QuickFixOpenAll command +" :QuickFixOpenAll +function! QuickFixOpenAll() + if empty(getqflist()) + return + endif + let s:prev_val = "" + for d in getqflist() + let s:curr_val = bufname(d.bufnr) + if (s:curr_val != s:prev_val) + exec "edit " . s:curr_val + endif + let s:prev_val = s:curr_val + endfor +endfunction + +command! QuickFixOpenAll call QuickFixOpenAll() diff --git a/modules/terminal-life/nvim/ui.vim b/modules/terminal-life/nvim/ui.vim new file mode 100644 index 0000000..b3e63a7 --- /dev/null +++ b/modules/terminal-life/nvim/ui.vim @@ -0,0 +1,32 @@ +"let g:base16_shell_path = $XDG_DATA_HOME . "/scripts/base16.sh" +"let base16colorspace = 256 +set termguicolors +"let g:sonokai_style = 'shusia' +"let g:sonokai_enable_italic = 1 +"let g:sonokai_disable_italic_comment = 1 +"let g:sonokai_transparent_background = 1 +set background=dark +colorscheme apprentice + +let g:airline#extensions#tabline#enabled = 1 " Enable the list of buffers +let g:airline#extensions#tabline#fnamemod = ':t' " Show just the filename +let g:airline#extensions#tabline#formatter = 'unique_tail_improved' +let g:airline_powerline_fonts = 1 " Use powerline fonts +let g:airline_theme = 'apprentice' + +" Customize fzf colors to match your color scheme +" - fzf#wrap translates this to a set of `--color` options +let g:fzf_colors = +\ { 'fg': ['fg', 'Normal'], + \ 'bg': ['bg', 'Normal'], + \ 'hl': ['fg', 'Comment'], + \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], + \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], + \ 'hl+': ['fg', 'Statement'], + \ 'info': ['fg', 'PreProc'], + \ 'border': ['fg', 'Ignore'], + \ 'prompt': ['fg', 'Conditional'], + \ 'pointer': ['fg', 'Exception'], + \ 'marker': ['fg', 'Keyword'], + \ 'spinner': ['fg', 'Label'], + \ 'header': ['fg', 'Comment'] } diff --git a/modules/terminal-life/starship.toml.nix b/modules/terminal-life/starship.toml.nix new file mode 100644 index 0000000..e05a1f4 --- /dev/null +++ b/modules/terminal-life/starship.toml.nix @@ -0,0 +1,169 @@ +{ + format = "$username$hostname$directory($git_branch$git_commit$git_state$git_status)($c$deno$golang$haskell$nodejs$php$python$ruby$rust$terraform[](fg:#F85E84 bg:#000000))($docker_context[](fg:#06969A))($container)$fill(\${custom.triton})$nix_shell$status[ |](fg:#F85E84)$line_break$character"; + + # Disable the blank line at the start of the prompt + add_newline = false; + + # You can also replace your username with a neat symbol like  to save some space + username = { + style_user = "bg:#000000 fg:#F85E84"; + style_root = "bg:#F85E84 fg:#000000"; + format = ''[$user ]($style)''; + }; + + hostname = { + ssh_symbol = ""; + trim_at = ""; + style = "bg:#000000 fg:#F85E84"; + }; + + character = { + success_symbol = "[❯](bold purple)"; + error_symbol = "[✗](#FF4B00)"; + }; + + status = { + disabled = false; + style = "#FF4B00"; + }; + + fill = { + symbol = "-"; + #style = "bold green"; + style = "black"; + }; + + directory = { + style = "#F85E84"; + truncate_to_repo = false; + fish_style_pwd_dir_length = 1; + truncation_symbol = "…/"; + format = "[](fg:black bg:#F85E84)[$path[$read_only](bg:$style fg:black)](bg:$style fg:black)[](fg:$style)"; + read_only = " "; + }; + + # Here is how you can shorten some long paths by text replacement + # similar to mapped_locations in Oh My Posh: + directory.substitutions = { + "Documents" = " "; + "Downloads" = " "; + "Music" = " "; + "Pictures" = " "; + }; + # Keep in mind that the order matters. For example: + # "Important Documents" = "  " + # will not be replaced, because "Documents" was already substituted before. + # So either put "Important Documents" before "Documents" or use the substituted version: + # "Important  " = "  " + + c = { + symbol = " "; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + #container = {}; + + custom = { + triton = { + command = "echo $TRITON_PROFILE"; + when = "test $TRITON_PROFILE"; + format = "[✚ ](fg:#F85E84 bg:#1A181A)[$output](fg:#F85E84 bg:#1A181A)"; + description = "The current triton profile"; + }; + }; + + docker_context = { + symbol = " "; + style = "bg:#06969A"; + format = ''[ $symbol $context ]($style) $path''; + }; + + #deno = {}; + + git_branch = { + style = "#E5C463"; + format = "[](fg:black bg:$style)[ $symbol$branch](fg:black bg:$style)[](fg:$style)"; + symbol = " "; + }; + + git_commit = { + style = "#E5C463"; + # ^H is the literal backspace character which renders to \b in the final + # starship config TOML, produced in insert mode via ctrl+v then ctrl+h. + # We use the literal character, because escaping a single \ doesn't work + # with pkgs.formats.toml, see: https://github.com/NixOS/nixpkgs/issues/97310 and + # https://jdhao.github.io/2020/10/07/nvim_insert_unicode_char/ + format = "[ ](bg:$style)[\\($hash$tag\\)](fg:black bg:$style)[](fg:$style)"; + }; + + git_state = { + style = "#E5C463"; + format = "[ ](bg:$style)[ \\($state( $progress_current/$progress_total)\\)](fg:black bg:$style)[](fg:$style)"; + }; + + git_status = { + style = "#E5C463"; + format = "([ ](bg:$style fg:black)$conflicted$staged$modified$renamed$deleted$untracked$stashed$ahead_behind[](fg:$style))"; + conflicted = "[ ](bold fg:88 bg:#E5C463)[  \${count} ](fg:black bg:#E5C463)"; + staged = "[ $count ](fg:black bg:#E5C463)"; + modified = "[ \${count} ](fg:black bg:#E5C463)"; + renamed = "[ \${count} ](fg:black bg:#E5C463)"; + deleted = "[ \${count} ](fg:black bg:#E5C463)"; + untracked = "[?\${count} ](fg:black bg:#E5C463)"; + stashed = "[ \${count} ](fg:black bg:#E5C463)"; + ahead = "[ \${count} ](fg:#523333 bg:#E5C463)"; + behind = "[ \${count} ](fg:black bg:#E5C463)"; + diverged = "[ ](fg:88 bg:#E5C463)[  ](fg:black bg:#E5C463)[ \${ahead_count} ](fg:black bg:#E5C463)[ \${behind_count} ](fg:black bg:#E5C463)"; + }; + + golang = { + symbol = " "; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + haskell = { + symbol = " "; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + nix_shell = { + format = ''[$symbol]($style) ''; + symbol = " "; + }; + + nodejs = { + symbol = ""; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + php = { + symbol = " "; + }; + + python = { + symbol = " "; + }; + + ruby = { + symbol = " "; + }; + + rust = { + symbol = ""; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + #terraform = {}; + + time = { + disabled = false; + time_format = "%R"; # Hour:Minute Format + style = "bg:#33658A"; + format = ''[ ♥ $time ]($style)''; + }; +} diff --git a/modules/user/.config/dircolors b/modules/user/.config/dircolors new file mode 100644 index 0000000..16b9bb1 --- /dev/null +++ b/modules/user/.config/dircolors @@ -0,0 +1,243 @@ +# Configuration file for dircolors, a utility to help you set the +# LS_COLORS environment variable used by GNU ls with the --color option. + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copying and distribution of this file, with or without modification, +# are permitted provided the copyright notice and this notice are preserved. + +# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the +# slackware version of dircolors) are recognized but ignored. + +# You can copy this file to .dir_colors in your $HOME directory to override +# the system defaults. + +# Below, there should be one TERM entry for each termtype that is colorizable +TERM Eterm +TERM ansi +TERM color-xterm +TERM con132x25 +TERM con132x30 +TERM con132x43 +TERM con132x60 +TERM con80x25 +TERM con80x28 +TERM con80x30 +TERM con80x43 +TERM con80x50 +TERM con80x60 +TERM cons25 +TERM console +TERM cygwin +TERM dtterm +TERM eterm-color +TERM gnome +TERM gnome-256color +TERM hurd +TERM jfbterm +TERM konsole +TERM kterm +TERM linux +TERM linux-c +TERM mach-color +TERM mach-gnu-color +TERM mlterm +TERM putty +TERM putty-256color +TERM rxvt +TERM rxvt-256color +TERM rxvt-cygwin +TERM rxvt-cygwin-native +TERM rxvt-unicode +TERM rxvt-unicode-256color +TERM rxvt-unicode256 +TERM screen +TERM screen-256color +TERM screen-256color-bce +TERM screen-bce +TERM screen-w +TERM screen.Eterm +TERM screen.rxvt +TERM screen.linux +TERM st +TERM st-256color +TERM terminator +TERM vt100 +TERM xterm +TERM xterm-16color +TERM xterm-256color +TERM xterm-88color +TERM xterm-color +TERM xterm-debian + +# Below are the color init strings for the basic file types. A color init +# string consists of one or more of the following numeric codes: +# Attribute codes: +# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed +# Text color codes: +# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white +# Background color codes: +# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white +#NORMAL 00 # no color code at all +#FILE 00 # regular file: use no color at all +RESET 0 # reset to "normal" color +DIR 01;34 # directory +LINK 01;36 # symbolic link. (If you set this to 'target' instead of a + # numerical value, the color is as for the file pointed to.) +MULTIHARDLINK 00 # regular file with more than one link +FIFO 40;33 # pipe +SOCK 01;35 # socket +DOOR 01;35 # door +BLK 40;33;01 # block device driver +CHR 40;33;01 # character device driver +ORPHAN 01;05;37;41 # orphaned syminks +MISSING 01;05;37;41 # ... and the files they point to +SETUID 37;41 # file that is setuid (u+s) +SETGID 30;43 # file that is setgid (g+s) +CAPABILITY 30;41 # file with capability +STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) +OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky +STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable + +# This is for files with execute permission: +EXEC 01;32 + +# List any file extensions like '.gz' or '.tar' that you would like ls +# to colorize below. Put the extension, a space, and the color init string. +# (and any comments you want to add after a '#') + +# If you use DOS-style suffixes, you may want to uncomment the following: +#.cmd 01;32 # executables (bright green) +#.exe 01;32 +#.com 01;32 +#.btm 01;32 +#.bat 01;32 +# Or if you want to colorize scripts even if they do not have the +# executable bit actually set. +#.sh 01;32 +#.csh 01;32 + +# archives or compressed (bright red) +.tar 01;31 +.tgz 01;31 +.arc 01;31 +.arj 01;31 +.taz 01;31 +.lha 01;31 +.lz4 01;31 +.lzh 01;31 +.lzma 01;31 +.tlz 01;31 +.txz 01;31 +.tzo 01;31 +.t7z 01;31 +.zip 01;31 +.z 01;31 +.Z 01;31 +.dz 01;31 +.gz 01;31 +.lrz 01;31 +.lz 01;31 +.lzo 01;31 +.xz 01;31 +.bz2 01;31 +.bz 01;31 +.tbz 01;31 +.tbz2 01;31 +.tz 01;31 +.deb 01;31 +.rpm 01;31 +.jar 01;31 +.war 01;31 +.ear 01;31 +.sar 01;31 +.rar 01;31 +.alz 01;31 +.ace 01;31 +.zoo 01;31 +.cpio 01;31 +.7z 01;31 +.rz 01;31 +.cab 01;31 + +# image formats +.jpg 01;35 +.jpeg 01;35 +.gif 01;35 +.bmp 01;35 +.pbm 01;35 +.pgm 01;35 +.ppm 01;35 +.tga 01;35 +.xbm 01;35 +.xpm 01;35 +.tif 01;35 +.tiff 01;35 +.png 01;35 +.svg 01;35 +.svgz 01;35 +.mng 01;35 +.pcx 01;35 +.mov 01;35 +.mpg 01;35 +.mpeg 01;35 +.m2v 01;35 +.mkv 01;35 +.webm 01;35 +.ogm 01;35 +.mp4 01;35 +.m4v 01;35 +.mp4v 01;35 +.vob 01;35 +.qt 01;35 +.nuv 01;35 +.wmv 01;35 +.asf 01;35 +.rm 01;35 +.rmvb 01;35 +.flc 01;35 +.avi 01;35 +.fli 01;35 +.flv 01;35 +.gl 01;35 +.dl 01;35 +.xcf 01;35 +.xwd 01;35 +.yuv 01;35 +.cgm 01;35 +.emf 01;35 + +# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions +.axv 01;35 +.anx 01;35 +.ogv 01;35 +.ogx 01;35 + +# Document files +.pdf 00;32 +.ps 00;32 +.txt 00;32 +.patch 00;32 +.diff 00;32 +.log 00;32 +.tex 00;32 +.doc 00;32 + +# audio formats +.aac 00;36 +.au 00;36 +.flac 00;36 +.m4a 00;36 +.mid 00;36 +.midi 00;36 +.mka 00;36 +.mp3 00;36 +.mpc 00;36 +.ogg 00;36 +.ra 00;36 +.wav 00;36 + +# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions +.axa 00;36 +.oga 00;36 +.spx 00;36 +.xspf 00;36 diff --git a/modules/user/.config/mimeapps.list b/modules/user/.config/mimeapps.list new file mode 100644 index 0000000..e69de29 diff --git a/modules/user/default.nix b/modules/user/default.nix new file mode 100644 index 0000000..aeeb372 --- /dev/null +++ b/modules/user/default.nix @@ -0,0 +1,101 @@ +{ + config, + pkgs, + lib, + ... +}: let + psCfg = config.pub-solar; +in + with lib; { + imports = [ + ./home.nix + ]; + + options.pub-solar = { + user = { + name = mkOption { + description = "User login name"; + type = types.nullOr types.str; + default = "nixos"; + }; + description = mkOption { + description = "User description"; + type = types.nullOr types.str; + default = "The main PubSolarOS user"; + }; + password = mkOption { + description = "User password"; + type = types.nullOr types.str; + default = null; + }; + passwordlessSudo = mkOption { + description = "Whether this user can use sudo without entering a password"; + type = types.bool; + default = false; + }; + publicKeys = mkOption { + description = "User SSH public keys"; + type = types.listOf types.str; + default = []; + }; + fullName = mkOption { + description = "User full name"; + type = types.nullOr types.str; + default = null; + }; + email = mkOption { + description = "User email address"; + type = types.nullOr types.str; + default = null; + }; + gpgKeyId = mkOption { + description = "GPG Key ID"; + type = types.nullOr types.str; + default = null; + }; + }; + }; + + config = { + users = { + mutableUsers = false; + + users."${psCfg.user.name}" = { + # Indicates whether this is an account for a “real” user. + # This automatically sets group to users, createHome to true, + # home to /home/username, useDefaultShell to true, and isSystemUser to false. + isNormalUser = true; + description = psCfg.user.description; + extraGroups = [ + "input" + "lp" + "networkmanager" + "scanner" + "video" + "wheel" + ]; + shell = pkgs.bash; + initialHashedPassword = + if psCfg.user.password != null + then psCfg.user.password + else ""; + openssh.authorizedKeys.keys = + if psCfg.user.publicKeys != null + then psCfg.user.publicKeys + else []; + }; + }; + + security.sudo.extraRules = mkIf psCfg.user.passwordlessSudo [ + { + users = ["${psCfg.user.name}"]; + commands = [ + { + command = "ALL"; + options = ["NOPASSWD"]; + } + ]; + } + ]; + }; + } diff --git a/modules/user/home.nix b/modules/user/home.nix new file mode 100644 index 0000000..ea1e07b --- /dev/null +++ b/modules/user/home.nix @@ -0,0 +1,50 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in { + imports = [ + ./session-variables.nix + ]; + + home-manager.users."${psCfg.user.name}" = { + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = psCfg.user.name; + home.homeDirectory = "/home/${psCfg.user.name}"; + home.stateVersion = "22.11"; + + programs.dircolors.enable = true; + + xdg.enable = true; + xdg.mime.enable = true; + xdg.mimeApps = import ./mimeapps.nix; + + xdg.configFile."dircolors".source = ./.config/dircolors; + + xdg.dataFile."shell.nix.tmpl" = { + text = '' + let + unstable = import (fetchTarball https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz) { }; + in + { nixpkgs ? import {} }: + with nixpkgs; mkShell { + buildInputs = [ + ]; + } + ''; + target = "nvim/templates/shell.nix.tmpl"; + }; + + # Allow unfree packages only on a user basis, not on a system-wide basis + xdg.configFile."nixpkgs/config.nix".text = " { allowUnfree = true; } "; + }; +} diff --git a/modules/user/mimeapps.nix b/modules/user/mimeapps.nix new file mode 100644 index 0000000..ab3fd49 --- /dev/null +++ b/modules/user/mimeapps.nix @@ -0,0 +1,27 @@ +{ + enable = true; + defaultApplications = { + "application/octet-stream" = ["firefox.desktop"]; + "application/pdf" = ["org.gnome.Evince.desktop"]; + "application/x-bittorrent" = ["deluge.desktop"]; + "application/x-extension-htm" = ["firefox.desktop"]; + "application/x-extension-html" = ["firefox.desktop"]; + "application/x-extension-shtml" = ["firefox.desktop"]; + "application/x-extension-xhtml" = ["firefox.desktop"]; + "application/x-extension-xht" = ["firefox.desktop"]; + "application/xhtml+xml" = ["firefox.desktop"]; + "image/jpeg" = ["org.gnome.eog.desktop"]; + "image/png" = ["org.gnome.eog.desktop"]; + "message/rfc822" = ["userapp-Thunderbird.desktop"]; + "text/html" = ["firefox.desktop"]; + "text/plain" = ["firefox.desktop"]; + "video/mp4" = ["vlc.desktop"]; + "x-scheme-handler/chrome" = ["firefox.desktop"]; + "x-scheme-handler/ftp" = ["firefox.desktop"]; + "x-scheme-handler/http" = ["firefox.desktop"]; + "x-scheme-handler/https" = ["firefox.desktop"]; + "x-scheme-handler/mailto" = ["userapp-Thunderbird.desktop"]; + "x-scheme-handler/msteams" = ["teams.desktop"]; + "x-scheme-handler/tg" = ["userapp-Telegram Desktop-JBKFU0.desktop"]; + }; +} diff --git a/modules/user/session-variables.nix b/modules/user/session-variables.nix new file mode 100644 index 0000000..ae96e81 --- /dev/null +++ b/modules/user/session-variables.nix @@ -0,0 +1,119 @@ +{ + config, + pkgs, + lib, + ... +}: let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; + variables = { + XDG_CONFIG_HOME = xdg.configHome; + XDG_CACHE_HOME = xdg.cacheHome; + XDG_DATA_HOME = xdg.dataHome; + + XDG_CURRENT_DESKTOP = "sway"; + + QT_QPA_PLATFORM = "wayland"; + + # Wayland fixes + ECORE_EVAS_ENGINE = "wayland_egl"; + ELM_ENGINE = "wayland_egl"; + SDL_VIDEODRIVER = "wayland"; + + EDITOR = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim"; + VISUAL = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim"; + + # fix "xdg-open fork-bomb" your preferred browser from here + BROWSER = "${pkgs.firefox-wayland}/bin/firefox"; + + # node + NODE_REPL_HISTORY = "${xdg.dataHome}/node_repl_history"; + NVM_DIR = "${xdg.dataHome}/nvm"; + PKG_CACHE_PATH = "${xdg.cacheHome}/pkg-cache"; + + # npm + NPM_CONFIG_USERCONFIG = "${xdg.configHome}/npm/config"; + NPM_CONFIG_CACHE = "${xdg.configHome}/npm"; + # TODO: used to be XDG_RUNTIME_DIR NPM_CONFIG_TMP = "/tmp/npm"; + + # Make sure virsh runs without root + LIBVIRT_DEFAULT_URI = "qemu:///system"; + + # wine + WINEPREFIX = "${xdg.dataHome}/wineprefixes/default"; + + # z + _Z_DATA = "${xdg.dataHome}/z"; + + # wget + WGETRC = "${xdg.configHome}/wgetrc"; + + # rust + RUSTUP_HOME = "${xdg.dataHome}/rustup"; + CARGO_HOME = "${xdg.dataHome}/cargo"; + + # Java + _JAVA_OPTIONS = "-Djava.util.prefs.userRoot='${xdg.configHome}/java'"; + _JAVA_AWT_WM_NONREPARENTING = "1"; + + # docker + DOCKER_CONFIG = "${xdg.configHome}/docker"; + + # experimental wayland in firefox/thunderbird + MOZ_ENABLE_WAYLAND = "1"; + + # chromium / electron on wayland: enable ozone (native wayland mode) + NIXOS_OZONE_WL = "1"; + + # Vagrant + VAGRANT_HOME = "${xdg.dataHome}/vagrant"; + VAGRANT_DEFAULT_PROVIDER = "libvirt"; + + # Android + ANDROID_SDK_ROOT = "${xdg.configHome}/android"; + + ANDROID_AVD_HOME = "${xdg.dataHome}/android"; + ANDROID_EMULATOR_HOME = "${xdg.dataHome}/android"; + ADB_VENDOR_KEY = "${xdg.configHome}/android"; + + # TELEMETRY BS + VUEDX_TELEMETRY = "off"; + + # FZF shell history widget default colors + FZF_DEFAULT_OPTS = lib.mkForce "--color=bg+:#2d2a2e,bg:#1a181a,spinner:#ef9062,hl:#7accd7 --color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062 --color=marker:#ef9062,fg+:#d3d1d4,prompt:#e5c463,hl+:#7accd7"; + + # nnn theme colors + NNN_FCOLORS = let + BLK = "04"; + CHR = "04"; + DIR = "04"; + EXE = "02"; + REG = "00"; + HARDLINK = "01"; + SYMLINK = "01"; + MISSING = "01"; + ORPHAN = "07"; + FIFO = "05"; + SOCK = "05"; + OTHER = "02"; + in + BLK + CHR + DIR + EXE + REG + HARDLINK + SYMLINK + MISSING + ORPHAN + FIFO + SOCK + OTHER; + }; + + envListNames = lib.attrsets.mapAttrsToList (name: value: name) variables; + + # Here we merge an extra variable into the attrset called FULL_ENV_LIST. + # It's a list of the variable names defined above. + # We can use this to tell `systemctl import-environment` to import the full list above. + variablesWithMeta = lib.attrsets.zipAttrsWith (name: values: builtins.head values) [ + variables + {IMPORT_ENVIRONMENT_ENV_LIST = lib.lists.foldl (a: b: a + " " + b) "IMPORT_ENVIRONMENT_ENV_LIST" envListNames;} + ]; +in { + home-manager.users."${psCfg.user.name}" = { + home.sessionVariables = variablesWithMeta; + systemd.user.sessionVariables = variablesWithMeta; + }; + + environment.variables = variablesWithMeta; +} diff --git a/modules/virtualisation/default.nix b/modules/virtualisation/default.nix new file mode 100644 index 0000000..892667b --- /dev/null +++ b/modules/virtualisation/default.nix @@ -0,0 +1,55 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; +in { + boot.kernelParams = [ + "amd_iommu=on" + "intel_iommu=on" + "iommu=pt" + ]; + + virtualisation.libvirtd = { + enable = true; + qemu.ovmf.enable = true; + }; + users.users."${psCfg.user.name}" = { + extraGroups = ["libvirtd"]; + }; + + environment.systemPackages = with pkgs; [ + libvirt + libvirt-glib + qemu + virt-manager + python3Packages.libvirt + gvfs + edk2 + OVMF + win-virtio + looking-glass-client + lgcl + ]; + + home-manager.users."${psCfg.user.name}" = { + xdg.dataFile."libvirt/.keep".text = "# this file is here to generate the directory"; + home.packages = [pkgs.obs-studio-plugins.looking-glass-obs]; + }; + + systemd.tmpfiles.rules = [ + "f /dev/shm/looking-glass 0660 ${psCfg.user.name} kvm" + ]; + #networking.bridges.virbr1.interfaces = []; + #networking.interfaces.virbr1 = { + # ipv4.addresses = [ + # { + # address = "192.168.123.1"; + # prefixLength = 24; + # } + # ]; + #}; +} diff --git a/modules/wireguard-client/default.nix b/modules/wireguard-client/default.nix new file mode 100644 index 0000000..b919828 --- /dev/null +++ b/modules/wireguard-client/default.nix @@ -0,0 +1,54 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; let + psCfg = config.pub-solar; + cfg = config.pub-solar.wireguard-client; +in { + options.pub-solar.wireguard-client = { + ownIPs = mkOption { + description = '' + Internal ips in wireguard used for cluster control-plane communication. + ''; + type = types.listOf types.str; + }; + + wireguardPrivateKeyFile = mkOption { + description = '' + Location of private key file + ''; + type = types.path; + }; + }; + + config = { + networking.firewall.allowedUDPPorts = [51899]; + + networking.wg-quick.interfaces = { + wg0 = { + listenPort = 51899; + address = cfg.ownIPs; + dns = [ + "10.0.1.2" + "fd00:b12f:acab:1312:acab:2::" + ]; + privateKeyFile = cfg.wireguardPrivateKeyFile; + peers = [ + { + # frikandel + publicKey = "p6YKNYBlySKfhTN+wbSsKdoNjzko/XSAiTAlCJzP1jA="; + allowedIPs = [ + "10.0.1.0/24" + "fd00:b12f:acab:1312::/64" + ]; + endpoint = "[2a01:4f8:c2c:b60::]:51899"; + persistentKeepalive = 25; + } + ]; + }; + }; + }; +} diff --git a/overlays/blesh.nix b/overlays/blesh.nix new file mode 100644 index 0000000..f29c29e --- /dev/null +++ b/overlays/blesh.nix @@ -0,0 +1,32 @@ +final: prev: { + blesh = prev.blesh.overrideAttrs (oldAttrs: rec { + inherit (prev.sources.blesh-nvfetcher) version src; + + dontBuild = false; + buildInputs = [prev.git]; + patchPhase = '' + substituteInPlace GNUmakefile \ + --replace "git submodule update --init --recursive" "" + ''; + nativeCheckInputs = oldAttrs.nativeCheckInputs ++ [prev.busybox]; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/share/blesh/lib" + + cat <"$out/share/blesh/lib/_package.sh" + _ble_base_package_type=nix + + function ble/base/package:nix/update { + echo "Ble.sh is installed by Nix. You can update it there." >&2 + return 1 + } + EOF + + make install INSDIR=$out/share/blesh + + runHook postInstall + ''; + }); +} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..2227aee --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,35 @@ +{ + self, + lib, + inputs, + ... +}: { + flake = { + nixosModules = rec { + overlays = {...}: { + nixpkgs.overlays = [ + (final: prev: let + unstable = import inputs.unstable { + system = prev.system; + }; + master = import inputs.master { + system = prev.system; + }; + in { + direnv = unstable.direnv; + nix-direnv = unstable.nix-direnv; + #vimPlugins = prev.vimPlugins // {inherit (unstable.vimPlugins) nvim-lspconfig;}; + }) + + inputs.erpnext.overlays.default + inputs.erpnext.overlays.pythonOverlay + + (import ../pkgs) + (import ./blesh.nix) + (import ./nix-index.nix) + (import ./neovim-plugins.nix) + ]; + }; + }; + }; +} diff --git a/overlays/neovim-plugins.nix b/overlays/neovim-plugins.nix new file mode 100644 index 0000000..1bb2c39 --- /dev/null +++ b/overlays/neovim-plugins.nix @@ -0,0 +1,24 @@ +final: prev: { + vimPlugins = + prev.vimPlugins + // { + instant-nvim-nvfetcher = prev.vimUtils.buildVimPlugin { + inherit (prev.sources.instant-nvim-nvfetcher) pname version src; + }; + vimagit-nvfetcher = prev.vimUtils.buildVimPlugin { + inherit (prev.sources.vimagit-nvfetcher) pname version src; + }; + vim-caddyfile-nvfetcher = prev.vimUtils.buildVimPlugin { + inherit (prev.sources.vim-caddyfile-nvfetcher) pname version src; + }; + vim-workspace-nvfetcher = prev.vimUtils.buildVimPlugin { + inherit (prev.sources.vim-workspace-nvfetcher) pname version src; + }; + vim-beautify-nvfetcher = prev.vimUtils.buildVimPlugin { + inherit (prev.sources.vim-beautify-nvfetcher) pname version src; + }; + vim-apprentice-nvfetcher = prev.vimUtils.buildVimPlugin { + inherit (prev.sources.vim-apprentice-nvfetcher) pname version src; + }; + }; +} diff --git a/overlays/nix-index.nix b/overlays/nix-index.nix new file mode 100644 index 0000000..2d91564 --- /dev/null +++ b/overlays/nix-index.nix @@ -0,0 +1,24 @@ +final: prev: { + nix-index-unwrapped = prev.nix-index-unwrapped.overrideAttrs (oldAttrs: rec { + inherit (oldAttrs) pname; + src = prev.fetchFromGitHub { + owner = "teutat3s"; + repo = "nix-index"; + rev = "e2d1917f474083f6d5a2c3368a6073f6427c19e4"; + hash = "sha256-3nTphxyqI6Hci7yJ2bKLcgdRl2qOY3BzUqoIl1YmmsA="; + }; + version = "unstable-2023-11-25"; + + cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const { + name = "${pname}-vendor.tar.gz"; + inherit src; + outputHash = "sha256-x4oejbS1/L3WkN2S6PzvJni9UasRTP3TVVp3Ur9ge8U="; + }); + + postInstall = '' + substituteInPlace etc/command-not-found.* \ + --subst-var out + install -Dm444 etc/command-not-found.* -t $out/etc/profile.d + ''; + }); +} diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix new file mode 100644 index 0000000..c37dc1a --- /dev/null +++ b/pkgs/_sources/generated.nix @@ -0,0 +1,114 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: +{ + blesh-nvfetcher = { + pname = "blesh-nvfetcher"; + version = "9641c3b8ef6c792912b58209281b77619c177637"; + src = fetchFromGitHub { + owner = "akinomyoga"; + repo = "ble.sh"; + rev = "9641c3b8ef6c792912b58209281b77619c177637"; + fetchSubmodules = true; + deepClone = false; + leaveDotGit = true; + sha256 = "sha256-y+lfSK5iVA1qNO10uqXFsuaJEKQqqT9rSdm/UQ3cWgs="; + }; + date = "2024-01-05"; + }; + instant-nvim-nvfetcher = { + pname = "instant-nvim-nvfetcher"; + version = "294b6d08143b3db8f9db7f606829270149e1a786"; + src = fetchFromGitHub { + owner = "jbyuki"; + repo = "instant.nvim"; + rev = "294b6d08143b3db8f9db7f606829270149e1a786"; + fetchSubmodules = false; + sha256 = "sha256-DXJWji/NR8ZCxe014rD51v3EHJHMhRQeOoI3SsY8mR4="; + }; + date = "2022-06-25"; + }; + manix = { + pname = "manix"; + version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; + src = fetchFromGitHub { + owner = "mlvzk"; + repo = "manix"; + rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; + fetchSubmodules = false; + sha256 = "sha256-GqPuYscLhkR5E2HnSFV4R48hCWvtM3C++3zlJhiK/aw="; + }; + date = "2021-04-20"; + }; + rnix-lsp-nvfetcher = { + pname = "rnix-lsp-nvfetcher"; + version = "95d40673fe43642e2e1144341e86d0036abd95d9"; + src = fetchFromGitHub { + owner = "nix-community"; + repo = "rnix-lsp"; + rev = "95d40673fe43642e2e1144341e86d0036abd95d9"; + fetchSubmodules = false; + sha256 = "sha256-F0s0m62S5bHNVWNHLZD6SeHiLrsDx98VQbRjDyIu+qQ="; + }; + date = "2022-11-27"; + }; + vim-apprentice-nvfetcher = { + pname = "vim-apprentice-nvfetcher"; + version = "59ad13661fa15edaf72c62218903c7817b5a3691"; + src = fetchFromGitHub { + owner = "romainl"; + repo = "Apprentice"; + rev = "59ad13661fa15edaf72c62218903c7817b5a3691"; + fetchSubmodules = false; + sha256 = "sha256-03B9tmU9+6t2hxhOgZxBqJr9r41CAqhHLUkHYvFdcks="; + }; + date = "2023-02-15"; + }; + vim-beautify-nvfetcher = { + pname = "vim-beautify-nvfetcher"; + version = "e0691483927dc5a0c051433602397419f9628623"; + src = fetchFromGitHub { + owner = "zeekay"; + repo = "vim-beautify"; + rev = "e0691483927dc5a0c051433602397419f9628623"; + fetchSubmodules = false; + sha256 = "sha256-QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ="; + }; + date = "2018-12-27"; + }; + vim-caddyfile-nvfetcher = { + pname = "vim-caddyfile-nvfetcher"; + version = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; + src = fetchFromGitHub { + owner = "isobit"; + repo = "vim-caddyfile"; + rev = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; + fetchSubmodules = false; + sha256 = "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o="; + }; + date = "2022-05-09"; + }; + vim-workspace-nvfetcher = { + pname = "vim-workspace-nvfetcher"; + version = "c0d1e4332a378f58bfdf363b4957168fa78e79b4"; + src = fetchFromGitHub { + owner = "thaerkh"; + repo = "vim-workspace"; + rev = "c0d1e4332a378f58bfdf363b4957168fa78e79b4"; + fetchSubmodules = false; + sha256 = "sha256-2Brx098dk5THiieBiW71FG9mUUwS1CSY9mpOPWA/Tq4="; + }; + date = "2023-05-28"; + }; + vimagit-nvfetcher = { + pname = "vimagit-nvfetcher"; + version = "06afe48439d0118a77d622ef06eff0f7cd7d62ab"; + src = fetchFromGitHub { + owner = "jreybert"; + repo = "vimagit"; + rev = "06afe48439d0118a77d622ef06eff0f7cd7d62ab"; + fetchSubmodules = false; + sha256 = "sha256-2kugFr32lZINgpmDyfTyBp5lNa2/dculKmcFGa2q/io="; + }; + date = "2024-01-04"; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..6655356 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,24 @@ +final: prev: +with final; { + # keep sources this first + sources = prev.callPackage (import ./_sources/generated.nix) {}; + # then, call packages with `final.callPackage` + import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final); + lgcl = writeShellScriptBin "lgcl" (import ./lgcl.nix final); + mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final); + mopidy-jellyfin = import ./mopidy-jellyfin.nix final; + mu = writeShellScriptBin "mu" (import ./mu.nix final); + psos = writeShellScriptBin "psos" (import ./psos.nix final); + psos-docs = import ./psos-docs.nix final; + s = writeShellScriptBin "s" (import ./s.nix final); + sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final); + sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final); + swaylock-bg = writeShellScriptBin "swaylock-bg" (import ./swaylock-bg.nix final); + toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final); + uhk-agent = import ./uhk-agent.nix final; + wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final); + drone-docker-runner = writeShellScriptBin "drone-docker-runner" (import ./drone-docker-runner.nix final); + record-screen = writeShellScriptBin "record-screen" (import ./record-screen.nix final); + + # ps-fixes +} diff --git a/pkgs/drone-docker-runner.nix b/pkgs/drone-docker-runner.nix new file mode 100644 index 0000000..bb3e8b8 --- /dev/null +++ b/pkgs/drone-docker-runner.nix @@ -0,0 +1,33 @@ +self: +with self; '' + case $1 in + start) + ${self.docker}/bin/docker run --detach \ + --volume=/var/run/docker.sock:/var/run/docker.sock \ + --env=DRONE_RPC_PROTO=$DRONE_RPC_PROTO \ + --env=DRONE_RPC_HOST=$DRONE_RPC_HOST \ + --env=DRONE_RPC_SECRET=$(${self.libsecret}/bin/secret-tool lookup drone rpc-secret) \ + --env=DRONE_RUNNER_CAPACITY=8 \ + --env=DRONE_RUNNER_NAME=$(${self.inetutils}/bin/hostname) \ + --publish=3000:3000 \ + --restart=always \ + --name=drone-runner \ + drone/drone-runner-docker:1 + ;; + + stop) + ${self.docker}/bin/docker stop drone-runner + ${self.docker}/bin/docker rm drone-runner + ;; + + logs) + ${self.docker}/bin/docker logs drone-runner + ;; + + *) + echo "Usage: drone-docker-runner " + exit 1; + ;; + esac + +'' diff --git a/pkgs/import-gtk-settings.nix b/pkgs/import-gtk-settings.nix new file mode 100644 index 0000000..2a4bf0f --- /dev/null +++ b/pkgs/import-gtk-settings.nix @@ -0,0 +1,12 @@ +self: +with self; '' + # usage: import-gsettings : : ... + + expression="" + for pair in "$@"; do + IFS=:; set -- $pair + expressions="$expressions -e 's/^$2=(.*)$/gsettings set org.gnome.desktop.interface $1 \1/e'" + done + IFS= + eval exec sed -E $expressions "$XDG_CONFIG_HOME"/gtk-3.0/settings.ini >/dev/null +'' diff --git a/pkgs/lgcl.nix b/pkgs/lgcl.nix new file mode 100644 index 0000000..73f9112 --- /dev/null +++ b/pkgs/lgcl.nix @@ -0,0 +1,8 @@ +self: +with self; let + looking-glass-client = self.looking-glass-client.overrideAttrs (old: { + meta.platforms = ["x86_64-linux" "aarch64-linux"]; + }); +in '' + ${looking-glass-client}/bin/looking-glass-client -f /dev/shm/looking-glass input:ignoreWindowsKeys=yes input:grabKeyboardOnFocus=no +'' diff --git a/pkgs/mailto-mutt.nix b/pkgs/mailto-mutt.nix new file mode 100644 index 0000000..7e014e0 --- /dev/null +++ b/pkgs/mailto-mutt.nix @@ -0,0 +1,11 @@ +self: +with self; '' + mkdir -p $XDG_CACHE_HOME/log + + LOGFILE=$XDG_CACHE_HOME/log/mailto.log + echo "$@" >> $LOGFILE + + EDITOR=/etc/profiles/per-user/$USER/bin/nvim + + ${alacritty}/bin/alacritty -e neomutt -- "$@" +'' diff --git a/pkgs/mopidy-jellyfin.nix b/pkgs/mopidy-jellyfin.nix new file mode 100644 index 0000000..b507ba1 --- /dev/null +++ b/pkgs/mopidy-jellyfin.nix @@ -0,0 +1,29 @@ +self: +with self; let + websocket-client = python3.pkgs.buildPythonPackage rec { + pname = "websocket-client"; + version = "1.2.1"; + doCheck = false; + src = python3.pkgs.fetchPypi { + inherit pname version; + sha256 = "sha256-jftxXYqZL1cS//jIQ62ulOIrIqmbLF5rDsShqYHMTg0="; + }; + }; +in + python3.pkgs.buildPythonPackage rec { + pname = "Mopidy-Jellyfin"; + version = "1.0.2"; + doCheck = false; + propagatedBuildInputs = with python3.pkgs; [ + unidecode + websocket-client + requests + setuptools + pykka + mopidy + ]; + src = python3.pkgs.fetchPypi { + inherit pname version; + sha256 = "sha256-5XimIIQSpvNyQbSOFtSTkA0jhA0V68BbyQEQNnov+0g="; + }; + } diff --git a/pkgs/mu.nix b/pkgs/mu.nix new file mode 100644 index 0000000..3b4c351 --- /dev/null +++ b/pkgs/mu.nix @@ -0,0 +1,4 @@ +self: +with self; '' + exec ${alacritty}/bin/alacritty --class mu_vimpc --option dimensions.columns=120 --option dimensions.lines=80 -e vimpc -- "$@" +'' diff --git a/pkgs/prison-break-url.patch b/pkgs/prison-break-url.patch new file mode 100644 index 0000000..42f60b6 --- /dev/null +++ b/pkgs/prison-break-url.patch @@ -0,0 +1,15 @@ +diff --git a/prisonbreak/plugins/wifionice.py b/prisonbreak/plugins/wifionice.py +index 1cee64d..e152903 100644 +--- a/prisonbreak/plugins/wifionice.py ++++ b/prisonbreak/plugins/wifionice.py +@@ -58,8 +58,8 @@ def accept(resp: requests.Response, s: requests.Session) -> bool: + log.debug(f"data: {postdata}") + + # TODO: detect the correct URL to query based on form path and url +- # The URL changed from http to http, and wifionice.de is now wifi.bahn.de +- resp = s.post("https://wifi.bahn.de/de/?url=http%3A%2F%2Fkrebsco.de%2Fsecret", data=postdata) ++ # The URL changed from wifi.bahn.de to login.wifionice.de ++ resp = s.post("https://login.wifionice.de/de/?url=http%3A%2F%2Fkrebsco.de%2Fsecret", data=postdata) + log.debug(f"Return code: {resp.status_code}") + log.debug(resp.headers) + return resp.ok diff --git a/pkgs/prison-break.nix b/pkgs/prison-break.nix new file mode 100644 index 0000000..482aa13 --- /dev/null +++ b/pkgs/prison-break.nix @@ -0,0 +1,49 @@ +self: +with self; let + straight-plugin = python3.pkgs.buildPythonPackage rec { + pname = "straight-plugin"; + version = "1.5.0"; + + src = fetchPypi { + pname = "straight.plugin"; + inherit version; + hash = "sha256-gYp2QQaJMu1kNtCvCju3e7veKd8KcULIvRoknnwvDTg="; + }; + + meta = with lib; { + description = "A simple namespaced plugin facility"; + homepage = https://github.com/ironfroggy/straight.plugin; + license = licenses.mit; + maintainers = [maintainers.makefu]; + }; + }; +in + python3.pkgs.buildPythonPackage { + name = "prison-break"; + version = "1.5.0"; + src = fetchFromGitHub { + owner = "makefu"; + repo = "prison-break"; + rev = "1.5.0"; + hash = "sha256-9Z60TxfvUAkp04fkb8VujLhBKjrJ1NZm00x/mGZ5Zz4="; + }; + propagatedBuildInputs = with python3.pkgs; [ + docopt + requests + beautifulsoup4 + notify2 + straight-plugin + ]; + patches = [ + ./prison-break-url.patch + ]; + + checkInputs = [python3.pkgs.black]; + + meta = with lib; { + description = "No Terms of Service (AGBs) every time you connect to a captive portal"; + homepage = https://github.com/makefu/prison-break; + license = licenses.mit; + maintainers = [maintainers.makefu]; + }; + } diff --git a/pkgs/psos-docs.nix b/pkgs/psos-docs.nix new file mode 100644 index 0000000..24e86bf --- /dev/null +++ b/pkgs/psos-docs.nix @@ -0,0 +1,27 @@ +self: +with self; + stdenv.mkDerivation rec { + pname = "psos-docs"; + version = "0.0.1"; + buildInputs = [ + mdbook + mdbook-pdf + ]; + + src = ../docs/..; # wut + + phases = ["buildPhase" "installPhase"]; + + buildPhase = '' + cp -r $src/doc ./doc + cp $src/README.md ./README.md + chmod ug+w -R . + ls -la . + mdbook build doc + ''; + + installPhase = '' + mkdir -p $out/lib/ + cp -r doc/book $out/lib/html + ''; + } diff --git a/pkgs/psos.nix b/pkgs/psos.nix new file mode 100644 index 0000000..7846f80 --- /dev/null +++ b/pkgs/psos.nix @@ -0,0 +1,34 @@ +self: +with self; '' + case $1 in + rebuild) + shift; + exec sudo nixos-rebuild switch --flake "/etc/nixos#installed-host" $@ + ;; + update) + shift; + cd /etc/nixos + git pull + exec nix flake update + ;; + option) + shift; + exec nixos-option -I nixpkgs=/etc/nixos/lib/compat $@ + ;; + help) + shift; + exec xdg-open http://help.local/ + ;; + *) + if [[ "$@" != "" ]]; then + echo "Unknown command: psos $@" + echo "" + fi + echo "Usage: psos [COMMAND]" + echo " rebuild Rebuild the configuration and switch to it" + echo " update Pull git and update flake.lock" + echo " option [path] See the current value for an option in the flake config. Example: psos option nix.nixPath" + exit 1 + ;; + esac +'' diff --git a/pkgs/record-screen.nix b/pkgs/record-screen.nix new file mode 100644 index 0000000..eb2d0bf --- /dev/null +++ b/pkgs/record-screen.nix @@ -0,0 +1,11 @@ +self: +with self; '' + mkdir -p "$HOME/Videos/Screenrecordings" + GEOMETRY="$(slurp -d -b \#ffffff11)" + RESOLUTION="$(echo $GEOMETRY | awk '{print $2}')" + FILE_LOCATION="$HOME/Videos/Screenrecordings/$(${coreutils}/bin/date +%Y%m%d_%Hh%Mm%Ss)_$RESOLUTION.mp4" + echo "Recording $GEOMETRY into $FILE_LOCATION" + ${alacritty}/bin/alacritty \ + --class screen-recorder \ + -e ${wf-recorder}/bin/wf-recorder -g "$GEOMETRY" -f "$FILE_LOCATION" +'' diff --git a/pkgs/s.nix b/pkgs/s.nix new file mode 100644 index 0000000..1b003b6 --- /dev/null +++ b/pkgs/s.nix @@ -0,0 +1,40 @@ +self: +with self; '' + case $1 in + d) + shift; + URL="https://duckduckgo.com?q=$@" + ;; + no) + shift; + URL="https://search.nixos.org/options?query=$@" + ;; + np) + shift; + URL="https://search.nixos.org/packages?query=$@" + ;; + rs) + shift; + URL="https://doc.rust-lang.org/std/index.html?search=$@" + ;; + rsc) + shift; + URL="https://docs.rs/releases/search?query=$@" + ;; + mdn) + shift; + URL="https://developer.mozilla.org/en-US/search?q=$@" + ;; + w) + shift; + URL="https://en.wikipedia.org/w/index.php?search=$@" + ;; + *) + URL="https://search.b12f.io?q=$@" + ;; + esac + + + ${firefox-wayland}/bin/firefox --new-tab "$URL" + ${sway}/bin/swaymsg '[app_id="firefox"]' focus +'' diff --git a/pkgs/sources.toml b/pkgs/sources.toml new file mode 100644 index 0000000..929cecb --- /dev/null +++ b/pkgs/sources.toml @@ -0,0 +1,38 @@ +# nvfetcher.toml +[manix] +src.git = "https://github.com/mlvzk/manix" +fetch.github = "mlvzk/manix" + +[rnix-lsp-nvfetcher] +src.git = "https://github.com/nix-community/rnix-lsp" +fetch.github = "nix-community/rnix-lsp" + +[vimagit-nvfetcher] +src.git = "https://github.com/jreybert/vimagit" +fetch.github = "jreybert/vimagit" + +[instant-nvim-nvfetcher] +src.git = "https://github.com/jbyuki/instant.nvim" +fetch.github = "jbyuki/instant.nvim" + +[vim-caddyfile-nvfetcher] +src.git = "https://github.com/isobit/vim-caddyfile" +fetch.github = "isobit/vim-caddyfile" + +[vim-workspace-nvfetcher] +src.git = "https://github.com/thaerkh/vim-workspace" +fetch.github = "thaerkh/vim-workspace" + +[vim-beautify-nvfetcher] +src.git = "https://github.com/zeekay/vim-beautify" +fetch.github = "zeekay/vim-beautify" + +[vim-apprentice-nvfetcher] +src.git = "https://github.com/romainl/Apprentice" +fetch.github = "romainl/Apprentice" + +[blesh-nvfetcher] +src.git = "https://github.com/akinomyoga/ble.sh" +fetch.github = "akinomyoga/ble.sh" +git.fetchSubmodules = true +git.leaveDotGit = true diff --git a/pkgs/sway-launcher.nix b/pkgs/sway-launcher.nix new file mode 100644 index 0000000..8eddd85 --- /dev/null +++ b/pkgs/sway-launcher.nix @@ -0,0 +1,65 @@ +self: +with self; '' + #!/usr/bin/env bash + # terminal application launcher for sway, using fzf + # original command: + # Based on: https://github.com/swaywm/sway/issues/1367 + # bindsym $altkey+space exec termite --name=launcher -e \ + # "bash -c 'compgen -c | sort -u | fzf --no-extended --print-query | \ + # tail -n1 | xargs -r swaymsg -t command exec'" + + HIST_FILE="''${XDG_CACHE_HOME:-$HOME/.cache}/sway-launcher-history.txt" + + # Get shell command list + # This may include the occasional non-executable file + command_list=$({ compgen -c | sed 's/:[^:]*$//'; }) + + # read existing command history + if [ -f "$HIST_FILE" ]; then + command_history=$(cat "$HIST_FILE") + else + command_history="" + fi + + # search command list + command_str=$(printf "%s\n" "''${command_history}" "''${command_list}" | \ + sed -E 's/^[0-9]+ (.+)$/\1/' | \ + fzf --color=16 --exact --no-extended --print-query --no-sort | \ + tail -n1) || exit 1 + + if [ "$command_str" = "" ]; then + exit 1 + fi + # echo "Command: $command_str" + + # using \E flag from perl regex + test "''${command_str#*\\E}" != "$command_str" && echo "command can't contain '\E'" + test "''${command_str#*\\E}" != "$command_str" && exit 1 + + # get full line from history (with count number) + hist_line=$(echo "$command_history" | grep -Pe "^[0-9]+ \Q$command_str\E$") + # echo "Hist Line: $hist_line" + + if [ "$hist_line" = "" ]; then + hist_count=1 + else + # Increment usage count + hist_count=$(echo "$hist_line" | sed -E 's/^([0-9]+) .+$/\1/') + hist_count=$((hist_count + 1)) + # delete line, to add updated later + # echo "Hist Before: $command_history" + command_history=$(echo "$command_history" | \ + grep --invert-match -Pe "^[0-9]+ \Q$command_str\E$") + # echo "Hist After: $command_history" + fi + + # update history + update_line="''${hist_count} ''${command_str}" + printf "%s\n" "''${update_line}" "''${command_history}" | \ + sort --numeric-sort --reverse > "$HIST_FILE" + # echo "$update_line" + + # execute command + echo "$command_str" + ${sway}/bin/swaymsg -t command exec "$command_str" +'' diff --git a/pkgs/sway-service.nix b/pkgs/sway-service.nix new file mode 100644 index 0000000..9ba8bb1 --- /dev/null +++ b/pkgs/sway-service.nix @@ -0,0 +1,7 @@ +self: +with self; '' + # first import environment variables from the login manager + systemctl --user import-environment; + # then start the service + exec systemctl --wait --user start sway.service +'' diff --git a/pkgs/swaylock-bg.nix b/pkgs/swaylock-bg.nix new file mode 100644 index 0000000..78a9681 --- /dev/null +++ b/pkgs/swaylock-bg.nix @@ -0,0 +1,20 @@ +self: +with self; '' + # Dependencies: + # swaylock + + # Make sure we aren't running twice + RUNNING=$(${procps}/bin/pgrep -c ${swaylock}/bin/swaylock) + if [ "$RUNNING" -ne 0 ]; then + exit 0 + fi + + IMAGE="$XDG_CONFIG_HOME/wallpaper.jpg" + LOCKARGS="" + + for OUTPUT in $(${sway}/bin/swaymsg -t get_outputs | ${jq}/bin/jq -r '.[].name') + do + LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}" + done + exec ${swaylock}/bin/swaylock $LOCKARGS +'' diff --git a/pkgs/toggle-kbd-layout.nix b/pkgs/toggle-kbd-layout.nix new file mode 100644 index 0000000..a35de23 --- /dev/null +++ b/pkgs/toggle-kbd-layout.nix @@ -0,0 +1,16 @@ +self: +with self; '' + set -e + + current_layout=$(${sway}/bin/swaymsg -t get_inputs | ${jq}/bin/jq -r '.[] | select(.type == "keyboard") | .xkb_active_layout_index' | head -1) + total_layouts=$(${sway}/bin/swaymsg -t get_inputs | ${jq}/bin/jq -r '.[] | select(.type == "keyboard") | .xkb_layout_names | length' | head -1) + + next_layout=$(expr $current_layout + 1); + + if [ $next_layout -ge $total_layouts ]; then + next_layout=0; + fi + + ${libnotify}/bin/notify-send "$next_layout" + ${sway}/bin/swaymsg input '*' xkb_switch_layout "$next_layout" +'' diff --git a/pkgs/uhk-agent.nix b/pkgs/uhk-agent.nix new file mode 100644 index 0000000..1293fc4 --- /dev/null +++ b/pkgs/uhk-agent.nix @@ -0,0 +1,44 @@ +self: +with self; let + uhk-agent-bin = stdenv.mkDerivation rec { + pname = "uhk-agent-bin"; + version = "1.5.14"; + src = builtins.fetchurl { + url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v1.5.14/UHK.Agent-1.5.14-linux-x86_64.AppImage"; + sha256 = "sha256:1yzh4ixy0cqg02xf84vcqj3h67mkxyzs6jf1h935ay582n70nyqg"; + }; + phases = ["installPhase" "patchPhase"]; + installPhase = '' + mkdir -p $out/bin + cp $src $out/bin/uhk-agent + chmod +x $out/bin/uhk-agent + ''; + }; + + script = '' + #!${bash}/bin/bash + + ${appimage-run}/bin/appimage-run ${uhk-agent-bin}/bin/uhk-agent + ''; +in + stdenv.mkDerivation rec { + pname = "uhk-agent"; + version = "1.5.14"; + buildInputs = [ + bash + uhk-agent-bin + appimage-run + ]; + + phases = ["buildPhase" "installPhase" "patchPhase"]; + + buildPhase = '' + echo "${script}" >> uhk-agent + ''; + + installPhase = '' + mkdir -p $out/bin + cp uhk-agent $out/bin/uhk-agent + chmod +x $out/bin/uhk-agent + ''; + } diff --git a/pkgs/wcwd.nix b/pkgs/wcwd.nix new file mode 100644 index 0000000..3f5e676 --- /dev/null +++ b/pkgs/wcwd.nix @@ -0,0 +1,6 @@ +self: +with self; '' + pid=$(${sway}/bin/swaymsg -t get_tree | jq '.. | select(.type?) | select(.type=="con") | select(.focused==true).pid') + ppid=$(pgrep --newest --parent ''${pid}) + readlink /proc/''${ppid}/cwd || echo $HOME +'' diff --git a/secrets/erpnext-admin-password.age b/secrets/erpnext-admin-password.age new file mode 100644 index 0000000..319ec1d --- /dev/null +++ b/secrets/erpnext-admin-password.age @@ -0,0 +1,29 @@ +age-encryption.org/v1 +-> ssh-ed25519 uYcDNw 88HhrQ8027RZCO/s3syfJ+p1pTLu1+BD9vNTeR5wilw +0HB76zuOmanHmJ7Q5SrroyCB86uZivYrBCBMxCw4dRs +-> ssh-rsa kFDS0A +lNeBDYSX/0z5mEQNiEmjbExNVkhsAxEq+f0VHX/GmQq6ueSaYKtfbQNmyH+9kWt8 +m27qP+aH+SD/d1cSk5rq/Eq4qAuYUs8S0IT6QyCXg2KEQ9z7A18HUrKj0PrIXFs6 +KyUPJZjjoplyFLTLe8DpgG7WSUns3T/wmDWlbzGEpUUVaNmDoaywUHVlGYAQHSPS +gLFnmv1WU30HfH4A/s6y/R6+mozk3eReogRBa2QUD0YGb0eZ2LKRhzHA362lCrkG +0r8C4Cxj7D1/5t+sFS/qglxjko6nAAWME5xtvc0C1YgiFo6qnK+TwzAETViwXhhR +L+sQQzpm2F9r/AUpVRNVOVQ59Vwi9wzVopq+8Y9/lp1hbd1JIot9RMjUBpl3Cqph +mcZWOEmyDZo3JI1eGucNYb//raN9TwTiQtdCkzAPWQz08istNZeWZEKHipM46oZE +0JqYWh+nRItk4A8bIaNCd21QNeBG2qAh4x4c6ISvCFHXGaKye/73MTouPCWyAEuw +obPu2kGSezXc5C8qSXj7GGnqnSTCMd6I4ZT0trRrccXNQIG1C2R47/9a0xvzDefo +ZJZDcViZk2r1nBjVZcQnd+TrLVap1t3DM0qOTh5TKMg+ThWNEhfNP18WEvgheavs +8K517p+lc6Y2yL+SDefeD68GUjfMXyBvyKHnRetlC+k +-> ssh-ed25519 hPyiJw mH7iJLzUqd6d2Emkxzf7zDeMNMZzd1+w501ew9zW/CI +Ur/uvRyTjYGfsYO3wz1i3SksipnoNt8APVFG0XJS5ww +-> ssh-ed25519 YFSOsg HZkD6H6inmpQCXgCM7YRY8aCuEKitTr9lux3d8K3vzg +qN7dxXnOvZcvu0UcJVHa0Nil0m2rDveGu1PefbtRbRI +-> ssh-ed25519 iHV63A rwNrmU2Wlt8ws9tFZk9MeZEXVKKXQYkIylc2TGdvDwo +a0duEvHTn0uoW4bon70q/KgOdPoh7aQzhB2EFpV01NM +-> ssh-ed25519 FuRdVg 5nUX068LeAwZ5aIUmKMF6NNuMAgQIpEnUbzlYvnKmHg +ji90oliDxdeLy6+xU5G2JyE+uw02DwbODcfqj8MB7PQ +-> ssh-ed25519 BVsyTA G/HcUWR3/2O6ZMrAU0SW3nnMlxRNXzEhGnYXQjtMBmk +Xkb9eX8fKXYdGq7T5tDZ4ZVc9lVnswz9qSypsRyGU6Y +-> ,q*oT-grease 18 eH/Tc P`5j O" +4Qy4tc85qC/W1N+sLJOVBUuo +--- 5UFLhvauoxBdZMuJy6PNF8wa2CBxqU2cDwvrC9+5BJk +9-sX 5.- 2/>RwL3Q Ǿ/,;Yjc \ No newline at end of file diff --git a/secrets/erpnext-db-root-password.age b/secrets/erpnext-db-root-password.age new file mode 100644 index 0000000..5911c92 --- /dev/null +++ b/secrets/erpnext-db-root-password.age @@ -0,0 +1,31 @@ +age-encryption.org/v1 +-> ssh-ed25519 uYcDNw DGmlYNPgz9u8ptvCW7capt+d/TolEC5rZuA/8QzRVXA +aD6zo+3HExznAyB9NshQ+wlicQzHAQEePiuT0NkbPLg +-> ssh-rsa kFDS0A +D/+sv54EAe2FFHK8xPoyxo+msqwB3snJrieOz6tgOz+HFp/bKMkLDW56sBKep+Du +hiAR03q4uDl8r89aJf9sHyLW+qFxqsqIoqmgOhmAcJhNbYQnyfZ3KRQ+PPXrh1We +epSO/Td3WRB5XcHtwm09gnlWEb4oADOV0DysNDJIsAfEck+nREa2I3vgjoS/6vuX +vt7M/wyMItqBvteUIhvcYL01h7b/+FYmA7NiMJxbtcqKQMjwbhj8J59na01ObPH+ +kzlKa80OYji125nzo/q46BxS5igpgodUSoBR5a4q0wSFDZJRYkOsu2A+Gk/C3iGu +V8mHjjkO38XkOHLkR/zaige35D2KklpXJ1gE92N3fzPNTMzwRLXqLgZtz2p51nw3 +MV/A3TuU1Uohf0ztmbz755AnuuXzNHF9UUYriGh8X+8ZMsbVSiHbpJfe7+hzCLjv +vikjfCvP0EttYqksyF0c1yhx5XRsm0Ab0BIRO3KWBGSwbrfgKN1Ni5K+3A+DWqDV +o5w54fpVr2fZ9yv8D12yZFFJmnOoRoponhbb8CQWq2lQ7VBwuluDLJbgvNGkfrvu +YnnLu9Fj83A6lI6KXYNwf56LdF+d4miSlocEvPHyGe2gzqjNiw+aDaqI6jeuhRK5 +FmHX3YO/zZSiRCCewUyCex88M8Rrz7igEZomnNMcxAQ +-> ssh-ed25519 hPyiJw bqfqVyh0Olxs+MIkYiVPWykFVkIscHIXrSJ11IVfEzQ +YNxR1ySsqO6hUpM9HDLrK9w4NDbDZkqu3pbejg4Hsk4 +-> ssh-ed25519 YFSOsg RgqgD4Rx0Nm+A4OC2MLPNabwXjntusSFCm5juDSbRks +qaSEwkBA0qIkfE7X0gzkDaEPeLid9D6jheAx2Qk89eo +-> ssh-ed25519 iHV63A Y0x1ZtORMMOspem9OOHZCT2iggTdckzOhXAMHAJNTU4 +ZG4Fg1wyWS21LysKhwEBWreT1KlUOc7nYsBadbyN82g +-> ssh-ed25519 FuRdVg Qy5joH+FrKoQGAZGaAC3gDA+GCh1/PuAX8CvyVc9qCY +xtEv2qsJe6CSrI0b+4iFw84LYWEOjvkRZCmbY2OLgZo +-> ssh-ed25519 BVsyTA m9ltg/MxSqyJ8YlgjiIFIuPiLEtAZ4Us56W8fE9tKiw +ky/DdgBXc0pWEWR3mk4mWjsl6DNQTG3q57cnRoNptYM +-> EoettRjt-grease F @g +pFQRo2TqYj1dx9+b2+r6OR8t0cWAiNdcRQF+VPkwCTyX7x5BsWTlQ6vqm/4PXp0K +3t+b3p7sBGshgoQnqv51vs0TRb397X8 +--- 6BVAgRY3BiCpM3KuS1OwyfD8/ua87JrEmIYFFUUCLfc +4޼}" +00fq>>HDR ssh-ed25519 uYcDNw Ibu+78045LD4FdOIHoaX9KuDTKwnKmFKKpyG0jUXGxU +4r1ACHQ88bQx/ceTJK6TpNvbP3nrG541SnX0CVJEwQc +-> ssh-rsa kFDS0A +PepcMWrjxYsN2j+b0cS3Q7/ivIbrPfga8X8nQgHNm3ia2Lf0WAVAPeffW/ip88LF +U14IwdlBt0uK6IDygiCAzdHNhxgDM4eJLkS0rzdyEEArto0pot97u1lZUkXC3eel +OIGUjGDu3xV7LAOzGIcXBc4ZKMoYP/peJMu1kxA34C2YCKERdiufgIs1/svDb/N1 +GEA/0f44m5ZuTlmCjFDloakoUCdsaISWj0LUUWypmA8q9AQczuubEsgi6xmXFQ7Y +q4mLmTFPUv+yij+4Qo473tfvrojgt7ylVPnbif1ZwYi7scOGbblp4AnzdgtubH4Q +D002rF6SS0NyB2LBTus8KCxAApGfL3llrcGweLQ8uk2pAMrvydFiPWW/JA5qEkmF +FZ5FVjJXs6tQFNOQrlJbXKLICIlz7nCfhoWTz333aO96FNOPMFsfNOUSedu7g4aI +wZMmd1l/B1ywUwpTNwPk7YS+Crd0pOl3eAg2TnecWXdtlCjumlQ2XMzvFWDAn75Y +jAON5OXbCglel05JCDjKAu/5+jQk8/6WbgFwJ8OWygRpm9Sc1Pjio0g9rxlDshxM +Jjpc5OmIddn+PDOWjPIMP+gX7WxkaszfPeqe2BdwRncS+aygossQ1MubBwpDZYlG +qkhIKNqaMplfJw2/F6h+6YdC2oIVCN/f9pIuJfDerFM +-> ssh-ed25519 hPyiJw TNkdmVMb2q6Xwp8BK1XDDESKcTUVP3/U2CxgVkSeskM +SVQo+HGrV+pxQyVAZ3yNz7AbSwl0pcOVBV5wDbnDCQo +-> ssh-ed25519 YFSOsg y1eWoyZ5+zBRvS4rhLjT7uDoV5tK2CPKrG/kPJqXtwQ +Eu2Hhr5S/J+SC5cYGXmR2RXI7u/r7JHa2tiE7+kvM4Q +-> ssh-ed25519 iHV63A Rt3RtT0X/CsIu0CDOgwUI5tvtqPRxi9oe4qbq7bBhF0 +Q9H192GZM8IUIC1XGn2CYvzWYcewYn0l6L8x7+QDfjc +-> ssh-ed25519 FuRdVg J4XF2+jC7UIhvbLkp3x1G5UvCL4+9JKgwkLtcnp2NgE +jUZKRQlnEk71GeSyUUPxcTDPGh6YRbHCULXL3IPSrY0 +-> ssh-ed25519 BVsyTA s2Z5lJOuKnzt1HWBtG3XhsotHe1FRP/1dZG+c4D0Qlc +6GDXbJFyojR2d/vnaqpQzEHmJfmkRo0FttBeoH1fHmk +-> R-~x-grease +yQmd3Mi+ZUG8euTmcWOsjO4nUwQ +--- 60WtnpLhUTtwPFKsAGnEOxc+mZac00PXnIBplXxiAdg +RV$^\׻ԋa49=h1'FЍwŽV3@#$T헐 \ No newline at end of file diff --git a/secrets/keycloak-database-password.age b/secrets/keycloak-database-password.age new file mode 100644 index 0000000..7affc35 Binary files /dev/null and b/secrets/keycloak-database-password.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 0000000..a2547ae --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,24 @@ +let + # set ssh public keys here for your system and user + host_001_momo_koeln = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFAMFmC8BNq08QLKQLyT139qzh7jIF5yOY32fCHiCMg5 root@pioneer"; + axeman = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNeQYLFauAbzDyIbKC86NUh9yZfiyBm/BtIdkcpZnSU @axeman"; + b12f-bbcom = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCmXpOU6vzQiVSSYCoxHYv7wDxC63Qg3dxlAMR6AOzwIABCU5PFFNcO0NWYms/YR7MOViorl+19LCLRABar9JgHU1n+uqxKV6eGph3OPeMp5sN8LAh7C9N+TZj8iJzBxQ3ch+Z/LdmLRwYNJ7KSUI+gwGK6xRS3+z1022Y4P0G0sx7IeCBl4lealQEIIF10ZOfjUdBcLQar7XTc5AxyGKnHCerXHRtccCoadLQujk0AvPXbv3Ma4JwX9X++AnCWRWakqS5UInu2tGuZ/6Hrjd2a9AKWjTaBVDcbYqCvY4XVuMj2/A2bCceFBaoi41apybSk26FSFTU4qiEUNQ6lxeOwG4+1NCXyHe2bGI4VyoxinDYa8vLLzXIRfTRA0qoGfCweXNeWPf0jMqASkUKaSOH5Ot7O5ps34r0j9pWzavDid8QeKJPyhxKuF1a5G4iBEZ0O9vuti60dPSjJPci9oTxbune2/jb7Sa0yO06DtLFJ2ncr5f70s/BDxKk4XIwQLy+KsvzlQEGdY8yA6xv28bOGxL3sQ0HE2pDTsvIbAisVOKzdJeolStL9MM5W8Hg0r/KkGj2bg0TfoRp1xHV9hjKkvJrsQ6okaPvNFeZq0HXzPhWMOVQ+/46z80uaQ1ByRLr3FTwuWJ7F/73ndfxiq6bDE4z2Ji0vOjeWJm6HCxTdGw=="; + teutat3s-dumpyourvms = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHcU6KPy4b1MQXd6EJhcYwbJu7E+0IrBZF/IP6T7gbMf teutat3s@dumpyourvms"; + hensoko_nitrokey_1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII/58A18EtxnLYHu63c/+AyTSkJQSso/VVdHUFGp1CTk cardno:FFFE34353135"; + hensoko_harrison = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEbaQdxp7Flz6ttELe63rn+Nt9g43qJOLih6VCMP4gPb hensoko@harrison"; + hensoko_norman = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAqkqMYgncrnczcW/0PY+Z+FmNXXpgw6D9JWTTwiainy hensoko@hensoko-tp-work"; + allKeys = [ + axeman + b12f-bbcom + hensoko_nitrokey_1 + hensoko_harrison + hensoko_norman + host_001_momo_koeln + teutat3s-dumpyourvms + ]; +in { + "keycloak-database-password.age".publicKeys = allKeys; + "erpnext-admin-password.age".publicKeys = allKeys; + "erpnext-db-root-password.age".publicKeys = allKeys; + "erpnext-db-user-password.age".publicKeys = allKeys; +} diff --git a/users/barkeeper/default.nix b/users/barkeeper/default.nix new file mode 100644 index 0000000..6a59eb2 --- /dev/null +++ b/users/barkeeper/default.nix @@ -0,0 +1,41 @@ +{ + config, + hmUsers, + pkgs, + lib, + ... +}: let + psCfg = config.pub-solar; +in { + config = { + security.sudo.extraRules = [ + { + users = ["${psCfg.user.name}"]; + commands = [ + { + command = "ALL"; + options = ["NOPASSWD"]; + } + ]; + } + ]; + + pub-solar = { + user = { + name = "barkeeper"; + description = "momo deployment user"; + fullName = "momo infra barkeeper"; + email = "admins@momo.koeln"; + gpgKeyId = ""; + publicKeys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII/58A18EtxnLYHu63c/+AyTSkJQSso/VVdHUFGp1CTk cardno:FFFE34353135 @hensoko" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAqkqMYgncrnczcW/0PY+Z+FmNXXpgw6D9JWTTwiainy hensoko@hensoko-tp-work" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEbaQdxp7Flz6ttELe63rn+Nt9g43qJOLih6VCMP4gPb @hensoko" + "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFro/k4Mgqyh8yV/7Zwjc0dv60ZM7bROBU9JNd99P/4co6fxPt1pJiU/pEz2Dax/HODxgcO+jFZfvPEuLMCeAl0= YubiKey #10593996 PIV Slot 9a @teutat3s" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGP5MvCwNRtCcP1pSDrn0XZTNlpOqYnjHDm9/OI4hECW @ci-drone-runner" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNeQYLFauAbzDyIbKC86NUh9yZfiyBm/BtIdkcpZnSU @axeman" + ]; + }; + }; + }; +} diff --git a/users/default.nix b/users/default.nix new file mode 100644 index 0000000..1281c69 --- /dev/null +++ b/users/default.nix @@ -0,0 +1,9 @@ +{self, ...}: { + flake = { + nixosModules = rec { + root = import ./root; + barkeeper = import ./barkeeper; + nixos = import ./nixos; + }; + }; +} diff --git a/users/modules/.flake-keep b/users/modules/.flake-keep new file mode 100644 index 0000000..e69de29 diff --git a/users/nixos/default.nix b/users/nixos/default.nix new file mode 100644 index 0000000..e0bf4b3 --- /dev/null +++ b/users/nixos/default.nix @@ -0,0 +1,36 @@ +{ + config, + pkgs, + lib, + ... +}: let + psCfg = config.pub-solar; +in { + config = { + pub-solar = { + # These are your personal settings + # The only required settings are `name` and `password`, + # The rest is used for programs like git + user = { + name = "nixos"; + description = "nixos"; + password = ""; + fullName = "nixos user"; + email = "nixos-iso@test-iso"; + publicKeys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmiF8ndGhnx2YAWbPDq14fftAwcJ0xnjJIVTotI12OO4SPX/SwH5Yp8C8Kf002qN9FbFmaONzq3s8TYpej13JubhfsQywNuFKZuZvJeHzmOwxsANW86RVrWT0WZmYx9a/a1TF9rPQpibDVt60wX8yLdExaJc5F1SvIIuyz1kxYpz36wItfR6hcwoLGh1emFCmfCpebJmp3hsrMDTTtTW/YNhyeSZW74ckyvZyjCYtRCJ8uF0ZmOSKRdillv4Ztg8MsUubGn+vaMl6V6x/QuDuehEPoM/3wBx9o22nf+QVbk7S1PC8EdT/K5vskn4/pfR7mDCyQOq1hB4w4Oyn0dsfX pi@ssrtc" + + "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHx4A8rLYmFgTOp1fDGbbONN8SOT0l5wWrUSYFUcVzMPTyfdT23ZVIdVD5yZCySgi/7PSh5mVmyLIZVIXlNrZJg= @b12f Yubi Main" + "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEST9eyAY3nzGYNnqDYfWHu+89LZsOjyKHMqCFvtP7vrgB7F7JbbECjdjAXEOfPDSCVwtMMpq8JJXeRMjpsD0rw= @b12f Yubi Backup" + + "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFro/k4Mgqyh8yV/7Zwjc0dv60ZM7bROBU9JNd99P/4co6fxPt1pJiU/pEz2Dax/HODxgcO+jFZfvPEuLMCeAl0= YubiKey #10593996 PIV Slot 9a @teutat3s" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII/58A18EtxnLYHu63c/+AyTSkJQSso/VVdHUFGp1CTk cardno:FFFE34353135 @hensoko" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAqkqMYgncrnczcW/0PY+Z+FmNXXpgw6D9JWTTwiainy hensoko@hensoko-tp-work" + + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKa5elEXgBc2luVBOHVWZisJgt0epFQOercPi0tZzPU root@cloud.pub.solar" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCelYBqrnyU1AI2p9urIrbVxRwnH81qDWF16BXU8sqMY47htvGji8FAnCBxCnd/9r5aOsOem4lKNoPQmzGFkZQZFn7xdxVO9uzcgIEFDWKK8dQ9MzmuB2W7JXMNjCs0zktkVu5hWpYiFGhN3QEMkqKoB+fJPBQ7d6J1488Yu3Zd3odyt8x1UMWfU7ObZIOCIzJIR0F23jACkh5Q1xWJXI7rUcycCZen4aWE6uYVTE7w94ARpTHHs6NlsQwUz3+aXKaWIoFLoXHumNO3mgrs/XzMgc96pS5HrbiauwL0GS5SRkskxMPbGr93mWeTEVsDd7Q6pszTzNeVM+0O9V/iVUfwyQ6L2OVUa+fYcGiCIjSJ7DzpPW7dx/bWDTtEyPb0amf1hvof9Q0R1LLHuYUPlxSy9ySp4aHM3++u4B10PKQnebvafkXAn98lgQolFiiuAn5dekGcHiFj1vQu2NP+E+LnQFDhPa61YQD2GVvAzR5Uh/2tZLIvXEoqDMZvKY9n02SsTGBeSweGd8kgT9WVkhQ3c2zAkfkGqPiJwYpaFVd8s/z+vLp+ViCgPY401sNNPQ81AoERY7BrcIRFG1Ed29jMVuzySDKpRGOYo/9H/RiHigIqAyUs2D0VOTYPbmCUZa17iZuPHhc6VLX/ar9optIBbV5EsXfDWhoy+fIXlQ+pw== root@nougat" + ]; + }; + }; + }; +} diff --git a/users/root/default.nix b/users/root/default.nix new file mode 100644 index 0000000..8810dc1 --- /dev/null +++ b/users/root/default.nix @@ -0,0 +1,3 @@ +{...}: { + users.users.root.hashedPassword = ""; +}