From 578f05b4f16e2aed4a1a862e764c981081aff72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Wed, 12 Jan 2022 17:39:16 +0100 Subject: [PATCH 001/111] Always hibernate --- .../config/config.d/custom-keybindings.conf | 4 +--- modules/sway/swayidle.service.nix | 8 +++----- pkgs/default.nix | 1 - pkgs/swaylock-bg.nix | 20 ------------------- 4 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 pkgs/swaylock-bg.nix diff --git a/modules/sway/config/config.d/custom-keybindings.conf b/modules/sway/config/config.d/custom-keybindings.conf index 6218d900..46fae96d 100644 --- a/modules/sway/config/config.d/custom-keybindings.conf +++ b/modules/sway/config/config.d/custom-keybindings.conf @@ -33,12 +33,10 @@ set $menu exec alacritty --class launcher -e env TERMINAL_COMMAND="alacritty -e" bindsym $mod+Space exec $menu # Set shut down, restart and locking features -set $mode_system (l)ock, (e)xit, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown +set $mode_system (e)xit, (h)ibernate, (r)eboot, (Shift+s)hutdown bindsym $mod+0 mode "$mode_system" mode "$mode_system" { - bindsym l exec swaylock-bg, mode "default" bindsym e exec swaymsg exit, mode "default" - bindsym s exec systemctl suspend, mode "default" bindsym h exec systemctl hibernate, mode "default" bindsym r exec systemctl reboot, mode "default" bindsym Shift+s exec systemctl poweroff, mode "default" diff --git a/modules/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index 597a8779..549f153f 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -9,12 +9,10 @@ pkgs: }; Service = { Type = "simple"; - Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin:${pkgs.swaylock}/bin:${pkgs.swaylock-bg}/bin"; + Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin"; ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ - timeout 600 'swaylock-bg' \ - timeout 900 'swaymsg "output * dpms off"' \ - resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock-bg' + timeout 300 'swaymsg "output * dpms off"' \ + timeout 600 'systemctl hibernate' \ ''; }; Install = { diff --git a/pkgs/default.nix b/pkgs/default.nix index 312e685f..d8a86fd7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -12,7 +12,6 @@ with 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 = writeScriptBin "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); diff --git a/pkgs/swaylock-bg.nix b/pkgs/swaylock-bg.nix deleted file mode 100644 index b55c32ae..00000000 --- a/pkgs/swaylock-bg.nix +++ /dev/null @@ -1,20 +0,0 @@ -self: with self; '' - # Dependencies: - # swaylock - - # Make sure we aren't running twice - RUNNING=$(ps -A | grep swaylock | wc -l) - 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 -r '.[].name'` - do - LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}" - IMAGES="''${IMAGES} ''${IMAGE}" - done - exec ${swaylock}/bin/swaylock $LOCKARGS -'' -- 2.44.1 From d2f8f0537c978a661b7b426b3e0c5a4ae9863a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 30 Apr 2022 21:41:43 +0200 Subject: [PATCH 002/111] Show notification when changing keyboard layouts --- pkgs/toggle-kbd-layout.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/toggle-kbd-layout.nix b/pkgs/toggle-kbd-layout.nix index 0d837b0a..529b7028 100644 --- a/pkgs/toggle-kbd-layout.nix +++ b/pkgs/toggle-kbd-layout.nix @@ -10,5 +10,6 @@ self: with self; '' next_layout=0; fi + notify-send "$next_layout" ${sway}/bin/swaymsg input '*' xkb_switch_layout "$next_layout" '' -- 2.44.1 From c48e1c8a75efd7a0321cc5e074a704dbb6df737f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 30 Apr 2022 21:43:56 +0200 Subject: [PATCH 003/111] Add package import of libnotify --- pkgs/toggle-kbd-layout.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/toggle-kbd-layout.nix b/pkgs/toggle-kbd-layout.nix index 529b7028..6418d043 100644 --- a/pkgs/toggle-kbd-layout.nix +++ b/pkgs/toggle-kbd-layout.nix @@ -10,6 +10,6 @@ self: with self; '' next_layout=0; fi - notify-send "$next_layout" + ${libnotify}/bin/notify-send "$next_layout" ${sway}/bin/swaymsg input '*' xkb_switch_layout "$next_layout" '' -- 2.44.1 From a94a41f444c11509cb32f995184b5bc8294a3d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 30 Apr 2022 22:12:52 +0200 Subject: [PATCH 004/111] Use our patched version of digga --- flake.lock | 10 +++++----- flake.nix | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 8fc8adf4..3713f1cc 100644 --- a/flake.lock +++ b/flake.lock @@ -188,15 +188,15 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1651210705, - "narHash": "sha256-2RzKrjEnWDhsBQ4Et2gm2LjV5pXyszeqV1xNe+LtNT8=", - "owner": "divnix", + "lastModified": 1651349453, + "narHash": "sha256-0ZAYPYWXm16reXFT0bJi/4f6GeYubnlj2YruXcmp0hs=", + "owner": "pub-solar", "repo": "digga", - "rev": "0ffa2dff5ede12a03ca83fbc514972f94cf18f42", + "rev": "531dd67b7aef37d7828fb28c2e45f09de0425c6b", "type": "github" }, "original": { - "owner": "divnix", + "owner": "pub-solar", "repo": "digga", "type": "github" } diff --git a/flake.nix b/flake.nix index e9b91fc9..340ca686 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ nixos.url = "github:nixos/nixpkgs/nixos-21.11"; latest.url = "github:nixos/nixpkgs/nixos-unstable"; - digga.url = "github:divnix/digga"; + digga.url = "github:pub-solar/digga"; digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixlib.follows = "nixos"; digga.inputs.home-manager.follows = "home"; -- 2.44.1 From 3dc6e6a5f6c569c4a6def1404767701aae678315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 30 Apr 2022 23:20:47 +0200 Subject: [PATCH 005/111] Change bootstrap isoImage command in CI --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index f683f2af..1c979c5a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -123,7 +123,7 @@ steps: - | nix --print-build-logs --verbose \ develop --command \ - bud build bootstrap bootstrapIso + bud build bootstrap isoImage - cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/ - name: "Publish ISO" @@ -158,6 +158,6 @@ volumes: --- kind: signature -hmac: e806a6980afdc1bf451be231db1a61e7917822a1f78afe3f2136eadfd632d521 +hmac: 0c0731948a73c30cff44c3dbbf4d1a131680b8777d9986ca04699b9f5c82bab2 ... -- 2.44.1 From d2f8a2d837904cecc978bbc3b5a77026e73b9bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 30 Apr 2022 23:56:02 +0200 Subject: [PATCH 006/111] Remove swaylock-bg from install list --- modules/sway/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/sway/default.nix b/modules/sway/default.nix index 83f407e4..88426536 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -75,7 +75,6 @@ in xsettingsd ydotool - swaylock-bg sway-launcher import-gtk-settings s -- 2.44.1 From 4b828cd91f8063047efcfce3c453465300c6e527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 1 May 2022 17:04:29 +0200 Subject: [PATCH 007/111] Shorten time until hibernate --- modules/sway/swayidle.service.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index 549f153f..61f32591 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -11,8 +11,8 @@ pkgs: Type = "simple"; Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin"; ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ - timeout 300 'swaymsg "output * dpms off"' \ - timeout 600 'systemctl hibernate' \ + timeout 150 'swaymsg "output * dpms off"' \ + timeout 300 'systemctl hibernate' \ ''; }; Install = { -- 2.44.1 From 0c4987ede101bd0348e599409626e74314f43ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 1 May 2022 17:29:21 +0200 Subject: [PATCH 008/111] Add resume device --- .../config/config.d/custom-keybindings.conf | 2 +- modules/x-os/boot.nix | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/sway/config/config.d/custom-keybindings.conf b/modules/sway/config/config.d/custom-keybindings.conf index 157ae8ee..172b7e53 100644 --- a/modules/sway/config/config.d/custom-keybindings.conf +++ b/modules/sway/config/config.d/custom-keybindings.conf @@ -23,7 +23,7 @@ bindsym $mod+F5 exec $term -e 'mocp -C $XDG_CONFIG_DIR/mocp/config' bindsym $mod+Shift+m exec mu bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf -# Screenshofts +# Screenshots 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 )" diff --git a/modules/x-os/boot.nix b/modules/x-os/boot.nix index 0633bec4..268f1547 100644 --- a/modules/x-os/boot.nix +++ b/modules/x-os/boot.nix @@ -10,18 +10,22 @@ in description = "Feature flag for iso builds"; }; config = { - # Enable plymouth for better experience of booting - boot.plymouth.enable = true; + boot = { + # Enable plymouth for better experience of booting + plymouth.enable = true; - # Mount / luks device in initrd - # Allow fstrim to work on it. - # The ! makes this enabled by default - boot.initrd = mkIf (!cfg.iso-options.enable) { - luks.devices."cryptroot" = { - allowDiscards = true; + # Mount / luks device in initrd + # Allow fstrim to work on it. + # The ! makes this enabled by default + initrd = mkIf (!cfg.iso-options.enable) { + luks.devices."cryptroot" = { + allowDiscards = true; + }; }; - }; - boot.loader.systemd-boot.enable = true; + resumeDevice = "/swapfile"; + + loader.systemd-boot.enable = true; + }; }; } -- 2.44.1 From 4712e535f9a9f670eb564cded3e5fdcecfd02d62 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 2 May 2022 01:23:18 +0200 Subject: [PATCH 009/111] sway: fix cursor not scaling correctly --- modules/sway/config/config.d/theme.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/sway/config/config.d/theme.conf b/modules/sway/config/config.d/theme.conf index 27ae794a..eb4427aa 100644 --- a/modules/sway/config/config.d/theme.conf +++ b/modules/sway/config/config.d/theme.conf @@ -11,3 +11,6 @@ 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 -- 2.44.1 From a772a91d7b9f4a60fff50ec7f48149297b44562e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 2 May 2022 01:23:41 +0200 Subject: [PATCH 010/111] zsh: precmd() don't echo trailing newline --- modules/terminal-life/zsh/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 2541fdd0..91bb422c 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -86,7 +86,7 @@ in precmd () { DIR_NAME=$(pwd | sed "s|^$HOME|~|g") - echo -e "\e]2;$DIR_NAME\e\\" + echo -e -n "\e]2;$DIR_NAME\e\\" } # If a command is not found, show me where it is -- 2.44.1 From 91605af1357f82c1e101e18cd70ddc725da95e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 2 May 2022 09:49:14 +0200 Subject: [PATCH 011/111] Revert "Merge pull request 'fix/boostrap-iso' (#75) from fix/boostrap-iso into main" This reverts commit 48be9cfa75b270d32d6b3eb379f1fabf0827826f, reversing changes made to 281d7b56b4d6d4435c053e051f05943f2daab25a. --- .drone.yml | 4 ++-- flake.lock | 10 +++++----- flake.nix | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1c979c5a..f683f2af 100644 --- a/.drone.yml +++ b/.drone.yml @@ -123,7 +123,7 @@ steps: - | nix --print-build-logs --verbose \ develop --command \ - bud build bootstrap isoImage + bud build bootstrap bootstrapIso - cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/ - name: "Publish ISO" @@ -158,6 +158,6 @@ volumes: --- kind: signature -hmac: 0c0731948a73c30cff44c3dbbf4d1a131680b8777d9986ca04699b9f5c82bab2 +hmac: e806a6980afdc1bf451be231db1a61e7917822a1f78afe3f2136eadfd632d521 ... diff --git a/flake.lock b/flake.lock index 3713f1cc..8fc8adf4 100644 --- a/flake.lock +++ b/flake.lock @@ -188,15 +188,15 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1651349453, - "narHash": "sha256-0ZAYPYWXm16reXFT0bJi/4f6GeYubnlj2YruXcmp0hs=", - "owner": "pub-solar", + "lastModified": 1651210705, + "narHash": "sha256-2RzKrjEnWDhsBQ4Et2gm2LjV5pXyszeqV1xNe+LtNT8=", + "owner": "divnix", "repo": "digga", - "rev": "531dd67b7aef37d7828fb28c2e45f09de0425c6b", + "rev": "0ffa2dff5ede12a03ca83fbc514972f94cf18f42", "type": "github" }, "original": { - "owner": "pub-solar", + "owner": "divnix", "repo": "digga", "type": "github" } diff --git a/flake.nix b/flake.nix index 340ca686..e9b91fc9 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ nixos.url = "github:nixos/nixpkgs/nixos-21.11"; latest.url = "github:nixos/nixpkgs/nixos-unstable"; - digga.url = "github:pub-solar/digga"; + digga.url = "github:divnix/digga"; digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixlib.follows = "nixos"; digga.inputs.home-manager.follows = "home"; -- 2.44.1 From 077ab8b4f4974f41d71aeb3b81ff8a20b910feff Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 2 May 2022 01:22:49 +0200 Subject: [PATCH 012/111] Fix ISO target path for publishing --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1c979c5a..527c0853 100644 --- a/.drone.yml +++ b/.drone.yml @@ -140,7 +140,7 @@ steps: from_secret: ssh_port key: from_secret: ssh_key - target: /var/www/pub.solar + target: /srv/os source: - /var/nix/iso-cache/*.iso strip_components: 3 @@ -158,6 +158,6 @@ volumes: --- kind: signature -hmac: 0c0731948a73c30cff44c3dbbf4d1a131680b8777d9986ca04699b9f5c82bab2 +hmac: 7aa9b1eadc2638d7c0b6da2eea92cce650232a8c44ce9ab4a2b0e563f7432693 ... -- 2.44.1 From 159ae86722bc706ff42d4d3e4b0f49ede2f253de Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Mon, 2 May 2022 20:19:04 +0200 Subject: [PATCH 013/111] Start sway as a systemd user process again After login on TTY1 sway was started by calling exec sway See also b84d88fc92c6710cff8e294315eb23ceb7ecf40e Co-authored-by: Hendrik Sokolowski --- modules/sway/config/config.d/custom-keybindings.conf | 2 +- modules/sway/default.nix | 1 + modules/terminal-life/zsh/default.nix | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/sway/config/config.d/custom-keybindings.conf b/modules/sway/config/config.d/custom-keybindings.conf index 5faddece..d5887e3e 100644 --- a/modules/sway/config/config.d/custom-keybindings.conf +++ b/modules/sway/config/config.d/custom-keybindings.conf @@ -37,7 +37,7 @@ set $mode_system (l)ock, (e)xit, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutd bindsym $mod+0 mode "$mode_system" mode "$mode_system" { bindsym l exec swaylock-bg, mode "default" - bindsym e exec swaymsg exit, mode "default" + bindsym e exec systemctl --user stop graphical-session.target, mode "default" bindsym s exec systemctl suspend, mode "default" bindsym h exec systemctl hibernate, mode "default" bindsym r exec systemctl reboot, mode "default" diff --git a/modules/sway/default.nix b/modules/sway/default.nix index 83f407e4..35013dd2 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -86,6 +86,7 @@ in #programs.waybar.systemd.enable = true; systemd.user.services.mako = import ./mako.service.nix pkgs; + systemd.user.services.sway = import ./sway.service.nix pkgs; systemd.user.services.swayidle = import ./swayidle.service.nix pkgs; systemd.user.services.xsettingsd = import ./xsettingsd.service.nix pkgs; systemd.user.services.waybar = import ./waybar.service.nix pkgs; diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 91bb422c..5cc81ca8 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -19,7 +19,7 @@ in }; loginExtra = '' - [ "$(tty)" = "/dev/tty1" ] && exec sway + [ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.sway-service}/bin/sway-service ''; shellAliases = { -- 2.44.1 From 87d76973260c14b6f047cd37ef7b6fd8a93cb061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 2 May 2022 23:53:34 +0200 Subject: [PATCH 014/111] Add docker drone runner wrapper Adds a small sh wrapper around a drone runner docker container. The `stop` and `logs` functionality is barely better than using straight up docker, but at least it saves you from having to know any of the implementation details. --- pkgs/default.nix | 1 + pkgs/drone-docker-runner.nix | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/drone-docker-runner.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index b2403502..dcbd0f0e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -16,6 +16,7 @@ with 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); # ps-fixes ps-signal-desktop = writeShellScriptBin "signal-desktop" (import ./ps-signal-desktop.nix final); diff --git a/pkgs/drone-docker-runner.nix b/pkgs/drone-docker-runner.nix new file mode 100644 index 00000000..7d098536 --- /dev/null +++ b/pkgs/drone-docker-runner.nix @@ -0,0 +1,32 @@ +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=4 \ + --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 + +'' -- 2.44.1 From 07577283e3c7e1a4712d769e25c42359bed7110c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 3 May 2022 11:43:36 +0200 Subject: [PATCH 015/111] Remove fake comment from gitmessage This was part of a botched copy paste and should not be in the actual gitmessage, since the real change list will come from git itself. --- profiles/base-user/.config/git/gitmessage.nix | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/profiles/base-user/.config/git/gitmessage.nix b/profiles/base-user/.config/git/gitmessage.nix index 7f4b1c64..69d2ca72 100644 --- a/profiles/base-user/.config/git/gitmessage.nix +++ b/profiles/base-user/.config/git/gitmessage.nix @@ -4,29 +4,20 @@ let xdg = config.home-manager.users."${user.name}".xdg; in '' -# Title: Summary, imperative, start upper case, don't end with a period -# No more than 50 chars. #### 50 chars is here: # -# + # Title: Summary, imperative, start upper case, don't end with a period + # No more than 50 chars. #### 50 chars is here: # + # -# ^ Remember ending with an extra blank line -# Body: Explain *what* and *why* (not *how*). Include issue number. -# Wrap at 72 chars. ################################## which is here: # -# + # ^ Remember ending with an extra blank line + # Body: Explain *what* and *why* (not *how*). Include issue number. + # Wrap at 72 chars. ################################## which is here: # + # -# ^ Remember ending with an extra blank line -# At the end: Include Co-authored-by for all contributors. -# -Co-authored-by: ${user.fullName} <${user.email}> + # ^ Remember ending with an extra blank line + # At the end: Include Co-authored-by for all contributors. + # + Co-authored-by: ${user.fullName} <${user.email}> -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# -# On branch master -# Your branch is up to date with 'origin/main'. -# -# Changes to be committed: -# new file: installation.md -# '' -- 2.44.1 From af12b9eabda8931c717902136b74b309d575fff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 3 May 2022 11:48:00 +0200 Subject: [PATCH 016/111] Remove gitmessage indentation -- 2.44.1 From f4a2cc34bb3b913717fd6402b986219fde453ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 3 May 2022 12:43:32 +0200 Subject: [PATCH 017/111] Comment Co-Authored-by --- profiles/base-user/.config/git/gitmessage.nix | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/profiles/base-user/.config/git/gitmessage.nix b/profiles/base-user/.config/git/gitmessage.nix index 69d2ca72..0d80f469 100644 --- a/profiles/base-user/.config/git/gitmessage.nix +++ b/profiles/base-user/.config/git/gitmessage.nix @@ -4,20 +4,19 @@ let xdg = config.home-manager.users."${user.name}".xdg; in '' - # Title: Summary, imperative, start upper case, don't end with a period - # No more than 50 chars. #### 50 chars is here: # - # +# Title: Summary, imperative, start upper case, don't end with a period +# No more than 50 chars. #### 50 chars is here: # +# - # ^ Remember ending with an extra blank line - # Body: Explain *what* and *why* (not *how*). Include issue number. - # Wrap at 72 chars. ################################## which is here: # - # +# ^ Remember ending with an extra blank line +# Body: Explain *what* and *why* (not *how*). Include issue number. +# Wrap at 72 chars. ################################## which is here: # +# - # ^ Remember ending with an extra blank line - # At the end: Include Co-authored-by for all contributors. - # - Co-authored-by: ${user.fullName} <${user.email}> - +# ^ Remember ending with an extra blank line +# At the end: Include Co-authored-by for all contributors. +# +# Co-authored-by: Example Name '' -- 2.44.1 From 3ce121ce60ac150b68413173814f273a9972acdf Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Tue, 3 May 2022 19:11:25 +0200 Subject: [PATCH 018/111] Introduce option to enable autologin This option allows to disable autologin which is enabled by default. --- modules/graphical/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index d38b4d1a..0bb9781c 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -26,6 +26,11 @@ in default = { }; }; }; + autologin.enable = mkOption { + type = types.bool; + default = true; + description = "Feature flag enabling autologin after boot."; + }; wayland.software-renderer.enable = mkOption { type = types.bool; default = false; @@ -54,7 +59,7 @@ in }; }; - services.getty.autologinUser = mkForce "${psCfg.user.name}"; + services.getty.autologinUser = mkIf cfg.autologin.enable "${psCfg.user.name}"; qt5 = { enable = true; -- 2.44.1 From 3fae0d93faf761cf358884f91cbfd81cfa1c9851 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 5 May 2022 16:06:52 +0200 Subject: [PATCH 019/111] graphical: move FF sharing indicator to sway ws 7 The Firefox sharing indicator sometimes doesn't like to float like it should, and when it does, it usually floats over UI elements you'd like to use. Moving it to sway workspace 7 should get it mostly out of the way --- modules/sway/config/config.d/applications.conf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/sway/config/config.d/applications.conf b/modules/sway/config/config.d/applications.conf index 8691bc4f..3bab265d 100644 --- a/modules/sway/config/config.d/applications.conf +++ b/modules/sway/config/config.d/applications.conf @@ -58,10 +58,11 @@ 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 enabled -for_window [title="Password Required - Mozilla Firefox"] floating enabled -for_window [title="Firefox — Sharing Indicator"] floating enabled -for_window [title="Extension: (Open in Browser)*"] floating enabled +for_window [title="About Mozilla Firefox"] floating enable +for_window [title="Password Required - Mozilla Firefox"] floating enable +for_window [title="Firefox — Sharing Indicator"] move to workspace $ws7, floating enable +no_focus [title="Firefox — Sharing Indicator"] +for_window [title="Extension: (Open in Browser)*"] floating enable # qMasterPassword floating menu for_window [title="qMasterPassword"] focus -- 2.44.1 From 8e43046dee1233e966cc6fc236ca3ed51849e747 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 2 Jun 2022 10:09:42 +0200 Subject: [PATCH 020/111] nixos: follow release-22.05 home: follow release-22.05 branch Fixes for upstream changes: ag renamed to silver-searcher, extfat-utils is now exfat, lot's of overrides no longer needed, as they're now in the release branch, services.caddy.config split up into globalConfig and extraConfig --- flake.lock | 85 +++++++++++++++---------------- flake.nix | 4 +- modules/terminal-life/default.nix | 2 +- modules/x-os/networking.nix | 8 +-- overlays/overrides.nix | 10 ---- profiles/core/default.nix | 2 +- 6 files changed, 50 insertions(+), 61 deletions(-) diff --git a/flake.lock b/flake.lock index 8fc8adf4..d29bd0f0 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1648942457, - "narHash": "sha256-i29Z1t3sVfCNfpp+KAfeExvpqHQSbLO1KWylTtfradU=", + "lastModified": 1652712410, + "narHash": "sha256-hMJ2TqLt0DleEnQFGUHK9sV2aAzJPU8pZeiZoqRozbE=", "owner": "ryantm", "repo": "agenix", - "rev": "0d5e59ed645e4c7b60174bc6f6aac6a203dc0b01", + "rev": "7e5e58b98c3dcbf497543ff6f22591552ebfe65b", "type": "github" }, "original": { @@ -87,11 +87,11 @@ ] }, "locked": { - "lastModified": 1650976225, - "narHash": "sha256-PGM65SQHS63Dd5MmLJo3GJsZP9lJVZmpWxluQoG1Dt8=", + "lastModified": 1651916036, + "narHash": "sha256-UuD9keUGm4IuVEV6wdSYbuRm7CwfXE63hVkzKDjVsh4=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "bb3baef6e115ae47bc2ab4973bd3a486488485b0", + "rev": "2f2bdf658d2b79bada78dc914af99c53cad37cba", "type": "github" }, "original": { @@ -130,11 +130,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1648475189, - "narHash": "sha256-gAGAS6IagwoUr1B0ohE3iR6sZ8hP4LSqzYLC8Mq3WGU=", + "lastModified": 1653594315, + "narHash": "sha256-kJ0ENmnQJ4qL2FeYKZba9kvv1KmIuB3NVpBwMeI7AJQ=", "owner": "serokell", "repo": "deploy-rs", - "rev": "83e0c78291cd08cb827ba0d553ad9158ae5a95c3", + "rev": "184349d8149436748986d1bdba087e4149e9c160", "type": "github" }, "original": { @@ -188,11 +188,11 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1651210705, - "narHash": "sha256-2RzKrjEnWDhsBQ4Et2gm2LjV5pXyszeqV1xNe+LtNT8=", + "lastModified": 1652713922, + "narHash": "sha256-era1h0M+QP9wP/hbwXRpxOiT8M5n+loWX/Zrq7duq5w=", "owner": "divnix", "repo": "digga", - "rev": "0ffa2dff5ede12a03ca83fbc514972f94cf18f42", + "rev": "29bbac0173859812893d777fdce204af83a231ea", "type": "github" }, "original": { @@ -269,11 +269,11 @@ "flake-utils": "flake-utils_3" }, "locked": { - "lastModified": 1647259887, - "narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=", + "lastModified": 1652704544, + "narHash": "sha256-UTKE33tYgCmDszaVyWA33a8mtegM5xfH4fH8w4y6TxA=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46", + "rev": "f8d6d1f87b6177e3bc674c29f247bdbf897ba274", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "flake-utils_4": { "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", "owner": "numtide", "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", "type": "github" }, "original": { @@ -349,16 +349,16 @@ ] }, "locked": { - "lastModified": 1651007218, - "narHash": "sha256-NkQAMtqW0PSJTbLHalyZtaqj0ai2TZMOedug9yDIcFw=", + "lastModified": 1654113405, + "narHash": "sha256-VpK+0QaWG2JRgB00lw77N9TjkE3ec0iMYIX1TzGpxa4=", "owner": "nix-community", "repo": "home-manager", - "rev": "d14adb99f3fb562ec74ad18c032efc154b438034", + "rev": "ac2287df5a2d6f0a44bbcbd11701dbbf6ec43675", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-21.11", + "ref": "release-22.05", "repo": "home-manager", "type": "github" } @@ -381,11 +381,11 @@ }, "latest_2": { "locked": { - "lastModified": 1651007983, - "narHash": "sha256-GNay7yDPtLcRcKCNHldug85AhAvBpTtPEJWSSDYBw8U=", + "lastModified": 1653931853, + "narHash": "sha256-O3wncIouj9x7gBPntzHeK/Hkmm9M1SGlYq7JI7saTAE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e10da1c7f542515b609f8dfbcf788f3d85b14936", + "rev": "f1c167688a6f81f4a51ab542e5f476c8c595e457", "type": "github" }, "original": { @@ -402,11 +402,11 @@ ] }, "locked": { - "lastModified": 1650265945, - "narHash": "sha256-SO8+1db4jTOjnwP++29vVgImLIfETSXyoz0FuLkiikE=", + "lastModified": 1653413650, + "narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=", "owner": "nmattia", "repo": "naersk", - "rev": "e8f9f8d037774becd82fce2781e1abdb7836d7df", + "rev": "69daaceebe12c070cd5ae69ba38f277bbf033695", "type": "github" }, "original": { @@ -423,11 +423,11 @@ ] }, "locked": { - "lastModified": 1649569158, - "narHash": "sha256-Wtmiyu/1d+3YGGcRxTnQyEtnJaKKR/Ry0kNbOY48Afs=", + "lastModified": 1653198236, + "narHash": "sha256-nzW2BaqWTGGQthOtFzHUJTHK5wK+mkh4aOhETGj5nBk=", "owner": "dramforever", "repo": "nix-dram", - "rev": "84c47c0dc93c77f7edfd996f71618d278844c1c4", + "rev": "e10086d39ca49abfd2a3b77d2a77baa6037ec31e", "type": "github" }, "original": { @@ -453,16 +453,16 @@ }, "nixos": { "locked": { - "lastModified": 1651093906, - "narHash": "sha256-kHXSbv+Hc73eV0/JVJ5YsJGr08bA4vJ3/XZew5PgZg0=", + "lastModified": 1654005557, + "narHash": "sha256-J6elwUzPoco+r5qWPHhvS2EHVWomUtNcxzkfdAQOwEU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "feea25c58657fa81d16e0e51f80e1a02ef4cbd49", + "rev": "08950a6e29cf7bddee466592eb790a417550f7f9", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-21.11", + "ref": "nixos-22.05", "repo": "nixpkgs", "type": "github" } @@ -473,11 +473,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1650997411, - "narHash": "sha256-r4a3qsSv5UTtx+pxTUEdOphBkwTx1+AAVog3c457A0M=", + "lastModified": 1653339081, + "narHash": "sha256-dpim9Mtd57Yj6qt7p7UKwjWm6NnOU3S7jaEyEscSyPE=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "3cdf22c79bc80910e2b610cd59fcb8408354ddbc", + "rev": "fb3ee0f618b8c80dea1239691b15dfeb4bb46331", "type": "github" }, "original": { @@ -488,11 +488,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1650522846, - "narHash": "sha256-SxWHXRI3qJwswyXAtzsi6PKVY3KLNNnb072KaJthII8=", + "lastModified": 1654057797, + "narHash": "sha256-mXo7C4v7Jj2feBzcReu1Eu/3Rnw5b023E9kOyFsHZQw=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "6b4ebea9093c997c5f275c820e679108de4871ab", + "rev": "0cab18a48de7914ef8cad35dca0bb36868f3e1af", "type": "github" }, "original": { @@ -551,10 +551,9 @@ }, "nur": { "locked": { - "lastModified": 1626378135, + "lastModified": 0, "narHash": "sha256-koC6DBYmLCrgXA+AMHVaODf1uHYPmvcFygHfy3eg6vI=", "path": "/nix/store/6mfkswqi67m35qwv0vh7kpk8rypbl2rq-source", - "rev": "00c2ec8f0bbdf0cfb2135bde55fbae5d6b64aa6d", "type": "path" }, "original": { diff --git a/flake.nix b/flake.nix index e9b91fc9..7f3c2803 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ inputs = { # Track channels with commits tested and built by hydra - nixos.url = "github:nixos/nixpkgs/nixos-21.11"; + nixos.url = "github:nixos/nixpkgs/nixos-22.05"; latest.url = "github:nixos/nixpkgs/nixos-unstable"; digga.url = "github:divnix/digga"; @@ -21,7 +21,7 @@ bud.inputs.nixpkgs.follows = "nixos"; bud.inputs.devshell.follows = "digga/devshell"; - home.url = "github:nix-community/home-manager/release-21.11"; + home.url = "github:nix-community/home-manager/release-22.05"; home.inputs.nixpkgs.follows = "nixos"; darwin.url = "github:LnL7/nix-darwin"; diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index 75ca2bd3..8ecb9919 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -27,7 +27,6 @@ in home.packages = [ ack asciinema - ag bat exa fd @@ -35,6 +34,7 @@ in glow nnn powerline + silver-searcher vifm watson ]; diff --git a/modules/x-os/networking.nix b/modules/x-os/networking.nix index 1e981290..347fe750 100644 --- a/modules/x-os/networking.nix +++ b/modules/x-os/networking.nix @@ -40,10 +40,10 @@ in # Caddy reverse proxy for local services like cups services.caddy = { enable = true; - config = '' - { - auto_https off - } + globalConfig = '' + auto_https off + ''; + extraConfig = '' cups.local:80 bind 127.0.0.1 request_header Host localhost:631 diff --git a/overlays/overrides.nix b/overlays/overrides.nix index 9b463e96..8c016e15 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -14,17 +14,7 @@ channels: final: prev: { starship deploy-rs - nixUnstable - neovim-unwrapped tdesktop - xdg-desktop-portal - xdg-desktop-portal-gtk - xdg-desktop-portal-wlr - obs-studio - obs-studio-plugins - looking-glass-client - nix-direnv - vimPlugins ; diff --git a/profiles/core/default.nix b/profiles/core/default.nix index 9348249b..f3136372 100644 --- a/profiles/core/default.nix +++ b/profiles/core/default.nix @@ -48,7 +48,7 @@ in dateutils diffutils findutils - exfat-utils + exfat file # zippit -- 2.44.1 From 6054a02ebf8805522959b89ac2400a1b606757dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 4 Jun 2022 19:32:12 +0200 Subject: [PATCH 021/111] Make sure we're all successful --- modules/terminal-life/zsh/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 5cc81ca8..685a9479 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -87,6 +87,10 @@ in precmd () { DIR_NAME=$(pwd | sed "s|^$HOME|~|g") echo -e -n "\e]2;$DIR_NAME\e\\" + + if [ $? -eq 0 ]; then + echo "success" + fi } # If a command is not found, show me where it is -- 2.44.1 From 63fe359cab47e62e5adc29d6bfc657e749093bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 4 Jun 2022 16:49:07 +0200 Subject: [PATCH 022/111] Add denols to nvim In Deno projects `tsserver` is less than ideal. This PR starts `denols` instead of `tsserver` if `nvim` finds the `NVIM_USE_DENOLS` variable when reading the lsp config. --- modules/terminal-life/nvim/lsp.vim | 43 +++++++++++++++++++----------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/modules/terminal-life/nvim/lsp.vim b/modules/terminal-life/nvim/lsp.vim index 025d2b5f..8ba4ea94 100644 --- a/modules/terminal-life/nvim/lsp.vim +++ b/modules/terminal-life/nvim/lsp.vim @@ -79,6 +79,8 @@ lua < Date: Sat, 4 Jun 2022 16:45:33 +0200 Subject: [PATCH 023/111] Remove unused scream pulse service file --- .../virtualisation/scream-pulse.service.nix | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 modules/virtualisation/scream-pulse.service.nix diff --git a/modules/virtualisation/scream-pulse.service.nix b/modules/virtualisation/scream-pulse.service.nix deleted file mode 100644 index c4337fa0..00000000 --- a/modules/virtualisation/scream-pulse.service.nix +++ /dev/null @@ -1,19 +0,0 @@ -pkgs: -{ - enable = true; - wantedBy = [ "multi-user.target" ]; - unitConfig = { - Description = "Scream IVSHMEM pulse reciever"; - BindsTo = [ "pipewire-pulse.service" ]; - After = [ "pipewire-pulse.service" ]; - Wants = [ "pipewire-pulse.service" ]; - }; - serviceConfig = { - Type = "simple"; - ExecStartPre = [ - "${pkgs.coreutils-full}/bin/truncate -s 0 /dev/shm/scream-ivshmem" - "${pkgs.coreutils-full}/bin/dd if=/dev/zero of=/dev/shm/scream-ivshmem bs=1M count=2" - ]; - ExecStart = "${pkgs.scream}/bin/scream -m /dev/shm/scream-ivshmem"; - }; -} -- 2.44.1 From 5094495a79fe15f6354eb5bb803b16b805848d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 4 Jun 2022 20:29:09 +0200 Subject: [PATCH 024/111] Less annoying --- modules/terminal-life/zsh/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 685a9479..2db8bc41 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -88,8 +88,10 @@ in DIR_NAME=$(pwd | sed "s|^$HOME|~|g") echo -e -n "\e]2;$DIR_NAME\e\\" - if [ $? -eq 0 ]; then - echo "success" + if [ $(date +%d%m) = '0104' ]; then + if [ $? -eq 0 ]; then + echo "Success! That was a great command! I can't wait to see what amazing stuff you'll be up to next." + fi fi } -- 2.44.1 From 3bd0b3c50237be867e91c355247b3f59f3e804f3 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 7 Jul 2022 22:24:43 +0200 Subject: [PATCH 025/111] signal-desktop: works without workaround again Also add --use-tray-icon flag, since it works now --- modules/social/default.nix | 2 +- modules/sway/config/config.d/custom-keybindings.conf | 2 +- pkgs/default.nix | 1 - pkgs/ps-signal-desktop.nix | 9 --------- 4 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 pkgs/ps-signal-desktop.nix diff --git a/modules/social/default.nix b/modules/social/default.nix index 9c53718d..e0d12449 100644 --- a/modules/social/default.nix +++ b/modules/social/default.nix @@ -12,7 +12,7 @@ in config = mkIf cfg.enable { home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { home.packages = [ - ps-signal-desktop + signal-desktop tdesktop element-desktop irssi diff --git a/modules/sway/config/config.d/custom-keybindings.conf b/modules/sway/config/config.d/custom-keybindings.conf index d5887e3e..bb452ddc 100644 --- a/modules/sway/config/config.d/custom-keybindings.conf +++ b/modules/sway/config/config.d/custom-keybindings.conf @@ -18,7 +18,7 @@ bindsym $mod+F2 exec firefox bindsym $mod+F3 exec $term -e vifm bindsym $mod+Shift+F3 exec gksu $term -e vifm bindsym $mod+F4 exec nautilus -w -bindsym $mod+Shift+F4 exec signal-desktop +bindsym $mod+Shift+F4 exec signal-desktop --use-tray-icon bindsym $mod+F5 exec $term -e 'mocp -C $XDG_CONFIG_DIR/mocp/config' bindsym $mod+Shift+m exec mu bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf diff --git a/pkgs/default.nix b/pkgs/default.nix index dcbd0f0e..ecac30a3 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -19,5 +19,4 @@ with final; { drone-docker-runner = writeShellScriptBin "drone-docker-runner" (import ./drone-docker-runner.nix final); # ps-fixes - ps-signal-desktop = writeShellScriptBin "signal-desktop" (import ./ps-signal-desktop.nix final); } diff --git a/pkgs/ps-signal-desktop.nix b/pkgs/ps-signal-desktop.nix deleted file mode 100644 index ff615639..00000000 --- a/pkgs/ps-signal-desktop.nix +++ /dev/null @@ -1,9 +0,0 @@ -self: with self; -let - signal-desktop = self.signal-desktop.overrideAttrs (old: { - meta.platforms = [ "x86_64-linux" "aarch64-linux" ]; - }); -in -'' - exec ${signal-desktop}/bin/signal-desktop --disable-gpu -- "$@" -'' -- 2.44.1 From 6a5b09a26a1cdd9eb8daf92152cf4a860d54b98b Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 7 Jul 2022 22:26:08 +0200 Subject: [PATCH 026/111] audio: remove mopidy-spotify, upstream abandonded support --- modules/audio/mopidy.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/audio/mopidy.nix b/modules/audio/mopidy.nix index 99552113..9d37eaba 100644 --- a/modules/audio/mopidy.nix +++ b/modules/audio/mopidy.nix @@ -1,7 +1,6 @@ pkgs: { enable = true; extensionPackages = with pkgs; [ - mopidy-spotify mopidy-mpd mopidy-soundcloud mopidy-youtube -- 2.44.1 From 237a7534744f5fe8b6033bfe2c9d39a3f999de8d Mon Sep 17 00:00:00 2001 From: teutat3s Date: Fri, 8 Jul 2022 14:18:10 +0200 Subject: [PATCH 027/111] audio: switch to wireplumber for pipewire configuration https://nixos.wiki/wiki/PipeWire#Bluetooth_Configuration --- modules/audio/default.nix | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/modules/audio/default.nix b/modules/audio/default.nix index fcceefd3..3fb67664 100644 --- a/modules/audio/default.nix +++ b/modules/audio/default.nix @@ -43,32 +43,19 @@ in }; }; config.pipewire-pulse = builtins.fromJSON (builtins.readFile ./pipewire-pulse.conf.json); + }; - # Bluetooth configuration for pipewire - media-session.config.bluez-monitor.rules = mkIf cfg.bluetooth.enable [ - { - # Matches all cards - matches = [{ "device.name" = "~bluez_card.*"; }]; - actions = { - "update-props" = { - "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; - # mSBC is not expected to work on all headset + adapter combinations. - "bluez5.msbc-support" = true; - }; - }; + # Bluetooth configuration using wireplumber + # https://nixos.wiki/wiki/PipeWire#Bluetooth_Configuration + environment.etc = mkIf cfg.bluetooth.enable { + "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 ]" } - { - matches = [ - # Matches all sources - { "node.name" = "~bluez_input.*"; } - # Matches all outputs - { "node.name" = "~bluez_output.*"; } - ]; - actions = { - "node.pause-on-idle" = false; - }; - } - ]; + ''; }; # Enable bluetooth -- 2.44.1 From f7fbdb80afd9aace0342c4ef62384a2bce21fa03 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Fri, 8 Jul 2022 14:13:41 +0200 Subject: [PATCH 028/111] hosts: add missing system.stateVersion --- hosts/PubSolarOS.nix | 8 ++++++++ hosts/bootstrap.nix | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/hosts/PubSolarOS.nix b/hosts/PubSolarOS.nix index 70cf7a08..d741a4d1 100644 --- a/hosts/PubSolarOS.nix +++ b/hosts/PubSolarOS.nix @@ -12,4 +12,12 @@ networking.networkmanager.enable = true; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.05"; # Did you read the comment? } diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix index c6d8f105..acadc449 100644 --- a/hosts/bootstrap.nix +++ b/hosts/bootstrap.nix @@ -18,4 +18,12 @@ # will be overridden by the bootstrapIso instrumentation fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.05"; # Did you read the comment? } -- 2.44.1 From b25b0431765309225486aa46f35017b4223efce1 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 9 Aug 2022 11:54:19 +0200 Subject: [PATCH 029/111] nvfetcher: use nixpkgs version --- flake.nix | 1 - shell/devos.nix | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 7f3c2803..f18df6df 100644 --- a/flake.nix +++ b/flake.nix @@ -76,7 +76,6 @@ overlays = [ nur.overlay agenix.overlay - nvfetcher.overlay ./pkgs/default.nix ]; }; diff --git a/shell/devos.nix b/shell/devos.nix index bb9f1744..f49254fa 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -38,9 +38,9 @@ in (devos agenix) { category = "devos"; - name = pkgs.nvfetcher-bin.pname; - help = pkgs.nvfetcher-bin.meta.description; - command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; + name = pkgs.nvfetcher.pname; + help = pkgs.nvfetcher.meta.description; + command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher}/bin/nvfetcher -c ./sources.toml $@"; } (linter nixpkgs-fmt) (linter editorconfig-checker) -- 2.44.1 From 0cc621a4ec2b5363b058c3111145aaedbef70803 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 9 Aug 2022 11:54:49 +0200 Subject: [PATCH 030/111] deploy-rs: use nixpkgs version --- shell/devos.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/devos.nix b/shell/devos.nix index f49254fa..f799ca03 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -46,7 +46,7 @@ in (linter editorconfig-checker) # (docs python3Packages.grip) too many deps (docs mdbook) - (devos inputs.deploy.packages.${pkgs.system}.deploy-rs) + (devos deploy-rs) ] ++ lib.optional (system != "i686-linux") -- 2.44.1 From 3142c58cf4bc6a56891d98ac97e25cd94591b5c3 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 2 Aug 2022 15:28:45 +0200 Subject: [PATCH 031/111] neovim, caddy: add json-schema, use tabs in Caddyfiles, add vim-caddyfile --- modules/terminal-life/nvim/default.nix | 11 + modules/terminal-life/nvim/lsp.vim | 13 +- modules/terminal-life/nvim/plugins.vim | 3 + .../share/nvim/json-schemas/caddy_schema.json | 8087 +++++++++++++++++ profiles/base-user/home.nix | 4 + 5 files changed, 8117 insertions(+), 1 deletion(-) create mode 100644 profiles/base-user/.local/share/nvim/json-schemas/caddy_schema.json diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index 13b5fb3d..8e073288 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -15,6 +15,16 @@ let }; }; + vim-caddyfile = pkgs.vimUtils.buildVimPlugin { + name = "vim-caddyfile"; + src = pkgs.fetchFromGitHub { + owner = "isobit"; + repo = "vim-caddyfile"; + rev = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; + sha256 = "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o="; + }; + }; + workspace = pkgs.vimUtils.buildVimPlugin { name = "vim-workspace"; src = pkgs.fetchFromGitHub { @@ -123,6 +133,7 @@ in ansible-vim emmet-vim rust-vim + vim-caddyfile vim-go vim-javascript vim-json diff --git a/modules/terminal-life/nvim/lsp.vim b/modules/terminal-life/nvim/lsp.vim index 025d2b5f..b9b8c421 100644 --- a/modules/terminal-life/nvim/lsp.vim +++ b/modules/terminal-life/nvim/lsp.vim @@ -105,7 +105,18 @@ lua < " 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 diff --git a/profiles/base-user/.local/share/nvim/json-schemas/caddy_schema.json b/profiles/base-user/.local/share/nvim/json-schemas/caddy_schema.json new file mode 100644 index 00000000..71873a05 --- /dev/null +++ b/profiles/base-user/.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/profiles/base-user/home.nix b/profiles/base-user/home.nix index 1ae6bd36..f87c136a 100644 --- a/profiles/base-user/home.nix +++ b/profiles/base-user/home.nix @@ -55,6 +55,10 @@ in # 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 = ""; xdg.dataFile."shell.nix.tmpl" = { text = '' -- 2.44.1 From 4339f04f7ccd929212ba7fc59b7ce1d40f9b2813 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 2 Aug 2022 15:31:06 +0200 Subject: [PATCH 032/111] neovim: use vimagit from latest master commit --- modules/terminal-life/nvim/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index 8e073288..0613d511 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -5,6 +5,16 @@ let preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs); + vimagit-master = pkgs.vimUtils.buildVimPlugin { + name = "vimagit-master"; + src = pkgs.fetchFromGitHub { + owner = "jreybert"; + repo = "vimagit"; + rev = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4"; + sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0="; + }; + }; + instant-nvim = pkgs.vimUtils.buildVimPlugin { name = "instant"; src = pkgs.fetchFromGitHub { @@ -118,7 +128,7 @@ in fugitive vim-gitgutter vim-rhubarb - vimagit + vimagit-master fzf-vim fzfWrapper -- 2.44.1 From 0619a69f32309c5624de0d679197c12518c83390 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 2 Aug 2022 15:31:27 +0200 Subject: [PATCH 033/111] neovim: add vim-nixhash plugin --- modules/terminal-life/nvim/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index 0613d511..1d6645ff 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -150,6 +150,7 @@ in SchemaStore-nvim vim-markdown vim-nix + vim-nixhash vim-ruby vim-toml vim-vue -- 2.44.1 From be0ae1a79932c06ff0b10c2d57c54ae5700938a6 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 2 Aug 2022 15:32:24 +0200 Subject: [PATCH 034/111] neovim: fix quoting, use vim.fn.stdpath to get the neovim config directory path --- modules/terminal-life/nvim/lsp.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/terminal-life/nvim/lsp.vim b/modules/terminal-life/nvim/lsp.vim index b9b8c421..bf7f0322 100644 --- a/modules/terminal-life/nvim/lsp.vim +++ b/modules/terminal-life/nvim/lsp.vim @@ -126,10 +126,10 @@ lua < Date: Wed, 10 Aug 2022 22:42:14 +0200 Subject: [PATCH 035/111] Add spotify as an audio option Adds a `config.pub-solar.audio.spotify` option that when enabled installs and configures `spotifyd` as a systemd daemon and `spotify-tui` as the terminal-based UI. After enabling, run `spt` in the terminal to open the UI. --- modules/audio/default.nix | 27 ++++++++++++++++++++++++++- profiles/base-user/default.nix | 8 +++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/modules/audio/default.nix b/modules/audio/default.nix index fcceefd3..b43dc4ac 100644 --- a/modules/audio/default.nix +++ b/modules/audio/default.nix @@ -9,10 +9,21 @@ in options.pub-solar.audio = { enable = mkEnableOption "Life in highs and lows"; mopidy.enable = mkEnableOption "Life with mopidy"; + spotify.enable = mkEnableOption "Life in DRM"; + spotify.username = mkOption { + description = "Spotify login username or email"; + type = types.str; + example = "yourname@example.com"; + default = ""; + }; bluetooth.enable = mkEnableOption "Life with bluetooth"; }; config = mkIf cfg.enable { + users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] { + extraGroups = [ "audio" ]; + }; + home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { home.packages = [ # easyeffects, e.g. for microphone noise filtering @@ -24,9 +35,23 @@ in # Needed for pactl cmd, until pw-cli is more mature (vol up/down hotkeys?) pulseaudio vimpc - ]; + ] ++ (if cfg.spotify.enable then [ pkgs.spotify-tui ] else [ ]); xdg.configFile."vimpc/vimpcrc".source = ./.config/vimpc/vimpcrc; systemd.user.services.easyeffects = import ./easyeffects.service.nix pkgs; + + services.spotifyd = mkIf cfg.spotify.enable { + enable = true; + settings = { + global = { + username = cfg.spotify.username; + password_cmd = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus ${pkgs.libsecret}/bin/secret-tool lookup spotify password"; + bitrate = 320; + volume_normalisation = true; + no_audio_cache = false; + max_cache_size = 1000000000; + }; + }; + }; }; # Enable sound using pipewire-pulse diff --git a/profiles/base-user/default.nix b/profiles/base-user/default.nix index 8f304794..9ff21c8e 100644 --- a/profiles/base-user/default.nix +++ b/profiles/base-user/default.nix @@ -16,7 +16,13 @@ in # home to /home/username, useDefaultShell to true, and isSystemUser to false. isNormalUser = true; description = psCfg.user.description; - extraGroups = [ "wheel" "docker" "input" "audio" "networkmanager" "lp" "scanner" ]; + extraGroups = [ + "wheel" + "input" + "networkmanager" + "lp" + "scanner" + ]; initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else ""; shell = pkgs.zsh; openssh.authorizedKeys.keyFiles = if psCfg.user.publicKeys != null then psCfg.user.publicKeys else [ ]; -- 2.44.1 From 45202d98ec26067f4dce7910194e7edbeb9db3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Wed, 10 Aug 2022 22:43:54 +0200 Subject: [PATCH 036/111] Add Arduino module This adds a small arduino development module that installs development tooling and adds the user to the `dialout` group. --- modules/arduino/default.nix | 23 +++++++++++++++++++++++ overlays/overrides.nix | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 modules/arduino/default.nix diff --git a/modules/arduino/default.nix b/modules/arduino/default.nix new file mode 100644 index 00000000..926a0f62 --- /dev/null +++ b/modules/arduino/default.nix @@ -0,0 +1,23 @@ +{ lib, config, pkgs, ... }: +with lib; +let + psCfg = config.pub-solar; + cfg = config.pub-solar.devops; +in +{ + options.pub-solar.arduino = { + enable = mkEnableOption "Life with home automation"; + }; + config = mkIf cfg.enable { + users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] { + extraGroups = [ "dialout" ]; + }; + + home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { + home.packages = [ + arduino + arduino-cli + ]; + }; + }; +} diff --git a/overlays/overrides.nix b/overlays/overrides.nix index 8c016e15..df75736d 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -15,6 +15,8 @@ channels: final: prev: { deploy-rs tdesktop + arduino + arduino-cli ; -- 2.44.1 From d11b90d830c2976bcfc4489380fbea3c98dbbe9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 13 Aug 2022 12:06:24 +0200 Subject: [PATCH 037/111] Update lock file so deploy-rs is available --- flake.lock | 109 +++++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/flake.lock b/flake.lock index d29bd0f0..f6a8edfc 100644 --- a/flake.lock +++ b/flake.lock @@ -67,11 +67,11 @@ ] }, "locked": { - "lastModified": 1642035816, - "narHash": "sha256-1Lq5c1AeUv/1SK08+O704JVfDdD/zodHzA0cv0TIga8=", + "lastModified": 1654190822, + "narHash": "sha256-B8z3stYaULNDBBjzJHrFHGgiJHrLqhBkxH+9u5iBP7E=", "owner": "divnix", "repo": "bud", - "rev": "a789d710851441ba7e7cd59be378623b1fe05688", + "rev": "0ff3e4e4b8791ea4d827bf5bfcac28cef060f209", "type": "github" }, "original": { @@ -87,11 +87,11 @@ ] }, "locked": { - "lastModified": 1651916036, - "narHash": "sha256-UuD9keUGm4IuVEV6wdSYbuRm7CwfXE63hVkzKDjVsh4=", + "lastModified": 1657835815, + "narHash": "sha256-CnZszAYpNKydh6N7+xg+eRtWNVoAAGqc6bg+Lpgq1xc=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "2f2bdf658d2b79bada78dc914af99c53cad37cba", + "rev": "54a24f042f93c79f5679f133faddedec61955cf2", "type": "github" }, "original": { @@ -108,11 +108,11 @@ ] }, "locked": { - "lastModified": 1650976225, - "narHash": "sha256-PGM65SQHS63Dd5MmLJo3GJsZP9lJVZmpWxluQoG1Dt8=", + "lastModified": 1651916036, + "narHash": "sha256-UuD9keUGm4IuVEV6wdSYbuRm7CwfXE63hVkzKDjVsh4=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "bb3baef6e115ae47bc2ab4973bd3a486488485b0", + "rev": "2f2bdf658d2b79bada78dc914af99c53cad37cba", "type": "github" }, "original": { @@ -130,11 +130,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1653594315, - "narHash": "sha256-kJ0ENmnQJ4qL2FeYKZba9kvv1KmIuB3NVpBwMeI7AJQ=", + "lastModified": 1659725433, + "narHash": "sha256-1ZxuK67TL29YLw88vQ18Y2Y6iYg8Jb7I6/HVzmNB6nM=", "owner": "serokell", "repo": "deploy-rs", - "rev": "184349d8149436748986d1bdba087e4149e9c160", + "rev": "41f15759dd8b638e7b4f299730d94d5aa46ab7eb", "type": "github" }, "original": { @@ -152,11 +152,11 @@ ] }, "locked": { - "lastModified": 1650389807, - "narHash": "sha256-GFRBdHMJ/T/ifaE2GS58RWpxyufH0LqI3oGS6oWAnHk=", + "lastModified": 1655976588, + "narHash": "sha256-VreHyH6ITkf/1EX/8h15UqhddJnUleb0HgbC3gMkAEQ=", "owner": "numtide", "repo": "devshell", - "rev": "5a53bbf3eb4c908d83884d725a86b3a3bde35979", + "rev": "899ca4629020592a13a46783587f6e674179d1db", "type": "github" }, "original": { @@ -188,11 +188,11 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1652713922, - "narHash": "sha256-era1h0M+QP9wP/hbwXRpxOiT8M5n+loWX/Zrq7duq5w=", + "lastModified": 1659622306, + "narHash": "sha256-Kpfm2PNs+kZU0W7qcugoPATLG8I2P7FJFGTgsf1LJiU=", "owner": "divnix", "repo": "digga", - "rev": "29bbac0173859812893d777fdce204af83a231ea", + "rev": "d1193743a535d7fbbc7f3eda4e51295b10bd4d2c", "type": "github" }, "original": { @@ -269,15 +269,16 @@ "flake-utils": "flake-utils_3" }, "locked": { - "lastModified": 1652704544, - "narHash": "sha256-UTKE33tYgCmDszaVyWA33a8mtegM5xfH4fH8w4y6TxA=", + "lastModified": 1654029967, + "narHash": "sha256-my3GQ3mQIw/1f6GPV1IhUZrcYQSWh0YJAMPNBjhXJDw=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "f8d6d1f87b6177e3bc674c29f247bdbf897ba274", + "rev": "6271cf3842ff9c8a9af9e3508c547f86bc77d199", "type": "github" }, "original": { "owner": "gytis-ivaskevicius", + "ref": "refs/pull/120/head", "repo": "flake-utils-plus", "type": "github" } @@ -314,11 +315,11 @@ }, "flake-utils_4": { "locked": { - "lastModified": 1652776076, - "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "owner": "numtide", "repo": "flake-utils", - "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "type": "github" }, "original": { @@ -349,11 +350,11 @@ ] }, "locked": { - "lastModified": 1654113405, - "narHash": "sha256-VpK+0QaWG2JRgB00lw77N9TjkE3ec0iMYIX1TzGpxa4=", + "lastModified": 1656169755, + "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", "owner": "nix-community", "repo": "home-manager", - "rev": "ac2287df5a2d6f0a44bbcbd11701dbbf6ec43675", + "rev": "4a3d01fb53f52ac83194081272795aa4612c2381", "type": "github" }, "original": { @@ -365,11 +366,11 @@ }, "latest": { "locked": { - "lastModified": 1650701402, - "narHash": "sha256-XKfstdtqDg+O+gNBx1yGVKWIhLgfEDg/e2lvJSsp9vU=", + "lastModified": 1657265485, + "narHash": "sha256-PUQ9C7mfi0/BnaAUX2R/PIkoNCb/Jtx9EpnhMBNrO/o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bc41b01dd7a9fdffd32d9b03806798797532a5fe", + "rev": "b39924fc7764c08ae3b51beef9a3518c414cdb7d", "type": "github" }, "original": { @@ -381,11 +382,11 @@ }, "latest_2": { "locked": { - "lastModified": 1653931853, - "narHash": "sha256-O3wncIouj9x7gBPntzHeK/Hkmm9M1SGlYq7JI7saTAE=", + "lastModified": 1660305968, + "narHash": "sha256-r0X1pZCSEA6mzt5OuTA7nHuLmvnbkwgpFAh1iLIx4GU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f1c167688a6f81f4a51ab542e5f476c8c595e457", + "rev": "c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d", "type": "github" }, "original": { @@ -402,11 +403,11 @@ ] }, "locked": { - "lastModified": 1653413650, - "narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=", + "lastModified": 1659610603, + "narHash": "sha256-LYgASYSPYo7O71WfeUOaEUzYfzuXm8c8eavJcel+pfI=", "owner": "nmattia", "repo": "naersk", - "rev": "69daaceebe12c070cd5ae69ba38f277bbf033695", + "rev": "c6a45e4277fa58abd524681466d3450f896dc094", "type": "github" }, "original": { @@ -423,11 +424,11 @@ ] }, "locked": { - "lastModified": 1653198236, - "narHash": "sha256-nzW2BaqWTGGQthOtFzHUJTHK5wK+mkh4aOhETGj5nBk=", + "lastModified": 1660180791, + "narHash": "sha256-oPO+keK4S9daL9ubU51hZ+QOWVSMbZ56F20iFI9Px3s=", "owner": "dramforever", "repo": "nix-dram", - "rev": "e10086d39ca49abfd2a3b77d2a77baa6037ec31e", + "rev": "ae7f0b7c5d39eec5941fe21e9f202106bdea9ac2", "type": "github" }, "original": { @@ -453,11 +454,11 @@ }, "nixos": { "locked": { - "lastModified": 1654005557, - "narHash": "sha256-J6elwUzPoco+r5qWPHhvS2EHVWomUtNcxzkfdAQOwEU=", + "lastModified": 1660318005, + "narHash": "sha256-g9WCa9lVUmOV6dYRbEPjv/TLOR5hamjeCcKExVGS3OQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "08950a6e29cf7bddee466592eb790a417550f7f9", + "rev": "5c211b47aeadcc178c5320afd4e74c7eed5c389f", "type": "github" }, "original": { @@ -473,11 +474,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1653339081, - "narHash": "sha256-dpim9Mtd57Yj6qt7p7UKwjWm6NnOU3S7jaEyEscSyPE=", + "lastModified": 1657748715, + "narHash": "sha256-WecDwDY/hEcDQYzFnccCNa+5Umht0lfjx/d1qGDy/rQ=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "fb3ee0f618b8c80dea1239691b15dfeb4bb46331", + "rev": "3323b944d99b026aebfd8de439e001409dde067d", "type": "github" }, "original": { @@ -488,11 +489,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1654057797, - "narHash": "sha256-mXo7C4v7Jj2feBzcReu1Eu/3Rnw5b023E9kOyFsHZQw=", + "lastModified": 1660291411, + "narHash": "sha256-9UfJMJeCl+T/DrOJMd1vLCoV8U3V7f9Qrv/QyH0Nn28=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "0cab18a48de7914ef8cad35dca0bb36868f3e1af", + "rev": "78f56d8ec2c67a1f80f2de649ca9aadc284f65b6", "type": "github" }, "original": { @@ -519,11 +520,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1650726686, - "narHash": "sha256-hE5PCqQlsdgWH3AUTwesvjZWs5ZUZ8SjMS5cnFB6W54=", + "lastModified": 1657292830, + "narHash": "sha256-ldfVSTveWceDCmW6gf3B4kR6vwmz/XS80y5wsLLHFJU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3c0f57e36ed0cf9947281e3b31f1bebb7ce5d4a1", + "rev": "334ec8b503c3981e37a04b817a70e8d026ea9e84", "type": "github" }, "original": { @@ -570,11 +571,11 @@ ] }, "locked": { - "lastModified": 1650169042, - "narHash": "sha256-x8469XNOU/ebIh5YCuvjcOAaAptwHjkEl1aTFrevu1o=", + "lastModified": 1654975372, + "narHash": "sha256-wkNZ16akgKViuZzE/IM+bux4uaJ04KIwUeexH8gBjgw=", "owner": "berberman", "repo": "nvfetcher", - "rev": "db780dba6923e531b5aedca502a36d3d9627fca9", + "rev": "d4b237c10f14f72f8266b0f658faad822e491e55", "type": "github" }, "original": { -- 2.44.1 From 93aaab26850ee648f840b77e057515587c149813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 13 Aug 2022 12:32:16 +0200 Subject: [PATCH 038/111] Make cryptroot optional --- modules/x-os/boot.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/x-os/boot.nix b/modules/x-os/boot.nix index 0633bec4..0ee29b84 100644 --- a/modules/x-os/boot.nix +++ b/modules/x-os/boot.nix @@ -9,6 +9,11 @@ in default = false; description = "Feature flag for iso builds"; }; + options.pub-solar.x-os.disk-encryption-active = mkOption { + type = types.bool; + default = true; + description = "Whether it should be assumed that there is a cryptroot device"; + }; config = { # Enable plymouth for better experience of booting boot.plymouth.enable = true; @@ -16,7 +21,7 @@ in # Mount / luks device in initrd # Allow fstrim to work on it. # The ! makes this enabled by default - boot.initrd = mkIf (!cfg.iso-options.enable) { + boot.initrd = mkIf (!cfg.iso-options.enable && cfg.disk-encryption-active) { luks.devices."cryptroot" = { allowDiscards = true; }; -- 2.44.1 From a5848ad06e4b9a254f1eb5f07d067947e1a3f870 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 13 Aug 2022 17:08:26 +0200 Subject: [PATCH 039/111] Bump flake.lock, fix error: attribute 'deploy-rs' missing --- flake.lock | 109 +++++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/flake.lock b/flake.lock index d29bd0f0..f6a8edfc 100644 --- a/flake.lock +++ b/flake.lock @@ -67,11 +67,11 @@ ] }, "locked": { - "lastModified": 1642035816, - "narHash": "sha256-1Lq5c1AeUv/1SK08+O704JVfDdD/zodHzA0cv0TIga8=", + "lastModified": 1654190822, + "narHash": "sha256-B8z3stYaULNDBBjzJHrFHGgiJHrLqhBkxH+9u5iBP7E=", "owner": "divnix", "repo": "bud", - "rev": "a789d710851441ba7e7cd59be378623b1fe05688", + "rev": "0ff3e4e4b8791ea4d827bf5bfcac28cef060f209", "type": "github" }, "original": { @@ -87,11 +87,11 @@ ] }, "locked": { - "lastModified": 1651916036, - "narHash": "sha256-UuD9keUGm4IuVEV6wdSYbuRm7CwfXE63hVkzKDjVsh4=", + "lastModified": 1657835815, + "narHash": "sha256-CnZszAYpNKydh6N7+xg+eRtWNVoAAGqc6bg+Lpgq1xc=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "2f2bdf658d2b79bada78dc914af99c53cad37cba", + "rev": "54a24f042f93c79f5679f133faddedec61955cf2", "type": "github" }, "original": { @@ -108,11 +108,11 @@ ] }, "locked": { - "lastModified": 1650976225, - "narHash": "sha256-PGM65SQHS63Dd5MmLJo3GJsZP9lJVZmpWxluQoG1Dt8=", + "lastModified": 1651916036, + "narHash": "sha256-UuD9keUGm4IuVEV6wdSYbuRm7CwfXE63hVkzKDjVsh4=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "bb3baef6e115ae47bc2ab4973bd3a486488485b0", + "rev": "2f2bdf658d2b79bada78dc914af99c53cad37cba", "type": "github" }, "original": { @@ -130,11 +130,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1653594315, - "narHash": "sha256-kJ0ENmnQJ4qL2FeYKZba9kvv1KmIuB3NVpBwMeI7AJQ=", + "lastModified": 1659725433, + "narHash": "sha256-1ZxuK67TL29YLw88vQ18Y2Y6iYg8Jb7I6/HVzmNB6nM=", "owner": "serokell", "repo": "deploy-rs", - "rev": "184349d8149436748986d1bdba087e4149e9c160", + "rev": "41f15759dd8b638e7b4f299730d94d5aa46ab7eb", "type": "github" }, "original": { @@ -152,11 +152,11 @@ ] }, "locked": { - "lastModified": 1650389807, - "narHash": "sha256-GFRBdHMJ/T/ifaE2GS58RWpxyufH0LqI3oGS6oWAnHk=", + "lastModified": 1655976588, + "narHash": "sha256-VreHyH6ITkf/1EX/8h15UqhddJnUleb0HgbC3gMkAEQ=", "owner": "numtide", "repo": "devshell", - "rev": "5a53bbf3eb4c908d83884d725a86b3a3bde35979", + "rev": "899ca4629020592a13a46783587f6e674179d1db", "type": "github" }, "original": { @@ -188,11 +188,11 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1652713922, - "narHash": "sha256-era1h0M+QP9wP/hbwXRpxOiT8M5n+loWX/Zrq7duq5w=", + "lastModified": 1659622306, + "narHash": "sha256-Kpfm2PNs+kZU0W7qcugoPATLG8I2P7FJFGTgsf1LJiU=", "owner": "divnix", "repo": "digga", - "rev": "29bbac0173859812893d777fdce204af83a231ea", + "rev": "d1193743a535d7fbbc7f3eda4e51295b10bd4d2c", "type": "github" }, "original": { @@ -269,15 +269,16 @@ "flake-utils": "flake-utils_3" }, "locked": { - "lastModified": 1652704544, - "narHash": "sha256-UTKE33tYgCmDszaVyWA33a8mtegM5xfH4fH8w4y6TxA=", + "lastModified": 1654029967, + "narHash": "sha256-my3GQ3mQIw/1f6GPV1IhUZrcYQSWh0YJAMPNBjhXJDw=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "f8d6d1f87b6177e3bc674c29f247bdbf897ba274", + "rev": "6271cf3842ff9c8a9af9e3508c547f86bc77d199", "type": "github" }, "original": { "owner": "gytis-ivaskevicius", + "ref": "refs/pull/120/head", "repo": "flake-utils-plus", "type": "github" } @@ -314,11 +315,11 @@ }, "flake-utils_4": { "locked": { - "lastModified": 1652776076, - "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "owner": "numtide", "repo": "flake-utils", - "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "type": "github" }, "original": { @@ -349,11 +350,11 @@ ] }, "locked": { - "lastModified": 1654113405, - "narHash": "sha256-VpK+0QaWG2JRgB00lw77N9TjkE3ec0iMYIX1TzGpxa4=", + "lastModified": 1656169755, + "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", "owner": "nix-community", "repo": "home-manager", - "rev": "ac2287df5a2d6f0a44bbcbd11701dbbf6ec43675", + "rev": "4a3d01fb53f52ac83194081272795aa4612c2381", "type": "github" }, "original": { @@ -365,11 +366,11 @@ }, "latest": { "locked": { - "lastModified": 1650701402, - "narHash": "sha256-XKfstdtqDg+O+gNBx1yGVKWIhLgfEDg/e2lvJSsp9vU=", + "lastModified": 1657265485, + "narHash": "sha256-PUQ9C7mfi0/BnaAUX2R/PIkoNCb/Jtx9EpnhMBNrO/o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bc41b01dd7a9fdffd32d9b03806798797532a5fe", + "rev": "b39924fc7764c08ae3b51beef9a3518c414cdb7d", "type": "github" }, "original": { @@ -381,11 +382,11 @@ }, "latest_2": { "locked": { - "lastModified": 1653931853, - "narHash": "sha256-O3wncIouj9x7gBPntzHeK/Hkmm9M1SGlYq7JI7saTAE=", + "lastModified": 1660305968, + "narHash": "sha256-r0X1pZCSEA6mzt5OuTA7nHuLmvnbkwgpFAh1iLIx4GU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f1c167688a6f81f4a51ab542e5f476c8c595e457", + "rev": "c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d", "type": "github" }, "original": { @@ -402,11 +403,11 @@ ] }, "locked": { - "lastModified": 1653413650, - "narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=", + "lastModified": 1659610603, + "narHash": "sha256-LYgASYSPYo7O71WfeUOaEUzYfzuXm8c8eavJcel+pfI=", "owner": "nmattia", "repo": "naersk", - "rev": "69daaceebe12c070cd5ae69ba38f277bbf033695", + "rev": "c6a45e4277fa58abd524681466d3450f896dc094", "type": "github" }, "original": { @@ -423,11 +424,11 @@ ] }, "locked": { - "lastModified": 1653198236, - "narHash": "sha256-nzW2BaqWTGGQthOtFzHUJTHK5wK+mkh4aOhETGj5nBk=", + "lastModified": 1660180791, + "narHash": "sha256-oPO+keK4S9daL9ubU51hZ+QOWVSMbZ56F20iFI9Px3s=", "owner": "dramforever", "repo": "nix-dram", - "rev": "e10086d39ca49abfd2a3b77d2a77baa6037ec31e", + "rev": "ae7f0b7c5d39eec5941fe21e9f202106bdea9ac2", "type": "github" }, "original": { @@ -453,11 +454,11 @@ }, "nixos": { "locked": { - "lastModified": 1654005557, - "narHash": "sha256-J6elwUzPoco+r5qWPHhvS2EHVWomUtNcxzkfdAQOwEU=", + "lastModified": 1660318005, + "narHash": "sha256-g9WCa9lVUmOV6dYRbEPjv/TLOR5hamjeCcKExVGS3OQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "08950a6e29cf7bddee466592eb790a417550f7f9", + "rev": "5c211b47aeadcc178c5320afd4e74c7eed5c389f", "type": "github" }, "original": { @@ -473,11 +474,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1653339081, - "narHash": "sha256-dpim9Mtd57Yj6qt7p7UKwjWm6NnOU3S7jaEyEscSyPE=", + "lastModified": 1657748715, + "narHash": "sha256-WecDwDY/hEcDQYzFnccCNa+5Umht0lfjx/d1qGDy/rQ=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "fb3ee0f618b8c80dea1239691b15dfeb4bb46331", + "rev": "3323b944d99b026aebfd8de439e001409dde067d", "type": "github" }, "original": { @@ -488,11 +489,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1654057797, - "narHash": "sha256-mXo7C4v7Jj2feBzcReu1Eu/3Rnw5b023E9kOyFsHZQw=", + "lastModified": 1660291411, + "narHash": "sha256-9UfJMJeCl+T/DrOJMd1vLCoV8U3V7f9Qrv/QyH0Nn28=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "0cab18a48de7914ef8cad35dca0bb36868f3e1af", + "rev": "78f56d8ec2c67a1f80f2de649ca9aadc284f65b6", "type": "github" }, "original": { @@ -519,11 +520,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1650726686, - "narHash": "sha256-hE5PCqQlsdgWH3AUTwesvjZWs5ZUZ8SjMS5cnFB6W54=", + "lastModified": 1657292830, + "narHash": "sha256-ldfVSTveWceDCmW6gf3B4kR6vwmz/XS80y5wsLLHFJU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3c0f57e36ed0cf9947281e3b31f1bebb7ce5d4a1", + "rev": "334ec8b503c3981e37a04b817a70e8d026ea9e84", "type": "github" }, "original": { @@ -570,11 +571,11 @@ ] }, "locked": { - "lastModified": 1650169042, - "narHash": "sha256-x8469XNOU/ebIh5YCuvjcOAaAptwHjkEl1aTFrevu1o=", + "lastModified": 1654975372, + "narHash": "sha256-wkNZ16akgKViuZzE/IM+bux4uaJ04KIwUeexH8gBjgw=", "owner": "berberman", "repo": "nvfetcher", - "rev": "db780dba6923e531b5aedca502a36d3d9627fca9", + "rev": "d4b237c10f14f72f8266b0f658faad822e491e55", "type": "github" }, "original": { -- 2.44.1 From 6817fb3d5f29eb5d533cb53ae25da9003554f403 Mon Sep 17 00:00:00 2001 From: vlalentim Date: Sat, 13 Aug 2022 20:05:51 +0200 Subject: [PATCH 040/111] Theme change for fzf --- pkgs/sway-launcher.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sway-launcher.nix b/pkgs/sway-launcher.nix index afa09d07..57c7afe4 100644 --- a/pkgs/sway-launcher.nix +++ b/pkgs/sway-launcher.nix @@ -23,7 +23,7 @@ self: with self; '' # search command list command_str=$(printf "%s\n" "''${command_history}" "''${command_list}" | \ sed -E 's/^[0-9]+ (.+)$/\1/' | \ - fzf --exact --no-extended --print-query --no-sort | \ + fzf --color=16 --exact --no-extended --print-query --no-sort | \ tail -n1) || exit 1 if [ "$command_str" = "" ]; then -- 2.44.1 From 616b7af85820608efe796dabb2de014b050af87d Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 13 Aug 2022 21:50:23 +0200 Subject: [PATCH 041/111] devos: include upstream commits https://github.com/divnix/digga/commit/780620d8659fdcb04d4952a2607ce363e0d3a3be https://github.com/divnix/digga/commit/e6b14d39d6d2e0a0544dbc50c7cc235acb2bc123 https://github.com/divnix/digga/commit/dd51f64bc5ff2a2127237805d9dcd6bd7ffebfed --- overlays/overrides.nix | 1 + shell/devos.nix | 28 +++++++++++++++++++--------- shell/hooks/pre-commit.sh | 7 +++++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/overlays/overrides.nix b/overlays/overrides.nix index df75736d..6c9e8e71 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -8,6 +8,7 @@ channels: final: prev: { discord element-desktop rage + nix-index nixpkgs-fmt qutebrowser signal-desktop diff --git a/shell/devos.nix b/shell/devos.nix index f799ca03..b7c6f108 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -1,12 +1,22 @@ -{ pkgs, extraModulesPath, inputs, ... }: +{ pkgs, extraModulesPath, inputs, lib, ... }: let + inherit (pkgs) + agenix + cachix + editorconfig-checker + mdbook + nixUnstable + nixpkgs-fmt + nvfetcher + ; + hooks = import ./hooks; pkgWithCategory = category: package: { inherit package category; }; + devos = pkgWithCategory "devos"; linter = pkgWithCategory "linter"; docs = pkgWithCategory "docs"; - devos = pkgWithCategory "devos"; in { @@ -44,15 +54,15 @@ in } (linter nixpkgs-fmt) (linter editorconfig-checker) - # (docs python3Packages.grip) too many deps + (docs mdbook) + ] + ++ lib.optionals (!pkgs.stdenv.buildPlatform.isi686) [ + (devos cachix) + ] + ++ lib.optionals (pkgs.stdenv.hostPlatform.isLinux && !pkgs.stdenv.buildPlatform.isDarwin) [ + (devos inputs.nixos-generators.defaultPackage.${pkgs.system}) (devos deploy-rs) ] - ++ lib.optional - (system != "i686-linux") - (devos cachix) - ++ lib.optional - (system != "aarch64-darwin") - (devos inputs.nixos-generators.defaultPackage.${pkgs.system}) ; } diff --git a/shell/hooks/pre-commit.sh b/shell/hooks/pre-commit.sh index 985d3b40..a7fa9083 100755 --- a/shell/hooks/pre-commit.sh +++ b/shell/hooks/pre-commit.sh @@ -14,13 +14,16 @@ nix_files=($($diff -- '*.nix')) all_files=($($diff)) # Format staged nix files. -if [[ -n "${nix_files[@]}" ]]; then +if (( ${#nix_files[@]} != 0 )); then nixpkgs-fmt "${nix_files[@]}" \ && git add "${nix_files[@]}" fi # check editorconfig -editorconfig-checker -- "${all_files[@]}" +if (( ${#all_files[@]} != 0 )); then + editorconfig-checker -- "${all_files[@]}" +fi + if [[ $? != '0' ]]; then printf "%b\n" \ "\nCode is not aligned with .editorconfig" \ -- 2.44.1 From 0b229a771e846893e759cd4102172e60a541d439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 13 Aug 2022 20:38:41 +0200 Subject: [PATCH 042/111] Barebones ci-runner module This adds a barebones CI-runner module with the following option: `pub-solar.ci-runner.enable` If enabled, this will start a systemd service on boot that runs `drone-runner-exec`. The configuration expects you to have a file called `secrets/drone-runner-exec-config` handled by agenix that gets put into `/run/agenix/drone-runner-exec-config` and is owned by root. This file should contain a configuration similar to the following: ``` CLIENT_DRONE_RPC_PROTO=https CLIENT_DRONE_RPC_HOST=drone.company.com CLIENT_DRONE_RPC_SECRET=super-duper-secret ``` --- modules/ci-runner/default.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 modules/ci-runner/default.nix diff --git a/modules/ci-runner/default.nix b/modules/ci-runner/default.nix new file mode 100644 index 00000000..28325b14 --- /dev/null +++ b/modules/ci-runner/default.nix @@ -0,0 +1,35 @@ +{ lib, config, pkgs, self, ... }: +with lib; +let + psCfg = config.pub-solar; + cfg = config.pub-solar.ci-runner; +in +{ + options.pub-solar.ci-runner = { + enable = mkEnableOption "Enables a systemd service that runs drone-ci-runner"; + }; + + config = mkIf cfg.enable { + systemd.services.ci-runner = { + enable = true; + + description = "CI runner for the PubSolarOS repository that can run test VM instances with KVM."; + + serviceConfig = { + Type = "simple"; + Restart = "always"; + }; + + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "libvirtd.service" ]; + + script = ''${pkgs.drone-runner-exec}/bin/drone-runner-exec daemon /run/agenix/drone-runner-exec-config''; + }; + + age.secrets."drone-runner-exec-config" = { + file = "${self}/secrets/drone-runner-exec-config"; + mode = "700"; + owner = "root"; + }; + }; +} -- 2.44.1 From e3d76f1999d0512cc4f8f4e8032858000665c3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 13 Aug 2022 22:31:30 +0200 Subject: [PATCH 043/111] Move ci-runner to user and add git, virsh and nix to path --- modules/ci-runner/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ci-runner/default.nix b/modules/ci-runner/default.nix index 28325b14..4db42286 100644 --- a/modules/ci-runner/default.nix +++ b/modules/ci-runner/default.nix @@ -10,7 +10,7 @@ in }; config = mkIf cfg.enable { - systemd.services.ci-runner = { + systemd.user.services.ci-runner = { enable = true; description = "CI runner for the PubSolarOS repository that can run test VM instances with KVM."; @@ -20,6 +20,8 @@ in Restart = "always"; }; + path = "${pkgs.git}/bin:${pkgs.nix}/bin:${pkgs.libvirt}/bin"; + wantedBy = [ "multi-user.target" ]; after = [ "network.target" "libvirtd.service" ]; @@ -29,7 +31,7 @@ in age.secrets."drone-runner-exec-config" = { file = "${self}/secrets/drone-runner-exec-config"; mode = "700"; - owner = "root"; + owner = psCfg.user.name; }; }; } -- 2.44.1 From 18e9b4a009a5de26bc29f3ff88afc642d4cc691e Mon Sep 17 00:00:00 2001 From: hensoko Date: Sat, 13 Aug 2022 20:35:43 +0000 Subject: [PATCH 044/111] feature/restructure-core-profile (#109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hendrik Sokolowski Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/109 Reviewed-by: Benjamin Bädorf Reviewed-by: teutat3s --- flake.nix | 5 +- modules/x-os/boot.nix | 6 +++ modules/x-os/default.nix | 3 ++ modules/x-os/fonts.nix | 12 +++++ modules/x-os/nix.nix | 25 ++++++++++ modules/x-os/services.nix | 13 +++++ profiles/core/default.nix | 56 ---------------------- profiles/core/starship.toml | 95 ------------------------------------- profiles/dram/default.nix | 5 ++ 9 files changed, 66 insertions(+), 154 deletions(-) create mode 100644 modules/x-os/fonts.nix create mode 100644 modules/x-os/nix.nix create mode 100644 modules/x-os/services.nix delete mode 100644 profiles/core/starship.toml create mode 100644 profiles/dram/default.nix diff --git a/flake.nix b/flake.nix index f18df6df..7d43b67c 100644 --- a/flake.nix +++ b/flake.nix @@ -120,7 +120,7 @@ suites = with profiles; rec { base = [ core users.pub-solar users.root ]; iso = base ++ [ base-user graphical pub-solar-iso ]; - pubsolaros = [ core full-install base-user users.root ]; + pubsolaros = [ core dram full-install base-user users.root ]; anonymous = [ pubsolaros users.pub-solar ]; }; }; @@ -145,6 +145,5 @@ homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; - } - ; + }; } diff --git a/modules/x-os/boot.nix b/modules/x-os/boot.nix index 0ee29b84..dd788d26 100644 --- a/modules/x-os/boot.nix +++ b/modules/x-os/boot.nix @@ -28,5 +28,11 @@ in }; boot.loader.systemd-boot.enable = true; + + # Use latest LTS linux kernel by default + boot.kernelPackages = pkgs.linuxPackages_5_15; + + # Support ntfs drives + boot.supportedFilesystems = [ "ntfs" ]; }; } diff --git a/modules/x-os/default.nix b/modules/x-os/default.nix index 6276bf5f..0fd734f3 100644 --- a/modules/x-os/default.nix +++ b/modules/x-os/default.nix @@ -1,7 +1,10 @@ { ... }: { imports = [ ./boot.nix + ./fonts.nix ./i18n.nix ./networking.nix + ./nix.nix + ./services.nix ]; } diff --git a/modules/x-os/fonts.nix b/modules/x-os/fonts.nix new file mode 100644 index 00000000..979ffc68 --- /dev/null +++ b/modules/x-os/fonts.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: + +{ + fonts = { + fonts = with pkgs; [ powerline-fonts dejavu_fonts ]; + fontconfig.defaultFonts = { + monospace = [ "DejaVu Sans Mono for Powerline" ]; + sansSerif = [ "DejaVu Sans" ]; + }; + }; +} + diff --git a/modules/x-os/nix.nix b/modules/x-os/nix.nix new file mode 100644 index 00000000..56b677da --- /dev/null +++ b/modules/x-os/nix.nix @@ -0,0 +1,25 @@ +{ config, pkgs, lib, inputs, ... }: + +{ + nix = { + # Improve nix store disk usage + autoOptimiseStore = true; + gc.automatic = true; + optimise.automatic = true; + # Prevents impurities in builds + useSandbox = true; + # give root and @wheel special privileges with nix + trustedUsers = [ "root" "@wheel" ]; + # This is just a representation of the nix default + systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + # Generally useful nix option defaults + extraOptions = '' + min-free = 536870912 + keep-outputs = true + keep-derivations = true + fallback = true + # used by nix-dram + default-flake = flake:nixpkgs + ''; + }; +} diff --git a/modules/x-os/services.nix b/modules/x-os/services.nix new file mode 100644 index 00000000..98a058a3 --- /dev/null +++ b/modules/x-os/services.nix @@ -0,0 +1,13 @@ +{ config, pkgs, lib, ... }: + +{ + + # For rage encryption, all hosts need a ssh key pair + services.openssh = { + enable = true; + openFirewall = lib.mkDefault false; + }; + + # Service that makes Out of Memory Killer more effective + services.earlyoom.enable = true; +} diff --git a/profiles/core/default.nix b/profiles/core/default.nix index f3136372..b35fb673 100644 --- a/profiles/core/default.nix +++ b/profiles/core/default.nix @@ -11,11 +11,7 @@ in pub-solar.crypto.enable = true; pub-solar.devops.enable = true; - # This is just a representation of the nix default - nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - environment = { - systemPackages = with pkgs; [ # Core unix utility packages coreutils-full @@ -75,57 +71,5 @@ in neofetch ]; }; - - fonts = { - fonts = with pkgs; [ powerline-fonts dejavu_fonts ]; - - fontconfig.defaultFonts = { - - monospace = [ "DejaVu Sans Mono for Powerline" ]; - - sansSerif = [ "DejaVu Sans" ]; - - }; - }; - - nix = { - # use nix-dram, a patched nix command, see: https://github.com/dramforever/nix-dram - package = inputs.nix-dram.packages.${pkgs.system}.nix-dram; - - # Improve nix store disk usage - autoOptimiseStore = true; - gc.automatic = true; - optimise.automatic = true; - - # Prevents impurities in builds - useSandbox = true; - - # give root and @wheel special privileges with nix - trustedUsers = [ "root" "@wheel" ]; - - # Generally useful nix option defaults - extraOptions = '' - min-free = 536870912 - keep-outputs = true - keep-derivations = true - fallback = true - # used by nix-dram - default-flake = flake:nixpkgs - ''; - }; - - # For rage encryption, all hosts need a ssh key pair - services.openssh = { - enable = true; - openFirewall = lib.mkDefault false; - }; - - # Service that makes Out of Memory Killer more effective - services.earlyoom.enable = true; - - # Use latest LTS linux kernel by default - boot.kernelPackages = pkgs.linuxPackages_5_15; - - boot.supportedFilesystems = [ "ntfs" ]; }; } diff --git a/profiles/core/starship.toml b/profiles/core/starship.toml deleted file mode 100644 index 6ed366b5..00000000 --- a/profiles/core/starship.toml +++ /dev/null @@ -1,95 +0,0 @@ -[aws] -symbol = " " - -[character] -success_symbol = "[❯](bold purple)" -vicmd_symbol = "[❮](bold purple)" - -[battery] -full_symbol = "" -charging_symbol = "" -discharging_symbol = "" - -[conda] -symbol = " " - -[directory] -style = "cyan" -read_only = " 🔒" - -[docker] -symbol = " " - -[elixir] -symbol = " " - -[elm] -symbol = " " - -[git_branch] -format = "[$symbol$branch]($style) " -symbol = " " -style = "bold dimmed white" - -[git_status] -format = '([「$all_status$ahead_behind」]($style) )' -conflicted = "⚠️" -ahead = "⟫${count} " -behind = "⟪${count}" -diverged = "🔀 " -untracked = "📁 " -stashed = "↪ " -modified = "𝚫 " -staged = "✔ " -renamed = "⇆ " -deleted = "✘ " -style = "bold bright-white" - -[golang] -symbol = " " - -[haskell] -symbol = " " - -[hg_branch] -symbol = " " - -[java] -symbol = " " - -[julia] -symbol = " " - -[memory_usage] -symbol = " " -disabled = false - -[nim] -symbol = " " - -[nix_shell] -format = '[$symbol$state]($style) ' -symbol = " " -pure_msg = "λ" -impure_msg = "⎔" - -[nodejs] -symbol = " " - -[package] -symbol = " " - -[php] -symbol = " " - -[python] -symbol = " " - -[ruby] -symbol = " " - -[rust] -symbol = " " - -[status] -disabled = false diff --git a/profiles/dram/default.nix b/profiles/dram/default.nix new file mode 100644 index 00000000..0b7fc3ee --- /dev/null +++ b/profiles/dram/default.nix @@ -0,0 +1,5 @@ +{ self, config, lib, pkgs, inputs, ... }: + +{ + nix.package = inputs.nix-dram.packages.${pkgs.system}.nix-dram; +} -- 2.44.1 From 9031dacbb54bad963aa611583df26eeac7296cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 14:11:10 +0200 Subject: [PATCH 045/111] Add AGPLv3 License --- LICENSE.md | 660 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 660 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..cba6f6a1 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,660 @@ +### GNU AFFERO GENERAL PUBLIC LICENSE + +Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +### Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains +free software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing +under this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +### TERMS AND CONDITIONS + +#### 0. Definitions. + +"This License" refers to version 3 of the GNU Affero General Public +License. + +"Copyright" also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a "modified version" of +the earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays "Appropriate Legal Notices" to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +#### 1. Source Code. + +The "source code" for a work means the preferred form of the work for +making modifications to it. "Object code" means any non-source form of +a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +#### 2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 makes +it unnecessary. + +#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +#### 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +#### 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +- a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. +- b) The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in section 4 + to "keep intact all notices". +- c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +- d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +#### 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +- a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +- b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the Corresponding + Source from a network server at no charge. +- c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +- d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +- e) Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the general + public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +"normally used" refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +#### 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +- a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +- b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +- c) Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +- d) Limiting the use for publicity purposes of names of licensors + or authors of the material; or +- e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +- f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions + of it) with contractual assumptions of liability to the recipient, + for any liability that these contractual assumptions directly + impose on those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +#### 8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +#### 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +#### 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +#### 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +#### 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree to +terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +#### 13. Remote Network Interaction; Use with the GNU General Public License. + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your +version supports such interaction) an opportunity to receive the +Corresponding Source of your version by providing access to the +Corresponding Source from a network server at no charge, through some +standard or customary means of facilitating copying of software. This +Corresponding Source shall include the Corresponding Source for any +work covered by version 3 of the GNU General Public License that is +incorporated pursuant to the following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +#### 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Affero General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever +published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +#### 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +#### 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +#### 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +### How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively state +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper +mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for +the specific requirements. + +You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU AGPL, see . -- 2.44.1 From b3a4ae5bbcbec4b2a955a77bb9b823c6fefa678d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 14:14:17 +0200 Subject: [PATCH 046/111] Our first real readme --- README.md | 131 +++++++++++++++++------------------------------------- 1 file changed, 41 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index e2a83eb9..f655075c 100644 --- a/README.md +++ b/README.md @@ -1,95 +1,46 @@ -[![NixOS](https://img.shields.io/badge/NixOS-unstable-blue.svg?style=flat&logo=NixOS&logoColor=white)](https://nixos.org) -[![MIT License](https://img.shields.io/github/license/divnix/devos)][mit] -[![Chat](https://img.shields.io/matrix/devos:nixos.org.svg?label=%23devos%3Anixos.org&logo=matrix&server_fqdn=matrix.org)][matrix] +# PubSolarOS -> #### ⚠ Advisory ⚠ -> DevOS requires the [flakes][flakes] feature available via an _experimental_ -> branch of [nix][nix]. Until nix 2.4 is released, this project -> should be considered unstable. +Welcome to PubSolarOS, a very opiniated Linux (NixOS) distribution for the nerdy. -### Why? -Make an awesome template for NixOS users, with consideration for common tools like [home-manager][home-manager], -[devshell][devshell], and [more](./doc/integrations). +We're creating this distribution for our own personal use and fun, but +take pride in our craft. As of 14.08.22 it's running on 14 physical devices, +both `x86_64` and `ARM`. -### No. Why _flakes_? -Flakes are a part of an explicit push to improve [Nix's UX](https://github.com/NixOS/nix/blob/master/doc/manual/src/contributing/cli-guideline.md), and have become an integral part of that effort. +At its core, it's a NixOS installation running our configuration. The UX +decisions and the way the project is structured are what make it +_PubSolarOS_: -They also make [Nix expressions](https://nixos.org/manual/nix/unstable/expressions/expression-syntax.html) easier to distribute and reuse with convient [flake references](https://github.com/NixOS/nix/blob/master/src/nix/flake.md#flake-references) for building or using packages, modules, and whole systems. +* Reproducibility is king, and the future is with declarative and functional + programming. Even if Nix does not turn out to be the end-all-be-all of + reproducible package management (Guix looks good), it has a plethora + of packages, a very active and helpful community, and very solid + software engineering practices. +* Because reproducibility is king, we're using nix flakes for locking flake + dependencies. [Digga](https://github.com/divnix/digga) is our flake + utility library, made by the wonderful people of the Divnix community. +* Physical devices are not shared anymore nowadays. Only seldomly will you + find shared devices that need more than one user account. For this + reason, only one user (excluding `root`) is assumed. +* Keyboard navigation wins where it matters; ergonomics, programmability, + efficiency, and speed. We use a tiling window manager (`sway`) and + prioritize cli-based solutions where sensible. The editor is `neovim` + configured to be just as opiniated as the operating system it is a part + of. For mailing, `neomutt` is the default, but we're more divided on + that part. +* We like new and shiny things, so we've moved to Wayland and pipewire. +* SICHERHEIT is written in capital letters at pub.solar, so we have first- + class disk-encryption support. Currently in the works is a paranoid + mode where the device can only hibernate (no more sleep or lockscreen) + so your data is locked any time you leave the device. +* Free software is better. If we can avoid it, nonfree software is avoided. + By default, `allowUnfree` is `false` so we don't ship non-free software + in a basic PubSolarOS ISO. However, nothing prevents you from using + as much non-free software as you like. +* Automation is better. The reproducibility of nix feels so much more + powerful once you're deploying your new configuration from your laptop + to all your other devices with one command. We've automated CI (WIP). +* Community is important. We just like working on this together, and it + feels really good to see our progress at the end of a + [hakken.irl](https://pub.solar/hakken) session. -## Getting Started -Check out the [guide](https://devos.divnix.com/start) to get up and running. -Also, have a look at [_flake.nix_](./flake.nix). If anything is not immediately -discoverable via "[`digga`][digga]'s [`mkFlake`][mk-flake], -please file a bug report. - -### Status: Beta -Although this project has already matured quite a bit, especially through -recent outfactoring of [`digga`][digga], a fair amount of api polishing is still -expected. There are unstable versions (0._x_._x_) to help users keep track -of changes and progress, and a [`develop`](https://github.com/divnix/devos/tree/develop) branch for the brave 😜 - -## In the Wild -* @Pacman99: [Personal](https://gitlab.com/coffeetables/lower), [Server](https://gitlab.com/coffeetables/myrdd) -* [@danielphan2003](https://github.com/danielphan2003/flk) and make sure to also check out [devos-ext-lib][devos-ext-lib] -* [PubSolarOS](https://git.sr.ht/~b12f/pub-solar-os) - -## Shoulders -This work does not reinvent the wheel. It stands on the [shoulders of the -following giants][giants]: - -### :onion: — like the layers of an onion -- [`divnix/digga`][digga] -- [`gytis-ivaskevicius/flake-utils-plus`][fup] -- [`numtide/flake-utils`][fu] - -### :family: — like family -- [`numtide/devshell`][devshell] -- [`serokell/deploy-rs`][deploy] -- [`berberman/nvfetcher`][nvfetcher] -- [`NixOS/nixpkgs`][nixpkgs] - -:heart: - -## Inspiration & Art -- [hlissner/dotfiles][dotfiles] -- [nix-user-chroot](https://github.com/nix-community/nix-user-chroot) -- [Nickel](https://github.com/tweag/nickel) -- [Awesome Nix](https://github.com/nix-community/awesome-nix) -- [devshell](https://github.com/numtide/devshell) - -## Divnix -The divnix org is an open space that spontaneously formed out of "the Nix". -It is really just a place where otherwise unrelated people work -together and get stuff done. - -It's a place to stop "geeking out in isolation" (or within company boundaries). -A place to experiment, learn together, and iterate quickly on best practices. -That's what it is. - -It might eventually become a non-profit if that's not too complicated or, if those -goals are sufficiently upstreamed into "the Nix", dissolved. - -# License -DevOS is licensed under the [MIT License][mit]. - -[community]: https://github.com/divnix/devos/tree/community -[core]: https://github.com/divnix/devos -[deploy]: https://github.com/serokell/deploy-rs -[devshell]: https://github.com/numtide/devshell -[digga]: https://github.com/divnix/digga -[dotfiles]: https://github.com/hlissner/dotfiles -[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md -[flakes]: https://nixos.wiki/wiki/Flakes -[fu]: https://github.com/numtide/flake-utils -[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus -[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants -[home-manager]: https://nix-community.github.io/home-manager -[mit]: https://mit-license.org -[mk-flake]: https://github.com/divnix/digga/tree/main/src/mkFlake -[nix]: https://nixos.org/manual/nix/stable -[nixos]: https://nixos.org/manual/nixos/stable -[nixpkgs]: https://github.com/NixOS/nixpkgs -[nvfetcher]: https://github.com/berberman/nvfetcher -[please]: https://github.com/nrdxp/devos/tree/nrd -[matrix]: https://matrix.to/#/#devos:nixos.org -[devos-ext-lib]: https://github.com/divnix/devos-ext-lib +To get started, take a look at the quick start guide in our docs. -- 2.44.1 From 552b2ee53e5103284b0e2de77d1c446e94b33452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 14:15:02 +0200 Subject: [PATCH 047/111] Remove nonfree software This commit removes the default, global `allowUnfree = true;` setting and removes nonfree packages where I could find them. Tested by building the `PubSolarOS` host once. --- flake.nix | 4 +++- modules/graphical/default.nix | 25 +++++++++++++------------ modules/printing/default.nix | 4 ---- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index f18df6df..d6be04da 100644 --- a/flake.nix +++ b/flake.nix @@ -66,7 +66,9 @@ { inherit self inputs; - channelsConfig = { allowUnfree = true; }; + channelsConfig = { + # allowUnfree = true; + }; supportedSystems = [ "x86_64-linux" "aarch64-linux" ]; diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index 0bb9781c..a506c2ef 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -5,17 +5,19 @@ let cfg = config.pub-solar.graphical; yamlFormat = pkgs.formats.yaml { }; recursiveMerge = attrList: - let f = attrPath: - zipAttrsWith (n: values: - if tail values == [ ] - then head values - else if all isList values - then unique (concatLists values) - else if all isAttrs values - then f (attrPath ++ [ n ]) values - else last values - ); - in f [ ] attrList; + let + f = attrPath: + zipAttrsWith (n: values: + if tail values == [ ] + then head values + else if all isList values + then unique (concatLists values) + else if all isAttrs values + then f (attrPath ++ [ n ]) values + else last values + ); + in + f [ ] attrList; in { options.pub-solar.graphical = { @@ -77,7 +79,6 @@ in fonts.enableDefaultFonts = true; fonts.fonts = with pkgs; [ - corefonts fira-code fira-code-symbols google-fonts diff --git a/modules/printing/default.nix b/modules/printing/default.nix index ea9ce166..4688c842 100644 --- a/modules/printing/default.nix +++ b/modules/printing/default.nix @@ -21,10 +21,6 @@ in services.printing.defaultShared = false; services.printing.drivers = [ pkgs.gutenprint - pkgs.brgenml1lpr - pkgs.brgenml1cupswrapper - pkgs.brlaser - pkgs.cups-brother-hl3140cw ]; hardware.sane = { enable = true; -- 2.44.1 From c2c9a65fc4403c200621693681ebd11e5b2051f5 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 14:21:11 +0200 Subject: [PATCH 048/111] devos: move common overlays to sharedOverlays for fup passthrough See: https://github.com/divnix/digga/commit/89d9b3ea97decc70598e1c26f0cf963edec8d0dd --- flake.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 7d43b67c..5bb7a948 100644 --- a/flake.nix +++ b/flake.nix @@ -73,11 +73,7 @@ channels = { nixos = { imports = [ (digga.lib.importOverlays ./overlays) ]; - overlays = [ - nur.overlay - agenix.overlay - ./pkgs/default.nix - ]; + overlays = [ ]; }; latest = { }; }; @@ -91,6 +87,10 @@ our = self.lib; }); }) + nur.overlay + agenix.overlay + + (import ./pkgs) ]; nixos = { -- 2.44.1 From 2f9225457c566fb6bd52653e3f5dfcb837e16d89 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 14:40:44 +0200 Subject: [PATCH 049/111] readme: ARM -> aarch64 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f655075c..18b1aebf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Welcome to PubSolarOS, a very opiniated Linux (NixOS) distribution for the nerdy We're creating this distribution for our own personal use and fun, but take pride in our craft. As of 14.08.22 it's running on 14 physical devices, -both `x86_64` and `ARM`. +both `x86_64` and `aarch64`. At its core, it's a NixOS installation running our configuration. The UX decisions and the way the project is structured are what make it -- 2.44.1 From 99d5e53ec8ef2e48f575922721726e7519568380 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 14:41:20 +0200 Subject: [PATCH 050/111] readme: add link to https://ci.b12f.io --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18b1aebf..31e84212 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ _PubSolarOS_: as much non-free software as you like. * Automation is better. The reproducibility of nix feels so much more powerful once you're deploying your new configuration from your laptop - to all your other devices with one command. We've automated CI (WIP). + to all your other devices with one command. [We have an automated CI using drone](https://ci.b12f.io/pub-solar/os). * Community is important. We just like working on this together, and it feels really good to see our progress at the end of a [hakken.irl](https://pub.solar/hakken) session. -- 2.44.1 From 4190818304cc2e2f23c97f9fc42eea1fd92dfee3 Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 13 Aug 2022 22:59:05 +0200 Subject: [PATCH 051/111] Rework of x-os module / core profile * move core settings to x-os * add option to only install a lite core * rename x-os module to core * remove core profile from flake.nix --- flake.nix | 4 +- modules/{x-os => core}/boot.nix | 6 +-- modules/core/default.nix | 30 +++++++++++ modules/{x-os => core}/fonts.nix | 0 modules/{x-os => core}/i18n.nix | 0 modules/core/modules.nix | 11 ++++ modules/{x-os => core}/networking.nix | 4 +- modules/{x-os => core}/nix.nix | 0 modules/core/packages.nix | 76 +++++++++++++++++++++++++++ modules/{x-os => core}/services.nix | 1 - modules/x-os/default.nix | 10 ---- profiles/core/default.nix | 75 -------------------------- profiles/pub-solar-iso/default.nix | 2 +- 13 files changed, 125 insertions(+), 94 deletions(-) rename modules/{x-os => core}/boot.nix (85%) create mode 100644 modules/core/default.nix rename modules/{x-os => core}/fonts.nix (100%) rename modules/{x-os => core}/i18n.nix (100%) create mode 100644 modules/core/modules.nix rename modules/{x-os => core}/networking.nix (95%) rename modules/{x-os => core}/nix.nix (100%) create mode 100644 modules/core/packages.nix rename modules/{x-os => core}/services.nix (99%) delete mode 100644 modules/x-os/default.nix delete mode 100644 profiles/core/default.nix diff --git a/flake.nix b/flake.nix index 7d43b67c..0c8a1c92 100644 --- a/flake.nix +++ b/flake.nix @@ -118,9 +118,9 @@ users = digga.lib.rakeLeaves ./users; }; suites = with profiles; rec { - base = [ core users.pub-solar users.root ]; + base = [ users.pub-solar users.root ]; iso = base ++ [ base-user graphical pub-solar-iso ]; - pubsolaros = [ core dram full-install base-user users.root ]; + pubsolaros = [ dram full-install base-user users.root ]; anonymous = [ pubsolaros users.pub-solar ]; }; }; diff --git a/modules/x-os/boot.nix b/modules/core/boot.nix similarity index 85% rename from modules/x-os/boot.nix rename to modules/core/boot.nix index dd788d26..9e9af88e 100644 --- a/modules/x-os/boot.nix +++ b/modules/core/boot.nix @@ -1,15 +1,15 @@ { config, pkgs, lib, ... }: with lib; let - cfg = config.pub-solar.x-os; + cfg = config.pub-solar.core; in { - options.pub-solar.x-os.iso-options.enable = mkOption { + options.pub-solar.core.iso-options.enable = mkOption { type = types.bool; default = false; description = "Feature flag for iso builds"; }; - options.pub-solar.x-os.disk-encryption-active = mkOption { + 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"; diff --git a/modules/core/default.nix b/modules/core/default.nix new file mode 100644 index 00000000..dae70e79 --- /dev/null +++ b/modules/core/default.nix @@ -0,0 +1,30 @@ +{ lib, ... }: + +with lib; +let + psCfg = config.pub-solar; + cfg = config.pub-solar.core; +in +{ + imports = [ + ./boot.nix + ./fonts.nix + ./i18n.nix + ./modules.nix + ./networking.nix + ./nix.nix + ./packages.nix + ./services.nix + ]; + + options.pub-solar.core = { + lite-core-active = mkOption { + description = '' + Whether the node should run as a server or agent. + Note that the server, by default, also runs as an agent. + ''; + default = false; + type = types.bool; + }; + }; +} diff --git a/modules/x-os/fonts.nix b/modules/core/fonts.nix similarity index 100% rename from modules/x-os/fonts.nix rename to modules/core/fonts.nix diff --git a/modules/x-os/i18n.nix b/modules/core/i18n.nix similarity index 100% rename from modules/x-os/i18n.nix rename to modules/core/i18n.nix diff --git a/modules/core/modules.nix b/modules/core/modules.nix new file mode 100644 index 00000000..b55281eb --- /dev/null +++ b/modules/core/modules.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.pub-solar.core; +in +{ + pub-solar.terminal-life.enable = lib.mkIf (!cfg.lite-core-active) true; + pub-solar.audio.enable = lib.mkIf (!cfg.lite-core-active) true; + pub-solar.crypto.enable = lib.mkIf (!cfg.lite-core-active) true; + pub-solar.devops.enable = lib.mkIf (!cfg.lite-core-active) true; +} diff --git a/modules/x-os/networking.nix b/modules/core/networking.nix similarity index 95% rename from modules/x-os/networking.nix rename to modules/core/networking.nix index 347fe750..ce3248d8 100644 --- a/modules/x-os/networking.nix +++ b/modules/core/networking.nix @@ -2,10 +2,10 @@ with lib; -let cfg = config.pub-solar.x-os; +let cfg = config.pub-solar.core; in { - options.pub-solar.x-os = { + options.pub-solar.core = { binaryCaches = mkOption { type = types.listOf types.str; default = [ ]; diff --git a/modules/x-os/nix.nix b/modules/core/nix.nix similarity index 100% rename from modules/x-os/nix.nix rename to modules/core/nix.nix diff --git a/modules/core/packages.nix b/modules/core/packages.nix new file mode 100644 index 00000000..07263245 --- /dev/null +++ b/modules/core/packages.nix @@ -0,0 +1,76 @@ +{ 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 + + wget + openssl + openssh + curl + htop + lsof + psmisc + file + ] + + ++ lib.optionals (!cfg.lite-core-active) [ + mtr + + gitFull + git-lfs + git-bug + + xdg-utils + sysfsutils + renameutils + nfs-utils + moreutils + mailutils + keyutils + input-utils + elfutils + binutils + dateutils + diffutils + findutils + exfat + + + # zippit + zip + unzip + + # Modern modern utilities + p7zip + croc + jq + + # Nix specific utilities + niv + manix + nix-index + nix-tree + nixpkgs-review + # Build broken, python2.7-PyJWT-2.0.1.drv' failed + #nixops + psos + nvd + + # Fun + neofetch + ]; + }; +} diff --git a/modules/x-os/services.nix b/modules/core/services.nix similarity index 99% rename from modules/x-os/services.nix rename to modules/core/services.nix index 98a058a3..61ba6ea0 100644 --- a/modules/x-os/services.nix +++ b/modules/core/services.nix @@ -1,7 +1,6 @@ { config, pkgs, lib, ... }: { - # For rage encryption, all hosts need a ssh key pair services.openssh = { enable = true; diff --git a/modules/x-os/default.nix b/modules/x-os/default.nix deleted file mode 100644 index 0fd734f3..00000000 --- a/modules/x-os/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: { - imports = [ - ./boot.nix - ./fonts.nix - ./i18n.nix - ./networking.nix - ./nix.nix - ./services.nix - ]; -} diff --git a/profiles/core/default.nix b/profiles/core/default.nix deleted file mode 100644 index b35fb673..00000000 --- a/profiles/core/default.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ self, config, lib, pkgs, inputs, ... }: -let inherit (lib) fileContents; -in -{ - # Sets nrdxp.cachix.org binary cache which just speeds up some builds - imports = [ ../cachix ]; - - config = { - pub-solar.terminal-life.enable = true; - pub-solar.audio.enable = true; - pub-solar.crypto.enable = true; - pub-solar.devops.enable = true; - - environment = { - systemPackages = with pkgs; [ - # Core unix utility packages - coreutils-full - progress - dnsutils - inetutils - mtr - pciutils - usbutils - gitFull - git-lfs - git-bug - wget - openssl - openssh - curl - htop - lsof - psmisc - xdg-utils - sysfsutils - renameutils - nfs-utils - moreutils - mailutils - keyutils - input-utils - elfutils - binutils - dateutils - diffutils - findutils - exfat - file - - # zippit - zip - unzip - - # Modern modern utilities - p7zip - croc - jq - - # Nix specific utilities - niv - manix - nix-index - nix-tree - nixpkgs-review - # Build broken, python2.7-PyJWT-2.0.1.drv' failed - #nixops - psos - nvd - - # Fun - neofetch - ]; - }; - }; -} diff --git a/profiles/pub-solar-iso/default.nix b/profiles/pub-solar-iso/default.nix index 24b5e1b3..4aa8c6fd 100644 --- a/profiles/pub-solar-iso/default.nix +++ b/profiles/pub-solar-iso/default.nix @@ -6,6 +6,6 @@ in config = { pub-solar.graphical.wayland.software-renderer.enable = true; pub-solar.sway.terminal = "foot"; - pub-solar.x-os.iso-options.enable = true; + pub-solar.core.iso-options.enable = true; }; } -- 2.44.1 From 7785744d73b8a60ae8376ddb1e9bcce7fe0daf6b Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sun, 14 Aug 2022 15:11:01 +0200 Subject: [PATCH 052/111] Move some packages from full to default set, move options for modules to default.nix --- modules/core/default.nix | 10 +++++++--- modules/core/modules.nix | 11 ----------- modules/core/packages.nix | 21 ++++++++++----------- 3 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 modules/core/modules.nix diff --git a/modules/core/default.nix b/modules/core/default.nix index dae70e79..8aec7846 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -17,11 +17,15 @@ in ./services.nix ]; + pub-solar.terminal-life.enable = true; + pub-solar.audio.enable = lib.mkIf (!cfg.lite) true; + pub-solar.crypto.enable = lib.mkIf (!cfg.lite) true; + pub-solar.devops.enable = lib.mkIf (!cfg.lite) true; + options.pub-solar.core = { - lite-core-active = mkOption { + lite = mkOption { description = '' - Whether the node should run as a server or agent. - Note that the server, by default, also runs as an agent. + Enable a lite edition of core with less default modules and a reduced package set. ''; default = false; type = types.bool; diff --git a/modules/core/modules.nix b/modules/core/modules.nix deleted file mode 100644 index b55281eb..00000000 --- a/modules/core/modules.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, lib, ... }: -with lib; -let - cfg = config.pub-solar.core; -in -{ - pub-solar.terminal-life.enable = lib.mkIf (!cfg.lite-core-active) true; - pub-solar.audio.enable = lib.mkIf (!cfg.lite-core-active) true; - pub-solar.crypto.enable = lib.mkIf (!cfg.lite-core-active) true; - pub-solar.devops.enable = lib.mkIf (!cfg.lite-core-active) true; -} diff --git a/modules/core/packages.nix b/modules/core/packages.nix index 07263245..f6867816 100644 --- a/modules/core/packages.nix +++ b/modules/core/packages.nix @@ -24,9 +24,18 @@ in lsof psmisc file + + # zippit + zip + unzip + + # Modern modern utilities + p7zip + croc + jq ] - ++ lib.optionals (!cfg.lite-core-active) [ + ++ lib.optionals (!cfg.lite) [ mtr gitFull @@ -48,16 +57,6 @@ in findutils exfat - - # zippit - zip - unzip - - # Modern modern utilities - p7zip - croc - jq - # Nix specific utilities niv manix -- 2.44.1 From bf581d1e9c19df13ff30ab7c0ff8330cefdd3626 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 14:23:37 +0200 Subject: [PATCH 053/111] nix-dram: remove nix-dram as default nix binary nix-dram as default nix binary isn't worth the maintenance work anymore, CI builds started failing because of it: https://ci.b12f.io/pub-solar/os/533/1/2 Automatic builds still happen each night and can be checked in our fork of nix-dram: https://github.com/pub-solar/nix-dram/actions Users of nix-dram can continue to use it via devshells or nix run github:dramforever/nix-dram -- --version --- flake.nix | 7 +------ modules/x-os/nix.nix | 2 -- overlays/overrides.nix | 1 + profiles/dram/default.nix | 5 ----- shell/devos.nix | 2 +- 5 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 profiles/dram/default.nix diff --git a/flake.nix b/flake.nix index 5bb7a948..4ed511d5 100644 --- a/flake.nix +++ b/flake.nix @@ -42,10 +42,6 @@ nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-generators.url = "github:nix-community/nixos-generators"; - - # PubSolarOS additions - nix-dram.url = "github:dramforever/nix-dram"; - nix-dram.inputs.nixpkgs.follows = "latest"; }; outputs = @@ -59,7 +55,6 @@ , agenix , nvfetcher , deploy - , nix-dram , ... } @ inputs: digga.lib.mkFlake @@ -120,7 +115,7 @@ suites = with profiles; rec { base = [ core users.pub-solar users.root ]; iso = base ++ [ base-user graphical pub-solar-iso ]; - pubsolaros = [ core dram full-install base-user users.root ]; + pubsolaros = [ core full-install base-user users.root ]; anonymous = [ pubsolaros users.pub-solar ]; }; }; diff --git a/modules/x-os/nix.nix b/modules/x-os/nix.nix index 56b677da..38b70cfc 100644 --- a/modules/x-os/nix.nix +++ b/modules/x-os/nix.nix @@ -18,8 +18,6 @@ keep-outputs = true keep-derivations = true fallback = true - # used by nix-dram - default-flake = flake:nixpkgs ''; }; } diff --git a/overlays/overrides.nix b/overlays/overrides.nix index df75736d..fd0b836f 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -13,6 +13,7 @@ channels: final: prev: { signal-desktop starship deploy-rs + nix tdesktop arduino diff --git a/profiles/dram/default.nix b/profiles/dram/default.nix deleted file mode 100644 index 0b7fc3ee..00000000 --- a/profiles/dram/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ self, config, lib, pkgs, inputs, ... }: - -{ - nix.package = inputs.nix-dram.packages.${pkgs.system}.nix-dram; -} diff --git a/shell/devos.nix b/shell/devos.nix index f799ca03..2198052f 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -34,7 +34,7 @@ in ''); commands = with pkgs; [ - (devos nixUnstable) + (devos nix) (devos agenix) { category = "devos"; -- 2.44.1 From 9d25b3ee9b3c4a6198c20361ebb488260cf4b92e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 14:24:53 +0200 Subject: [PATCH 054/111] Fix build of rnix-lsp for nix verion 2.10+ This fix didn't land in a released tag of rnix-lsp yet. Build it from the master branch until next release Upstream PR: https://github.com/nix-community/rnix-lsp/pull/94 Also bump flake.lock --- flake.lock | 45 ++++--------------------------------------- overlays/rnix-lsp.nix | 18 +++++++++++++++++ 2 files changed, 22 insertions(+), 41 deletions(-) create mode 100644 overlays/rnix-lsp.nix diff --git a/flake.lock b/flake.lock index f6a8edfc..2e4bdbcd 100644 --- a/flake.lock +++ b/flake.lock @@ -314,21 +314,6 @@ } }, "flake-utils_4": { - "locked": { - "lastModified": 1656928814, - "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { "locked": { "lastModified": 1649676176, "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", @@ -416,27 +401,6 @@ "type": "github" } }, - "nix-dram": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": [ - "latest" - ] - }, - "locked": { - "lastModified": 1660180791, - "narHash": "sha256-oPO+keK4S9daL9ubU51hZ+QOWVSMbZ56F20iFI9Px3s=", - "owner": "dramforever", - "repo": "nix-dram", - "rev": "ae7f0b7c5d39eec5941fe21e9f202106bdea9ac2", - "type": "github" - }, - "original": { - "owner": "dramforever", - "repo": "nix-dram", - "type": "github" - } - }, "nixlib": { "locked": { "lastModified": 1636849918, @@ -489,11 +453,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1660291411, - "narHash": "sha256-9UfJMJeCl+T/DrOJMd1vLCoV8U3V7f9Qrv/QyH0Nn28=", + "lastModified": 1660407119, + "narHash": "sha256-04lWO0pDbhAXFdL4v2VzzwgxrZ5IefKn+TmZPiPeKxg=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "78f56d8ec2c67a1f80f2de649ca9aadc284f65b6", + "rev": "12620020f76b1b5d2b0e6fbbda831ed4f5fe56e1", "type": "github" }, "original": { @@ -565,7 +529,7 @@ "nvfetcher": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixos" ] @@ -621,7 +585,6 @@ "home": "home", "latest": "latest_2", "naersk": "naersk", - "nix-dram": "nix-dram", "nixos": "nixos", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", diff --git a/overlays/rnix-lsp.nix b/overlays/rnix-lsp.nix new file mode 100644 index 00000000..62c0f2b0 --- /dev/null +++ b/overlays/rnix-lsp.nix @@ -0,0 +1,18 @@ +final: prev: { + rnix-lsp = prev.rnix-lsp.overrideAttrs (oldAttrs: rec { + version = "unstable-2022-07-28"; + + src = prev.fetchFromGitHub { + owner = "nix-community"; + repo = "rnix-lsp"; + rev = "ff18e04551a39ccdab0ff9c83926db3807b23478"; + sha256 = "sha256-4OIpATLdPQvryyhRQPELeqNYC0n6PCyjD6LCPdwOztc="; + }; + + cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const { + name = "rnix-lsp-vendor.tar.gz"; + inherit src; + outputHash = "sha256-SroynaHaFpvKlMSEagoGQhZcY7A0tE4xTbUXYFcneo8="; + }); + }); +} -- 2.44.1 From c43b96c4d5f61cf07aa1a83b2cf753f0e95a3276 Mon Sep 17 00:00:00 2001 From: hensoko Date: Sun, 14 Aug 2022 13:54:19 +0000 Subject: [PATCH 055/111] Fix core module (#116) Co-authored-by: Hendrik Sokolowski Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/116 Reviewed-by: teutat3s --- hosts/bootstrap.nix | 1 - modules/core/default.nix | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix index acadc449..541ca6fb 100644 --- a/hosts/bootstrap.nix +++ b/hosts/bootstrap.nix @@ -6,7 +6,6 @@ # interface that has the local link to the target machine imports = [ # profiles.networking - profiles.core profiles.users.root # make sure to configure ssh keys profiles.users.pub-solar profiles.base-user diff --git a/modules/core/default.nix b/modules/core/default.nix index 8aec7846..c7457c1b 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ config, lib, ... }: with lib; let @@ -10,18 +10,12 @@ in ./boot.nix ./fonts.nix ./i18n.nix - ./modules.nix ./networking.nix ./nix.nix ./packages.nix ./services.nix ]; - pub-solar.terminal-life.enable = true; - pub-solar.audio.enable = lib.mkIf (!cfg.lite) true; - pub-solar.crypto.enable = lib.mkIf (!cfg.lite) true; - pub-solar.devops.enable = lib.mkIf (!cfg.lite) true; - options.pub-solar.core = { lite = mkOption { description = '' @@ -31,4 +25,13 @@ in type = types.bool; }; }; + + config = { + pub-solar = { + terminal-life.enable = true; + audio.enable = lib.mkIf (!cfg.lite) true; + crypto.enable = lib.mkIf (!cfg.lite) true; + devops.enable = lib.mkIf (!cfg.lite) true; + }; + }; } -- 2.44.1 From 4c0991c7e1a7670526ec2331c0def1a5ae46e918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 17:10:30 +0200 Subject: [PATCH 056/111] Put always hibernate behind a flag Hibernation is now a core option: ``` pub-solar.core.hibernation.enable = true; ``` And there's a paranoia mode, that keeps the disk encrypted as much as possible by enabling hibernation and removing the options for sleep, screen locking. Idle locking now hibernates, and it does it on very short notice. --- modules/core/boot.nix | 10 ++++- modules/paranoia/default.nix | 24 +++++++++++ .../config/config.d/custom-keybindings.conf | 19 --------- .../sway/config/config.d/mode_system.conf.nix | 21 ++++++++++ modules/sway/default.nix | 40 ++++++++++--------- modules/sway/gammastep.service.nix | 2 +- modules/sway/libinput-gestures.service.nix | 2 +- modules/sway/mako.service.nix | 2 +- modules/sway/sway-session.target.nix | 2 +- modules/sway/sway.service.nix | 2 +- modules/sway/swayidle.service.nix | 15 +++++-- modules/sway/waybar.service.nix | 2 +- modules/sway/xsettingsd.service.nix | 2 +- modules/sway/ydotool.service.nix | 2 +- pkgs/default.nix | 1 + pkgs/swaylock-bg.nix | 20 ++++++++++ 16 files changed, 115 insertions(+), 51 deletions(-) create mode 100644 modules/paranoia/default.nix create mode 100644 modules/sway/config/config.d/mode_system.conf.nix create mode 100644 pkgs/swaylock-bg.nix diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 99b6d76c..6f93fabf 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -16,6 +16,14 @@ in description = "Whether it should be assumed that there is a cryptroot device"; }; + options.pub-solar.core.hibernation = { + enable = mkOption { + type = types.bool; + default = false; + description = "Whether the device can hibernate. This creates a swapfile at /swapfile."; + }; + }; + config = { boot = { # Enable plymouth for better experience of booting @@ -30,7 +38,7 @@ in }; }; - resumeDevice = "/swapfile"; + resumeDevice = mkIf cfg.core.hibernation.enable "/swapfile"; loader.systemd-boot.enable = true; diff --git a/modules/paranoia/default.nix b/modules/paranoia/default.nix new file mode 100644 index 00000000..ec530fc3 --- /dev/null +++ b/modules/paranoia/default.nix @@ -0,0 +1,24 @@ +{ config, lib, ... }: + +with lib; +let + psCfg = config.pub-solar; + cfg = config.pub-solar.paranoia; +in +{ + options.pub-solar.paranoia = { + enable = mkOption { + description = '' + Only offer hibernation instead of screen locking and sleeping. This only makes sense + if your hard drive is encrypted, and ensures that the contents of your drive are + encrypted if you are not actively using the device. + ''; + default = false; + type = types.bool; + }; + }; + + config = mkIf cfg.enable { + pub-solar.core.allow-hibernation = true; + }; +} diff --git a/modules/sway/config/config.d/custom-keybindings.conf b/modules/sway/config/config.d/custom-keybindings.conf index fdeac97a..659a4660 100644 --- a/modules/sway/config/config.d/custom-keybindings.conf +++ b/modules/sway/config/config.d/custom-keybindings.conf @@ -31,22 +31,3 @@ bindsym $mod+Ctrl+f exec "( pkill flameshot || true && flameshot & ) && ( sleep # Launcher set $menu exec alacritty --class launcher -e env TERMINAL_COMMAND="alacritty -e" sway-launcher bindsym $mod+Space exec $menu - -# Set shut down, restart and locking features -set $mode_system (e)xit, (h)ibernate, (r)eboot, (Shift+s)hutdown -bindsym $mod+0 mode "$mode_system" -mode "$mode_system" { - bindsym e exec swaymsg exit, mode "default" -#======= - bindsym l exec swaylock-bg, mode "default" - bindsym e exec systemctl --user stop graphical-session.target, mode "default" - bindsym s exec systemctl suspend, mode "default" -#>>>>>>> main - bindsym h exec systemctl hibernate, 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/sway/config/config.d/mode_system.conf.nix b/modules/sway/config/config.d/mode_system.conf.nix new file mode 100644 index 00000000..ef11a461 --- /dev/null +++ b/modules/sway/config/config.d/mode_system.conf.nix @@ -0,0 +1,21 @@ +{ psCfg, ... }: '' +# Set shut down, restart and locking features +set $mode_system (e)xit, (h)ibernate, (r)eboot, (Shift+s)hutdown +bindsym $mod+0 mode "$mode_system" +mode "$mode_system" { + bindsym e exec swaymsg exit, mode "default" +'' + (if !psCfg.core.allow-hibernation then '' + bindsym h exec systemctl hibernate, mode "default" +'' else "") + + (if !psCfg.paranoia.enable then '' + bindsym l exec swaylock-bg, mode "default" + bindsym s exec systemctl suspend, mode "default" +'' else "") + '' + 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/sway/default.nix b/modules/sway/default.nix index 59b6ff09..2872a3b3 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -2,25 +2,26 @@ with lib; let psCfg = config.pub-solar; - cfg = config.pub-solar.sway; in { options.pub-solar.sway = { enable = mkEnableOption "Life in boxes"; - }; - options.pub-solar.sway.terminal = mkOption { - type = types.nullOr types.str; - default = "alacritty"; - description = "Choose sway's default terminal"; - }; - options.pub-solar.sway.v4l2loopback.enable = mkOption { - type = types.bool; - default = true; - description = "WebCam streaming tool"; + + terminal = mkOption { + type = types.nullOr types.str; + default = "alacritty"; + description = "Choose sway's default terminal"; + }; + + v4l2loopback.enable = mkOption { + type = types.bool; + default = true; + description = "WebCam streaming tool"; + }; }; - config = mkIf cfg.enable (mkMerge [ - (mkIf (cfg.v4l2loopback.enable) { + config = mkIf psCfg.sway.enable (mkMerge [ + (mkIf (psCfg.sway.v4l2loopback.enable) { boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; boot.kernelModules = [ "v4l2loopback" ]; boot.extraModprobeConfig = '' @@ -84,18 +85,19 @@ in programs.waybar.enable = true; #programs.waybar.systemd.enable = true; - systemd.user.services.mako = import ./mako.service.nix pkgs; - systemd.user.services.sway = import ./sway.service.nix pkgs; - systemd.user.services.swayidle = import ./swayidle.service.nix pkgs; - systemd.user.services.xsettingsd = import ./xsettingsd.service.nix pkgs; - systemd.user.services.waybar = import ./waybar.service.nix pkgs; - systemd.user.targets.sway-session = import ./sway-session.target.nix pkgs; + systemd.user.services.mako = import ./mako.service.nix { inherit pkgs psCfg; }; + 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.config.nix { inherit 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/sway/gammastep.service.nix b/modules/sway/gammastep.service.nix index f59edf02..3960d1ae 100644 --- a/modules/sway/gammastep.service.nix +++ b/modules/sway/gammastep.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "set color temperature of display according to time of day"; diff --git a/modules/sway/libinput-gestures.service.nix b/modules/sway/libinput-gestures.service.nix index c4c860da..798d10d6 100644 --- a/modules/sway/libinput-gestures.service.nix +++ b/modules/sway/libinput-gestures.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "Actions gestures on your touchpad using libinput"; diff --git a/modules/sway/mako.service.nix b/modules/sway/mako.service.nix index 190b986d..b155e148 100644 --- a/modules/sway/mako.service.nix +++ b/modules/sway/mako.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "Lightweight Wayland notification daemon"; diff --git a/modules/sway/sway-session.target.nix b/modules/sway/sway-session.target.nix index 3eb4d24c..7b25376a 100644 --- a/modules/sway/sway-session.target.nix +++ b/modules/sway/sway-session.target.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "sway compositor session"; diff --git a/modules/sway/sway.service.nix b/modules/sway/sway.service.nix index 95efc3e6..0d0d782c 100644 --- a/modules/sway/sway.service.nix +++ b/modules/sway/sway.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "sway - SirCmpwn's Wayland window manager"; diff --git a/modules/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index 61f32591..3b87c610 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, psCfg, ... }: { Unit = { Description = "Idle manager for Wayland"; @@ -10,9 +10,16 @@ pkgs: Service = { Type = "simple"; Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin"; - ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ - timeout 150 'swaymsg "output * dpms off"' \ - timeout 300 'systemctl hibernate' \ + ExecStart = if psCfg.paranoia.enable then '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 120 'swaymsg "output * dpms off"' \ + timeout 150 'systemctl hibernate' \ + '' else '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 600 'swaylock-bg' \ + timeout 900 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock-bg' ''; }; Install = { diff --git a/modules/sway/waybar.service.nix b/modules/sway/waybar.service.nix index ee5e8938..98b8ed35 100644 --- a/modules/sway/waybar.service.nix +++ b/modules/sway/waybar.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors."; diff --git a/modules/sway/xsettingsd.service.nix b/modules/sway/xsettingsd.service.nix index 0d729cb2..db3e842c 100644 --- a/modules/sway/xsettingsd.service.nix +++ b/modules/sway/xsettingsd.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "X Settings Daemon"; diff --git a/modules/sway/ydotool.service.nix b/modules/sway/ydotool.service.nix index d53bfcd7..24b64432 100644 --- a/modules/sway/ydotool.service.nix +++ b/modules/sway/ydotool.service.nix @@ -1,4 +1,4 @@ -pkgs: +{ pkgs, ... }: { Unit = { Description = "ydotool - Generic command-line automation tool (no X!)"; diff --git a/pkgs/default.nix b/pkgs/default.nix index 1b04f378..28e513b7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -12,6 +12,7 @@ with 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); diff --git a/pkgs/swaylock-bg.nix b/pkgs/swaylock-bg.nix new file mode 100644 index 00000000..b55c32ae --- /dev/null +++ b/pkgs/swaylock-bg.nix @@ -0,0 +1,20 @@ +self: with self; '' + # Dependencies: + # swaylock + + # Make sure we aren't running twice + RUNNING=$(ps -A | grep swaylock | wc -l) + 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 -r '.[].name'` + do + LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}" + IMAGES="''${IMAGES} ''${IMAGE}" + done + exec ${swaylock}/bin/swaylock $LOCKARGS +'' -- 2.44.1 From 762e78677b39b722dbd12990025d9d3b5e943df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 17:15:50 +0200 Subject: [PATCH 057/111] Fix hibernation enabling in paranoia mode --- modules/paranoia/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/paranoia/default.nix b/modules/paranoia/default.nix index ec530fc3..19c470ad 100644 --- a/modules/paranoia/default.nix +++ b/modules/paranoia/default.nix @@ -19,6 +19,6 @@ in }; config = mkIf cfg.enable { - pub-solar.core.allow-hibernation = true; + pub-solar.core.hibernate.enable = true; }; } -- 2.44.1 From 1c015508e1f38551977e36ade2c3b21697cc8521 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 13 Aug 2022 21:34:46 +0200 Subject: [PATCH 058/111] tree: remove bud and all mentions of it Include upstream update doc updates --- doc/CONTRIBUTING.md | 17 +-- doc/SUMMARY.md | 11 +- doc/api-reference-channels.md | 91 +++++++++++++ doc/api-reference-devshell.md | 72 +++++++++++ doc/api-reference-home.md | 119 +++++++++++++++++ doc/api-reference-nixos.md | 234 ++++++++++++++++++++++++++++++++++ doc/api-reference.md | 80 ++++++++++++ doc/bud/get.md | 10 -- doc/bud/index.md | 24 ---- doc/concepts/users.md | 13 +- doc/start/bootstrapping.md | 102 --------------- doc/start/from-nixos.md | 51 -------- doc/start/index.md | 37 ++++-- doc/start/iso.md | 40 ++++-- flake.lock | 128 ++----------------- flake.nix | 6 - hosts/bootstrap.nix | 2 +- shell/default.nix | 1 - 18 files changed, 678 insertions(+), 360 deletions(-) create mode 100755 doc/api-reference-channels.md create mode 100755 doc/api-reference-devshell.md create mode 100755 doc/api-reference-home.md create mode 100755 doc/api-reference-nixos.md create mode 100755 doc/api-reference.md delete mode 100644 doc/bud/get.md delete mode 100644 doc/bud/index.md delete mode 100644 doc/start/bootstrapping.md delete mode 100644 doc/start/from-nixos.md diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index 86f5dd70..e3af7e20 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -1,18 +1,13 @@ -# Pull Requests - -## TL;DR; +# TL;DR; - **Target Branch**: `main` -- **Merge Policy**: [`bors`][bors] is always right (→ `bors try`) -- **Docs**: every changeset is expected to contain doc updates +- **Merge Policy**: green check: merge away. yellow circle: have patience. red x: try again. +- **Docs**: every change set is expected to contain doc updates - **Commit Msg**: be a poet! Comprehensive and explanatory commit messages should cover the motivation and use case in an easily understandable manner even when read after a few months. -- **Test Driven Development**: please default to test driven development where possible. +- **Test Driven Development**: please default to test driven development you can + make use of the `./examples` & `./e2e` and wire test up in the devshell. ### Within the Devshell (`nix develop`) - **Hooks**: please `git commit` within the devshell -- **Fail Early**: please run from within the devshell on your local machine: - - `nix flake check` - -[bors]: https://bors.tech - +- **Fail Early**: please run `check-all` from within the devshell on your local machine diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md index 1d7bafe9..09d2d626 100644 --- a/doc/SUMMARY.md +++ b/doc/SUMMARY.md @@ -3,8 +3,6 @@ - [Introduction](../README.md) - [Quick Start](./start/index.md) - [ISO](./start/iso.md) - - [Bootstrapping](./start/bootstrapping.md) - - [From NixOS](./start/from-nixos.md) - [Key Concepts](./concepts/index.md) - [Hosts](./concepts/hosts.md) - [Overrides](./concepts/overrides.md) @@ -18,11 +16,16 @@ - [Concerns]() - [Secrets](./secrets.md) - [Tests](./tests.md) -- [Helper Script – `bud`](./bud/index.md) - - [get](./bud/get.md) - [Integrations](./integrations/index.md) - [Cachix](./integrations/cachix.md) - [Deploy RS](./integrations/deploy.md) - [NvFetcher](./integrations/nvfetcher.md) - [Hercules CI](./integrations/hercules.md) +- [API Reference](./api-reference.md) + - [Channels](./api-reference-channels.md) + - [Home](./api-reference-home.md) + - [Devshell](./api-reference-devshell.md) + - [NixOS](./api-reference-nixos.md) +- [Library Reference]() - [Contributing](./CONTRIBUTING.md) + diff --git a/doc/api-reference-channels.md b/doc/api-reference-channels.md new file mode 100755 index 00000000..533e6e91 --- /dev/null +++ b/doc/api-reference-channels.md @@ -0,0 +1,91 @@ +# Channels API Container +Configure your channels that you can use throughout your configurations. + +> #### ⚠ Gotcha ⚠ +> Devshell & (non-host-specific) Home-Manager `pkgs` instances are rendered off the +> `nixos.hostDefaults.channelName` (default) channel. + + +## channels +nixpkgs channels to create + + +*_Type_*: +attribute set of submodules or path convertible to it + + +*_Default_* +``` +{} +``` + + + + +## channels.\.config +nixpkgs config for this channel + + +*_Type_*: +attribute set or path convertible to it + + +*_Default_* +``` +{} +``` + + + + +## channels.\.input +nixpkgs flake input to use for this channel + + +*_Type_*: +nix flake + + +*_Default_* +``` +"self.inputs." +``` + + + + +## channels.\.overlays +overlays to apply to this channel +these will get exported under the 'overlays' flake output +as \/\ and any overlay pulled from \ +will be filtered out + + +*_Type_*: +list of valid Nixpkgs overlay or path convertible to its or anything convertible to it or path convertible to it + + +*_Default_* +``` +[] +``` + + + + +## channels.\.patches +patches to apply to this channel + + +*_Type_*: +list of paths + + +*_Default_* +``` +[] +``` + + + + diff --git a/doc/api-reference-devshell.md b/doc/api-reference-devshell.md new file mode 100755 index 00000000..28f18087 --- /dev/null +++ b/doc/api-reference-devshell.md @@ -0,0 +1,72 @@ +# Devshell API Container +Configure your devshell module collections of your environment. + + +## devshell +Modules to include in your DevOS shell. the `modules` argument +will be exported under the `devshellModules` output + + +*_Type_*: +submodule or path convertible to it + + +*_Default_* +``` +{} +``` + + + + +## devshell.exportedModules +modules to include in all hosts and export to devshellModules output + + +*_Type_*: +list of valid module or path convertible to its or anything convertible to it + + +*_Default_* +``` +[] +``` + + + + +## devshell.externalModules +The `externalModules` option has been removed. +Any modules that should be exported should be defined with the `exportedModules` +option and all other modules should just go into the `modules` option. + + +*_Type_*: +list of valid modules or anything convertible to it + + +*_Default_* +``` +[] +``` + + + + +## devshell.modules +modules to include that won't be exported +meant importing modules from external flakes + + +*_Type_*: +list of valid modules or anything convertible to it or path convertible to it + + +*_Default_* +``` +[] +``` + + + + diff --git a/doc/api-reference-home.md b/doc/api-reference-home.md new file mode 100755 index 00000000..0ab62f36 --- /dev/null +++ b/doc/api-reference-home.md @@ -0,0 +1,119 @@ +# Home-Manager API Container +Configure your home manager modules, profiles & suites. + + +## home +hosts, modules, suites, and profiles for home-manager + + +*_Type_*: +submodule or path convertible to it + + +*_Default_* +``` +{} +``` + + + + +## home.exportedModules +modules to include in all hosts and export to homeModules output + + +*_Type_*: +list of valid modules or anything convertible to it or path convertible to it + + +*_Default_* +``` +[] +``` + + + + +## home.externalModules +The `externalModules` option has been removed. +Any modules that should be exported should be defined with the `exportedModules` +option and all other modules should just go into the `modules` option. + + +*_Type_*: +list of valid modules or anything convertible to it + + +*_Default_* +``` +[] +``` + + + + +## home.importables +Packages of paths to be passed to modules as `specialArgs`. + + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## home.importables.suites +collections of profiles + + +*_Type_*: +null or attribute set of list of paths or anything convertible to its or path convertible to it + + +*_Default_* +``` +null +``` + + + + +## home.modules +modules to include that won't be exported +meant importing modules from external flakes + + +*_Type_*: +list of valid modules or anything convertible to it or path convertible to it + + +*_Default_* +``` +[] +``` + + + + +## home.users +HM users that can be deployed portably without a host. + + +*_Type_*: +attribute set of HM user configs + + +*_Default_* +``` +{} +``` + + + + diff --git a/doc/api-reference-nixos.md b/doc/api-reference-nixos.md new file mode 100755 index 00000000..7428b161 --- /dev/null +++ b/doc/api-reference-nixos.md @@ -0,0 +1,234 @@ +# NixOS API Container +Configure your nixos modules, profiles & suites. + + +## nixos +hosts, modules, suites, and profiles for NixOS + + +*_Type_*: +submodule or path convertible to it + + +*_Default_* +``` +{} +``` + + + + +## nixos.hostDefaults +Defaults for all hosts. +the modules passed under hostDefaults will be exported +to the 'nixosModules' flake output. +They will also be added to all hosts. + + +*_Type_*: +submodule + + +*_Default_* +``` +{} +``` + + + + +## nixos.hostDefaults.channelName +Channel this host should follow + + +*_Type_*: +channel defined in `channels` + + + + + + +## nixos.hostDefaults.exportedModules +modules to include in all hosts and export to nixosModules output + + +*_Type_*: +list of valid modules or anything convertible to it or path convertible to it + + +*_Default_* +``` +[] +``` + + + + +## nixos.hostDefaults.externalModules +The `externalModules` option has been removed. +Any modules that should be exported should be defined with the `exportedModules` +option and all other modules should just go into the `modules` option. + + +*_Type_*: +list of valid modules or anything convertible to it + + +*_Default_* +``` +[] +``` + + + + +## nixos.hostDefaults.modules +modules to include that won't be exported +meant importing modules from external flakes + + +*_Type_*: +list of valid modules or anything convertible to it or path convertible to it + + +*_Default_* +``` +[] +``` + + + + +## nixos.hostDefaults.system +system for this host + + +*_Type_*: +null or system defined in `supportedSystems` + + +*_Default_* +``` +null +``` + + + + +## nixos.hosts +configurations to include in the nixosConfigurations output + + +*_Type_*: +attribute set of submodules + + +*_Default_* +``` +{} +``` + + + + +## nixos.hosts.\.channelName +Channel this host should follow + + +*_Type_*: +null or channel defined in `channels` + + +*_Default_* +``` +null +``` + + + + +## nixos.hosts.\.modules +modules to include + + +*_Type_*: +list of valid modules or anything convertible to it or path convertible to it + + +*_Default_* +``` +[] +``` + + + + +## nixos.hosts.\.system +system for this host + + +*_Type_*: +null or system defined in `supportedSystems` + + +*_Default_* +``` +null +``` + + + + +## nixos.hosts.\.tests +tests to run + + +*_Type_*: +list of valid NixOS test or path convertible to its or anything convertible to it + + +*_Default_* +``` +[] +``` + + +*_Example_* +``` +{"_type":"literalExpression","text":"[\n {\n name = \"testname1\";\n machine = { ... };\n testScript = ''\n # ...\n '';\n }\n ({ corutils, writers, ... }: {\n name = \"testname2\";\n machine = { ... };\n testScript = ''\n # ...\n '';\n })\n ./path/to/test.nix\n];\n"} +``` + + +## nixos.importables +Packages of paths to be passed to modules as `specialArgs`. + + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## nixos.importables.suites +collections of profiles + + +*_Type_*: +null or attribute set of list of paths or anything convertible to its or path convertible to it + + +*_Default_* +``` +null +``` + + + + diff --git a/doc/api-reference.md b/doc/api-reference.md new file mode 100755 index 00000000..47eb1284 --- /dev/null +++ b/doc/api-reference.md @@ -0,0 +1,80 @@ +# Top Level API +`digga`'s top level API. API Containers are documented in their respective sub-chapter: + +- [Channels](./api-reference-channels.md) +- [Home](./api-reference-home.md) +- [Devshell](./api-reference-devshell.md) +- [NixOS](./api-reference-nixos.md) +- [Darwin](./api-reference-darwin.md) + +## channelsConfig +nixpkgs config for all channels + + +*_Type_*: +attribute set or path convertible to it + + +*_Default_* +``` +{} +``` + + + + +## inputs +The flake's inputs + +*_Type_*: +attribute set of nix flakes + + + + + + +## outputsBuilder +builder for flake system-spaced outputs +The builder gets passed an attrset of all channels + + +*_Type_*: +function that evaluates to a(n) attribute set or path convertible to it + + +*_Default_* +``` +"channels: { }" +``` + + + + +## self +The flake to create the DevOS outputs for + +*_Type_*: +nix flake + + + + + + +## supportedSystems +The systems supported by this flake + + +*_Type_*: +list of strings + + +*_Default_* +``` +["aarch64-linux","aarch64-darwin","i686-linux","x86_64-darwin","x86_64-linux"] +``` + + + + diff --git a/doc/bud/get.md b/doc/bud/get.md deleted file mode 100644 index 12263df0..00000000 --- a/doc/bud/get.md +++ /dev/null @@ -1,10 +0,0 @@ -# get -The `get` subcommand is useful for getting a bare copy of devos without the -git history. - -## Usage -```sh -bud get DEST-DIR -``` - -If DEST-DIR is ommitted, it defaults to _./devos_. diff --git a/doc/bud/index.md b/doc/bud/index.md deleted file mode 100644 index 7b985792..00000000 --- a/doc/bud/index.md +++ /dev/null @@ -1,24 +0,0 @@ -# [`bud`][bud] command -The template incudes a convenient script for managing your system called [`bud`][bud]. - -It is a portable and highly composable system control tool that work anywhere on your host -or in the flake's devshell. - -Although it comes with some predefined standard helpers, -it is very extensible and you are encouraged to write your own script snippets -to ease your workflows. An example is the bud module for a `get` command that -comes included with `devos`. - -While writing scripts you can convenientely access smart environment variables -that can tell the current architecture, user or host name, among others, regardless -wether you invoke `bud` within the devshell or as the system-wide installed `bud`. - -For details, please review the [bud repo][bud]. - -## Usage -```sh -bud help -``` - - -[bud]: https://github.com/divnix/bud diff --git a/doc/concepts/users.md b/doc/concepts/users.md index b2a6c2a3..b3454244 100644 --- a/doc/concepts/users.md +++ b/doc/concepts/users.md @@ -49,19 +49,18 @@ argument that gets passed to your home-manager users. ## External Usage You can easily use the defined home-manager configurations outside of NixOS -using the `homeConfigurations` flake output. The [bud](../bud/index.md) helper -script makes this even easier. +using the `homeConfigurations` flake output. -This is great for keeping your environment consistent across Unix systems, -including OSX. +This is great for keeping your environment consistent across Unix-like systems, +including macOS. ### From within the projects devshell: ```sh -# builds the nixos user defined in the NixOS host -bud home NixOS nixos +# builds the pub-solar user defined in the PubSolarOS host +nix build '.#homeConfigurations."pub-solar@PubSolarOS".activationPackage' # build and activate -bud home NixOS nixos switch +nix build '.#homeConfigurations."pub-solar@PubSolarOS".activationPackage' && ./result/activate && unlink result ``` ### Manually from outside the project: diff --git a/doc/start/bootstrapping.md b/doc/start/bootstrapping.md deleted file mode 100644 index b8a0ad04..00000000 --- a/doc/start/bootstrapping.md +++ /dev/null @@ -1,102 +0,0 @@ -# Bootstrapping - -This will help you boostrap a bare host with the help of the -[bespoke iso](./iso.md) live installer. - -_Note: nothing prevents you from remotely executing the boostrapping -process. See below._ - -Once your target host has booted into the live iso, you need to partition -and format your disk according to the [official manual][manual]. - -## Mount partitions - -Then properly mount the formatted partitions at `/mnt`, so that you can -install your system to those new partitions. - -Mount `nixos` partition to `/mnt` and — for UEFI — `boot` -partition to `/mnt/boot`: - -```console -$ mount /dev/disk/by-label/nixos /mnt -$ mkdir -p /mnt/boot && mount /dev/disk/by-label/boot /mnt/boot # UEFI only -$ swapon /dev/disk/by-label/swap -``` - -Add some extra space to the store. In the iso, it's running on a tmpfs -off your RAM: -```console -$ mkdir -p /mnt/tmpstore/{work,store} -$ mount -t overlay overlay -olowerdir=/nix/store,upperdir=/mnt/tmpstore/store,workdir=/mnt/tmpstore/work /nix/store -``` - -## Install - -Install off of a copy of devos from the time the iso was built: - -```console -$ cd /iso/devos -$ nixos-install --flake .#NixOS -``` - -## Notes of interest - -### Remote access to the live installer - -The iso live installer comes preconfigured with a network configuration -which announces it's hostname via [MulticastDNS][mDNS] as `hostname.local`, -that is `bootstrap.local` in the [iso example](./iso). - -In the rare case that [MulticastDNS][mDNS] is not availabe or turned off -in your network, there is a static link-local IPv6 address configured to -`fe80::47`(mnemonic from the letter's position in the english alphabet: -`n=14 i=9 x=24; 47 = n+i+x`). - -Provided that you have added your public key to the authorized keys of the -`root` user _(hint: [`deploy-rs`](../integrations/deploy.md) needs passwordless -sudo access)_: - -```nix -{ ... }: -{ - users.users.root.openssh.authorizedKeys.keyFiles = [ - ../secrets/path/to/key.pub - ]; -} -``` - -You can then ssh into the live installer through one of the -following options: - -```console -ssh root@bootstrap.local - -ssh root@fe80::47%eno1 # where eno1 is your network interface on which you are linked to the target -``` - -_Note: the [static link-local IPv6 address][staticLLA] and [MulticastDNS][mDNS] is only -configured on the live installer. If you wish to enable [MulticastDNS][mDNS] -for your environment, you ought to configure that in a regular [profile](../concepts/profiles.md)._ - -### EUI-64 LLA & Host Identity - -The iso's IPv6 Link Local Address (LLA) is configured with a static 64-bit Extended -Unique Identifiers (EUI-64) that is derived from the host interface's Message -Authentication Code (MAC) address. - -After a little while (a few seconds), you can remotely discover this unique and host -specific address over [NDP][NDP] for example with: - -```console -ip -6 neigh show # also shows fe80::47 -``` - -***This LLA is stable for the host, unless you need to swap that particular network card.*** -Under this reservation, though, you may use this EUI-64 to wire up a specific -(cryptographic) host identity. - - -[manual]: https://nixos.org/manual/nixos/stable/index.html#sec-installation-partitioning -[mDNS]: https://en.wikipedia.org/wiki/Multicast_DNS -[NDP]: https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol -[staticLLA]: https://tools.ietf.org/html/rfc7404 diff --git a/doc/start/from-nixos.md b/doc/start/from-nixos.md deleted file mode 100644 index 3e8c84d6..00000000 --- a/doc/start/from-nixos.md +++ /dev/null @@ -1,51 +0,0 @@ -# From NixOS - -## Generate Configuration -Assuming you're happy with your existing partition layout, you can generate a -basic NixOS configuration for your system using: -```sh -bud up -``` - -This will make a new file `hosts/up-$(hostname).nix`, which you can edit to -your liking. - -You must then add a host to `nixos.hosts` in flake.nix: -```nix -{ - nixos.hosts = { - modules = hosts/NixOS.nix; - }; -} -``` - -Make sure your `i18n.defaultLocale` and `time.timeZone` are set properly for -your region. Keep in mind that `networking.hostName` will be automatically -set to the name of your host; - -Now might be a good time to read the docs on [suites](../concepts/suites.md) and -[profiles](../concepts/profiles.md) and add or create any that you need. - -> ##### _Note:_ -> While the `up` sub-command is provided as a convenience to quickly set up and -> install a "fresh" NixOS system on current hardware, committing these files is -> discouraged. -> -> They are placed in the git staging area automatically because they would be -> invisible to the flake otherwise, but it is best to move what you need from -> them directly into a host module of your own making, and commit that instead. -# Installation - -Once you're ready to deploy `hosts/my-host.nix`: -```sh -bud my-host switch -``` - - -This calls `nixos-rebuild` with sudo to build and install your configuration. - -> ##### _Notes:_ -> - Instead of `switch`, you can pass `build`, `test`, `boot`, etc just as with -> `nixos-rebuild`. - - diff --git a/doc/start/index.md b/doc/start/index.md index 2cd14d9a..9650ba05 100644 --- a/doc/start/index.md +++ b/doc/start/index.md @@ -2,25 +2,35 @@ The only dependency is nix, so make sure you have it [installed][install-nix]. ## Get the Template -Here is a snippet that will get you the template without the git history: +If you currently don't have flakes setup, you can utilize the digga shell to pull the template: ```sh -nix-shell -p cachix --run "cachix use nrdxp" - -nix-shell https://github.com/divnix/devos/archive/main.tar.gz -A shell \ - --run "bud get main" - -cd devos - -nix-shell +nix-shell "https://github.com/divnix/digga/archive/main.tar.gz" \ + --run "nix flake init -t github:divnix/digga" +``` +If you already have flakes support, you can directly pull the template: +```sh +nix flake init -t github:divnix/digga +``` +Then make sure to create the git repository: +```sh git init git add . git commit -m init ``` -This will place you in a new folder named `devos` with git initialized, and a -nix-shell that provides all the dependencies, including the unstable nix -version required. +To drop into a nix-shell, if you don't have flakes setup, use the digga shell to create a `flake.lock`: +```sh +nix-shell "https://github.com/divnix/digga/archive/main.tar.gz" \ + --run "nix flake lock" +``` +Or if you do have flakes support, just run: +```sh +nix flake lock +``` + +Finally, run `nix-shell` to get to an interactive shell with all the dependencies, including the unstable nix +version required. You can run `menu` to confirm that you are using digga (expected output includes [docs], [general commands], [linter], etc.). In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment. @@ -33,9 +43,8 @@ In addition, the [binary cache](../integrations/cachix.md) is added for faster d > you can try with sudo: `sudo nix-shell -p cachix --run "cachix use nrdxp"` ## Next Steps: + - [Make installable ISO](./iso.md) -- [Bootstrap Host](./bootstrapping.md) -- [Already on NixOS](./from-nixos.md) [install-nix]: https://nixos.org/manual/nix/stable/#sect-multi-user-installation diff --git a/doc/start/iso.md b/doc/start/iso.md index 76af1c6e..b8fa6659 100644 --- a/doc/start/iso.md +++ b/doc/start/iso.md @@ -1,22 +1,36 @@ -# ISO +# Installation Media + +This project leverages [nix-community/nixos-generators][nixos-generators] for +building machine images. In most cases, you'll probably want to use the +`install-iso` format. + +Making an installable ISO for `hosts/bootstrap.nix` is as simple as: -Making and writing an installable iso for `hosts/bootstrap.nix` is as simple as: ```sh -bud build bootstrap bootstrapIso -sudo -E $(which bud) burn +nix run github:nix-community/nixos-generators -- \ + --format install-iso \ + --flake '.#bootstrap' ``` -This works for any host. +Then "burn" the ISO to your USB stick (or CD-R if you like!) following the +[instructions in the NixOS manual][burn] (or using your preferred USB burner). -## ISO image nix store & cache +You can also swap out the `--format` for [any of the others][formats] supported +by nixos-generators. -The iso image holds the store to the live environment and _also_ acts as a binary cache -to the installer. To considerably speed up things, the image already includes all flake -`inputs` as well as the `devshell` closures. +Continue by following the usual installation instructions in the NixOS manual. -While you _could_ provision any machine with a single stick, a custom-made iso for -the host you want to install DevOS to, maximises those local cache hits. +## ISO Nix Store and Cache -For hosts that don't differ too much, a single usb stick might be ok, whereas when -there are bigger differences, a custom-made usb stick will be considerably faster. +The ISO image holds the Nix store for the live environment and _also_ acts as a +binary cache to the installer. To considerably speed things up, the image +already includes all flake `inputs` as well as the `devshell` closures. +While you _could_ provision any NixOS machine with the same USB stick, an ISO +custom-made for your target host will maximise those local cache hits. For hosts +that don't differ too much, a single USB stick might be ok, whereas when there +are bigger differences, a custom-made USB stick will be considerably faster. + +[nixos-generators]: https://github.com/nix-community/nixos-generators +[burn]: https://nixos.org/manual/nixos/stable/index.html#sec-booting-from-usb +[formats]: https://github.com/nix-community/nixos-generators/tree/master/formats diff --git a/flake.lock b/flake.lock index 2e4bdbcd..857bb989 100644 --- a/flake.lock +++ b/flake.lock @@ -20,26 +20,6 @@ "type": "github" } }, - "beautysh": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "poetry2nix": "poetry2nix" - }, - "locked": { - "lastModified": 1641830469, - "narHash": "sha256-uhDmgNP/biOWe4FtOa6c2xZnREH+NP9rdrMm0LccRUk=", - "owner": "lovesegfault", - "repo": "beautysh", - "rev": "e85d9736927c0fcf2abb05cb3a2d8d9b4502a2eb", - "type": "github" - }, - "original": { - "owner": "lovesegfault", - "repo": "beautysh", - "type": "github" - } - }, "blank": { "locked": { "lastModified": 1625557891, @@ -55,31 +35,6 @@ "type": "github" } }, - "bud": { - "inputs": { - "beautysh": "beautysh", - "devshell": [ - "digga", - "devshell" - ], - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1654190822, - "narHash": "sha256-B8z3stYaULNDBBjzJHrFHGgiJHrLqhBkxH+9u5iBP7E=", - "owner": "divnix", - "repo": "bud", - "rev": "0ff3e4e4b8791ea4d827bf5bfcac28cef060f209", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "bud", - "type": "github" - } - }, "darwin": { "inputs": { "nixpkgs": [ @@ -145,7 +100,7 @@ }, "devshell": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": [ "digga", "nixpkgs" @@ -251,11 +206,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", "owner": "numtide", "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", "type": "github" }, "original": { @@ -266,7 +221,7 @@ }, "flake-utils-plus": { "inputs": { - "flake-utils": "flake-utils_3" + "flake-utils": "flake-utils_2" }, "locked": { "lastModified": 1654029967, @@ -284,21 +239,6 @@ } }, "flake-utils_2": { - "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -313,7 +253,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_3": { "locked": { "lastModified": 1649676176, "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", @@ -435,7 +375,7 @@ "nixos-generators": { "inputs": { "nixlib": "nixlib", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1657748715, @@ -468,16 +408,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1633971123, - "narHash": "sha256-WmI4NbH1IPGFWVkuBkKoYgOnxgwSfWDgdZplJlQ93vA=", + "lastModified": 1637186689, + "narHash": "sha256-NU7BhgnwA/3ibmCeSzFK6xGi+Bari9mPfn+4cBmyEjw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e4ef597edfd8a0ba5f12362932fc9b1dd01a0aef", + "rev": "7fad01d9d5a3f82081c00fb57918d64145dc904c", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable-small", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -498,22 +438,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1637186689, - "narHash": "sha256-NU7BhgnwA/3ibmCeSzFK6xGi+Bari9mPfn+4cBmyEjw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7fad01d9d5a3f82081c00fb57918d64145dc904c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "locked": { "lastModified": 0, @@ -529,7 +453,7 @@ "nvfetcher": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixos" ] @@ -548,37 +472,9 @@ "type": "github" } }, - "poetry2nix": { - "inputs": { - "flake-utils": [ - "bud", - "beautysh", - "flake-utils" - ], - "nixpkgs": [ - "bud", - "beautysh", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1633382856, - "narHash": "sha256-hYlet806M9xJj4yxf0g5fhDT2IEUVIMAl7sqIeZ8DUM=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "705cbfa10e3d9bfed2e59e0256844ae3704dbd7e", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "poetry2nix", - "type": "github" - } - }, "root": { "inputs": { "agenix": "agenix", - "bud": "bud", "darwin": "darwin", "deploy": "deploy", "digga": "digga", diff --git a/flake.nix b/flake.nix index 85e05602..bf050b2e 100644 --- a/flake.nix +++ b/flake.nix @@ -17,10 +17,6 @@ digga.inputs.home-manager.follows = "home"; digga.inputs.deploy.follows = "deploy"; - bud.url = "github:divnix/bud"; - bud.inputs.nixpkgs.follows = "nixos"; - bud.inputs.devshell.follows = "digga/devshell"; - home.url = "github:nix-community/home-manager/release-22.05"; home.inputs.nixpkgs.follows = "nixos"; @@ -47,7 +43,6 @@ outputs = { self , digga - , bud , nixos , home , nixos-hardware @@ -101,7 +96,6 @@ digga.nixosModules.nixConfig home.nixosModules.home-manager agenix.nixosModules.age - bud.nixosModules.bud ]; }; diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix index 541ca6fb..ba509911 100644 --- a/hosts/bootstrap.nix +++ b/hosts/bootstrap.nix @@ -1,6 +1,6 @@ { profiles, ... }: { - # build with: `bud build bootstrap bootstrapIso` + # build with: `nix build '.#nixosConfigurations.bootstrap.config.system.build.bootstrapIso'` # reachable on the local link via ssh root@fe80::47%eno1 # where 'eno1' is replaced by your own machine's network # interface that has the local link to the target machine diff --git a/shell/default.nix b/shell/default.nix index d22b3af4..597a2d2d 100644 --- a/shell/default.nix +++ b/shell/default.nix @@ -1,7 +1,6 @@ { self, inputs, ... }: { modules = with inputs; [ - bud.devshellModules.bud ]; exportedModules = [ ./devos.nix -- 2.44.1 From b42f7b72ad5a7c8b72bbd93039e8addb2a95a6d2 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 12:31:53 +0200 Subject: [PATCH 059/111] Remove bud from CI, too --- .drone.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 23805095..f54bd8f9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -106,7 +106,6 @@ steps: - nix $$NIX_FLAGS flake check - nix $$NIX_FLAGS build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel" - nix $$NIX_FLAGS develop --command echo OK - - nix $$NIX_FLAGS develop --command bud --help --- kind: pipeline @@ -122,8 +121,8 @@ steps: commands: - | nix --print-build-logs --verbose \ - develop --command \ - bud build bootstrap bootstrapIso + build \ + '.#nixosConfigurations.bootstrap.config.system.build.bootstrapIso' - cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/ - name: "Publish ISO" @@ -158,6 +157,6 @@ volumes: --- kind: signature -hmac: bdbefb07b97dc8efc44d8eb36ee4d1bb89eec3b7255b49929e126e86a4b4a788 +hmac: da951ba8ede88996728acfb47846e01880eb0e3b91f66e47848d6c1cc727c5d9 ... -- 2.44.1 From cb5c75b1cc37e9272422bf45ecd3e6353abb0cd2 Mon Sep 17 00:00:00 2001 From: hensoko Date: Sun, 14 Aug 2022 15:17:35 +0000 Subject: [PATCH 060/111] feature/terminal-life-lite-mode (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/117 Reviewed-by: Benjamin Bädorf --- modules/core/default.nix | 6 +++++- modules/terminal-life/default.nix | 8 ++++++++ modules/terminal-life/nvim/default.nix | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/core/default.nix b/modules/core/default.nix index c7457c1b..7b168268 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -28,10 +28,14 @@ in config = { pub-solar = { - terminal-life.enable = true; audio.enable = lib.mkIf (!cfg.lite) true; crypto.enable = lib.mkIf (!cfg.lite) true; devops.enable = lib.mkIf (!cfg.lite) true; + + terminal-life = { + enable = true; + lite = cfg.lite; + }; }; }; } diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index 8ecb9919..6bd0312f 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -7,6 +7,14 @@ in { options.pub-solar.terminal-life = { enable = mkEnableOption "Life in black and white"; + + lite = mkOption { + description = '' + Enable a lite edition of terminal-life with less modules and a reduced package set. + ''; + default = false; + type = types.bool; + }; }; config = mkIf cfg.enable { diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index 1d6645ff..bc06943b 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: 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); @@ -76,7 +77,7 @@ in withRuby = true; withPython3 = true; - extraPackages = with pkgs; [ + extraPackages = with pkgs; lib.mkIf (!cfg.lite) [ ccls gopls nodejs -- 2.44.1 From ca4262b84f341b97cd4a179bde3740d42bc61052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 17:20:09 +0200 Subject: [PATCH 061/111] Fix hibernation enabling in paranoia mode --- modules/paranoia/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/paranoia/default.nix b/modules/paranoia/default.nix index 19c470ad..bb319767 100644 --- a/modules/paranoia/default.nix +++ b/modules/paranoia/default.nix @@ -19,6 +19,6 @@ in }; config = mkIf cfg.enable { - pub-solar.core.hibernate.enable = true; + pub-solar.core.hibernation.enable = true; }; } -- 2.44.1 From 043178172b96ad23ef9c62bd406c43652b342bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 18:03:32 +0200 Subject: [PATCH 062/111] Improve help and screen recording keybindings in sway This commit shuffles around some sway keybindings and improves the screen recording experience by adding a small wrapper around `slurp` and `wf-recorder` conveniently called `record-screen`. * `$mod+F5` now reload the sway configuration, * `$mod+Ctrl+r` starts a screen recording (to stop it, go to workspace 7 and kill the process), * `record-screen` and the firefox sharing indicator are both on workspace 7 now, making it the "trash" workspace, * `$mod+F1` and `$mod+Shift+h` now open Firefox with the docs of our repository availabe under `help.local`. * To not infuriate `qMasterPassword` users, that is now available under `$mod+Shift+m` instead of `$mod+F1`. --- doc/book.toml | 2 +- modules/core/networking.nix | 16 ++++++++---- .../sway/config/config.d/applications.conf | 11 +++++--- .../config/config.d/custom-keybindings.conf | 15 +++++++---- modules/sway/config/config.nix | 2 +- modules/sway/default.nix | 1 + pkgs/default.nix | 2 ++ pkgs/psos-docs.nix | 26 +++++++++++++++++++ pkgs/psos.nix | 4 +++ pkgs/record-screen.nix | 10 +++++++ 10 files changed, 74 insertions(+), 15 deletions(-) create mode 100644 pkgs/psos-docs.nix create mode 100644 pkgs/record-screen.nix diff --git a/doc/book.toml b/doc/book.toml index 373d26fd..f9dca6a3 100644 --- a/doc/book.toml +++ b/doc/book.toml @@ -3,4 +3,4 @@ authors = ["Timothy DeHerrera"] language = "en" multilingual = false src = "." -title = "devos docs" +title = "PubSolarOS documentation" diff --git a/modules/core/networking.nix b/modules/core/networking.nix index ce3248d8..95db64e3 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -34,20 +34,26 @@ in # These entries get added to /etc/hosts networking.hosts = { - "127.0.0.1" = [ "cups.local" ]; + "127.0.0.1" = [ "cups.local" "help.local" "caddy.local" ]; }; # Caddy reverse proxy for local services like cups services.caddy = { enable = true; globalConfig = '' + default_bind 127.0.0.1 auto_https off ''; extraConfig = '' - cups.local:80 - bind 127.0.0.1 - request_header Host localhost:631 - reverse_proxy unix//run/cups/cups.sock + cups.local:80 { + request_header Host localhost:631 + reverse_proxy unix//run/cups/cups.sock + } + + help.local:80 { + root * ${pkgs.psos-docs}/lib/html + file_server + } ''; }; }; diff --git a/modules/sway/config/config.d/applications.conf b/modules/sway/config/config.d/applications.conf index 3bab265d..00eecef3 100644 --- a/modules/sway/config/config.d/applications.conf +++ b/modules/sway/config/config.d/applications.conf @@ -14,8 +14,9 @@ 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="pavucontrol"] floating enable for_window [app_id="blueman-manager"] floating enable # Open specific applications in floating mode @@ -60,10 +61,14 @@ 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="Firefox — Sharing Indicator"] move to workspace $ws7, floating enable -no_focus [title="Firefox — Sharing Indicator"] 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 diff --git a/modules/sway/config/config.d/custom-keybindings.conf b/modules/sway/config/config.d/custom-keybindings.conf index bb452ddc..39a0353e 100644 --- a/modules/sway/config/config.d/custom-keybindings.conf +++ b/modules/sway/config/config.d/custom-keybindings.conf @@ -13,21 +13,26 @@ bindsym $mod+Ctrl+m exec pavucontrol ################################################################################################ # Quickstart application shortcuts -bindsym $mod+F1 exec qMasterPassword +bindsym $mod+F1 exec psos help +bindsym $mod+Shift+h exec psos help + bindsym $mod+F2 exec firefox + bindsym $mod+F3 exec $term -e vifm bindsym $mod+Shift+F3 exec gksu $term -e vifm + bindsym $mod+F4 exec nautilus -w bindsym $mod+Shift+F4 exec signal-desktop --use-tray-icon -bindsym $mod+F5 exec $term -e 'mocp -C $XDG_CONFIG_DIR/mocp/config' -bindsym $mod+Shift+m exec mu -bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf -# Screenshofts +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 diff --git a/modules/sway/config/config.nix b/modules/sway/config/config.nix index 8e21ec02..2375d616 100644 --- a/modules/sway/config/config.nix +++ b/modules/sway/config/config.nix @@ -50,7 +50,7 @@ floating_modifier $mod normal # Reload the configuration file - bindsym $mod+Ctrl+r reload + bindsym $mod+F5 reload # # Moving around: diff --git a/modules/sway/default.nix b/modules/sway/default.nix index 35013dd2..b8abb402 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -77,6 +77,7 @@ in swaylock-bg sway-launcher + record-screen import-gtk-settings s wcwd diff --git a/pkgs/default.nix b/pkgs/default.nix index ecac30a3..6d392772 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,6 +9,7 @@ with 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); @@ -17,6 +18,7 @@ with 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/psos-docs.nix b/pkgs/psos-docs.nix new file mode 100644 index 00000000..112e39bc --- /dev/null +++ b/pkgs/psos-docs.nix @@ -0,0 +1,26 @@ +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 index a60bad6d..eb050bfb 100644 --- a/pkgs/psos.nix +++ b/pkgs/psos.nix @@ -14,6 +14,10 @@ self: with self; '' shift; exec nixos-option -I nixpkgs=/etc/nixos/lib/compat $@ ;; + help) + shift; + exec xdg-open http://help.local/ + ;; *) if [[ "$@" != "" ]]; then echo "Unknown command: psos $@" diff --git a/pkgs/record-screen.nix b/pkgs/record-screen.nix new file mode 100644 index 00000000..d8d7f4a3 --- /dev/null +++ b/pkgs/record-screen.nix @@ -0,0 +1,10 @@ +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" +'' -- 2.44.1 From aabe96a3357e35056f7f5a68f023d10ec820ecfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 18:11:25 +0200 Subject: [PATCH 063/111] Fix hibernation config --- modules/core/boot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 6f93fabf..1512289c 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -38,7 +38,7 @@ in }; }; - resumeDevice = mkIf cfg.core.hibernation.enable "/swapfile"; + resumeDevice = mkIf cfg.hibernation.enable "/swapfile"; loader.systemd-boot.enable = true; -- 2.44.1 From ba6dfdcf533c690333b4fc31e76a41d722b0ff8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 19:48:45 +0200 Subject: [PATCH 064/111] Fix sway mode_system config import --- modules/sway/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sway/default.nix b/modules/sway/default.nix index 469e5cfb..dd0e6055 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -98,7 +98,7 @@ in 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.config.nix { inherit psCfg; }; + xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix { inherit 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; }; -- 2.44.1 From 46992c46d6521dd74c81a937ad1c1465578cbe30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 19:59:01 +0200 Subject: [PATCH 065/111] Add parameter for swapfile offset --- modules/core/boot.nix | 21 +++++++++++- .../sway/config/config.d/mode_system.conf.nix | 32 +++++++++---------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 1512289c..9df859e2 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -22,6 +22,18 @@ in default = false; description = "Whether the device can hibernate. This creates a swapfile at /swapfile."; }; + + resumeDevice = mkOption { + type = types.str; + default = "/swapfile"; + description = "The location of the hibernation resume swap file."; + }; + + resumeOffset = mkOption { + type = types.nullOr types.number; + 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 = { @@ -38,7 +50,14 @@ in }; }; - resumeDevice = mkIf cfg.hibernation.enable "/swapfile"; + + resumeDevice = mkIf cfg.hibernation.enable cfg.hibernation.resumeDevice; + kernelParams = mkIf cfg.hibernation.enable [ + "resume=${cfg.hibernation.resumeDevice}" + ] ++ ( + if (cfg.hibernation.resumeOffset == null) then builtins.abort "config.pub-solar.hibernation.resumeOffset has to be set if config.pub-solar.hibernation.enable is true." + else [ "resume_offset=${cfg.hibernation.resumeOffset}" ] + ); loader.systemd-boot.enable = true; diff --git a/modules/sway/config/config.d/mode_system.conf.nix b/modules/sway/config/config.d/mode_system.conf.nix index ef11a461..c505a9f5 100644 --- a/modules/sway/config/config.d/mode_system.conf.nix +++ b/modules/sway/config/config.d/mode_system.conf.nix @@ -1,21 +1,21 @@ { psCfg, ... }: '' -# Set shut down, restart and locking features -set $mode_system (e)xit, (h)ibernate, (r)eboot, (Shift+s)hutdown -bindsym $mod+0 mode "$mode_system" -mode "$mode_system" { - bindsym e exec swaymsg exit, mode "default" -'' + (if !psCfg.core.allow-hibernation then '' - bindsym h exec systemctl hibernate, mode "default" + # Set shut down, restart and locking features + set $mode_system (e)xit, (h)ibernate, (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 "") - + (if !psCfg.paranoia.enable then '' - bindsym l exec swaylock-bg, mode "default" - bindsym s exec systemctl suspend, mode "default" ++ (if !psCfg.paranoia.enable then '' + bindsym l exec swaylock-bg, mode "default" + bindsym s exec systemctl suspend, mode "default" '' else "") + '' - bindsym r exec systemctl reboot, mode "default" - bindsym Shift+s exec systemctl poweroff, 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" -} + # exit system mode: "Enter" or "Escape" + bindsym Return mode "default" + bindsym Escape mode "default" + } '' -- 2.44.1 From f9b7c9e3c9181debb9ad6fe944a4bf94a4d0e0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 20:09:38 +0200 Subject: [PATCH 066/111] Fix build --- modules/core/boot.nix | 29 --------------------------- modules/core/default.nix | 1 + modules/core/hibernation.nix | 38 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 29 deletions(-) create mode 100644 modules/core/hibernation.nix diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 9df859e2..10f67dc4 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -16,26 +16,6 @@ in description = "Whether it should be assumed that there is a cryptroot device"; }; - 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.str; - default = "/swapfile"; - description = "The location of the hibernation resume swap file."; - }; - - resumeOffset = mkOption { - type = types.nullOr types.number; - 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 = { # Enable plymouth for better experience of booting @@ -50,15 +30,6 @@ in }; }; - - resumeDevice = mkIf cfg.hibernation.enable cfg.hibernation.resumeDevice; - kernelParams = mkIf cfg.hibernation.enable [ - "resume=${cfg.hibernation.resumeDevice}" - ] ++ ( - if (cfg.hibernation.resumeOffset == null) then builtins.abort "config.pub-solar.hibernation.resumeOffset has to be set if config.pub-solar.hibernation.enable is true." - else [ "resume_offset=${cfg.hibernation.resumeOffset}" ] - ); - loader.systemd-boot.enable = true; # Use latest LTS linux kernel by default diff --git a/modules/core/default.nix b/modules/core/default.nix index 7b168268..80ca4926 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -8,6 +8,7 @@ in { imports = [ ./boot.nix + ./hibernation.nix ./fonts.nix ./i18n.nix ./networking.nix diff --git a/modules/core/hibernation.nix b/modules/core/hibernation.nix new file mode 100644 index 00000000..c0e912f1 --- /dev/null +++ b/modules/core/hibernation.nix @@ -0,0 +1,38 @@ +{ 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.str; + default = "/swapfile"; + 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 = cfg.resumeDevice; + kernelParams = [ + "resume=${cfg.resumeDevice}" + ] ++ ( + if (cfg.resumeOffset == null && cfg.enable) then builtins.abort "config.pub-solar.resumeOffset has to be set if config.pub-solar.enable is true." + else [ "resume_offset=${cfg.resumeOffset}" ] + ); + }; + }; +} -- 2.44.1 From c5362c045313d983bd571ef4dd6fd5d48d53f31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 20:24:50 +0200 Subject: [PATCH 067/111] Fix path in drone runner exec --- modules/ci-runner/default.nix | 6 +++++- pkgs/drone-docker-runner.nix | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ci-runner/default.nix b/modules/ci-runner/default.nix index 4db42286..1460ab16 100644 --- a/modules/ci-runner/default.nix +++ b/modules/ci-runner/default.nix @@ -20,7 +20,11 @@ in Restart = "always"; }; - path = "${pkgs.git}/bin:${pkgs.nix}/bin:${pkgs.libvirt}/bin"; + path = [ + pkgs.git + pkgs.nix + pkgs.libvirt + ]; wantedBy = [ "multi-user.target" ]; after = [ "network.target" "libvirtd.service" ]; diff --git a/pkgs/drone-docker-runner.nix b/pkgs/drone-docker-runner.nix index 7d098536..e1773d5a 100644 --- a/pkgs/drone-docker-runner.nix +++ b/pkgs/drone-docker-runner.nix @@ -6,7 +6,7 @@ self: with self; '' --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=4 \ + --env=DRONE_RUNNER_CAPACITY=8 \ --env=DRONE_RUNNER_NAME=$(${self.inetutils}/bin/hostname) \ --publish=3000:3000 \ --restart=always \ -- 2.44.1 From 14ba7010615ddd723474bb5844ff686f42bfaabb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sun, 14 Aug 2022 20:28:18 +0200 Subject: [PATCH 068/111] Don't use libvirt in ci-runner --- modules/ci-runner/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ci-runner/default.nix b/modules/ci-runner/default.nix index 1460ab16..0e78e55e 100644 --- a/modules/ci-runner/default.nix +++ b/modules/ci-runner/default.nix @@ -23,11 +23,10 @@ in path = [ pkgs.git pkgs.nix - pkgs.libvirt ]; wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "libvirtd.service" ]; + after = [ "network.target" ]; script = ''${pkgs.drone-runner-exec}/bin/drone-runner-exec daemon /run/agenix/drone-runner-exec-config''; }; -- 2.44.1 From c63c3da345aff2bc1239687abc6729b2bf293b75 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Wed, 24 Aug 2022 00:53:38 +0200 Subject: [PATCH 069/111] nix: set nix.package to force overlays/ overrides.nix to apply use nix as default version alias in devshell as well --- modules/core/nix.nix | 2 ++ shell/devos.nix | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/nix.nix b/modules/core/nix.nix index 38b70cfc..f7ff5fa4 100644 --- a/modules/core/nix.nix +++ b/modules/core/nix.nix @@ -2,6 +2,8 @@ { nix = { + # Use default version alias for nix package + package = pkgs.nix; # Improve nix store disk usage autoOptimiseStore = true; gc.automatic = true; diff --git a/shell/devos.nix b/shell/devos.nix index bd3399a1..9aefcc6f 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -6,7 +6,7 @@ let cachix editorconfig-checker mdbook - nixUnstable + nix nixpkgs-fmt nvfetcher ; -- 2.44.1 From dc8257f31fa2fcbadf8baa679cf9141c3ee60c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Wed, 24 Aug 2022 18:43:11 +0200 Subject: [PATCH 070/111] Fix hibernation The resumeDevice and kernel `resume` parameter were being used wrong. Only `boot.resumeDevice` is necessary, and it should point at the _block device_ that holds the swapfile. If you are running on encrypted volumes, this means you will need to use the name of the *decrypted block device* on which the swapfile sits. --- modules/core/hibernation.nix | 9 +++------ modules/sway/config/config.d/mode_system.conf.nix | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/core/hibernation.nix b/modules/core/hibernation.nix index c0e912f1..0454d82b 100644 --- a/modules/core/hibernation.nix +++ b/modules/core/hibernation.nix @@ -13,7 +13,7 @@ in resumeDevice = mkOption { type = types.str; - default = "/swapfile"; + default = "/dev/sda1"; description = "The location of the hibernation resume swap file."; }; @@ -27,12 +27,9 @@ in config = { boot = mkIf cfg.enable { resumeDevice = cfg.resumeDevice; - kernelParams = [ - "resume=${cfg.resumeDevice}" - ] ++ ( + kernelParams = if (cfg.resumeOffset == null && cfg.enable) then builtins.abort "config.pub-solar.resumeOffset has to be set if config.pub-solar.enable is true." - else [ "resume_offset=${cfg.resumeOffset}" ] - ); + else [ "resume_offset=${builtins.toString cfg.resumeOffset}" ]; }; }; } diff --git a/modules/sway/config/config.d/mode_system.conf.nix b/modules/sway/config/config.d/mode_system.conf.nix index c505a9f5..f34ecc57 100644 --- a/modules/sway/config/config.d/mode_system.conf.nix +++ b/modules/sway/config/config.d/mode_system.conf.nix @@ -4,7 +4,7 @@ bindsym $mod+0 mode "$mode_system" mode "$mode_system" { bindsym e exec swaymsg exit, mode "default" -'' + (if !psCfg.core.hibernation.enable then '' +'' + (if psCfg.core.hibernation.enable then '' bindsym h exec systemctl hibernate, mode "default" '' else "") + (if !psCfg.paranoia.enable then '' -- 2.44.1 From 57f608ecde64e26e40f5c6a3f58d6b1028348fc4 Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Wed, 24 Aug 2022 18:19:03 +0200 Subject: [PATCH 071/111] Disable NetworkManager-wait-online system service This service is presumably useful for devices that need to ensure there is an active internet connection before starting other systemd units. This is neither the case for end-user devices as the an active internet connection is only needed after login nor the case for server-like systems as they normally have a static / dhcp-based network configuration which does not require switchable network configuration profiles. --- modules/core/networking.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/networking.nix b/modules/core/networking.nix index 95db64e3..ab6f7e3d 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -23,6 +23,9 @@ in }; }; config = { + # disable NetworkManager-wait-online by default + systemd.services.NetworkManager-wait-online.enable = lib.mkDefault false; + networking.networkmanager = { # Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff. enable = true; -- 2.44.1 From 8efc4c2f9e6786c1bf92fbe73f7335412a9c130c Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Wed, 18 May 2022 00:30:24 +0200 Subject: [PATCH 072/111] Use iwd as wifi backend iwd is a lightweight wireless connection backend that was initiated by developers of intel. It is supposed to be faster. --- modules/core/networking.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/core/networking.nix b/modules/core/networking.nix index 95db64e3..60dcfe74 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -26,6 +26,7 @@ in networking.networkmanager = { # Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff. enable = true; + wifi.backend = "iwd"; }; # Customized binary caches list (with fallback to official binary cache) -- 2.44.1 From f7eda8ca1c40214c4361d14ce96174d62ce6233e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 5 Jun 2022 03:07:50 +0200 Subject: [PATCH 073/111] zsh: bundle plugins within our config --- modules/terminal-life/zsh/default.nix | 57 ++++++++++++++++++++------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 2db8bc41..63da73ca 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -39,21 +39,48 @@ in nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat"; myip = "dig +short myip.opendns.com @208.67.222.222 2>&1"; }; - zplug = { - enable = true; - plugins = [ - { - name = "plugins/z"; - tags = [ "from:oh-my-zsh" ]; - } - { - name = "romkatv/powerlevel10k"; - tags = [ "as:theme" "depth:1" ]; - } - { name = "zdharma/fast-syntax-highlighting"; } - { name = "chisui/zsh-nix-shell"; } - ]; - }; + plugins = [ + { + # will source ohmyzsh/plugins/z/ + name = "zsh-plugins-z"; + file = "plugins/z/z.sh"; + src = pkgs.fetchFromGitHub { + owner = "ohmyzsh"; + repo = "ohmyzsh"; + rev = "master"; + sha256 = "sha256-NAVotL5RxpS/zKnO+ngMIjv787lqc1dj/c4blQrQcvU="; + }; + } + { + name = "zsh-powerlevel10k"; + file = "powerlevel10k.zsh-theme"; + src = pkgs.fetchFromGitHub { + owner = "romkatv"; + repo = "powerlevel10k"; + rev = "master"; + sha256 = "sha256-0pzkKPdzyQXTe8usaSaM1Iivi2UHQrSJrh5V2pRdiGg="; + }; + } + { + name = "zsh-fast-syntax-highlighting"; + src = pkgs.fetchFromGitHub { + owner = "zdharma"; + repo = "fast-syntax-highlighting"; + rev = "master"; + sha256 = "sha256-uoLrXfq31GvfHO6GTrg7Hus8da2B4SCM1Frc+mRFbFc="; + }; + } + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "master"; + sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; + }; + } + ]; initExtra = '' bindkey -v -- 2.44.1 From de03f0f42fbd61968dedf26e761f9f618d20617f Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 17 Jul 2022 16:37:09 +0200 Subject: [PATCH 074/111] zsh: correctly pin plugins to commits instead of branch names, to prevent errors like: error: hash mismatch in fixed-output derivation '/nix/store/n7w9jd46zx4rzy9a24abxv3lcx1ikn1j-source.drv': specified: sha256-0pzkKPdzyQXTe8usaSaM1Iivi2UHQrSJrh5V2pRd0Gg= got: sha256-9vc4cMBCNOmPOyzGwnPeMrXXyQUq4pC9Du3AWl9+Rys= --- modules/terminal-life/zsh/default.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index 63da73ca..b68a4270 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -47,7 +47,7 @@ in src = pkgs.fetchFromGitHub { owner = "ohmyzsh"; repo = "ohmyzsh"; - rev = "master"; + rev = "249c708ed3a4a7a63d16a6e911a46b6fb9623cbd"; sha256 = "sha256-NAVotL5RxpS/zKnO+ngMIjv787lqc1dj/c4blQrQcvU="; }; } @@ -57,17 +57,18 @@ in src = pkgs.fetchFromGitHub { owner = "romkatv"; repo = "powerlevel10k"; - rev = "master"; - sha256 = "sha256-0pzkKPdzyQXTe8usaSaM1Iivi2UHQrSJrh5V2pRdiGg="; + rev = "2dd6a29e4d7a33bfef10973d6550e087be37ddee"; + sha256 = "sha256-9vc4cMBCNOmPOyzGwnPeMrXXyQUq4pC9Du3AWl9+Rys="; }; } { name = "zsh-fast-syntax-highlighting"; + file = "F-Sy-H.plugin.zsh"; src = pkgs.fetchFromGitHub { - owner = "zdharma"; - repo = "fast-syntax-highlighting"; - rev = "master"; - sha256 = "sha256-uoLrXfq31GvfHO6GTrg7Hus8da2B4SCM1Frc+mRFbFc="; + owner = "z-shell"; + repo = "F-Sy-H"; + rev = "c4bdc485b67b58351a24f21fcac92c9e0232b939"; + sha256 = "sha256-uXBGIdJwubuueNhQRdGxPUi0eJN17cflYAuHTjeQ8FQ="; }; } { @@ -76,7 +77,7 @@ in src = pkgs.fetchFromGitHub { owner = "chisui"; repo = "zsh-nix-shell"; - rev = "master"; + rev = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; }; } -- 2.44.1 From 6d1d683b231a13e94bed8fd215cd311fb99b0be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Thu, 25 Aug 2022 00:13:23 +0200 Subject: [PATCH 075/111] Fix swayidle command, add hibernation on lid close, fix env The swayidle command in the service was straight up broken, this commit fixes that. Environment Variables set in the `session-variables` file are now correctly imported across the system. This fixes `EDITOR` defaulting to `nano`. --- modules/paranoia/default.nix | 1 + modules/sway/config/config.d/systemd.conf | 2 +- modules/sway/mako.service.nix | 1 - modules/sway/swayidle.service.nix | 20 +++++++++----------- modules/sway/waybar.service.nix | 3 ++- pkgs/sway-service.nix | 2 +- profiles/base-user/session-variables.nix | 18 +++++++++++++++--- 7 files changed, 29 insertions(+), 18 deletions(-) diff --git a/modules/paranoia/default.nix b/modules/paranoia/default.nix index bb319767..699ab13e 100644 --- a/modules/paranoia/default.nix +++ b/modules/paranoia/default.nix @@ -20,5 +20,6 @@ in config = mkIf cfg.enable { pub-solar.core.hibernation.enable = true; + services.logind.lidSwitch = "hibernate"; }; } diff --git a/modules/sway/config/config.d/systemd.conf b/modules/sway/config/config.d/systemd.conf index d6380d41..66759c4f 100644 --- a/modules/sway/config/config.d/systemd.conf +++ b/modules/sway/config/config.d/systemd.conf @@ -5,4 +5,4 @@ # 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 DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway" +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/sway/mako.service.nix b/modules/sway/mako.service.nix index b155e148..1f210c74 100644 --- a/modules/sway/mako.service.nix +++ b/modules/sway/mako.service.nix @@ -5,7 +5,6 @@ Documentation = [ "man:mako(1)" ]; BindsTo = [ "sway-session.target" ]; After = [ "sway-session.target" ]; - # ConditionEnvironment requires systemd v247 to work correctly ConditionEnvironment = [ "WAYLAND_DISPLAY" ]; }; Service = { diff --git a/modules/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index 3b87c610..f10675fb 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -10,17 +10,15 @@ Service = { Type = "simple"; Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin"; - ExecStart = if psCfg.paranoia.enable then '' - ${pkgs.swayidle}/bin/swayidle -w \ - timeout 120 'swaymsg "output * dpms off"' \ - timeout 150 'systemctl hibernate' \ - '' else '' - ${pkgs.swayidle}/bin/swayidle -w \ - timeout 600 'swaylock-bg' \ - timeout 900 'swaymsg "output * dpms off"' \ - resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock-bg' - ''; + ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ + after-resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock-bg' '' + (if psCfg.paranoia.enable then '' \ + timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + timeout 150 'systemctl hibernate' + '' else '' \ + timeout 600 'swaylock-bg' + timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' + ''); }; Install = { WantedBy = [ "sway-session.target" ]; diff --git a/modules/sway/waybar.service.nix b/modules/sway/waybar.service.nix index 98b8ed35..0237612f 100644 --- a/modules/sway/waybar.service.nix +++ b/modules/sway/waybar.service.nix @@ -4,8 +4,9 @@ Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors."; Documentation = "https://github.com/Alexays/Waybar/wiki/"; BindsTo = [ "sway-session.target" ]; - After = [ "graphical-session-pre.target" "network-online.target" ]; + After = [ "sway-session.target" "network-online.target" ]; Wants = [ "graphical-session-pre.target" "network-online.target" "blueman-applet.service" ]; + ConditionEnvironment = [ "WAYLAND_DISPLAY" ]; }; Service = { diff --git a/pkgs/sway-service.nix b/pkgs/sway-service.nix index f0b97ee7..15781a1a 100644 --- a/pkgs/sway-service.nix +++ b/pkgs/sway-service.nix @@ -1,6 +1,6 @@ self: with self; '' # first import environment variables from the login manager - systemctl --user import-environment + systemctl --user import-environment $IMPORT_ENVIRONMENT_ENV_LIST DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP PATH; # then start the service exec systemctl --wait --user start sway.service '' diff --git a/profiles/base-user/session-variables.nix b/profiles/base-user/session-variables.nix index 5bbfa8ee..e922781b 100644 --- a/profiles/base-user/session-variables.nix +++ b/profiles/base-user/session-variables.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let psCfg = config.pub-solar; wlroots = psCfg.graphical.wayland; @@ -77,10 +77,22 @@ let # TELEMETRY BS VUEDX_TELEMETRY = "off"; }; + + 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 = pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { - home.sessionVariables = variables; - systemd.user.sessionVariables = variables; + home.sessionVariables = variablesWithMeta; + systemd.user.sessionVariables = variablesWithMeta; }; + + environment.variables = variablesWithMeta; } -- 2.44.1 From dbee2f03e7fb444dde5e7bcbabcf6fbeb5c45cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Thu, 25 Aug 2022 15:17:17 +0200 Subject: [PATCH 076/111] Import the full environment again --- pkgs/sway-service.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sway-service.nix b/pkgs/sway-service.nix index 15781a1a..2ab84c62 100644 --- a/pkgs/sway-service.nix +++ b/pkgs/sway-service.nix @@ -1,6 +1,6 @@ self: with self; '' # first import environment variables from the login manager - systemctl --user import-environment $IMPORT_ENVIRONMENT_ENV_LIST DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP PATH; + systemctl --user import-environment; # then start the service exec systemctl --wait --user start sway.service '' -- 2.44.1 From 8fc8ac2d586735b6a697c950b6536746ac1e73e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Thu, 25 Aug 2022 15:25:34 +0200 Subject: [PATCH 077/111] Fix service startup for ci-runner --- modules/ci-runner/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ci-runner/default.nix b/modules/ci-runner/default.nix index 0e78e55e..1460ab16 100644 --- a/modules/ci-runner/default.nix +++ b/modules/ci-runner/default.nix @@ -23,10 +23,11 @@ in path = [ pkgs.git pkgs.nix + pkgs.libvirt ]; wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + after = [ "network.target" "libvirtd.service" ]; script = ''${pkgs.drone-runner-exec}/bin/drone-runner-exec daemon /run/agenix/drone-runner-exec-config''; }; -- 2.44.1 From 8be1bd53d3c471b641d3e8ef24811f5305760860 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 4 Jun 2022 23:45:06 +0200 Subject: [PATCH 078/111] wip: first PubSolarOS iso test using the NixOS test suite: https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests --- .drone.yml | 21 ++++++++++- flake.nix | 6 ++- tests/first-test.nix | 87 +++++++++++++++++++++++++++++++++++++++++++ tests/second-test.nix | 14 +++++++ 4 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 tests/first-test.nix create mode 100644 tests/second-test.nix diff --git a/.drone.yml b/.drone.yml index f54bd8f9..57a0aa1c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -103,10 +103,29 @@ steps: NIX_FLAGS: "--print-build-logs --verbose" commands: - 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS' - - nix $$NIX_FLAGS flake check - nix $$NIX_FLAGS build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel" - nix $$NIX_FLAGS develop --command echo OK +--- +kind: pipeline +type: exec +name: Tests + +steps: + - name: "Tests" + when: + event: + - pull_request + - tag + environment: + NIX_FLAGS: "--print-build-logs --verbose" + commands: + - 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS' + - nix $$NIX_FLAGS build ".#checks.x86_64-linux.customTestFor-PubSolarOS-firstTest" + #- nix $$NIX_FLAGS flake check + #- nix $$NIX_FLAGS develop --command echo OK + #- nix $$NIX_FLAGS develop --command bud --help + --- kind: pipeline type: docker diff --git a/flake.nix b/flake.nix index bf050b2e..b4335a8d 100644 --- a/flake.nix +++ b/flake.nix @@ -102,7 +102,11 @@ imports = [ (digga.lib.importHosts ./hosts) ]; hosts = { /* set host specific properties here */ - PubSolarOS = { }; + PubSolarOS = { + tests = [ + (import ./tests/first-test.nix { pkgs = nixos.legacyPackages.x86_64-linux; lib = nixos.lib; }) + ]; + }; }; importables = rec { profiles = digga.lib.rakeLeaves ./profiles // { diff --git a/tests/first-test.nix b/tests/first-test.nix new file mode 100644 index 00000000..251779a1 --- /dev/null +++ b/tests/first-test.nix @@ -0,0 +1,87 @@ +{ pkgs, lib, ... }: +{ + name = "firstTest"; + + nodes.test-machine = { suites ? null, ... }: { + imports = suites.iso; + + home-manager.users.pub-solar.programs.zsh.shellAliases = { + test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok"; + test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok"; + }; + + # source: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/tests/sway.nix + environment = { + # For glinfo and wayland-info: + systemPackages = with pkgs; [ mesa-demos wayland-utils alacritty ]; + # Use a fixed SWAYSOCK path (for swaymsg): + variables = { + "SWAYSOCK" = "/tmp/sway-ipc.sock"; + # TODO: Investigate if we can get hardware acceleration to work (via + # virtio-gpu and Virgil). We currently have to use the Pixman software + # renderer since the GLES2 renderer doesn't work inside the VM (even + # with WLR_RENDERER_ALLOW_SOFTWARE): + # "WLR_RENDERER_ALLOW_SOFTWARE" = "1"; + "WLR_RENDERER" = "pixman"; + }; + + # To help with OCR: + etc."xdg/foot/foot.ini".text = lib.generators.toINI { } { + main = { + font = "inconsolata:size=14"; + }; + colors = rec { + foreground = "000000"; + background = "ffffff"; + regular2 = foreground; + }; + }; + }; + + fonts.fonts = [ pkgs.inconsolata ]; + + # Need to switch to a different GPU driver than the default one (-vga std) so that Sway can launch: + virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ]; + virtualisation.cores = 4; + virtualisation.memorySize = 2048; + }; + + enableOCR = true; + + testScript = '' + import shlex + def swaymsg(command: str, succeed=True): + with machine.nested(f"sending swaymsg {command!r}" + " (allowed to fail)" * (not succeed)): + (machine.succeed if succeed else machine.execute)( + f"su - pub-solar -c {shlex.quote('swaymsg -- ' + command)}" + ) + + + machine.wait_for_unit("multi-user.target") + + # To check the version: + print(machine.succeed("sway --version")) + + # Wait for Sway to complete startup: + machine.wait_for_file("/run/user/1000/wayland-1") + machine.wait_for_file("/tmp/sway-ipc.sock") + + # Start a terminal (foot) on workspace 3: + machine.wait_for_text("1") + machine.send_key("meta_l-3") + machine.sleep(3) + machine.send_key("meta_l-ret") + machine.sleep(10) + machine.send_chars("whoami\n") + machine.sleep(3) + machine.wait_for_text("pub-solar") + machine.send_chars("test-wayland\n") + machine.wait_for_file("/tmp/test-wayland-exit-ok") + print(machine.succeed("cat /tmp/test-wayland.out")) + machine.copy_from_vm("/tmp/test-wayland.out") + machine.sleep(3) + machine.screenshot("foot_wayland_info") + machine.send_key("meta_l-shift-q") + machine.wait_until_fails("pgrep foot") + ''; +} diff --git a/tests/second-test.nix b/tests/second-test.nix new file mode 100644 index 00000000..d6409820 --- /dev/null +++ b/tests/second-test.nix @@ -0,0 +1,14 @@ +{ }: +{ + name = "secondTest"; + + nodes.test-machine2 = { suites ? null, ... }: { + imports = [ + suites.iso + ]; + }; + + testScript = '' + machines[0].systemctl("is-system-running --wait") + ''; +} -- 2.44.1 From 472560e1c1507a664e3b8ef479f28228712464ef Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 20:51:56 +0200 Subject: [PATCH 079/111] Restructure CI: build ISO on each push to main branch tags with v* and t* names trigger a test VM pull requests trigger a basic check building host PubSolarOS --- .drone.yml | 119 ++++++++--------------------------------------------- 1 file changed, 17 insertions(+), 102 deletions(-) diff --git a/.drone.yml b/.drone.yml index 57a0aa1c..986eee5c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,92 +1,3 @@ ---- -kind: pipeline -type: docker -name: Upstreaming - -steps: - - name: "Sync 'devos' branch with upstream" - image: alpine/git - when: - event: - - cron - cron: - - sync-main-with-upstream - environment: - GITEA_SSH_KEY: - from_secret: gitea_ssh_key - commands: - - ./.drone/setup_ssh.sh - - git remote add devos git@git.b12f.io:pub-solar/devos - - git remote set-url origin git@git.b12f.io:pub-solar/os - - git fetch --all - - git checkout -b devos --track origin/devos - - git merge -X theirs devos/main - - git push origin devos - - git remote set-url origin https://git.b12f.io/pub-solar/os.git - - - name: "Sync $BRANCH with upstream" - image: alpine/git - when: - event: - - cron - cron: - - sync-main-with-upstream - - sync-b12f-with-main - - sync-teutat3s-with-main - environment: - GITEA_SSH_KEY: - from_secret: gitea_ssh_key - commands: - - git fetch origin - - git checkout origin/main - - ./.drone/setup_ssh.sh - - git remote set-url origin git@git.b12f.io:pub-solar/os - - git fetch --all - - ./.drone/upstream-branch.sh - - - name: "Open pull request for failed merge" - image: nixery.dev/shell/tea - when: - status: - - failure - event: - - cron - cron: - - sync-main-with-upstream - - sync-b12f-with-main - - sync-teutat3s-with-main - environment: - TEA_CONFIG: - from_secret: tea_config - commands: - - mkdir -p ~/.config/tea - - echo "$$TEA_CONFIG" > ~/.config/tea/config.yml - - tea pulls create --base main --head devos - - - name: "Notify matrix" - image: plugins/matrix - when: - status: - - failure - event: - - cron - cron: - - sync-main-with-upstream - - sync-b12f-with-main - - sync-teutat3s-with-main - settings: - homeserver: https://matrix.pub.solar - roomid: dfQBqwkhIzrFjMSsxy:pub.solar - username: - from_secret: matrix_username - password: - from_secret: matrix_password - template: "Upstreaming {{ build.status }} [{{ build.branch }}#{{ truncate build.commit 8 }}]({{ build.link }}) by {{ build.author }}. [Pull requests](https://git.b12f.io/pub-solar/os/pulls)" - -trigger: - event: - - cron - --- kind: pipeline type: docker @@ -98,11 +9,11 @@ steps: when: event: - pull_request - - tag environment: NIX_FLAGS: "--print-build-logs --verbose" commands: - 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS' + - nix $$NIX_FLAGS flake show - nix $$NIX_FLAGS build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel" - nix $$NIX_FLAGS develop --command echo OK @@ -113,18 +24,19 @@ name: Tests steps: - name: "Tests" - when: - event: - - pull_request - - tag environment: NIX_FLAGS: "--print-build-logs --verbose" commands: - 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS' - nix $$NIX_FLAGS build ".#checks.x86_64-linux.customTestFor-PubSolarOS-firstTest" - #- nix $$NIX_FLAGS flake check - #- nix $$NIX_FLAGS develop --command echo OK - #- nix $$NIX_FLAGS develop --command bud --help + - nix-store --read-log result + - nix $$NIX_FLAGS flake check + - nix $$NIX_FLAGS develop --command echo OK + +trigger: + ref: + - refs/tags/v* + - refs/tags/t* --- kind: pipeline @@ -134,14 +46,15 @@ name: Publish ISO steps: - name: "Build ISO" image: docker.nix-community.org/nixpkgs/nix-flakes:latest + environment: + NIX_FLAGS: "--print-build-logs --verbose" volumes: - name: file-exchange path: /var/nix/iso-cache commands: - | - nix --print-build-logs --verbose \ - build \ - '.#nixosConfigurations.bootstrap.config.system.build.bootstrapIso' + nix $$NIX_FLAGS build \ + '.#nixosConfigurations.bootstrap.config.system.build.bootstrapIso' - cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/ - name: "Publish ISO" @@ -167,8 +80,10 @@ depends_on: - Check trigger: + branch: + - main event: - - tag + - push volumes: - name: file-exchange @@ -176,6 +91,6 @@ volumes: --- kind: signature -hmac: da951ba8ede88996728acfb47846e01880eb0e3b91f66e47848d6c1cc727c5d9 +hmac: f78042286446a0649b61bdd28240caf7650cf995804acb714b92d145fa028bdf ... -- 2.44.1 From 553e23baf9e25a77323b1c06f5e75e37713a4fc0 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 14 Aug 2022 21:40:29 +0200 Subject: [PATCH 080/111] ci: add upload artifacts step --- .drone.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 986eee5c..84ef47c9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,9 +13,8 @@ steps: NIX_FLAGS: "--print-build-logs --verbose" commands: - 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS' - - nix $$NIX_FLAGS flake show + - nix $$NIX_FLAGS develop --command nix flake show - nix $$NIX_FLAGS build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel" - - nix $$NIX_FLAGS develop --command echo OK --- kind: pipeline @@ -33,6 +32,25 @@ steps: - nix $$NIX_FLAGS flake check - nix $$NIX_FLAGS develop --command echo OK + - name: "Upload artifacts" + environment: + TRITON_DONT_SOURCE_PROFILE: 1 + PRIVATE_SSH_KEY: + from_secret: private_ssh_key + MANTA_USER: pub_solar + MANTA_URL: https://eu-central.manta.greenbaum.cloud + MANTA_KEY_ID: "02:ae:79:2b:8f:7f:51:ba:c6:3c:ea:6f:f7:bb:d1:6a" + commands: + - export TARGET_DIR="$${DRONE_REPO}/$${DRONE_BUILD_NUMBER}" + - echo env var TARGET_DIR is set to $$TARGET_DIR + - "mkdir ~/.ssh && chmod 700 ~/.ssh" + - echo "$$PRIVATE_SSH_KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519 + - nix flake new --template "git+https://git.greenbaum.cloud/dev/tritonshell?ref=main" ./tritonshell + - git add tritonshell + - cd tritonshell + - nix develop --command mput -p -f ../result/foot_wayland_info.png ~~/public/$${TARGET_DIR} + - nix develop --command mput -p -f ../result/test-wayland.out ~~/public/$${TARGET_DIR} + trigger: ref: - refs/tags/v* @@ -89,8 +107,13 @@ volumes: - name: file-exchange temp: {} +--- +kind: secret +name: private_ssh_key +data: cSWd6rIg8Z51hD+KMenYPX669qb6PWdh9V80Z1YpED68Ffoy73tWEoBjEs2pKUJpcL8qGxMjj5Ot2TAK6iUs5Qnv+ZKmjvvttgVCfKdHE6ULT+aOPdl3PvvKV6VY5iapE7aXmPF5NWuMe4G6OJiA/IP5U4P4hspAUV4/MlAjiLYDNtfJSXpA/5Hv5PvjuTM2RartUdXLdFe5qXfMFlmFKeU6J9jxf0BFY9lwhniOsxTGo6YQmf0fEqRd6i2AeKN58Oevir3H5rKQvDhCAUmPxT8rEHYoG7sgkt4ow+0gWyLuoimetZHHT/0IKbSWpQV9rfgxMa7L9TvN9pe573dKjFcGpJpbUsaL8O7R/Av6APzcNBWwNArMcD7/nSuj/33bppCJfC3IA5KLrRqi2Tt5nVw7Wm5eYX4iloftCBFsuI2Zj3B9eW4wrKy4k/CvP7klinaoyfGrt48Z3K3JCOUnwaZH/4xTE8+V0UeYEfDjU10etVa27I//sxK/yBRNrX3pRXnwQS997/zW8KHhzh7C4BUNkKj9k2qjxFPRKJp3knbfHlEsirfFcPXoDSRlBHpvDqKzNkxtAA== + --- kind: signature -hmac: f78042286446a0649b61bdd28240caf7650cf995804acb714b92d145fa028bdf +hmac: 82e3f3690bafae2ff1962ebc24504275dba0dbca707e14b2a389b31a9f7b57c0 ... -- 2.44.1 From 8feaa494cbafcbd426873fa43b1089cb0354b5ae Mon Sep 17 00:00:00 2001 From: teutat3s Date: Wed, 24 Aug 2022 22:36:53 +0200 Subject: [PATCH 081/111] ci: add matrix notify step, fix ssh key id --- .drone.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index 84ef47c9..0f6e6f7a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,7 +39,7 @@ steps: from_secret: private_ssh_key MANTA_USER: pub_solar MANTA_URL: https://eu-central.manta.greenbaum.cloud - MANTA_KEY_ID: "02:ae:79:2b:8f:7f:51:ba:c6:3c:ea:6f:f7:bb:d1:6a" + MANTA_KEY_ID: "5d:5f:3d:22:8d:37:1f:e6:d6:ab:06:18:d9:a2:04:67" commands: - export TARGET_DIR="$${DRONE_REPO}/$${DRONE_BUILD_NUMBER}" - echo env var TARGET_DIR is set to $$TARGET_DIR @@ -56,6 +56,31 @@ trigger: - refs/tags/v* - refs/tags/t* +--- +kind: pipeline +type: docker +name: Notification + +steps: + - name: "Notify matrix" + image: plugins/matrix + settings: + homeserver: https://matrix.pub.solar + roomid: dfQBqwkhIzrFjMSsxy:pub.solar + username: + from_secret: matrix_username + password: + from_secret: matrix_password + template: "Test run status: {{ build.status }}, artifacts uploaded to Manta: https://eu-central.manta.greenbaum.cloud/pub_solar/public/{{ repo.Owner }}/{{ repo.Name }}/{{ build.number }}" + +depends_on: + - Tests + +trigger: + ref: + - refs/tags/v* + - refs/tags/t* + --- kind: pipeline type: docker @@ -107,13 +132,8 @@ volumes: - name: file-exchange temp: {} ---- -kind: secret -name: private_ssh_key -data: cSWd6rIg8Z51hD+KMenYPX669qb6PWdh9V80Z1YpED68Ffoy73tWEoBjEs2pKUJpcL8qGxMjj5Ot2TAK6iUs5Qnv+ZKmjvvttgVCfKdHE6ULT+aOPdl3PvvKV6VY5iapE7aXmPF5NWuMe4G6OJiA/IP5U4P4hspAUV4/MlAjiLYDNtfJSXpA/5Hv5PvjuTM2RartUdXLdFe5qXfMFlmFKeU6J9jxf0BFY9lwhniOsxTGo6YQmf0fEqRd6i2AeKN58Oevir3H5rKQvDhCAUmPxT8rEHYoG7sgkt4ow+0gWyLuoimetZHHT/0IKbSWpQV9rfgxMa7L9TvN9pe573dKjFcGpJpbUsaL8O7R/Av6APzcNBWwNArMcD7/nSuj/33bppCJfC3IA5KLrRqi2Tt5nVw7Wm5eYX4iloftCBFsuI2Zj3B9eW4wrKy4k/CvP7klinaoyfGrt48Z3K3JCOUnwaZH/4xTE8+V0UeYEfDjU10etVa27I//sxK/yBRNrX3pRXnwQS997/zW8KHhzh7C4BUNkKj9k2qjxFPRKJp3knbfHlEsirfFcPXoDSRlBHpvDqKzNkxtAA== - --- kind: signature -hmac: 82e3f3690bafae2ff1962ebc24504275dba0dbca707e14b2a389b31a9f7b57c0 +hmac: b38ea67f7458383c2f7650d86a619efd065b59888d738d4471c83b0a0ad12e3d ... -- 2.44.1 From c2e5d8df3c6f01c58ec07f2bf7ce74c16f2f62f5 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 25 Aug 2022 15:42:33 +0200 Subject: [PATCH 082/111] ci: better matrix notify template message, prefix manta path with ci/ and set target filename for mput --- .drone.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0f6e6f7a..0bebe210 100644 --- a/.drone.yml +++ b/.drone.yml @@ -41,15 +41,15 @@ steps: MANTA_URL: https://eu-central.manta.greenbaum.cloud MANTA_KEY_ID: "5d:5f:3d:22:8d:37:1f:e6:d6:ab:06:18:d9:a2:04:67" commands: - - export TARGET_DIR="$${DRONE_REPO}/$${DRONE_BUILD_NUMBER}" + - export TARGET_DIR="ci/$${DRONE_REPO}/$${DRONE_BUILD_NUMBER}" - echo env var TARGET_DIR is set to $$TARGET_DIR - "mkdir ~/.ssh && chmod 700 ~/.ssh" - echo "$$PRIVATE_SSH_KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519 - nix flake new --template "git+https://git.greenbaum.cloud/dev/tritonshell?ref=main" ./tritonshell - git add tritonshell - cd tritonshell - - nix develop --command mput -p -f ../result/foot_wayland_info.png ~~/public/$${TARGET_DIR} - - nix develop --command mput -p -f ../result/test-wayland.out ~~/public/$${TARGET_DIR} + - nix develop --command mput -p -f ../result/foot_wayland_info.png ~~/public/$${TARGET_DIR}/foot_wayland_info.png + - nix develop --command mput -p -f ../result/test-wayland.out ~~/public/$${TARGET_DIR}/test-wayland.out trigger: ref: @@ -71,7 +71,7 @@ steps: from_secret: matrix_username password: from_secret: matrix_password - template: "Test run status: {{ build.status }}, artifacts uploaded to Manta: https://eu-central.manta.greenbaum.cloud/pub_solar/public/{{ repo.Owner }}/{{ repo.Name }}/{{ build.number }}" + template: "Test run triggered by tag: {{ build.tag }}. Test run exit status: {{ build.status }}. Artifacts uploaded to Manta: https://eu-central.manta.greenbaum.cloud/pub_solar/public/ci/{{ repo.Owner }}/{{ repo.Name }}/{{ build.number }}/foot_wayland_info.png" depends_on: - Tests @@ -134,6 +134,6 @@ volumes: --- kind: signature -hmac: b38ea67f7458383c2f7650d86a619efd065b59888d738d4471c83b0a0ad12e3d +hmac: c6845bbec339e7ccfdb34889bfd56d25dc2c423eac255eb30f19b8d9e7bf9f1f ... -- 2.44.1 From 61220214356b9d719b0cbddc6e878586c3775e1c Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 27 Aug 2022 13:48:32 +0200 Subject: [PATCH 083/111] Bump flake.lock --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 857bb989..29228dcd 100644 --- a/flake.lock +++ b/flake.lock @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1657835815, - "narHash": "sha256-CnZszAYpNKydh6N7+xg+eRtWNVoAAGqc6bg+Lpgq1xc=", + "lastModified": 1661329936, + "narHash": "sha256-dafFjAcJPo0SdegK3E+SnTI8CNMgV/bBm/6CeDf82f8=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "54a24f042f93c79f5679f133faddedec61955cf2", + "rev": "ef0e7f41cdf8fae1d2390c4df246c90a364ed8d9", "type": "github" }, "original": { @@ -307,11 +307,11 @@ }, "latest_2": { "locked": { - "lastModified": 1660305968, - "narHash": "sha256-r0X1pZCSEA6mzt5OuTA7nHuLmvnbkwgpFAh1iLIx4GU=", + "lastModified": 1661361016, + "narHash": "sha256-Bjf6ZDnDc6glTwIIItvwfcaeJ5zWFM6GYfPajSArdUY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d", + "rev": "b784c5ae63dd288375af1b4d37b8a27dd8061887", "type": "github" }, "original": { @@ -358,11 +358,11 @@ }, "nixos": { "locked": { - "lastModified": 1660318005, - "narHash": "sha256-g9WCa9lVUmOV6dYRbEPjv/TLOR5hamjeCcKExVGS3OQ=", + "lastModified": 1661427965, + "narHash": "sha256-LJeSDbiebN0/eRt9vyOm+Bxljdsq5ZdalmmTk9Xpp30=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5c211b47aeadcc178c5320afd4e74c7eed5c389f", + "rev": "058de3818577db19d1965c21e2479916a3eaaf95", "type": "github" }, "original": { @@ -378,11 +378,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1657748715, - "narHash": "sha256-WecDwDY/hEcDQYzFnccCNa+5Umht0lfjx/d1qGDy/rQ=", + "lastModified": 1660727616, + "narHash": "sha256-zYTIvdPMYMx/EYqXODAwIIU30RiEHqNHdgarIHuEYZc=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "3323b944d99b026aebfd8de439e001409dde067d", + "rev": "adccd191a0e83039d537e021f19495b7bad546a1", "type": "github" }, "original": { -- 2.44.1 From 242de215d6801d6858fe935d2ef1170651909d49 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 27 Aug 2022 13:49:55 +0200 Subject: [PATCH 084/111] Switch to our digga fork, include upstream PR divnix/digga#455 to fix bootstrap iso builds --- flake.lock | 11 ++++++----- flake.nix | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 29228dcd..794fd6d0 100644 --- a/flake.lock +++ b/flake.lock @@ -143,15 +143,16 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1659622306, - "narHash": "sha256-Kpfm2PNs+kZU0W7qcugoPATLG8I2P7FJFGTgsf1LJiU=", - "owner": "divnix", + "lastModified": 1661600857, + "narHash": "sha256-KfQCcTtfvU0PXV4fD9XKIMcKx9lUUR0xWJoBgc12fKE=", + "owner": "pub-solar", "repo": "digga", - "rev": "d1193743a535d7fbbc7f3eda4e51295b10bd4d2c", + "rev": "c902b3ef0aa45cb4f336c390f647bb182c38a221", "type": "github" }, "original": { - "owner": "divnix", + "owner": "pub-solar", + "ref": "fix/bootstrap-iso", "repo": "digga", "type": "github" } diff --git a/flake.nix b/flake.nix index b4335a8d..466d1077 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ nixos.url = "github:nixos/nixpkgs/nixos-22.05"; latest.url = "github:nixos/nixpkgs/nixos-unstable"; - digga.url = "github:divnix/digga"; + digga.url = "github:pub-solar/digga/fix/bootstrap-iso"; digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixlib.follows = "nixos"; digga.inputs.home-manager.follows = "home"; -- 2.44.1 From 209eed069c066b1ae504ae7e43adc4f4f90bcceb Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 29 Aug 2022 11:53:55 +0200 Subject: [PATCH 085/111] Add comment how to build isoImage --- hosts/bootstrap.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix index ba509911..7772b0f1 100644 --- a/hosts/bootstrap.nix +++ b/hosts/bootstrap.nix @@ -1,9 +1,6 @@ { profiles, ... }: { - # build with: `nix build '.#nixosConfigurations.bootstrap.config.system.build.bootstrapIso'` - # reachable on the local link via ssh root@fe80::47%eno1 - # where 'eno1' is replaced by your own machine's network - # interface that has the local link to the target machine + # build with: `nix build ".#nixosConfigurations.bootstrap.config.system.build.isoImage"` imports = [ # profiles.networking profiles.users.root # make sure to configure ssh keys -- 2.44.1 From c1b672fe703a46a50dda2bcbca9f021606d41c0f Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 29 Aug 2022 11:55:20 +0200 Subject: [PATCH 086/111] Fix conflicting definition values, force use of our defined value. error: The option 'services.getty.autologinUser' has conflicting definition values: - In '/nix/store/zyh8f18z0m1r9jppvdcdivfvfxg0j3fv-source/nixos/modules/profiles/installation-device.nix': "nixos" - In '/nix/store/w82qigr5jqv9c6jhdrpdwixydk3rmbzw-source/modules/graphical': "pub-solar" --- modules/graphical/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index a506c2ef..ede262b3 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -61,7 +61,7 @@ in }; }; - services.getty.autologinUser = mkIf cfg.autologin.enable "${psCfg.user.name}"; + services.getty.autologinUser = mkIf cfg.autologin.enable (mkForce "${psCfg.user.name}"); qt5 = { enable = true; -- 2.44.1 From 7b5696435a8ec65b4788647c8a3a42f92da58348 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 29 Aug 2022 15:19:07 +0200 Subject: [PATCH 087/111] Fix Build ISO ci step, use '.#nixosConfigurations.bootstrap.config.system.build.isoImage' --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0bebe210..a170d5a2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -97,7 +97,7 @@ steps: commands: - | nix $$NIX_FLAGS build \ - '.#nixosConfigurations.bootstrap.config.system.build.bootstrapIso' + '.#nixosConfigurations.bootstrap.config.system.build.isoImage' - cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/ - name: "Publish ISO" @@ -134,6 +134,6 @@ volumes: --- kind: signature -hmac: c6845bbec339e7ccfdb34889bfd56d25dc2c423eac255eb30f19b8d9e7bf9f1f +hmac: 5d7c0ef5519ffe68189271b18d9084db55c9e14831f95234655f5387f9426db0 ... -- 2.44.1 From 2fa84ab4aae51a50218344e177e9009bb9cbeba1 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 29 Aug 2022 16:47:31 +0200 Subject: [PATCH 088/111] Use more descriptive drone secret names --- .drone.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index a170d5a2..7da733c4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -107,13 +107,13 @@ steps: path: /var/nix/iso-cache settings: host: - from_secret: ssh_host + from_secret: iso_web_ssh_host user: - from_secret: ssh_user + from_secret: iso_web_ssh_user port: - from_secret: ssh_port + from_secret: iso_web_ssh_port key: - from_secret: ssh_key + from_secret: iso_web_ssh_key target: /srv/os source: - /var/nix/iso-cache/*.iso @@ -134,6 +134,6 @@ volumes: --- kind: signature -hmac: 5d7c0ef5519ffe68189271b18d9084db55c9e14831f95234655f5387f9426db0 +hmac: 2b930bb5fe02006203b7c2fae8af75814749e8cec5f976ec0d6e64eae1b0c5db ... -- 2.44.1 From b7ba1b7ba9b87c7a60e3f2fe4772d8579b0ed711 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 1 Sep 2022 14:34:57 +0200 Subject: [PATCH 089/111] Fix hosts rebuilding with ISO config after #125 See: https://github.com/divnix/digga/pull/455#issuecomment-1231789444 Upstream fix found in https://github.com/montchr/dotfield/blob/e1b09712fef297ee6173f7010787cd5b2b574a17/nixos/default.nix#L85-L88 --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 466d1077..41cd4ff2 100644 --- a/flake.nix +++ b/flake.nix @@ -92,7 +92,10 @@ imports = [ (digga.lib.importExportableModules ./modules) ]; modules = [ { lib.our = self.lib; } - digga.nixosModules.bootstrapIso + # FIXME: upstream module causes a huge number of unnecessary + # dependencies to be pulled in for all systems -- many of them are + # graphical. should only be imported as needed. + # digga.nixosModules.bootstrapIso digga.nixosModules.nixConfig home.nixosModules.home-manager agenix.nixosModules.age -- 2.44.1 From d563b1d469a0a8bd2e170f450e8c6e790ee4efb9 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 1 Sep 2022 14:37:14 +0200 Subject: [PATCH 090/111] Fix swaylock-bg, now a bash script - reference jq from pkgs - shellcheck fixes --- pkgs/swaylock-bg.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/swaylock-bg.nix b/pkgs/swaylock-bg.nix index b55c32ae..75bcd7de 100644 --- a/pkgs/swaylock-bg.nix +++ b/pkgs/swaylock-bg.nix @@ -3,18 +3,17 @@ self: with self; '' # swaylock # Make sure we aren't running twice - RUNNING=$(ps -A | grep swaylock | wc -l) - if [ $RUNNING -ne 0 ]; then + RUNNING=$(${procps}/bin/pgrep -c ${swaylock}/bin/swaylock) + if [ "$RUNNING" -ne 0 ]; then exit 0 fi - IMAGE=$XDG_CONFIG_HOME/wallpaper.jpg + IMAGE="$XDG_CONFIG_HOME/wallpaper.jpg" LOCKARGS="" - for OUTPUT in `${sway}/bin/swaymsg -t get_outputs | jq -r '.[].name'` + for OUTPUT in $(${sway}/bin/swaymsg -t get_outputs | ${jq}/bin/jq -r '.[].name') do LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}" - IMAGES="''${IMAGES} ''${IMAGE}" done exec ${swaylock}/bin/swaylock $LOCKARGS '' -- 2.44.1 From 1767dcb0763cbfeed673200602b20e11c465da35 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 1 Sep 2022 14:38:10 +0200 Subject: [PATCH 091/111] Fix swayidle service - add missing \ - reference swaylock-bg script from pkgs --- modules/sway/swayidle.service.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index f10675fb..685d0f1d 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -12,11 +12,11 @@ Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin"; ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ after-resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock-bg' '' + (if psCfg.paranoia.enable then '' \ + before-sleep '${pkgs.swaylock-bg}/bin/swaylock-bg' '' + (if psCfg.paranoia.enable then '' \ timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ timeout 150 'systemctl hibernate' '' else '' \ - timeout 600 'swaylock-bg' + timeout 600 '${pkgs.swaylock-bg}/bin/swaylock-bg' \ timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' ''); }; -- 2.44.1 From 0fbabc23b921fa8ac8ac5647d1ff6b5a360b70c4 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 1 Sep 2022 15:35:04 +0200 Subject: [PATCH 092/111] bootstap: host needs digga's bootstrapIso module --- flake.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flake.nix b/flake.nix index 41cd4ff2..4ac60e8a 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,11 @@ imports = [ (digga.lib.importHosts ./hosts) ]; hosts = { /* set host specific properties here */ + bootstrap = { + modules = [ + digga.nixosModules.bootstrapIso + ]; + }; PubSolarOS = { tests = [ (import ./tests/first-test.nix { pkgs = nixos.legacyPackages.x86_64-linux; lib = nixos.lib; }) -- 2.44.1 From 612e5e35c0cab9ed9f836d1dc861a815d3921bbe Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 1 Oct 2022 23:12:48 +0200 Subject: [PATCH 093/111] Fix swayidle, lock, waybar menu --- modules/sway/config/config.d/mode_system.conf.nix | 15 +++++++++++---- modules/sway/default.nix | 2 +- modules/sway/swayidle.service.nix | 8 ++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/modules/sway/config/config.d/mode_system.conf.nix b/modules/sway/config/config.d/mode_system.conf.nix index f34ecc57..f01921c4 100644 --- a/modules/sway/config/config.d/mode_system.conf.nix +++ b/modules/sway/config/config.d/mode_system.conf.nix @@ -1,15 +1,22 @@ -{ psCfg, ... }: '' +{ pkgs, psCfg, ... }: '' # Set shut down, restart and locking features +'' + (if psCfg.core.hibernation.enable && !psCfg.paranoia.enable then '' + set $mode_system (e)xit, (h)ibernate, (l)ock, (s)uspend, (r)eboot, (Shift+s)hutdown +'' else if psCfg.paranoia.enable then '' set $mode_system (e)xit, (h)ibernate, (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" + bindsym h exec systemctl hibernate, mode "default" '' else "") + (if !psCfg.paranoia.enable then '' - bindsym l exec swaylock-bg, mode "default" - bindsym s exec systemctl suspend, mode "default" + bindsym l exec ${pkgs.swaylock-bg}/bin/swaylock-bg, mode "default" + bindsym s exec systemctl suspend, mode "default" '' else "") + '' bindsym r exec systemctl reboot, mode "default" bindsym Shift+s exec systemctl poweroff, mode "default" diff --git a/modules/sway/default.nix b/modules/sway/default.nix index dd0e6055..c173e9ce 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -98,7 +98,7 @@ in 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 psCfg; }; + 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/sway/swayidle.service.nix b/modules/sway/swayidle.service.nix index 685d0f1d..80a04518 100644 --- a/modules/sway/swayidle.service.nix +++ b/modules/sway/swayidle.service.nix @@ -9,14 +9,14 @@ }; Service = { Type = "simple"; - Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin"; - ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \ + Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin:${pkgs.swaylock-bg}/bin:${pkgs.swayidle}/bin"; + ExecStart = ''swayidle -w \ after-resume 'swaymsg "output * dpms on"' \ - before-sleep '${pkgs.swaylock-bg}/bin/swaylock-bg' '' + (if psCfg.paranoia.enable then '' \ + before-sleep 'swaylock-bg' '' + (if psCfg.paranoia.enable then '' \ timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ timeout 150 'systemctl hibernate' '' else '' \ - timeout 600 '${pkgs.swaylock-bg}/bin/swaylock-bg' \ + timeout 600 'swaylock-bg' \ timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' ''); }; -- 2.44.1 From 1181cd6feafb4b7a3778fc8dc2a7434bfe2b4b54 Mon Sep 17 00:00:00 2001 From: hensoko Date: Sun, 2 Oct 2022 01:17:34 +0000 Subject: [PATCH 094/111] Improve core module (#132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/132 Reviewed-by: Benjamin Bädorf --- modules/core/boot.nix | 2 +- modules/core/default.nix | 8 +++--- modules/core/networking.nix | 49 ++++++++++++++++++++++++------------- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 10f67dc4..cb16865d 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -19,7 +19,7 @@ in config = { boot = { # Enable plymouth for better experience of booting - plymouth.enable = true; + plymouth.enable = mkIf (!cfg.lite) (lib.mkDefault true); # Mount / luks device in initrd # Allow fstrim to work on it. diff --git a/modules/core/default.nix b/modules/core/default.nix index 80ca4926..9a3ea0fe 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -29,12 +29,12 @@ in config = { pub-solar = { - audio.enable = lib.mkIf (!cfg.lite) true; - crypto.enable = lib.mkIf (!cfg.lite) true; - devops.enable = lib.mkIf (!cfg.lite) true; + audio.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true); + crypto.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true); + devops.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true); terminal-life = { - enable = true; + enable = lib.mkDefault true; lite = cfg.lite; }; }; diff --git a/modules/core/networking.nix b/modules/core/networking.nix index 5774f7eb..edfef42d 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -6,6 +6,15 @@ let cfg = config.pub-solar.core; in { options.pub-solar.core = { + enableCaddy = mkOption { + type = types.bool; + default = !cfg.lite; + }; + enableHelp = mkOption { + type = types.bool; + default = !cfg.lite; + }; + binaryCaches = mkOption { type = types.listOf types.str; default = [ ]; @@ -16,11 +25,6 @@ in default = [ ]; description = "Public keys of binary caches."; }; - iwdConfig = mkOption { - type = with types; nullOr (attrsOf (attrsOf (oneOf [ bool int str ]))); - default = null; - description = "Configuratoin of iNet Wireless Daemon."; - }; }; config = { # disable NetworkManager-wait-online by default @@ -38,27 +42,38 @@ in # These entries get added to /etc/hosts networking.hosts = { - "127.0.0.1" = [ "cups.local" "help.local" "caddy.local" ]; + "127.0.0.1" = [ ] + ++ lib.optionals cfg.enableCaddy [ "caddy.local" ] + ++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ] + ++ lib.optionals cfg.enableHelp [ "help.local" ]; }; # Caddy reverse proxy for local services like cups services.caddy = { - enable = true; + enable = cfg.enableCaddy; globalConfig = '' default_bind 127.0.0.1 auto_https off ''; - extraConfig = '' - cups.local:80 { - request_header Host localhost:631 - reverse_proxy unix//run/cups/cups.sock - } + extraConfig = concatStringsSep "\n" [ + (lib.optionalString + config.pub-solar.printing.enable + '' + cups.local:80 { + request_header Host localhost:631 + reverse_proxy unix//run/cups/cups.sock + } + '') - help.local:80 { - root * ${pkgs.psos-docs}/lib/html - file_server - } - ''; + (lib.optionalString + cfg.enableHelp + '' + help.local:80 { + root * ${pkgs.psos-docs}/lib/html + file_server + } + '') + ]; }; }; } -- 2.44.1 From e80195849422055e52d3e447cb92428cc88fca19 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 2 Oct 2022 04:10:50 +0200 Subject: [PATCH 095/111] Update inputs in flake.lock --- flake.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index 794fd6d0..4e02f07a 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1652712410, - "narHash": "sha256-hMJ2TqLt0DleEnQFGUHK9sV2aAzJPU8pZeiZoqRozbE=", + "lastModified": 1664140963, + "narHash": "sha256-pFxDtOLduRFlol0Y4ShE+soRQX4kbhaCNBtDOvx7ykw=", "owner": "ryantm", "repo": "agenix", - "rev": "7e5e58b98c3dcbf497543ff6f22591552ebfe65b", + "rev": "6acb1fe5f8597d5ce63fc82bc7fcac7774b1cdf0", "type": "github" }, "original": { @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1661329936, - "narHash": "sha256-dafFjAcJPo0SdegK3E+SnTI8CNMgV/bBm/6CeDf82f8=", + "lastModified": 1664210064, + "narHash": "sha256-df6nKVZe/yAhmJ9csirTPahc0dldwm3HBhCVNA6qWr0=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "ef0e7f41cdf8fae1d2390c4df246c90a364ed8d9", + "rev": "02d2551c927b7d65ded1b3c7cd13da5cc7ae3fcf", "type": "github" }, "original": { @@ -192,11 +192,11 @@ "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1648199409, - "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -256,11 +256,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -308,11 +308,11 @@ }, "latest_2": { "locked": { - "lastModified": 1661361016, - "narHash": "sha256-Bjf6ZDnDc6glTwIIItvwfcaeJ5zWFM6GYfPajSArdUY=", + "lastModified": 1664538465, + "narHash": "sha256-EnlC7dDKX7X1wlnXkB1gmn9rBZQ0J9+biVTZHw//8us=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b784c5ae63dd288375af1b4d37b8a27dd8061887", + "rev": "10ecda252ce1b3b1d6403caeadbcc8f30d5ab796", "type": "github" }, "original": { @@ -329,11 +329,11 @@ ] }, "locked": { - "lastModified": 1659610603, - "narHash": "sha256-LYgASYSPYo7O71WfeUOaEUzYfzuXm8c8eavJcel+pfI=", + "lastModified": 1662220400, + "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", "owner": "nmattia", "repo": "naersk", - "rev": "c6a45e4277fa58abd524681466d3450f896dc094", + "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", "type": "github" }, "original": { @@ -359,11 +359,11 @@ }, "nixos": { "locked": { - "lastModified": 1661427965, - "narHash": "sha256-LJeSDbiebN0/eRt9vyOm+Bxljdsq5ZdalmmTk9Xpp30=", + "lastModified": 1664594436, + "narHash": "sha256-YHowMADGzdi7fKnGlg47qe0PIljq+11VqLarmXDuKxQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "058de3818577db19d1965c21e2479916a3eaaf95", + "rev": "9cac45850280978a21a3eb67b15a18f34cbffa2d", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1660407119, - "narHash": "sha256-04lWO0pDbhAXFdL4v2VzzwgxrZ5IefKn+TmZPiPeKxg=", + "lastModified": 1664628729, + "narHash": "sha256-A1J0ZPhBfZZiWI6ipjKJ8+RpMllzOMu/An/8Tk3t4oo=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "12620020f76b1b5d2b0e6fbbda831ed4f5fe56e1", + "rev": "3024c67a2e9a35450558426c42e7419ab37efd95", "type": "github" }, "original": { @@ -460,11 +460,11 @@ ] }, "locked": { - "lastModified": 1654975372, - "narHash": "sha256-wkNZ16akgKViuZzE/IM+bux4uaJ04KIwUeexH8gBjgw=", + "lastModified": 1664550666, + "narHash": "sha256-eXfMRd9uItEp3PsYI31FSVGPG9dVC6yF++65ZrGwW8A=", "owner": "berberman", "repo": "nvfetcher", - "rev": "d4b237c10f14f72f8266b0f658faad822e491e55", + "rev": "9763ad40d59a044e90726653d9253efaeeb053b2", "type": "github" }, "original": { -- 2.44.1 From 986680cc26e75217b9365935f379581b84b26007 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 2 Oct 2022 23:59:08 +0200 Subject: [PATCH 096/111] bootstrap iso: add PubSolarOS naming, drone pipeline adjustments to include a symlink to the latest iso built --- .drone.yml | 13 +++++++++-- hosts/bootstrap.nix | 48 +++++++++++++++++++++++++++++++--------- modules/core/default.nix | 9 ++++---- 3 files changed, 52 insertions(+), 18 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7da733c4..b9718b8c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -98,7 +98,14 @@ steps: - | nix $$NIX_FLAGS build \ '.#nixosConfigurations.bootstrap.config.system.build.isoImage' - - cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/ + - cp $(readlink -f result)/iso/PubSolarOS*.iso /var/nix/iso-cache/ + - nix shell nixpkgs#findutils + - cd /var/nix/iso-cache/ + - export ISO_NAME=$(find . -name '*.iso' -printf "%f\n") + - sha256sum $ISO_NAME > $ISO_NAME.sha256 + - ln -s $ISO_NAME PubSolarOS-latest.iso + - cp $ISO_NAME.sha256 PubSolarOS-latest.iso.sha256 + - nix run nixpkgs#gnused -- --in-place "s/$ISO_NAME/PubSolarOS-latest.iso/" PubSolarOS-latest.iso.sha256 - name: "Publish ISO" image: appleboy/drone-scp @@ -117,6 +124,8 @@ steps: target: /srv/os source: - /var/nix/iso-cache/*.iso + - /var/nix/iso-cache/*.iso.sha256 + overwrite: true strip_components: 3 depends_on: @@ -134,6 +143,6 @@ volumes: --- kind: signature -hmac: 2b930bb5fe02006203b7c2fae8af75814749e8cec5f976ec0d6e64eae1b0c5db +hmac: 7b0b56a97294cd563eee2bde56abeea6dd0928e01729980a25f8c165a3f6e0f6 ... diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix index 7772b0f1..49422675 100644 --- a/hosts/bootstrap.nix +++ b/hosts/bootstrap.nix @@ -1,4 +1,18 @@ -{ profiles, ... }: +{ config, lib, pkgs, profiles, ... }: +with lib; +let + # Gets hostname of host to be bundled inside iso + # Copied from https://github.com/divnix/digga/blob/30ffa0b02272dc56c94fd3c7d8a5a0f07ca197bf/modules/bootstrap-iso.nix#L3-L11 + getFqdn = config: + let + net = config.networking; + fqdn = + if (net ? domain) && (net.domain != null) + then "${net.hostName}.${net.domain}" + else net.hostName; + in + fqdn; +in { # build with: `nix build ".#nixosConfigurations.bootstrap.config.system.build.isoImage"` imports = [ @@ -10,16 +24,28 @@ profiles.pub-solar-iso ]; - boot.loader.systemd-boot.enable = true; + config = { + boot.loader.systemd-boot.enable = true; - # will be overridden by the bootstrapIso instrumentation - fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; + # will be overridden by the bootstrapIso instrumentation + fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "21.05"; # Did you read the comment? + system.nixos.label = "PubSolarOS-" + config.system.nixos.version; + + # mkForce because a similar transformation gets double applied otherwise + # https://github.com/divnix/digga/blob/30ffa0b02272dc56c94fd3c7d8a5a0f07ca197bf/modules/bootstrap-iso.nix#L17 + # https://github.com/NixOS/nixpkgs/blob/aecd4d8349b94f9bd5718c74a5b789f233f67326/nixos/modules/installer/cd-dvd/installation-cd-base.nix#L21-L22 + isoImage = { + isoBaseName = mkForce (getFqdn config); + isoName = mkForce "${config.system.nixos.label}-${config.isoImage.isoBaseName}-${pkgs.stdenv.hostPlatform.system}.iso"; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.05"; # Did you read the comment? + }; } diff --git a/modules/core/default.nix b/modules/core/default.nix index 9a3ea0fe..4f74b46d 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -2,7 +2,6 @@ with lib; let - psCfg = config.pub-solar; cfg = config.pub-solar.core; in { @@ -29,12 +28,12 @@ in config = { pub-solar = { - audio.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true); - crypto.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true); - devops.enable = lib.mkIf (!cfg.lite) (lib.mkDefault true); + audio.enable = mkIf (!cfg.lite) (mkDefault true); + crypto.enable = mkIf (!cfg.lite) (mkDefault true); + devops.enable = mkIf (!cfg.lite) (mkDefault true); terminal-life = { - enable = lib.mkDefault true; + enable = mkDefault true; lite = cfg.lite; }; }; -- 2.44.1 From f2ecc2d8b9ee6b5c0cbda2f3e8b5342e714e58b6 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 3 Oct 2022 02:30:08 +0200 Subject: [PATCH 097/111] ci: fix upload target path --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index b9718b8c..5e20924e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -121,7 +121,7 @@ steps: from_secret: iso_web_ssh_port key: from_secret: iso_web_ssh_key - target: /srv/os + target: /srv/os/download source: - /var/nix/iso-cache/*.iso - /var/nix/iso-cache/*.iso.sha256 @@ -143,6 +143,6 @@ volumes: --- kind: signature -hmac: 7b0b56a97294cd563eee2bde56abeea6dd0928e01729980a25f8c165a3f6e0f6 +hmac: 8823c7103f6a075bb291a497c7ab5d5db47a91f9bc7d8ef95329b5620c9cf91d ... -- 2.44.1 From 8529a15177466a14be333e0fdc83e39f3eb4ee07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 3 Oct 2022 03:57:34 +0200 Subject: [PATCH 098/111] Be more paranoid The paranoia mode now also enables the firewall and closes down a couple of small openSSH holes. `noexec` on the whole FS is left out as it will make every existing PubSolarOS installation panic. --- modules/core/networking.nix | 2 ++ modules/paranoia/default.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/modules/core/networking.nix b/modules/core/networking.nix index edfef42d..c5ec9cbe 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -36,6 +36,8 @@ in wifi.backend = "iwd"; }; + networking.firewall.enable = true; + # Customized binary caches list (with fallback to official binary cache) nix.binaryCaches = cfg.binaryCaches; nix.binaryCachePublicKeys = cfg.publicKeys; diff --git a/modules/paranoia/default.nix b/modules/paranoia/default.nix index 699ab13e..f5ceaeaf 100644 --- a/modules/paranoia/default.nix +++ b/modules/paranoia/default.nix @@ -21,5 +21,35 @@ in config = mkIf cfg.enable { pub-solar.core.hibernation.enable = true; services.logind.lidSwitch = "hibernate"; + + # The options below are directly taken from or inspired by + # https://xeiaso.net/blog/paranoid-nixos-2021-07-18 + + # Don't set this if you need sftp + services.openssh.allowSFTP = false; + services.openssh.openFirewall = false; # Lock yourself out + + # 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" ]; + + services.openssh = { + enable = true; + openFirewall = false; + passwordAuthentication = false; + kbdInteractiveAuthentication = false; + extraConfig = '' + AllowTcpForwarding yes + X11Forwarding no + AllowAgentForwarding no + AllowStreamLocalForwarding no + AuthenticationMethods publickey + ''; + }; }; } -- 2.44.1 From 6f3885d0caff8d36508080e4db60b4c62616c3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 3 Oct 2022 04:07:48 +0200 Subject: [PATCH 099/111] Remove doubled openssh configs in paranoia module --- modules/paranoia/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/paranoia/default.nix b/modules/paranoia/default.nix index f5ceaeaf..75275a11 100644 --- a/modules/paranoia/default.nix +++ b/modules/paranoia/default.nix @@ -39,8 +39,6 @@ in # fileSystems."/".options = [ "noexec" ]; services.openssh = { - enable = true; - openFirewall = false; passwordAuthentication = false; kbdInteractiveAuthentication = false; extraConfig = '' -- 2.44.1 From b23e1e16a42465ff3905905e43f3265ef8b62846 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 3 Oct 2022 04:11:16 +0200 Subject: [PATCH 100/111] alacritty: improve selection and cursor colors --- modules/graphical/alacritty.nix | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/graphical/alacritty.nix b/modules/graphical/alacritty.nix index e4e2f6ad..b389343c 100644 --- a/modules/graphical/alacritty.nix +++ b/modules/graphical/alacritty.nix @@ -100,10 +100,15 @@ foreground = "0xe3e1e4"; }; - # Colors the cursor will use if `custom_cursor_colors` is true + # 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 = "0x1a181a"; - cursor = "0xe3e1e4"; + text = "CellBackground"; + cursor = "CellForeground"; }; # Colors used for the search bar and match highlighting. @@ -115,14 +120,25 @@ background = "0x1a181a"; }; focused_match = { - foreground = "0xe5c463"; - background = "0xe3e1e4"; + 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"; -- 2.44.1 From 5da560ef56cb081b4dd3bae67a3a2e67421487cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 3 Oct 2022 04:55:14 +0200 Subject: [PATCH 101/111] Open up SSH by default --- modules/core/services.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/services.nix b/modules/core/services.nix index 61ba6ea0..41aa45e5 100644 --- a/modules/core/services.nix +++ b/modules/core/services.nix @@ -4,7 +4,9 @@ # For rage encryption, all hosts need a ssh key pair services.openssh = { enable = true; - openFirewall = lib.mkDefault false; + # If you don't want the host to have SSH actually opened up to the net, + # set `services.openssh.openFirewall` to false in your config. + openFirewall = lib.mkDefault true; }; # Service that makes Out of Memory Killer more effective -- 2.44.1 From f28d05e24eee55396773f165b40d374be795f414 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Wed, 5 Oct 2022 11:57:51 +0200 Subject: [PATCH 102/111] Change user.publicKeys to a SSH keys string list --- modules/user/default.nix | 2 +- profiles/base-user/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/user/default.nix b/modules/user/default.nix index 2fd5958e..7c869380 100644 --- a/modules/user/default.nix +++ b/modules/user/default.nix @@ -23,7 +23,7 @@ in }; publicKeys = mkOption { description = "User SSH public keys"; - type = types.listOf types.path; + type = types.listOf types.str; default = [ ]; }; fullName = mkOption { diff --git a/profiles/base-user/default.nix b/profiles/base-user/default.nix index 9ff21c8e..374dca40 100644 --- a/profiles/base-user/default.nix +++ b/profiles/base-user/default.nix @@ -25,7 +25,7 @@ in ]; initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else ""; shell = pkgs.zsh; - openssh.authorizedKeys.keyFiles = if psCfg.user.publicKeys != null then psCfg.user.publicKeys else [ ]; + openssh.authorizedKeys.keys = if psCfg.user.publicKeys != null then psCfg.user.publicKeys else [ ]; }; }; } -- 2.44.1 From d43bd8058058f7d3231b4422997e9a11eb03385b Mon Sep 17 00:00:00 2001 From: teutat3s Date: Wed, 5 Oct 2022 11:58:26 +0200 Subject: [PATCH 103/111] core: disable SSH passwordAuthentication by default --- modules/core/services.nix | 1 + modules/paranoia/default.nix | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/services.nix b/modules/core/services.nix index 41aa45e5..6ce74472 100644 --- a/modules/core/services.nix +++ b/modules/core/services.nix @@ -7,6 +7,7 @@ # If you don't want the host to have SSH actually opened up to the net, # set `services.openssh.openFirewall` to false in your config. openFirewall = lib.mkDefault true; + passwordAuthentication = false; }; # Service that makes Out of Memory Killer more effective diff --git a/modules/paranoia/default.nix b/modules/paranoia/default.nix index 75275a11..2dc439cf 100644 --- a/modules/paranoia/default.nix +++ b/modules/paranoia/default.nix @@ -39,7 +39,6 @@ in # fileSystems."/".options = [ "noexec" ]; services.openssh = { - passwordAuthentication = false; kbdInteractiveAuthentication = false; extraConfig = '' AllowTcpForwarding yes -- 2.44.1 From 4520dece5f0a96e762c032e7d98d9080481f33a4 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 18 Oct 2022 16:24:43 +0200 Subject: [PATCH 104/111] neovim: use nvfetcher for custom plugins --- modules/terminal-life/nvim/default.nix | 72 ++------------------- overlays/neovim-plugins.nix | 22 +++++++ overlays/rnix-lsp.nix | 9 +-- pkgs/_sources/generated.nix | 90 ++++++++++++++++++++++++-- pkgs/sources.toml | 28 ++++++++ 5 files changed, 140 insertions(+), 81 deletions(-) create mode 100644 overlays/neovim-plugins.nix diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index bc06943b..4df1892a 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -5,66 +5,6 @@ let xdg = config.home-manager.users."${psCfg.user.name}".xdg; preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs); - - vimagit-master = pkgs.vimUtils.buildVimPlugin { - name = "vimagit-master"; - src = pkgs.fetchFromGitHub { - owner = "jreybert"; - repo = "vimagit"; - rev = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4"; - sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0="; - }; - }; - - instant-nvim = pkgs.vimUtils.buildVimPlugin { - name = "instant"; - src = pkgs.fetchFromGitHub { - owner = "jbyuki"; - repo = "instant.nvim"; - rev = "c02d72267b12130609b7ad39b76cf7f4a3bc9554"; - sha256 = "sha256-7Pr2Au/oGKp5kMXuLsQY4BK5Wny9L1EBdXtyS5EaZPI="; - }; - }; - - vim-caddyfile = pkgs.vimUtils.buildVimPlugin { - name = "vim-caddyfile"; - src = pkgs.fetchFromGitHub { - owner = "isobit"; - repo = "vim-caddyfile"; - rev = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; - sha256 = "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o="; - }; - }; - - workspace = pkgs.vimUtils.buildVimPlugin { - name = "vim-workspace"; - src = pkgs.fetchFromGitHub { - owner = "thaerkh"; - repo = "vim-workspace"; - rev = "c26b473f9b073f24bacecd38477f44c5cd1f5a62"; - sha256 = "sha256-XV7opLyfkHIDO0+JJaO/x0za0gsHuklrzapTGdLHJmI="; - }; - }; - - beautify = pkgs.vimUtils.buildVimPlugin { - name = "vim-beautify"; - src = pkgs.fetchFromGitHub { - owner = "zeekay"; - repo = "vim-beautify"; - rev = "e0691483927dc5a0c051433602397419f9628623"; - sha256 = "QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ="; - }; - }; - - apprentice = pkgs.vimUtils.buildVimPlugin { - name = "vim-apprentice"; - src = pkgs.fetchFromGitHub { - owner = "romainl"; - repo = "Apprentice"; - rev = "ecd41698037f15a58125b349be76dbd2595bfb6d"; - sha256 = "sha256-9s7Yzn3IEJBjcyUq9NBIQ9wb45Xr7jOkEIoWf0lAYYg="; - }; - }; in { enable = true; @@ -108,7 +48,7 @@ in lsp_extensions-nvim nvim-lspconfig - instant-nvim + instant-nvim-nvfetcher ack-vim vim-airline @@ -119,23 +59,23 @@ in syntastic vim-gutentags vim-vinegar - workspace + vim-workspace-nvfetcher sonokai vim-hybrid-material vim-airline-themes - apprentice + vim-apprentice-nvfetcher fugitive vim-gitgutter vim-rhubarb - vimagit-master + vimagit-nvfetcher fzf-vim fzfWrapper vim-highlightedyank - beautify + vim-beautify-nvfetcher vim-surround vim-bufkill @@ -144,7 +84,7 @@ in ansible-vim emmet-vim rust-vim - vim-caddyfile + vim-caddyfile-nvfetcher vim-go vim-javascript vim-json diff --git a/overlays/neovim-plugins.nix b/overlays/neovim-plugins.nix new file mode 100644 index 00000000..b022049c --- /dev/null +++ b/overlays/neovim-plugins.nix @@ -0,0 +1,22 @@ +final: prev: { + vimPlugins = prev.vimPlugins // { + instant-nvim-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.instant-nvim-nvfetcher) pname version src; + }; + vimagit-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vimagit-nvfetcher) pname version src; + }; + vim-caddyfile-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-caddyfile-nvfetcher) pname version src; + }; + vim-workspace-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-workspace-nvfetcher) pname version src; + }; + vim-beautify-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-beautify-nvfetcher) pname version src; + }; + vim-apprentice-nvfetcher = prev.vimUtils.buildVimPluginFrom2Nix { + inherit (prev.sources.vim-apprentice-nvfetcher) pname version src; + }; + }; +} diff --git a/overlays/rnix-lsp.nix b/overlays/rnix-lsp.nix index 62c0f2b0..f755d110 100644 --- a/overlays/rnix-lsp.nix +++ b/overlays/rnix-lsp.nix @@ -1,13 +1,6 @@ final: prev: { rnix-lsp = prev.rnix-lsp.overrideAttrs (oldAttrs: rec { - version = "unstable-2022-07-28"; - - src = prev.fetchFromGitHub { - owner = "nix-community"; - repo = "rnix-lsp"; - rev = "ff18e04551a39ccdab0ff9c83926db3807b23478"; - sha256 = "sha256-4OIpATLdPQvryyhRQPELeqNYC0n6PCyjD6LCPdwOztc="; - }; + inherit (prev.sources.rnix-lsp-nvfetcher) pname version src; cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const { name = "rnix-lsp-vendor.tar.gz"; diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index 71be3965..f8bdd149 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -1,16 +1,92 @@ # This file was generated by nvfetcher, please do not modify it manually. -{ fetchgit, fetchurl }: +{ fetchgit, fetchurl, fetchFromGitHub }: { + instant-nvim-nvfetcher = { + pname = "instant-nvim-nvfetcher"; + version = "294b6d08143b3db8f9db7f606829270149e1a786"; + src = fetchFromGitHub ({ + owner = "jbyuki"; + repo = "instant.nvim"; + rev = "294b6d08143b3db8f9db7f606829270149e1a786"; + fetchSubmodules = false; + sha256 = "sha256-DXJWji/NR8ZCxe014rD51v3EHJHMhRQeOoI3SsY8mR4="; + }); + }; manix = { pname = "manix"; version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; - src = fetchgit { - url = "https://github.com/mlvzk/manix"; + src = fetchFromGitHub ({ + owner = "mlvzk"; + repo = "manix"; rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; fetchSubmodules = false; - deepClone = false; - leaveDotGit = false; - sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; - }; + sha256 = "sha256-GqPuYscLhkR5E2HnSFV4R48hCWvtM3C++3zlJhiK/aw="; + }); + }; + rnix-lsp-nvfetcher = { + pname = "rnix-lsp-nvfetcher"; + version = "6925256babec4307479a4080b44f2be38056f210"; + src = fetchFromGitHub ({ + owner = "nix-community"; + repo = "rnix-lsp"; + rev = "6925256babec4307479a4080b44f2be38056f210"; + fetchSubmodules = false; + sha256 = "sha256-OKLyIXIXhUnRB3Xw+7zI3u6XkwF7Mrbfz1XaasV6i7Q="; + }); + }; + vim-apprentice-nvfetcher = { + pname = "vim-apprentice-nvfetcher"; + version = "9942d0bb0a5d82f7a24450b00051c1f2cc008659"; + src = fetchFromGitHub ({ + owner = "romainl"; + repo = "Apprentice"; + rev = "9942d0bb0a5d82f7a24450b00051c1f2cc008659"; + fetchSubmodules = false; + sha256 = "sha256-Xs+vTdnihNbBFPOKsW+NB40pqN9eaadqzc0DIeNoOFo="; + }); + }; + vim-beautify-nvfetcher = { + pname = "vim-beautify-nvfetcher"; + version = "e0691483927dc5a0c051433602397419f9628623"; + src = fetchFromGitHub ({ + owner = "zeekay"; + repo = "vim-beautify"; + rev = "e0691483927dc5a0c051433602397419f9628623"; + fetchSubmodules = false; + sha256 = "sha256-QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ="; + }); + }; + vim-caddyfile-nvfetcher = { + pname = "vim-caddyfile-nvfetcher"; + version = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; + src = fetchFromGitHub ({ + owner = "isobit"; + repo = "vim-caddyfile"; + rev = "24fe0720551883e407cb70ae1d7c03f162d1d5a0"; + fetchSubmodules = false; + sha256 = "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o="; + }); + }; + vim-workspace-nvfetcher = { + pname = "vim-workspace-nvfetcher"; + version = "c26b473f9b073f24bacecd38477f44c5cd1f5a62"; + src = fetchFromGitHub ({ + owner = "thaerkh"; + repo = "vim-workspace"; + rev = "c26b473f9b073f24bacecd38477f44c5cd1f5a62"; + fetchSubmodules = false; + sha256 = "sha256-XV7opLyfkHIDO0+JJaO/x0za0gsHuklrzapTGdLHJmI="; + }); + }; + vimagit-nvfetcher = { + pname = "vimagit-nvfetcher"; + version = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4"; + src = fetchFromGitHub ({ + owner = "jreybert"; + repo = "vimagit"; + rev = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4"; + fetchSubmodules = false; + sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0="; + }); }; } diff --git a/pkgs/sources.toml b/pkgs/sources.toml index f7af168e..b3535048 100644 --- a/pkgs/sources.toml +++ b/pkgs/sources.toml @@ -2,3 +2,31 @@ [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" -- 2.44.1 From e69c8fe9c74e9e27d0897b338aa97a55067278de Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 18 Oct 2022 17:02:23 +0200 Subject: [PATCH 105/111] Bump flake.lock --- flake.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index 4e02f07a..ebcef0ac 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1664140963, - "narHash": "sha256-pFxDtOLduRFlol0Y4ShE+soRQX4kbhaCNBtDOvx7ykw=", + "lastModified": 1665870395, + "narHash": "sha256-Tsbqb27LDNxOoPLh0gw2hIb6L/6Ow/6lIBvqcHzEKBI=", "owner": "ryantm", "repo": "agenix", - "rev": "6acb1fe5f8597d5ce63fc82bc7fcac7774b1cdf0", + "rev": "a630400067c6d03c9b3e0455347dc8559db14288", "type": "github" }, "original": { @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1664210064, - "narHash": "sha256-df6nKVZe/yAhmJ9csirTPahc0dldwm3HBhCVNA6qWr0=", + "lastModified": 1665392861, + "narHash": "sha256-bCd8fYJMAb0LzabsiXl4nxECDoz483bJOCa2hjox7N0=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "02d2551c927b7d65ded1b3c7cd13da5cc7ae3fcf", + "rev": "ef56fd8979b5f4e800c4716f62076e00600b1172", "type": "github" }, "original": { @@ -276,11 +276,11 @@ ] }, "locked": { - "lastModified": 1656169755, - "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", + "lastModified": 1665996265, + "narHash": "sha256-/k9og6LDBQwT+f/tJ5ClcWiUl8kCX5m6ognhsAxOiCY=", "owner": "nix-community", "repo": "home-manager", - "rev": "4a3d01fb53f52ac83194081272795aa4612c2381", + "rev": "b81e128fc053ab3159d7b464d9b7dedc9d6a6891", "type": "github" }, "original": { @@ -308,11 +308,11 @@ }, "latest_2": { "locked": { - "lastModified": 1664538465, - "narHash": "sha256-EnlC7dDKX7X1wlnXkB1gmn9rBZQ0J9+biVTZHw//8us=", + "lastModified": 1665940183, + "narHash": "sha256-cPe3F7CtnxU9YbJpc3Adl4d9kX+turqTv5FxM98i8vg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "10ecda252ce1b3b1d6403caeadbcc8f30d5ab796", + "rev": "104e8082de1b20f9d0e1f05b1028795ed0e0e4bc", "type": "github" }, "original": { @@ -359,11 +359,11 @@ }, "nixos": { "locked": { - "lastModified": 1664594436, - "narHash": "sha256-YHowMADGzdi7fKnGlg47qe0PIljq+11VqLarmXDuKxQ=", + "lastModified": 1666014999, + "narHash": "sha256-gvKl8xlPJreezNG1NVTJv/HdGC69MSrM+IpCxS+eFvw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9cac45850280978a21a3eb67b15a18f34cbffa2d", + "rev": "1935dd8fdab8e022a9d958419663162fd840014c", "type": "github" }, "original": { @@ -379,11 +379,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1660727616, - "narHash": "sha256-zYTIvdPMYMx/EYqXODAwIIU30RiEHqNHdgarIHuEYZc=", + "lastModified": 1666016402, + "narHash": "sha256-Cm/nrdUMXwXiFQforG1Mv8OA4o8yhuVx6E1eDFH4rew=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "adccd191a0e83039d537e021f19495b7bad546a1", + "rev": "688db42a1eb34853f050267ff65c975f664312f0", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1664628729, - "narHash": "sha256-A1J0ZPhBfZZiWI6ipjKJ8+RpMllzOMu/An/8Tk3t4oo=", + "lastModified": 1665987993, + "narHash": "sha256-MvlaIYTRiqefG4dzI5p6vVCfl+9V8A1cPniUjcn6Ngc=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "3024c67a2e9a35450558426c42e7419ab37efd95", + "rev": "0e6593630071440eb89cd97a52921497482b22c6", "type": "github" }, "original": { -- 2.44.1 From e4418bfe0c9c7ca95aac590e4466fee293db9f48 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 20 Oct 2022 13:56:57 +0200 Subject: [PATCH 106/111] drone: use our custom drone-scp image --- .drone.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5e20924e..4cf4b3b2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -108,7 +108,9 @@ steps: - nix run nixpkgs#gnused -- --in-place "s/$ISO_NAME/PubSolarOS-latest.iso/" PubSolarOS-latest.iso.sha256 - name: "Publish ISO" - image: appleboy/drone-scp + # custom drone-scp image, source: https://git.b12f.io/pub-solar/drone-scp/ + # docker build --tag registry.greenbaum.cloud/library/drone-scp:v1.6.5 --file ./docker/Dockerfile.linux.amd64 . + image: registry.greenbaum.cloud/library/drone-scp:v1.6.5 volumes: - name: file-exchange path: /var/nix/iso-cache @@ -125,7 +127,7 @@ steps: source: - /var/nix/iso-cache/*.iso - /var/nix/iso-cache/*.iso.sha256 - overwrite: true + unlink_first: true strip_components: 3 depends_on: @@ -143,6 +145,6 @@ volumes: --- kind: signature -hmac: 8823c7103f6a075bb291a497c7ab5d5db47a91f9bc7d8ef95329b5620c9cf91d +hmac: 3e6a89e903e214f21d488eba82863683b130ef6dbc2dc352377d4fd94ab3cd0c ... -- 2.44.1 From eece344083ec64ce0d5f9006d2751fe33c91eb0e Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sun, 23 Oct 2022 18:33:11 +0200 Subject: [PATCH 107/111] Make resume_offset optional --- modules/core/hibernation.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/core/hibernation.nix b/modules/core/hibernation.nix index 0454d82b..a71ffd37 100644 --- a/modules/core/hibernation.nix +++ b/modules/core/hibernation.nix @@ -27,9 +27,7 @@ in config = { boot = mkIf cfg.enable { resumeDevice = cfg.resumeDevice; - kernelParams = - if (cfg.resumeOffset == null && cfg.enable) then builtins.abort "config.pub-solar.resumeOffset has to be set if config.pub-solar.enable is true." - else [ "resume_offset=${builtins.toString cfg.resumeOffset}" ]; + kernelParams = mkIf (cfg.resumeOffset != null) [ "resume_offset=${builtins.toString cfg.resumeOffset}" ]; }; }; } -- 2.44.1 From ea6233f57e994286bd989c4527f4999c108713db Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 18 Oct 2022 16:44:00 +0200 Subject: [PATCH 108/111] zsh: fetch plugins using nvfetcher --- modules/terminal-life/zsh/default.nix | 31 ++++--------------- pkgs/_sources/generated.nix | 44 +++++++++++++++++++++++++++ pkgs/sources.toml | 16 ++++++++++ 3 files changed, 66 insertions(+), 25 deletions(-) diff --git a/modules/terminal-life/zsh/default.nix b/modules/terminal-life/zsh/default.nix index b68a4270..36ec41ad 100644 --- a/modules/terminal-life/zsh/default.nix +++ b/modules/terminal-life/zsh/default.nix @@ -40,46 +40,27 @@ in myip = "dig +short myip.opendns.com @208.67.222.222 2>&1"; }; plugins = [ + # src gets fetched by nvfetcher, see: ./pkgs/sources.toml { # will source ohmyzsh/plugins/z/ name = "zsh-plugins-z"; - file = "plugins/z/z.sh"; - src = pkgs.fetchFromGitHub { - owner = "ohmyzsh"; - repo = "ohmyzsh"; - rev = "249c708ed3a4a7a63d16a6e911a46b6fb9623cbd"; - sha256 = "sha256-NAVotL5RxpS/zKnO+ngMIjv787lqc1dj/c4blQrQcvU="; - }; + file = "plugins/z/z.plugin.zsh"; + src = pkgs.sources.ohmyzsh.src; } { name = "zsh-powerlevel10k"; file = "powerlevel10k.zsh-theme"; - src = pkgs.fetchFromGitHub { - owner = "romkatv"; - repo = "powerlevel10k"; - rev = "2dd6a29e4d7a33bfef10973d6550e087be37ddee"; - sha256 = "sha256-9vc4cMBCNOmPOyzGwnPeMrXXyQUq4pC9Du3AWl9+Rys="; - }; + src = pkgs.sources.powerlevel10k.src; } { name = "zsh-fast-syntax-highlighting"; file = "F-Sy-H.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "z-shell"; - repo = "F-Sy-H"; - rev = "c4bdc485b67b58351a24f21fcac92c9e0232b939"; - sha256 = "sha256-uXBGIdJwubuueNhQRdGxPUi0eJN17cflYAuHTjeQ8FQ="; - }; + src = pkgs.sources.F-Sy-H.src; } { name = "zsh-nix-shell"; file = "nix-shell.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; - sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; - }; + src = pkgs.sources.zsh-nix-shell.src; } ]; diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index f8bdd149..30bcbdef 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -1,6 +1,17 @@ # This file was generated by nvfetcher, please do not modify it manually. { fetchgit, fetchurl, fetchFromGitHub }: { + F-Sy-H = { + pname = "F-Sy-H"; + version = "b935a87a75560f8173dd78deee6717c59d464e06"; + src = fetchFromGitHub ({ + owner = "z-shell"; + repo = "F-Sy-H"; + rev = "b935a87a75560f8173dd78deee6717c59d464e06"; + fetchSubmodules = false; + sha256 = "sha256-448OlDnrDkUjvaSLDhXsa9bkgYXzj1Ju8CTpJVjH8LM="; + }); + }; instant-nvim-nvfetcher = { pname = "instant-nvim-nvfetcher"; version = "294b6d08143b3db8f9db7f606829270149e1a786"; @@ -23,6 +34,28 @@ sha256 = "sha256-GqPuYscLhkR5E2HnSFV4R48hCWvtM3C++3zlJhiK/aw="; }); }; + ohmyzsh = { + pname = "ohmyzsh"; + version = "65a1e4edbe678cdac37ad96ca4bc4f6d77e27adf"; + src = fetchFromGitHub ({ + owner = "ohmyzsh"; + repo = "ohmyzsh"; + rev = "65a1e4edbe678cdac37ad96ca4bc4f6d77e27adf"; + fetchSubmodules = false; + sha256 = "sha256-qyI7CU0vKhhADZfQtD73GsyAbqdMPhDQ1uA03h4erpw="; + }); + }; + powerlevel10k = { + pname = "powerlevel10k"; + version = "8091c8a3a8a845c70046684235a01cd500075def"; + src = fetchFromGitHub ({ + owner = "romkatv"; + repo = "powerlevel10k"; + rev = "8091c8a3a8a845c70046684235a01cd500075def"; + fetchSubmodules = false; + sha256 = "sha256-I0/tktXCbZ3hMYTNvPoWfOEYWRgmHoXsar/jcUB6bpo="; + }); + }; rnix-lsp-nvfetcher = { pname = "rnix-lsp-nvfetcher"; version = "6925256babec4307479a4080b44f2be38056f210"; @@ -89,4 +122,15 @@ sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0="; }); }; + zsh-nix-shell = { + pname = "zsh-nix-shell"; + version = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; + src = fetchFromGitHub ({ + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "af6f8a266ea1875b9a3e86e14796cadbe1cfbf08"; + fetchSubmodules = false; + sha256 = "sha256-BjgMhILEL/qdgfno4LR64LSB8n9pC9R+gG7IQWwgyfQ="; + }); + }; } diff --git a/pkgs/sources.toml b/pkgs/sources.toml index b3535048..5ec5e936 100644 --- a/pkgs/sources.toml +++ b/pkgs/sources.toml @@ -3,6 +3,22 @@ src.git = "https://github.com/mlvzk/manix" fetch.github = "mlvzk/manix" +[ohmyzsh] +src.git = "https://github.com/ohmyzsh/ohmyzsh" +fetch.github = "ohmyzsh/ohmyzsh" + +[powerlevel10k] +src.git = "https://github.com/romkatv/powerlevel10k" +fetch.github = "romkatv/powerlevel10k" + +[F-Sy-H] +src.git = "https://github.com/z-shell/F-Sy-H" +fetch.github = "z-shell/F-Sy-H" + +[zsh-nix-shell] +src.git = "https://github.com/chisui/zsh-nix-shell" +fetch.github = "chisui/zsh-nix-shell" + [rnix-lsp-nvfetcher] src.git = "https://github.com/nix-community/rnix-lsp" fetch.github = "nix-community/rnix-lsp" -- 2.44.1 From 630d0afc5e0b389c1ad956230b9ad96a381a157a Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 15 Oct 2022 01:58:36 +0200 Subject: [PATCH 109/111] Update drone-config --- .drone.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4cf4b3b2..b4d4bb92 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,11 +1,12 @@ --- kind: pipeline -type: docker +type: exec name: Check +node: + hosttype: baremetal steps: - name: "Check" - image: docker.nix-community.org/nixpkgs/nix-flakes:latest when: event: - pull_request @@ -20,6 +21,8 @@ steps: kind: pipeline type: exec name: Tests +node: + hosttype: baremetal steps: - name: "Tests" @@ -145,6 +148,6 @@ volumes: --- kind: signature -hmac: 3e6a89e903e214f21d488eba82863683b130ef6dbc2dc352377d4fd94ab3cd0c +hmac: 291be33bbf2954d1f5e4bf569679e24a773e7d6f90db4765fb9dacb3686a825e ... -- 2.44.1 From 02c145697b3539077c7217ce4edc872c2a656408 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 7 Nov 2022 11:24:59 +0100 Subject: [PATCH 110/111] Pull in upstream commits from https://github.com/divnix/digga/pull/490 Improved flake-compat Get the rev from the flake.lock file. Shouldn't be an issue for first time users as the guide instructs users to generate a lock file. `builtins.file` was used in accordance with nix.dev reccommendations. https://nix.dev/anti-patterns/language#reproducibility-referencing-top-level-directory-with Rm tempfix --- flake.nix | 3 +++ lib/compat/default.nix | 8 ++++---- shell/devos.nix | 15 --------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 4ac60e8a..cce3f8ee 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,9 @@ nixos.url = "github:nixos/nixpkgs/nixos-22.05"; latest.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-compat.url = "github:edolstra/flake-compat"; + flake-compat.flake = false; + digga.url = "github:pub-solar/digga/fix/bootstrap-iso"; digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixlib.follows = "nixos"; diff --git a/lib/compat/default.nix b/lib/compat/default.nix index 9d0c2837..ae3b4426 100644 --- a/lib/compat/default.nix +++ b/lib/compat/default.nix @@ -1,14 +1,14 @@ let - rev = "e7e5d481a0e15dcd459396e55327749989e04ce0"; + lock = builtins.fromJSON (builtins.readFile builtins.path { path = ../../flake.lock; name = "lockPath"; }); flake = (import ( fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz"; - sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x"; + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; } ) { - src = ../../.; + src = builtins.path { path = ../../.; name = "projectRoot"; }; }); in flake diff --git a/shell/devos.nix b/shell/devos.nix index 9aefcc6f..382a6d34 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -28,21 +28,6 @@ in # override for our own welcome devshell.name = pkgs.lib.mkForce "PubSolarOS"; - # tempfix: remove when merged https://github.com/numtide/devshell/pull/123 - devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry '' - # PATH is devshell's exorbitant privilige: - # fence against its pollution - _PATH=''${PATH} - # Load installed profiles - for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do - # If that folder doesn't exist, bash loves to return the whole glob - [[ -f "$file" ]] && source "$file" - done - # Exert exorbitant privilige and leave no trace - export PATH=''${_PATH} - unset _PATH - ''); - commands = with pkgs; [ (devos nix) (devos agenix) -- 2.44.1 From 06ed2a78a9fdf8bee7b83b31f1ae823d02c0168e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 7 Nov 2022 11:26:58 +0100 Subject: [PATCH 111/111] Bump flake.lock --- flake.lock | 67 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index ebcef0ac..060a2aea 100644 --- a/flake.lock +++ b/flake.lock @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1665392861, - "narHash": "sha256-bCd8fYJMAb0LzabsiXl4nxECDoz483bJOCa2hjox7N0=", + "lastModified": 1667419884, + "narHash": "sha256-oLNw87ZI5NxTMlNQBv1wG2N27CUzo9admaFlnmavpiY=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "ef56fd8979b5f4e800c4716f62076e00600b1172", + "rev": "cfc0125eafadc9569d3d6a16ee928375b77e3100", "type": "github" }, "original": { @@ -205,6 +205,22 @@ "type": "github" } }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1642700792, @@ -256,11 +272,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1667077288, + "narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", "type": "github" }, "original": { @@ -276,11 +292,11 @@ ] }, "locked": { - "lastModified": 1665996265, - "narHash": "sha256-/k9og6LDBQwT+f/tJ5ClcWiUl8kCX5m6ognhsAxOiCY=", + "lastModified": 1667677389, + "narHash": "sha256-y9Zdq8vtsn0T5TO1iTvWA7JndYIAGjzCjbYVi/hOSmA=", "owner": "nix-community", "repo": "home-manager", - "rev": "b81e128fc053ab3159d7b464d9b7dedc9d6a6891", + "rev": "87d55517f6f36aa1afbd7a4a064869d5a1d405b8", "type": "github" }, "original": { @@ -308,11 +324,11 @@ }, "latest_2": { "locked": { - "lastModified": 1665940183, - "narHash": "sha256-cPe3F7CtnxU9YbJpc3Adl4d9kX+turqTv5FxM98i8vg=", + "lastModified": 1667629849, + "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "104e8082de1b20f9d0e1f05b1028795ed0e0e4bc", + "rev": "3bacde6273b09a21a8ccfba15586fb165078fb62", "type": "github" }, "original": { @@ -359,11 +375,11 @@ }, "nixos": { "locked": { - "lastModified": 1666014999, - "narHash": "sha256-gvKl8xlPJreezNG1NVTJv/HdGC69MSrM+IpCxS+eFvw=", + "lastModified": 1667653703, + "narHash": "sha256-Xow4vx52/g5zkhlgZnMEm/TEXsj+13jTPCc2jIhW1xU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1935dd8fdab8e022a9d958419663162fd840014c", + "rev": "f09ad462c5a121d0239fde645aacb2221553a217", "type": "github" }, "original": { @@ -379,11 +395,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1666016402, - "narHash": "sha256-Cm/nrdUMXwXiFQforG1Mv8OA4o8yhuVx6E1eDFH4rew=", + "lastModified": 1666812839, + "narHash": "sha256-0nBDgjPU+iDsvz89W+cDEyhnFGSwCJmwDl/gMGqYiU0=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "688db42a1eb34853f050267ff65c975f664312f0", + "rev": "41f3518bc194389df22a3d198215eae75e6b5ab9", "type": "github" }, "original": { @@ -394,11 +410,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1665987993, - "narHash": "sha256-MvlaIYTRiqefG4dzI5p6vVCfl+9V8A1cPniUjcn6Ngc=", + "lastModified": 1667768008, + "narHash": "sha256-PGbX0s2hhXGnZDFVE6UIhPSOf5YegpWs5dUXpT/14F0=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "0e6593630071440eb89cd97a52921497482b22c6", + "rev": "f6483e0def85efb9c1e884efbaff45a5e7aabb34", "type": "github" }, "original": { @@ -453,18 +469,18 @@ }, "nvfetcher": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_3", "nixpkgs": [ "nixos" ] }, "locked": { - "lastModified": 1664550666, - "narHash": "sha256-eXfMRd9uItEp3PsYI31FSVGPG9dVC6yF++65ZrGwW8A=", + "lastModified": 1667620329, + "narHash": "sha256-v1Zk7rtEbAGpevBGPZvZBKpwbmw4I+uVwxvd+pBlp3o=", "owner": "berberman", "repo": "nvfetcher", - "rev": "9763ad40d59a044e90726653d9253efaeeb053b2", + "rev": "294826951113dcd3aa9abbcacfb1aa5b95a19116", "type": "github" }, "original": { @@ -479,6 +495,7 @@ "darwin": "darwin", "deploy": "deploy", "digga": "digga", + "flake-compat": "flake-compat_3", "home": "home", "latest": "latest_2", "naersk": "naersk", -- 2.44.1