From 4c311fd78e4f2b3cbdd51be38a0edbba2d9cffb3 Mon Sep 17 00:00:00 2001 From: yusing Date: Fri, 24 Jan 2025 10:42:50 +0800 Subject: [PATCH] fixed some schemas, packed it as a npm package --- .gitignore | 4 +- Makefile | 14 +- bun.lock | 117 ++ package.json | 24 + pnpm-lock.yaml | 391 +++++++ schemas/config.schema.json | 1229 +-------------------- schemas/config/autocert.ts | 1 - schemas/config/providers.ts | 3 +- schemas/docker_routes.schema.json | 1199 +------------------- schemas/middleware_compose.schema.json | 365 +----- schemas/middlewares/middleware_compose.ts | 2 +- schemas/middlewares/middlewares.ts | 40 +- schemas/providers/homepage.ts | 20 +- schemas/providers/idlewatcher.ts | 2 +- schemas/routes.schema.json | 1124 +------------------ schemas/types.ts | 44 +- tsconfig.json | 10 + 17 files changed, 634 insertions(+), 3955 deletions(-) create mode 100644 bun.lock create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index d3c2ff1..497ef55 100755 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,6 @@ todo.md .aider* mtrace.json .env -test.Dockerfile \ No newline at end of file +test.Dockerfile + +node_modules/ \ No newline at end of file diff --git a/Makefile b/Makefile index 934e44e..0f491d2 100755 --- a/Makefile +++ b/Makefile @@ -87,8 +87,17 @@ build-docker: --build-arg BUILD_FLAGS="${BUILD_FLAGS}" \ . +# To generate schema +# comment out this part from typescript-json-schema.js#L884 +# +# if (indexType.flags !== ts.TypeFlags.Number && !isIndexedObject) { +# throw new Error("Not supported: IndexSignatureDeclaration with index symbol other than a number or a string"); +# } + gen-schema-single: - typescript-json-schema --noExtraProps --required --skipLibCheck --tsNodeRegister=true -o schemas/${OUT} schemas/${IN} ${CLASS} + bun run typescript-json-schema --noExtraProps --required --skipLibCheck --tsNodeRegister=true -o schemas/${OUT} schemas/${IN} ${CLASS} + # minify + python3 -c "import json; f=open('schemas/${OUT}', 'r'); j=json.load(f); f.close(); f=open('schemas/${OUT}', 'w'); json.dump(j, f, separators=(',', ':'));" gen-schema: make IN=config/config.ts \ @@ -108,5 +117,8 @@ gen-schema: OUT=docker_routes.schema.json \ gen-schema-single +update-schema-generator: + pnpm up -g typescript-json-schema + push-github: git push origin $(shell git rev-parse --abbrev-ref HEAD) \ No newline at end of file diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..f041cbc --- /dev/null +++ b/bun.lock @@ -0,0 +1,117 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "godoxy-types", + "devDependencies": { + "prettier": "^3.4.2", + "typescript-json-schema": "^0.65.1", + }, + }, + }, + "packages": { + "@cspotcode/source-map-support": ["@cspotcode/source-map-support@0.8.1", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.9" } }, "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="], + + "@tsconfig/node10": ["@tsconfig/node10@1.0.11", "", {}, "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw=="], + + "@tsconfig/node12": ["@tsconfig/node12@1.0.11", "", {}, "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag=="], + + "@tsconfig/node14": ["@tsconfig/node14@1.0.3", "", {}, "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow=="], + + "@tsconfig/node16": ["@tsconfig/node16@1.0.4", "", {}, "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA=="], + + "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], + + "@types/node": ["@types/node@18.19.74", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-HMwEkkifei3L605gFdV+/UwtpxP6JSzM+xFk2Ia6DNFSwSVBRh9qp5Tgf4lNFOMfPVuU0WnkcWpXZpgn5ufO4A=="], + + "acorn": ["acorn@8.14.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA=="], + + "acorn-walk": ["acorn-walk@8.3.4", "", { "dependencies": { "acorn": "^8.11.0" } }, "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g=="], + + "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "arg": ["arg@4.1.3", "", {}, "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA=="], + + "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + + "brace-expansion": ["brace-expansion@1.1.11", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA=="], + + "cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="], + + "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], + + "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + + "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], + + "create-require": ["create-require@1.1.1", "", {}, "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ=="], + + "diff": ["diff@4.0.2", "", {}, "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A=="], + + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], + + "fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="], + + "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], + + "glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], + + "inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="], + + "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + + "make-error": ["make-error@1.3.6", "", {}, "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="], + + "minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="], + + "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + + "path-equal": ["path-equal@1.2.5", "", {}, "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g=="], + + "path-is-absolute": ["path-is-absolute@1.0.1", "", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="], + + "prettier": ["prettier@3.4.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ=="], + + "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="], + + "safe-stable-stringify": ["safe-stable-stringify@2.5.0", "", {}, "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA=="], + + "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "ts-node": ["ts-node@10.9.2", "", { "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "peerDependencies": { "@swc/core": ">=1.2.50", "@swc/wasm": ">=1.2.50", "@types/node": "*", "typescript": ">=2.7" }, "optionalPeers": ["@swc/core", "@swc/wasm"], "bin": { "ts-node": "dist/bin.js", "ts-script": "dist/bin-script-deprecated.js", "ts-node-cwd": "dist/bin-cwd.js", "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js" } }, "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ=="], + + "typescript": ["typescript@5.5.4", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q=="], + + "typescript-json-schema": ["typescript-json-schema@0.65.1", "", { "dependencies": { "@types/json-schema": "^7.0.9", "@types/node": "^18.11.9", "glob": "^7.1.7", "path-equal": "^1.2.5", "safe-stable-stringify": "^2.2.0", "ts-node": "^10.9.1", "typescript": "~5.5.0", "yargs": "^17.1.1" }, "bin": { "typescript-json-schema": "bin/typescript-json-schema" } }, "sha512-tuGH7ff2jPaUYi6as3lHyHcKpSmXIqN7/mu50x3HlYn0EHzLpmt3nplZ7EuhUkO0eqDRc9GqWNkfjgBPIS9kxg=="], + + "undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="], + + "v8-compile-cache-lib": ["v8-compile-cache-lib@3.0.1", "", {}, "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg=="], + + "wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], + + "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + + "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], + + "yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="], + + "yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="], + + "yn": ["yn@3.1.1", "", {}, "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="], + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..8d6cf51 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "godoxy-schemas", + "version": "0.9.0", + "repository": { + "type": "git", + "url": "https://github.com/yusing/go-proxy" + }, + "files": [ + "schemas/", + "README.md", + "LICENSE" + ], + "devDependencies": { + "prettier": "^3.4.2", + "typescript-json-schema": "^0.65.1" + }, + "displayName": "GoDoxy Types", + "packageManager": "bun@1.2.0", + "publisher": "yusing", + "scripts": { + "gen-schema": "make gen-schema", + "format:write": "prettier --write \"schemas/**/*.ts\" --cache" + } +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..46a851a --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,391 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + typescript-json-schema: + specifier: ^0.65.1 + version: 0.65.1 + +packages: + + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + + '@tsconfig/node10@1.0.11': + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/node@18.19.74': + resolution: {integrity: sha512-HMwEkkifei3L605gFdV+/UwtpxP6JSzM+xFk2Ia6DNFSwSVBRh9qp5Tgf4lNFOMfPVuU0WnkcWpXZpgn5ufO4A==} + + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + path-equal@1.2.5: + resolution: {integrity: sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + safe-stable-stringify@2.5.0: + resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==} + engines: {node: '>=10'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + + typescript-json-schema@0.65.1: + resolution: {integrity: sha512-tuGH7ff2jPaUYi6as3lHyHcKpSmXIqN7/mu50x3HlYn0EHzLpmt3nplZ7EuhUkO0eqDRc9GqWNkfjgBPIS9kxg==} + hasBin: true + + typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + +snapshots: + + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@tsconfig/node10@1.0.11': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + + '@types/json-schema@7.0.15': {} + + '@types/node@18.19.74': + dependencies: + undici-types: 5.26.5 + + acorn-walk@8.3.4: + dependencies: + acorn: 8.14.0 + + acorn@8.14.0: {} + + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + arg@4.1.3: {} + + balanced-match@1.0.2: {} + + brace-expansion@1.1.11: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + concat-map@0.0.1: {} + + create-require@1.1.1: {} + + diff@4.0.2: {} + + emoji-regex@8.0.0: {} + + escalade@3.2.0: {} + + fs.realpath@1.0.0: {} + + get-caller-file@2.0.5: {} + + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + is-fullwidth-code-point@3.0.0: {} + + make-error@1.3.6: {} + + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.11 + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + path-equal@1.2.5: {} + + path-is-absolute@1.0.1: {} + + require-directory@2.1.1: {} + + safe-stable-stringify@2.5.0: {} + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + ts-node@10.9.2(@types/node@18.19.74)(typescript@5.5.4): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 18.19.74 + acorn: 8.14.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.5.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + typescript-json-schema@0.65.1: + dependencies: + '@types/json-schema': 7.0.15 + '@types/node': 18.19.74 + glob: 7.2.3 + path-equal: 1.2.5 + safe-stable-stringify: 2.5.0 + ts-node: 10.9.2(@types/node@18.19.74)(typescript@5.5.4) + typescript: 5.5.4 + yargs: 17.7.2 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + + typescript@5.5.4: {} + + undici-types@5.26.5: {} + + v8-compile-cache-lib@3.0.1: {} + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrappy@1.0.2: {} + + y18n@5.0.8: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yn@3.1.1: {} diff --git a/schemas/config.schema.json b/schemas/config.schema.json index d944ced..2cd786a 100644 --- a/schemas/config.schema.json +++ b/schemas/config.schema.json @@ -1,1228 +1 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "AccessLogFieldMode": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "AccessLogFormat": { - "enum": [ - "combined", - "common", - "json" - ], - "type": "string" - }, - "AutocertConfig": { - "anyOf": [ - { - "$ref": "#/definitions/LocalOptions" - }, - { - "$ref": "#/definitions/CloudflareOptions" - }, - { - "$ref": "#/definitions/CloudDNSOptions" - }, - { - "$ref": "#/definitions/DuckDNSOptions" - }, - { - "$ref": "#/definitions/OVHOptionsWithAppKey" - }, - { - "$ref": "#/definitions/OVHOptionsWithOAuth2Config" - } - ] - }, - "CIDR": { - "anyOf": [ - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*:.*:.*:.*:.*:.*:.*$", - "type": "string" - }, - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$", - "type": "string" - }, - { - "pattern": "^::[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*::/[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*::/[0-9]*$", - "type": "string" - } - ] - }, - "CloudDNSOptions": { - "additionalProperties": false, - "properties": { - "cert_path": { - "type": "string" - }, - "domains": { - "items": { - "pattern": "^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" - }, - "type": "array" - }, - "email": { - "format": "email", - "type": "string" - }, - "key_path": { - "type": "string" - }, - "options": { - "additionalProperties": false, - "properties": { - "client_id": { - "type": "string" - }, - "email": { - "format": "email", - "type": "string" - }, - "password": { - "type": "string" - } - }, - "required": [ - "client_id", - "email", - "password" - ], - "type": "object" - }, - "provider": { - "const": "clouddns", - "type": "string" - } - }, - "required": [ - "domains", - "email", - "options", - "provider" - ], - "type": "object" - }, - "CloudflareOptions": { - "additionalProperties": false, - "properties": { - "cert_path": { - "type": "string" - }, - "domains": { - "items": { - "pattern": "^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" - }, - "type": "array" - }, - "email": { - "format": "email", - "type": "string" - }, - "key_path": { - "type": "string" - }, - "options": { - "additionalProperties": false, - "properties": { - "auth_token": { - "type": "string" - } - }, - "required": [ - "auth_token" - ], - "type": "object" - }, - "provider": { - "const": "cloudflare", - "type": "string" - } - }, - "required": [ - "domains", - "email", - "options", - "provider" - ], - "type": "object" - }, - "DuckDNSOptions": { - "additionalProperties": false, - "properties": { - "cert_path": { - "type": "string" - }, - "domains": { - "items": { - "pattern": "^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" - }, - "type": "array" - }, - "email": { - "format": "email", - "type": "string" - }, - "key_path": { - "type": "string" - }, - "options": { - "additionalProperties": false, - "properties": { - "token": { - "type": "string" - } - }, - "required": [ - "token" - ], - "type": "object" - }, - "provider": { - "const": "duckdns", - "type": "string" - } - }, - "required": [ - "domains", - "email", - "options", - "provider" - ], - "type": "object" - }, - "GotifyConfig": { - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "provider": { - "const": "gotify", - "type": "string" - }, - "token": { - "type": "string" - }, - "url": { - "format": "uri", - "type": "string" - } - }, - "required": [ - "name", - "provider", - "token", - "url" - ], - "type": "object" - }, - "LocalOptions": { - "additionalProperties": false, - "properties": { - "cert_path": { - "type": "string" - }, - "domains": { - "items": { - "pattern": "^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" - }, - "type": "array" - }, - "email": { - "format": "email", - "type": "string" - }, - "key_path": { - "type": "string" - }, - "provider": { - "const": "local", - "type": "string" - } - }, - "required": [ - "domains", - "email", - "provider" - ], - "type": "object" - }, - "MiddlewareComposeMap": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "CustomErrorPage", - "ErrorPage", - "customErrorPage", - "custom_error_page", - "errorPage", - "error_page" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "RedirectHTTP", - "redirectHTTP", - "redirect_http" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "SetXForwarded", - "setXForwarded", - "set_x_forwarded" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "HideXForwarded", - "hideXForwarded", - "hide_x_forwarded" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "allow": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "message": { - "default": "IP not allowed", - "description": "Error message when blocked", - "type": "string" - }, - "status": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked (alias of status_code)" - }, - "status_code": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked" - }, - "use": { - "enum": [ - "CIDRWhitelist", - "cidrWhitelist", - "cidr_whitelist" - ], - "type": "string" - } - }, - "required": [ - "allow", - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "recursive": { - "default": false, - "description": "Recursively resolve the IP", - "type": "boolean" - }, - "use": { - "enum": [ - "cloudflareRealIp", - "cloudflare_real_ip" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - }, - "use": { - "enum": [ - "ModifyRequest", - "Request", - "modifyRequest", - "modify_request", - "request" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - }, - "use": { - "enum": [ - "ModifyResponse", - "Response", - "modifyResponse", - "modify_response", - "response" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "allowed_groups": { - "description": "Allowed groups", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "allowed_users": { - "description": "Allowed users", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "use": { - "enum": [ - "OIDC", - "oidc" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "average": { - "description": "Average number of requests allowed in a period", - "type": "number" - }, - "burst": { - "description": "Maximum number of requests allowed in a period", - "type": "number" - }, - "period": { - "default": "1s", - "description": "Duration of the rate limit", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "use": { - "enum": [ - "RateLimit", - "rateLimit", - "rate_limit" - ], - "type": "string" - } - }, - "required": [ - "average", - "burst", - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "from": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "header": { - "default": "X-Real-IP", - "description": "Header to get the client IP from", - "pattern": "^[a-zA-Z0-9\\-]+$", - "type": "string" - }, - "recursive": { - "default": false, - "description": "Recursive resolve the IP", - "type": "boolean" - }, - "use": { - "enum": [ - "RealIP", - "realIP", - "real_ip" - ], - "type": "string" - } - }, - "required": [ - "from", - "use" - ], - "type": "object" - } - ] - }, - "OVHEndpoint": { - "enum": [ - "kimsufi-ca", - "kimsufi-eu", - "ovh-ca", - "ovh-eu", - "ovh-us", - "soyoustart-ca", - "soyoustart-eu" - ], - "type": "string" - }, - "OVHOptionsWithAppKey": { - "additionalProperties": false, - "properties": { - "cert_path": { - "type": "string" - }, - "domains": { - "items": { - "pattern": "^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" - }, - "type": "array" - }, - "email": { - "format": "email", - "type": "string" - }, - "key_path": { - "type": "string" - }, - "options": { - "additionalProperties": false, - "properties": { - "api_endpoint": { - "$ref": "#/definitions/OVHEndpoint" - }, - "application_key": { - "type": "string" - }, - "application_secret": { - "type": "string" - }, - "consumer_key": { - "type": "string" - } - }, - "required": [ - "application_key", - "application_secret", - "consumer_key" - ], - "type": "object" - }, - "provider": { - "const": "ovh", - "type": "string" - } - }, - "required": [ - "domains", - "email", - "options", - "provider" - ], - "type": "object" - }, - "OVHOptionsWithOAuth2Config": { - "additionalProperties": false, - "properties": { - "cert_path": { - "type": "string" - }, - "domains": { - "items": { - "pattern": "^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" - }, - "type": "array" - }, - "email": { - "format": "email", - "type": "string" - }, - "key_path": { - "type": "string" - }, - "options": { - "additionalProperties": false, - "properties": { - "api_endpoint": { - "$ref": "#/definitions/OVHEndpoint" - }, - "application_secret": { - "type": "string" - }, - "consumer_key": { - "type": "string" - }, - "oauth2_config": { - "additionalProperties": false, - "properties": { - "client_id": { - "type": "string" - }, - "client_secret": { - "type": "string" - } - }, - "required": [ - "client_id", - "client_secret" - ], - "type": "object" - } - }, - "required": [ - "application_secret", - "consumer_key", - "oauth2_config" - ], - "type": "object" - }, - "provider": { - "const": "ovh", - "type": "string" - } - }, - "required": [ - "domains", - "email", - "options", - "provider" - ], - "type": "object" - }, - "StatusCode": { - "anyOf": [ - { - "pattern": "^[0-9]*$", - "type": "string" - }, - { - "type": "number" - } - ] - }, - "StatusCodeRange": { - "anyOf": [ - { - "pattern": "^[0-9]*$", - "type": "string" - }, - { - "pattern": "^[0-9]*-[0-9]*$", - "type": "string" - }, - { - "type": "number" - } - ] - }, - "WebhookColorMode": { - "enum": [ - "dec", - "hex" - ], - "type": "string" - }, - "WebhookConfig": { - "additionalProperties": false, - "properties": { - "color_mode": { - "$ref": "#/definitions/WebhookColorMode", - "default": "hex", - "description": "Webhook color mode" - }, - "method": { - "$ref": "#/definitions/WebhookMethod", - "default": "POST", - "description": "Webhook method" - }, - "mime_type": { - "$ref": "#/definitions/WebhookMimeType", - "default": "application/json", - "description": "Webhook mime type" - }, - "name": { - "type": "string" - }, - "payload": { - "description": "Webhook message (usally JSON),\nrequired when template is not defined", - "type": "string" - }, - "provider": { - "const": "webhook", - "type": "string" - }, - "template": { - "const": "discord", - "default": "discord", - "description": "Webhook template", - "type": "string" - }, - "token": { - "type": "string" - }, - "url": { - "format": "uri", - "type": "string" - } - }, - "required": [ - "name", - "provider", - "url" - ], - "type": "object" - }, - "WebhookMethod": { - "enum": [ - "GET", - "POST", - "PUT" - ], - "type": "string" - }, - "WebhookMimeType": { - "enum": [ - "application/json", - "application/x-www-form-urlencoded", - "text/plain" - ], - "type": "string" - } - }, - "properties": { - "autocert": { - "$ref": "#/definitions/AutocertConfig", - "description": "Optional autocert configuration", - "examples": [ - { - "provider": "local" - }, - { - "domains": [ - "example.com" - ], - "email": "abc@gmail", - "options": { - "auth_token": "c1234565789-abcdefghijklmnopqrst" - }, - "provider": "cloudflare" - }, - { - "domains": [ - "example.com" - ], - "email": "abc@gmail", - "options": { - "client_id": "c1234565789", - "email": "abc@gmail", - "password": "password" - }, - "provider": "clouddns" - } - ] - }, - "entrypoint": { - "additionalProperties": false, - "properties": { - "access_log": { - "additionalProperties": false, - "description": "Entrypoint access log configuration", - "examples": [ - { - "fields": { - "headers": { - "config": { - "foo": "redact" - }, - "default": "keep" - } - }, - "filters": { - "status_codes": { - "values": [ - "200-299" - ] - } - }, - "format": "combined", - "path": "/var/log/access.log" - } - ], - "properties": { - "buffer_size": { - "default": 65536, - "description": "The size of the buffer.", - "minimum": 0, - "type": "integer" - }, - "fields": { - "additionalProperties": false, - "properties": { - "cookie": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - }, - "header": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - }, - "query": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - } - }, - "type": "object" - }, - "filters": { - "additionalProperties": false, - "properties": { - "cidr": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "headers": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "host": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "method": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "enum": [ - "CONNECT", - "DELETE", - "GET", - "HEAD", - "OPTIONS", - "PATCH", - "POST", - "PUT", - "TRACE" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "status_code": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "$ref": "#/definitions/StatusCodeRange" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - } - }, - "type": "object" - }, - "format": { - "$ref": "#/definitions/AccessLogFormat", - "default": "combined", - "description": "The format of the access log." - }, - "path": { - "format": "uri-reference", - "type": "string" - } - }, - "required": [ - "path" - ], - "type": "object" - }, - "middlewares": { - "description": "Entrypoint middleware configuration", - "examples": [ - { - "use": "RedirectHTTP" - }, - { - "allow": [ - "127.0.0.1", - "10.0.0.0/8", - "172.16.0.0/12", - "192.168.0.0/16" - ], - "message": "Forbidden", - "status": 403, - "use": "CIDRWhitelist" - } - ], - "items": { - "$ref": "#/definitions/MiddlewareComposeMap" - }, - "type": "array" - } - }, - "required": [ - "middlewares" - ], - "type": "object" - }, - "homepage": { - "additionalProperties": false, - "properties": { - "use_default_categories": { - "default": true, - "description": "Use default app categories (uses docker image name)", - "type": "boolean" - } - }, - "required": [ - "use_default_categories" - ], - "type": "object" - }, - "match_domains": { - "description": "Optional list of domains to match", - "examples": [ - "example.com", - "*.example.com" - ], - "items": { - "pattern": "^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$" - }, - "minItems": 1, - "type": "array" - }, - "providers": { - "additionalProperties": false, - "properties": { - "docker": { - "additionalProperties": { - "type": "string" - }, - "description": "Name-value mapping of docker hosts to retrieve routes from", - "examples": [ - { - "local": "$DOCKER_HOST" - }, - { - "remote": "tcp://10.0.2.1:2375" - }, - { - "remote2": "ssh://root:1234@10.0.2.2" - } - ], - "items": { - "pattern": "^((\\w+://)[^\\s]+)|\\$DOCKER_HOST$" - }, - "minProperties": 1, - "type": "object" - }, - "include": { - "description": "List of route definition files to include", - "examples": [ - "file1.yml", - "file2.yml" - ], - "items": { - "pattern": "^[\\w\\d\\-_]+\\.(yaml|yml)$" - }, - "minItems": 1, - "type": "array" - }, - "notification": { - "description": "List of notification providers", - "examples": [ - { - "name": "gotify", - "provider": "gotify", - "token": "abcd", - "url": "https://gotify.domain.tld" - }, - { - "name": "discord", - "provider": "webhook", - "template": "discord", - "url": "https://discord.com/api/webhooks/1234/abcd" - } - ], - "items": { - "anyOf": [ - { - "$ref": "#/definitions/GotifyConfig" - }, - { - "$ref": "#/definitions/WebhookConfig" - } - ] - }, - "minItems": 1, - "type": "array" - } - }, - "type": "object" - }, - "timeout_shutdown": { - "default": 3, - "description": "Optional timeout before shutdown", - "minimum": 1, - "type": "number" - } - }, - "required": [ - "providers" - ], - "type": "object" -} - +{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"definitions":{"AccessLogFieldMode":{"enum":["drop","keep","redact"],"type":"string"},"AccessLogFormat":{"enum":["combined","common","json"],"type":"string"},"AutocertConfig":{"anyOf":[{"$ref":"#/definitions/LocalOptions"},{"$ref":"#/definitions/CloudflareOptions"},{"$ref":"#/definitions/CloudDNSOptions"},{"$ref":"#/definitions/DuckDNSOptions"},{"$ref":"#/definitions/OVHOptionsWithAppKey"},{"$ref":"#/definitions/OVHOptionsWithOAuth2Config"}]},"CIDR":{"anyOf":[{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$","type":"string"},{"pattern":"^.*:.*:.*:.*:.*:.*:.*:.*$","type":"string"},{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$","type":"string"},{"pattern":"^::[0-9]*$","type":"string"},{"pattern":"^.*::/[0-9]*$","type":"string"},{"pattern":"^.*:.*::/[0-9]*$","type":"string"}]},"CloudDNSOptions":{"additionalProperties":false,"properties":{"cert_path":{"type":"string"},"domains":{"items":{"pattern":"^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},"type":"array"},"email":{"$ref":"#/definitions/Email"},"key_path":{"type":"string"},"options":{"additionalProperties":false,"properties":{"client_id":{"type":"string"},"email":{"$ref":"#/definitions/Email"},"password":{"type":"string"}},"required":["client_id","email","password"],"type":"object"},"provider":{"const":"clouddns","type":"string"}},"required":["domains","email","options","provider"],"type":"object"},"CloudflareOptions":{"additionalProperties":false,"properties":{"cert_path":{"type":"string"},"domains":{"items":{"pattern":"^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},"type":"array"},"email":{"$ref":"#/definitions/Email"},"key_path":{"type":"string"},"options":{"additionalProperties":false,"properties":{"auth_token":{"type":"string"}},"required":["auth_token"],"type":"object"},"provider":{"const":"cloudflare","type":"string"}},"required":["domains","email","options","provider"],"type":"object"},"DuckDNSOptions":{"additionalProperties":false,"properties":{"cert_path":{"type":"string"},"domains":{"items":{"pattern":"^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},"type":"array"},"email":{"$ref":"#/definitions/Email"},"key_path":{"type":"string"},"options":{"additionalProperties":false,"properties":{"token":{"type":"string"}},"required":["token"],"type":"object"},"provider":{"const":"duckdns","type":"string"}},"required":["domains","email","options","provider"],"type":"object"},"Duration":{"pattern":"^([0-9]+(ms|s|m|h))+$","type":"string"},"Email":{"format":"email","type":"string"},"GotifyConfig":{"additionalProperties":false,"properties":{"name":{"type":"string"},"provider":{"const":"gotify","type":"string"},"token":{"type":"string"},"url":{"$ref":"#/definitions/URL"}},"required":["name","provider","token","url"],"type":"object"},"HTTPHeader":{"description":"HTTP Header","pattern":"^[a-zA-Z0-9\\-]+$","type":"string"},"LocalOptions":{"additionalProperties":false,"properties":{"cert_path":{"type":"string"},"domains":{"items":{"pattern":"^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},"type":"array"},"email":{"$ref":"#/definitions/Email"},"key_path":{"type":"string"},"provider":{"const":"local","type":"string"}},"required":["domains","email","provider"],"type":"object"},"MiddlewareComposeMap":{"anyOf":[{"additionalProperties":false,"properties":{"use":{"enum":["CustomErrorPage","ErrorPage","customErrorPage","custom_error_page","errorPage","error_page"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"use":{"enum":["RedirectHTTP","redirectHTTP","redirect_http"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"use":{"enum":["SetXForwarded","setXForwarded","set_x_forwarded"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"use":{"enum":["HideXForwarded","hideXForwarded","hide_x_forwarded"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"allow":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"message":{"default":"IP not allowed","description":"Error message when blocked","type":"string"},"status":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked (alias of status_code)"},"status_code":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked"},"use":{"enum":["CIDRWhitelist","cidrWhitelist","cidr_whitelist"],"type":"string"}},"required":["allow","use"],"type":"object"},{"additionalProperties":false,"properties":{"recursive":{"default":false,"description":"Recursively resolve the IP","type":"boolean"},"use":{"enum":["cloudflareRealIp","cloudflare_real_ip"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"},"use":{"enum":["ModifyRequest","Request","modifyRequest","modify_request","request"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"},"use":{"enum":["ModifyResponse","Response","modifyResponse","modify_response","response"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"allowed_groups":{"description":"Allowed groups","items":{"type":"string"},"minItems":1,"type":"array"},"allowed_users":{"description":"Allowed users","items":{"type":"string"},"minItems":1,"type":"array"},"use":{"enum":["OIDC","oidc"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"average":{"description":"Average number of requests allowed in a period","type":"number"},"burst":{"description":"Maximum number of requests allowed in a period","type":"number"},"period":{"$ref":"#/definitions/Duration","default":"1s","description":"Duration of the rate limit"},"use":{"enum":["RateLimit","rateLimit","rate_limit"],"type":"string"}},"required":["average","burst","use"],"type":"object"},{"additionalProperties":false,"properties":{"from":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"header":{"$ref":"#/definitions/HTTPHeader","default":"X-Real-IP","description":"Header to get the client IP from"},"recursive":{"default":false,"description":"Recursive resolve the IP","type":"boolean"},"use":{"enum":["RealIP","realIP","real_ip"],"type":"string"}},"required":["from","use"],"type":"object"}]},"OVHEndpoint":{"enum":["kimsufi-ca","kimsufi-eu","ovh-ca","ovh-eu","ovh-us","soyoustart-ca","soyoustart-eu"],"type":"string"},"OVHOptionsWithAppKey":{"additionalProperties":false,"properties":{"cert_path":{"type":"string"},"domains":{"items":{"pattern":"^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},"type":"array"},"email":{"$ref":"#/definitions/Email"},"key_path":{"type":"string"},"options":{"additionalProperties":false,"properties":{"api_endpoint":{"$ref":"#/definitions/OVHEndpoint"},"application_key":{"type":"string"},"application_secret":{"type":"string"},"consumer_key":{"type":"string"}},"required":["application_key","application_secret","consumer_key"],"type":"object"},"provider":{"const":"ovh","type":"string"}},"required":["domains","email","options","provider"],"type":"object"},"OVHOptionsWithOAuth2Config":{"additionalProperties":false,"properties":{"cert_path":{"type":"string"},"domains":{"items":{"pattern":"^(\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},"type":"array"},"email":{"$ref":"#/definitions/Email"},"key_path":{"type":"string"},"options":{"additionalProperties":false,"properties":{"api_endpoint":{"$ref":"#/definitions/OVHEndpoint"},"application_secret":{"type":"string"},"consumer_key":{"type":"string"},"oauth2_config":{"additionalProperties":false,"properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"}},"required":["client_id","client_secret"],"type":"object"}},"required":["application_secret","consumer_key","oauth2_config"],"type":"object"},"provider":{"const":"ovh","type":"string"}},"required":["domains","email","options","provider"],"type":"object"},"StatusCode":{"anyOf":[{"pattern":"^[0-9]*$","type":"string"},{"type":"number"}]},"StatusCodeRange":{"anyOf":[{"pattern":"^[0-9]*$","type":"string"},{"pattern":"^[0-9]*-[0-9]*$","type":"string"},{"type":"number"}]},"URI":{"format":"uri-reference","type":"string"},"URL":{"format":"uri","type":"string"},"WebhookColorMode":{"enum":["dec","hex"],"type":"string"},"WebhookConfig":{"additionalProperties":false,"properties":{"color_mode":{"$ref":"#/definitions/WebhookColorMode","default":"hex","description":"Webhook color mode"},"method":{"$ref":"#/definitions/WebhookMethod","default":"POST","description":"Webhook method"},"mime_type":{"$ref":"#/definitions/WebhookMimeType","default":"application/json","description":"Webhook mime type"},"name":{"type":"string"},"payload":{"description":"Webhook message (usally JSON),\nrequired when template is not defined","type":"string"},"provider":{"const":"webhook","type":"string"},"template":{"const":"discord","default":"discord","description":"Webhook template","type":"string"},"token":{"type":"string"},"url":{"$ref":"#/definitions/URL"}},"required":["name","provider","url"],"type":"object"},"WebhookMethod":{"enum":["GET","POST","PUT"],"type":"string"},"WebhookMimeType":{"enum":["application/json","application/x-www-form-urlencoded","text/plain"],"type":"string"}},"properties":{"autocert":{"$ref":"#/definitions/AutocertConfig","description":"Optional autocert configuration","examples":[{"provider":"local"},{"domains":["example.com"],"email":"abc@gmail","options":{"auth_token":"c1234565789-abcdefghijklmnopqrst"},"provider":"cloudflare"},{"domains":["example.com"],"email":"abc@gmail","options":{"client_id":"c1234565789","email":"abc@gmail","password":"password"},"provider":"clouddns"}]},"entrypoint":{"additionalProperties":false,"properties":{"access_log":{"additionalProperties":false,"description":"Entrypoint access log configuration","examples":[{"fields":{"headers":{"config":{"foo":"redact"},"default":"keep"}},"filters":{"status_codes":{"values":["200-299"]}},"format":"combined","path":"/var/log/access.log"}],"properties":{"buffer_size":{"default":65536,"description":"The size of the buffer.","minimum":0,"type":"integer"},"fields":{"additionalProperties":false,"properties":{"cookie":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"},"header":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"},"query":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"}},"type":"object"},"filters":{"additionalProperties":false,"properties":{"cidr":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"}},"required":["values"],"type":"object"},"headers":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"}},"required":["values"],"type":"object"},"host":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"type":"string"},"type":"array"}},"required":["values"],"type":"object"},"method":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"enum":["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],"type":"string"},"type":"array"}},"required":["values"],"type":"object"},"status_code":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/StatusCodeRange"},"type":"array"}},"required":["values"],"type":"object"}},"type":"object"},"format":{"$ref":"#/definitions/AccessLogFormat","default":"combined","description":"The format of the access log."},"path":{"$ref":"#/definitions/URI"}},"required":["path"],"type":"object"},"middlewares":{"description":"Entrypoint middleware configuration","examples":[{"use":"RedirectHTTP"},{"allow":["127.0.0.1","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"],"message":"Forbidden","status":403,"use":"CIDRWhitelist"}],"items":{"$ref":"#/definitions/MiddlewareComposeMap"},"type":"array"}},"required":["middlewares"],"type":"object"},"homepage":{"additionalProperties":false,"properties":{"use_default_categories":{"default":true,"description":"Use default app categories (uses docker image name)","type":"boolean"}},"required":["use_default_categories"],"type":"object"},"match_domains":{"description":"Optional list of domains to match","examples":["example.com","*.example.com"],"items":{"pattern":"^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},"minItems":1,"type":"array"},"providers":{"additionalProperties":false,"properties":{"docker":{"additionalProperties":{"anyOf":[{"format":"uri","type":"string"},{"const":"$DOCKER_HOST","type":"string"}]},"description":"Name-value mapping of docker hosts to retrieve routes from","examples":[{"local":"$DOCKER_HOST"},{"remote":"tcp://10.0.2.1:2375"},{"remote2":"ssh://root:1234@10.0.2.2"}],"minProperties":1,"type":"object"},"include":{"description":"List of route definition files to include","examples":["file1.yml","file2.yml"],"items":{"pattern":"^[\\w\\d\\-_]+\\.(yaml|yml)$"},"minItems":1,"type":"array"},"notification":{"description":"List of notification providers","examples":[{"name":"gotify","provider":"gotify","token":"abcd","url":"https://gotify.domain.tld"},{"name":"discord","provider":"webhook","template":"discord","url":"https://discord.com/api/webhooks/1234/abcd"}],"items":{"anyOf":[{"$ref":"#/definitions/GotifyConfig"},{"$ref":"#/definitions/WebhookConfig"}]},"minItems":1,"type":"array"}},"type":"object"},"timeout_shutdown":{"default":3,"description":"Optional timeout before shutdown","minimum":1,"type":"number"}},"required":["providers"],"type":"object"} \ No newline at end of file diff --git a/schemas/config/autocert.ts b/schemas/config/autocert.ts index dde342f..7bb472a 100644 --- a/schemas/config/autocert.ts +++ b/schemas/config/autocert.ts @@ -47,7 +47,6 @@ export interface CloudDNSOptions extends AutocertConfigBase { }; } - export interface DuckDNSOptions extends AutocertConfigBase { provider: "duckdns"; options: { diff --git a/schemas/config/providers.ts b/schemas/config/providers.ts index e049927..e01c7ed 100644 --- a/schemas/config/providers.ts +++ b/schemas/config/providers.ts @@ -13,9 +13,8 @@ export type Providers = { * * @minProperties 1 * @examples require(".").dockerExamples - * @items.pattern ^((\w+://)[^\s]+)|\$DOCKER_HOST$ */ - docker?: { [name: string]: URL }; + docker?: { [name: string]: URL | "$DOCKER_HOST" }; /** List of notification providers * * @minItems 1 diff --git a/schemas/docker_routes.schema.json b/schemas/docker_routes.schema.json index dd1f1ab..cf2b98e 100644 --- a/schemas/docker_routes.schema.json +++ b/schemas/docker_routes.schema.json @@ -1,1198 +1 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "access_log": { - "additionalProperties": false, - "description": "Access log config", - "examples": [ - { - "fields": { - "headers": { - "config": { - "foo": "redact" - }, - "default": "keep" - } - }, - "filters": { - "status_codes": { - "values": [ - "200-299" - ] - } - }, - "format": "combined", - "path": "/var/log/access.log" - } - ], - "properties": { - "buffer_size": { - "default": 65536, - "description": "The size of the buffer.", - "minimum": 0, - "type": "integer" - }, - "fields": { - "additionalProperties": false, - "properties": { - "cookie": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - }, - "header": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - }, - "query": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - } - }, - "type": "object" - }, - "filters": { - "additionalProperties": false, - "properties": { - "cidr": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "headers": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "host": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "method": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "enum": [ - "CONNECT", - "DELETE", - "GET", - "HEAD", - "OPTIONS", - "PATCH", - "POST", - "PUT", - "TRACE" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "status_code": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "$ref": "#/definitions/StatusCodeRange" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - } - }, - "type": "object" - }, - "format": { - "$ref": "#/definitions/AccessLogFormat", - "default": "combined", - "description": "The format of the access log." - }, - "path": { - "format": "uri-reference", - "type": "string" - } - }, - "required": [ - "path" - ], - "type": "object" - }, - "alias": { - "description": "Alias (subdomain or FDN)", - "minLength": 1, - "type": "string" - }, - "healthcheck": { - "additionalProperties": false, - "description": "Healthcheck config", - "properties": { - "disable": { - "default": false, - "description": "Disable healthcheck", - "type": "boolean" - }, - "interval": { - "default": "5s", - "description": "Healthcheck interval", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "path": { - "default": "/", - "description": "Healthcheck path", - "format": "uri-reference", - "type": "string" - }, - "timeout": { - "default": "5s", - "description": "Healthcheck timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "use_get": { - "default": false, - "description": "Use GET instead of HEAD", - "type": "boolean" - } - }, - "type": "object" - }, - "homepage": { - "additionalProperties": false, - "description": "Homepage config", - "examples": [ - { - "category": "Arr suite", - "icon": "png/sonarr.png", - "name": "Sonarr" - }, - { - "icon": "@target/favicon.ico", - "name": "App" - } - ], - "properties": { - "category": { - "type": "string" - }, - "description": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "name": { - "type": "string" - }, - "show": { - "default": true, - "description": "Whether show in dashboard", - "type": "boolean" - }, - "url": { - "format": "uri", - "type": "string" - }, - "widget_config": { - "additionalProperties": {}, - "type": "object" - } - }, - "type": "object" - }, - "host": { - "default": "localhost", - "description": "Proxy host", - "type": "string" - }, - "idle_timeout": { - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "load_balance": { - "$ref": "#/definitions/LoadBalanceConfig", - "description": "Load balance config" - }, - "middlewares": { - "$ref": "#/definitions/MiddlewaresMap", - "description": "Middlewares" - }, - "no_tls_verify": { - "default": false, - "description": "Skip TLS verification", - "type": "boolean" - }, - "path_patterns": { - "description": "Path patterns (only patterns that match will be proxied).\n\nSee https://pkg.go.dev/net/http#hdr-Patterns-ServeMux", - "items": { - "type": "string" - }, - "type": "array" - }, - "port": { - "default": 80, - "description": "Proxy port", - "maximum": 65535, - "minimum": 0, - "type": "integer" - }, - "scheme": { - "$ref": "#/definitions/ProxyScheme", - "default": "http", - "description": "Proxy scheme" - }, - "start_endpoint": { - "format": "uri-reference", - "type": "string" - }, - "stop_method": { - "$ref": "#/definitions/StopMethod", - "default": "stop", - "description": "Stop method" - }, - "stop_signal": { - "$ref": "#/definitions/Signal" - }, - "stop_timeout": { - "default": "10s", - "description": "Stop timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "wake_timeout": { - "default": "30s", - "description": "Wake timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - } - }, - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "alias": { - "description": "Alias (subdomain or FDN)", - "minLength": 1, - "type": "string" - }, - "healthcheck": { - "additionalProperties": false, - "description": "Healthcheck config", - "properties": { - "disable": { - "default": false, - "description": "Disable healthcheck", - "type": "boolean" - }, - "interval": { - "default": "5s", - "description": "Healthcheck interval", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "path": { - "default": "/", - "description": "Healthcheck path", - "format": "uri-reference", - "type": "string" - }, - "timeout": { - "default": "5s", - "description": "Healthcheck timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "use_get": { - "default": false, - "description": "Use GET instead of HEAD", - "type": "boolean" - } - }, - "type": "object" - }, - "host": { - "default": "localhost", - "description": "Stream host", - "type": "string" - }, - "idle_timeout": { - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "port": { - "pattern": "^\\d+:\\d+$", - "type": "string" - }, - "scheme": { - "$ref": "#/definitions/StreamScheme", - "default": "tcp", - "description": "Stream scheme" - }, - "start_endpoint": { - "format": "uri-reference", - "type": "string" - }, - "stop_method": { - "$ref": "#/definitions/StopMethod", - "default": "stop", - "description": "Stop method" - }, - "stop_signal": { - "$ref": "#/definitions/Signal" - }, - "stop_timeout": { - "default": "10s", - "description": "Stop timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "wake_timeout": { - "default": "30s", - "description": "Wake timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - } - }, - "required": [ - "port", - "scheme" - ], - "type": "object" - } - ] - }, - "definitions": { - "AccessLogFieldMode": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "AccessLogFormat": { - "enum": [ - "combined", - "common", - "json" - ], - "type": "string" - }, - "CIDR": { - "anyOf": [ - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*:.*:.*:.*:.*:.*:.*$", - "type": "string" - }, - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$", - "type": "string" - }, - { - "pattern": "^::[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*::/[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*::/[0-9]*$", - "type": "string" - } - ] - }, - "LoadBalanceConfig": { - "additionalProperties": false, - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "link": { - "description": "Alias (subdomain or FDN) of load-balancer", - "minLength": 1, - "type": "string" - }, - "mode": { - "const": "round_robin", - "type": "string" - }, - "weight": { - "description": "Load-balance weight (reserved for future use)", - "maximum": 100, - "minimum": 0, - "type": "number" - } - }, - "required": [ - "link", - "mode" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "link": { - "description": "Alias (subdomain or FDN) of load-balancer", - "minLength": 1, - "type": "string" - }, - "mode": { - "const": "least_conn", - "type": "string" - }, - "weight": { - "description": "Load-balance weight (reserved for future use)", - "maximum": 100, - "minimum": 0, - "type": "number" - } - }, - "required": [ - "link", - "mode" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": false, - "description": "Real IP config, header to get client IP from", - "properties": { - "from": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "header": { - "default": "X-Real-IP", - "description": "Header to get the client IP from", - "pattern": "^[a-zA-Z0-9\\-]+$", - "type": "string" - }, - "recursive": { - "default": false, - "description": "Recursive resolve the IP", - "type": "boolean" - }, - "use": { - "enum": [ - "RealIP", - "realIP", - "real_ip" - ], - "type": "string" - } - }, - "required": [ - "from", - "use" - ], - "type": "object" - }, - "link": { - "description": "Alias (subdomain or FDN) of load-balancer", - "minLength": 1, - "type": "string" - }, - "mode": { - "const": "ip_hash", - "type": "string" - }, - "weight": { - "description": "Load-balance weight (reserved for future use)", - "maximum": 100, - "minimum": 0, - "type": "number" - } - }, - "required": [ - "config", - "link", - "mode" - ], - "type": "object" - } - ] - }, - "MiddlewaresMap": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "use": { - "pattern": "^.*@file$", - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "$ref": "#/definitions/{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}" - }, - { - "$ref": "#/definitions/{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}" - }, - { - "$ref": "#/definitions/{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}" - }, - { - "$ref": "#/definitions/{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}" - }, - { - "$ref": "#/definitions/{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}" - }, - { - "$ref": "#/definitions/{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}" - }, - { - "$ref": "#/definitions/{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}" - }, - { - "$ref": "#/definitions/{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}" - }, - { - "$ref": "#/definitions/{oidc:Omit;OIDC:Omit;}" - }, - { - "$ref": "#/definitions/{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}" - }, - { - "$ref": "#/definitions/{real_ip:Omit;realIP:Omit;RealIP:Omit;}" - }, - { - "$ref": "#/definitions/{[x:`${string}@file`]:NullOrEmptyMap;}" - } - ] - }, - "Omit": { - "additionalProperties": false, - "properties": { - "allow": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "message": { - "default": "IP not allowed", - "description": "Error message when blocked", - "type": "string" - }, - "status": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked (alias of status_code)" - }, - "status_code": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked" - } - }, - "required": [ - "allow" - ], - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "recursive": { - "default": false, - "description": "Recursively resolve the IP", - "type": "boolean" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "allowed_groups": { - "description": "Allowed groups", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "allowed_users": { - "description": "Allowed users", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "average": { - "description": "Average number of requests allowed in a period", - "type": "number" - }, - "burst": { - "description": "Maximum number of requests allowed in a period", - "type": "number" - }, - "period": { - "default": "1s", - "description": "Duration of the rate limit", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - } - }, - "required": [ - "average", - "burst" - ], - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "from": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "header": { - "default": "X-Real-IP", - "description": "Header to get the client IP from", - "pattern": "^[a-zA-Z0-9\\-]+$", - "type": "string" - }, - "recursive": { - "default": false, - "description": "Recursive resolve the IP", - "type": "boolean" - } - }, - "required": [ - "from" - ], - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "ProxyScheme": { - "enum": [ - "http", - "https" - ], - "type": "string" - }, - "Signal": { - "enum": [ - "", - "HUP", - "INT", - "QUIT", - "SIGHUP", - "SIGINT", - "SIGQUIT", - "SIGTERM", - "TERM" - ], - "type": "string" - }, - "StatusCode": { - "anyOf": [ - { - "pattern": "^[0-9]*$", - "type": "string" - }, - { - "type": "number" - } - ] - }, - "StatusCodeRange": { - "anyOf": [ - { - "pattern": "^[0-9]*$", - "type": "string" - }, - { - "pattern": "^[0-9]*-[0-9]*$", - "type": "string" - }, - { - "type": "number" - } - ] - }, - "StopMethod": { - "enum": [ - "kill", - "pause", - "stop" - ], - "type": "string" - }, - "StreamScheme": { - "enum": [ - "tcp", - "udp" - ], - "type": "string" - }, - "{[x:`${string}@file`]:NullOrEmptyMap;}": { - "additionalProperties": false, - "type": "object" - }, - "{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}": { - "additionalProperties": false, - "properties": { - "CIDRWhitelist": { - "$ref": "#/definitions/Omit" - }, - "cidrWhitelist": { - "$ref": "#/definitions/Omit" - }, - "cidr_whitelist": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "CIDRWhitelist", - "cidrWhitelist", - "cidr_whitelist" - ], - "type": "object" - }, - "{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}": { - "additionalProperties": false, - "properties": { - "cloudflareRealIp": { - "$ref": "#/definitions/Omit" - }, - "cloudflare_real_ip": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "cloudflareRealIp", - "cloudflare_real_ip" - ], - "type": "object" - }, - "{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}": { - "additionalProperties": false, - "properties": { - "CustomErrorPage": { - "$ref": "#/definitions/Omit" - }, - "ErrorPage": { - "$ref": "#/definitions/Omit" - }, - "customErrorPage": { - "$ref": "#/definitions/Omit" - }, - "custom_error_page": { - "$ref": "#/definitions/Omit" - }, - "errorPage": { - "$ref": "#/definitions/Omit" - }, - "error_page": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "CustomErrorPage", - "ErrorPage", - "customErrorPage", - "custom_error_page", - "errorPage", - "error_page" - ], - "type": "object" - }, - "{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}": { - "additionalProperties": false, - "properties": { - "HideXForwarded": { - "$ref": "#/definitions/Omit" - }, - "hideXForwarded": { - "$ref": "#/definitions/Omit" - }, - "hide_x_forwarded": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "HideXForwarded", - "hideXForwarded", - "hide_x_forwarded" - ], - "type": "object" - }, - "{oidc:Omit;OIDC:Omit;}": { - "additionalProperties": false, - "properties": { - "OIDC": { - "$ref": "#/definitions/Omit" - }, - "oidc": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "OIDC", - "oidc" - ], - "type": "object" - }, - "{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}": { - "additionalProperties": false, - "properties": { - "RateLimit": { - "$ref": "#/definitions/Omit" - }, - "rateLimit": { - "$ref": "#/definitions/Omit" - }, - "rate_limit": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "RateLimit", - "rateLimit", - "rate_limit" - ], - "type": "object" - }, - "{real_ip:Omit;realIP:Omit;RealIP:Omit;}": { - "additionalProperties": false, - "properties": { - "RealIP": { - "$ref": "#/definitions/Omit" - }, - "realIP": { - "$ref": "#/definitions/Omit" - }, - "real_ip": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "RealIP", - "realIP", - "real_ip" - ], - "type": "object" - }, - "{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}": { - "additionalProperties": false, - "properties": { - "RedirectHTTP": { - "$ref": "#/definitions/Omit" - }, - "redirectHTTP": { - "$ref": "#/definitions/Omit" - }, - "redirect_http": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "RedirectHTTP", - "redirectHTTP", - "redirect_http" - ], - "type": "object" - }, - "{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}": { - "additionalProperties": false, - "properties": { - "ModifyRequest": { - "$ref": "#/definitions/Omit" - }, - "Request": { - "$ref": "#/definitions/Omit" - }, - "modifyRequest": { - "$ref": "#/definitions/Omit" - }, - "modify_request": { - "$ref": "#/definitions/Omit" - }, - "request": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "ModifyRequest", - "Request", - "modifyRequest", - "modify_request", - "request" - ], - "type": "object" - }, - "{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}": { - "additionalProperties": false, - "properties": { - "ModifyResponse": { - "$ref": "#/definitions/Omit" - }, - "Response": { - "$ref": "#/definitions/Omit" - }, - "modifyResponse": { - "$ref": "#/definitions/Omit" - }, - "modify_response": { - "$ref": "#/definitions/Omit" - }, - "response": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "ModifyResponse", - "Response", - "modifyResponse", - "modify_response", - "response" - ], - "type": "object" - }, - "{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}": { - "additionalProperties": false, - "properties": { - "SetXForwarded": { - "$ref": "#/definitions/Omit" - }, - "setXForwarded": { - "$ref": "#/definitions/Omit" - }, - "set_x_forwarded": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "SetXForwarded", - "setXForwarded", - "set_x_forwarded" - ], - "type": "object" - } - }, - "type": "object" -} - +{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{"anyOf":[{"additionalProperties":false,"properties":{"access_log":{"additionalProperties":false,"description":"Access log config","examples":[{"fields":{"headers":{"config":{"foo":"redact"},"default":"keep"}},"filters":{"status_codes":{"values":["200-299"]}},"format":"combined","path":"/var/log/access.log"}],"properties":{"buffer_size":{"default":65536,"description":"The size of the buffer.","minimum":0,"type":"integer"},"fields":{"additionalProperties":false,"properties":{"cookie":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"},"header":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"},"query":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"}},"type":"object"},"filters":{"additionalProperties":false,"properties":{"cidr":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"}},"required":["values"],"type":"object"},"headers":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"}},"required":["values"],"type":"object"},"host":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"type":"string"},"type":"array"}},"required":["values"],"type":"object"},"method":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"enum":["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],"type":"string"},"type":"array"}},"required":["values"],"type":"object"},"status_code":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/StatusCodeRange"},"type":"array"}},"required":["values"],"type":"object"}},"type":"object"},"format":{"$ref":"#/definitions/AccessLogFormat","default":"combined","description":"The format of the access log."},"path":{"$ref":"#/definitions/URI"}},"required":["path"],"type":"object"},"alias":{"description":"Alias (subdomain or FDN)","minLength":1,"type":"string"},"healthcheck":{"additionalProperties":false,"description":"Healthcheck config","properties":{"disable":{"default":false,"description":"Disable healthcheck","type":"boolean"},"interval":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck interval"},"path":{"$ref":"#/definitions/URI","default":"/","description":"Healthcheck path"},"timeout":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck timeout"},"use_get":{"default":false,"description":"Use GET instead of HEAD","type":"boolean"}},"type":"object"},"homepage":{"additionalProperties":false,"description":"Homepage config","examples":[{"category":"Arr suite","icon":"png/sonarr.png","name":"Sonarr"},{"icon":"@target/favicon.ico","name":"App"}],"properties":{"category":{"type":"string"},"description":{"type":"string"},"icon":{"anyOf":[{"format":"uri","type":"string"},{"pattern":"^png/.*/.*\\..*$","type":"string"},{"pattern":"^svg/.*/.*\\..*$","type":"string"},{"pattern":"^webp/.*/.*\\..*$","type":"string"},{"pattern":"^@selfhst/.*\\..*$","type":"string"},{"pattern":"^@walkxcode/.*\\..*$","type":"string"},{"pattern":"^@target/.*$","type":"string"},{"pattern":"^/.*$","type":"string"}]},"name":{"type":"string"},"show":{"default":true,"description":"Whether show in dashboard","type":"boolean"},"url":{"$ref":"#/definitions/URL"},"widget_config":{"additionalProperties":{},"type":"object"}},"type":"object"},"host":{"anyOf":[{"format":"hostname","type":"string"},{"format":"ipv4","type":"string"},{"format":"ipv6","type":"string"}],"default":"localhost","description":"Proxy host"},"idle_timeout":{"$ref":"#/definitions/Duration"},"load_balance":{"$ref":"#/definitions/LoadBalanceConfig","description":"Load balance config"},"middlewares":{"$ref":"#/definitions/MiddlewaresMap","description":"Middlewares"},"no_tls_verify":{"default":false,"description":"Skip TLS verification","type":"boolean"},"path_patterns":{"description":"Path patterns (only patterns that match will be proxied).\n\nSee https://pkg.go.dev/net/http#hdr-Patterns-ServeMux","items":{"$ref":"#/definitions/PathPattern"},"type":"array"},"port":{"$ref":"#/definitions/Port","default":80,"description":"Proxy port"},"scheme":{"$ref":"#/definitions/ProxyScheme","default":"http","description":"Proxy scheme"},"start_endpoint":{"$ref":"#/definitions/URI"},"stop_method":{"$ref":"#/definitions/StopMethod","default":"stop","description":"Stop method"},"stop_signal":{"$ref":"#/definitions/Signal"},"stop_timeout":{"$ref":"#/definitions/Duration","default":"30s","description":"Stop timeout"},"wake_timeout":{"$ref":"#/definitions/Duration","default":"30s","description":"Wake timeout"}},"type":"object"},{"additionalProperties":false,"properties":{"alias":{"description":"Alias (subdomain or FDN)","minLength":1,"type":"string"},"healthcheck":{"additionalProperties":false,"description":"Healthcheck config","properties":{"disable":{"default":false,"description":"Disable healthcheck","type":"boolean"},"interval":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck interval"},"path":{"$ref":"#/definitions/URI","default":"/","description":"Healthcheck path"},"timeout":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck timeout"},"use_get":{"default":false,"description":"Use GET instead of HEAD","type":"boolean"}},"type":"object"},"host":{"anyOf":[{"format":"hostname","type":"string"},{"format":"ipv4","type":"string"},{"format":"ipv6","type":"string"}],"default":"localhost","description":"Stream host"},"idle_timeout":{"$ref":"#/definitions/Duration"},"port":{"$ref":"#/definitions/StreamPort"},"scheme":{"$ref":"#/definitions/StreamScheme","default":"tcp","description":"Stream scheme"},"start_endpoint":{"$ref":"#/definitions/URI"},"stop_method":{"$ref":"#/definitions/StopMethod","default":"stop","description":"Stop method"},"stop_signal":{"$ref":"#/definitions/Signal"},"stop_timeout":{"$ref":"#/definitions/Duration","default":"30s","description":"Stop timeout"},"wake_timeout":{"$ref":"#/definitions/Duration","default":"30s","description":"Wake timeout"}},"required":["port","scheme"],"type":"object"}]},"definitions":{"AccessLogFieldMode":{"enum":["drop","keep","redact"],"type":"string"},"AccessLogFormat":{"enum":["combined","common","json"],"type":"string"},"CIDR":{"anyOf":[{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$","type":"string"},{"pattern":"^.*:.*:.*:.*:.*:.*:.*:.*$","type":"string"},{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$","type":"string"},{"pattern":"^::[0-9]*$","type":"string"},{"pattern":"^.*::/[0-9]*$","type":"string"},{"pattern":"^.*:.*::/[0-9]*$","type":"string"}]},"Duration":{"pattern":"^([0-9]+(ms|s|m|h))+$","type":"string"},"HTTPHeader":{"description":"HTTP Header","pattern":"^[a-zA-Z0-9\\-]+$","type":"string"},"LoadBalanceConfig":{"anyOf":[{"additionalProperties":false,"properties":{"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["link"],"type":"object"},{"additionalProperties":false,"properties":{"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"mode":{"const":"round_robin","type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["link","mode"],"type":"object"},{"additionalProperties":false,"properties":{"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"mode":{"const":"least_conn","type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["link","mode"],"type":"object"},{"additionalProperties":false,"properties":{"config":{"additionalProperties":false,"description":"Real IP config, header to get client IP from","properties":{"from":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"header":{"$ref":"#/definitions/HTTPHeader","default":"X-Real-IP","description":"Header to get the client IP from"},"recursive":{"default":false,"description":"Recursive resolve the IP","type":"boolean"},"use":{"enum":["RealIP","realIP","real_ip"],"type":"string"}},"required":["from","use"],"type":"object"},"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"mode":{"const":"ip_hash","type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["config","link","mode"],"type":"object"}]},"MiddlewaresMap":{"anyOf":[{"additionalProperties":false,"properties":{"use":{"pattern":"^.*@file$","type":"string"}},"required":["use"],"type":"object"},{"$ref":"#/definitions/{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}"},{"$ref":"#/definitions/{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}"},{"$ref":"#/definitions/{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}"},{"$ref":"#/definitions/{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}"},{"$ref":"#/definitions/{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}"},{"$ref":"#/definitions/{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}"},{"$ref":"#/definitions/{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}"},{"$ref":"#/definitions/{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}"},{"$ref":"#/definitions/{oidc:Omit;OIDC:Omit;}"},{"$ref":"#/definitions/{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}"},{"$ref":"#/definitions/{real_ip:Omit;realIP:Omit;RealIP:Omit;}"},{"$ref":"#/definitions/{[x:`${string}@file`]:NullOrEmptyMap;}"}]},"Omit":{"additionalProperties":false,"properties":{"allow":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"message":{"default":"IP not allowed","description":"Error message when blocked","type":"string"},"status":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked (alias of status_code)"},"status_code":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked"}},"required":["allow"],"type":"object"},"Omit":{"additionalProperties":false,"properties":{"recursive":{"default":false,"description":"Recursively resolve the IP","type":"boolean"}},"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"Omit":{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"}},"type":"object"},"Omit":{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"}},"type":"object"},"Omit":{"additionalProperties":false,"properties":{"allowed_groups":{"description":"Allowed groups","items":{"type":"string"},"minItems":1,"type":"array"},"allowed_users":{"description":"Allowed users","items":{"type":"string"},"minItems":1,"type":"array"}},"type":"object"},"Omit":{"additionalProperties":false,"properties":{"average":{"description":"Average number of requests allowed in a period","type":"number"},"burst":{"description":"Maximum number of requests allowed in a period","type":"number"},"period":{"$ref":"#/definitions/Duration","default":"1s","description":"Duration of the rate limit"}},"required":["average","burst"],"type":"object"},"Omit":{"additionalProperties":false,"properties":{"from":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"header":{"$ref":"#/definitions/HTTPHeader","default":"X-Real-IP","description":"Header to get the client IP from"},"recursive":{"default":false,"description":"Recursive resolve the IP","type":"boolean"}},"required":["from"],"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"PathPattern":{"pattern":"^(?:([A-Z]+) )?(?:([a-zA-Z0-9.-]+)\\\\/)?(\\\\/[^\\\\s]*)$","type":"string"},"Port":{"maximum":65535,"minimum":0,"type":"integer"},"ProxyScheme":{"enum":["http","https"],"type":"string"},"Signal":{"enum":["","HUP","INT","QUIT","SIGHUP","SIGINT","SIGQUIT","SIGTERM","TERM"],"type":"string"},"StatusCode":{"anyOf":[{"pattern":"^[0-9]*$","type":"string"},{"type":"number"}]},"StatusCodeRange":{"anyOf":[{"pattern":"^[0-9]*$","type":"string"},{"pattern":"^[0-9]*-[0-9]*$","type":"string"},{"type":"number"}]},"StopMethod":{"enum":["kill","pause","stop"],"type":"string"},"StreamPort":{"pattern":"^\\d+:\\d+$","type":"string"},"StreamScheme":{"enum":["tcp","udp"],"type":"string"},"URI":{"format":"uri-reference","type":"string"},"URL":{"format":"uri","type":"string"},"{[x:`${string}@file`]:NullOrEmptyMap;}":{"additionalProperties":false,"type":"object"},"{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}":{"additionalProperties":false,"properties":{"CIDRWhitelist":{"$ref":"#/definitions/Omit"},"cidrWhitelist":{"$ref":"#/definitions/Omit"},"cidr_whitelist":{"$ref":"#/definitions/Omit"}},"required":["CIDRWhitelist","cidrWhitelist","cidr_whitelist"],"type":"object"},"{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}":{"additionalProperties":false,"properties":{"cloudflareRealIp":{"$ref":"#/definitions/Omit"},"cloudflare_real_ip":{"$ref":"#/definitions/Omit"}},"required":["cloudflareRealIp","cloudflare_real_ip"],"type":"object"},"{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}":{"additionalProperties":false,"properties":{"CustomErrorPage":{"$ref":"#/definitions/Omit"},"ErrorPage":{"$ref":"#/definitions/Omit"},"customErrorPage":{"$ref":"#/definitions/Omit"},"custom_error_page":{"$ref":"#/definitions/Omit"},"errorPage":{"$ref":"#/definitions/Omit"},"error_page":{"$ref":"#/definitions/Omit"}},"required":["CustomErrorPage","ErrorPage","customErrorPage","custom_error_page","errorPage","error_page"],"type":"object"},"{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}":{"additionalProperties":false,"properties":{"HideXForwarded":{"$ref":"#/definitions/Omit"},"hideXForwarded":{"$ref":"#/definitions/Omit"},"hide_x_forwarded":{"$ref":"#/definitions/Omit"}},"required":["HideXForwarded","hideXForwarded","hide_x_forwarded"],"type":"object"},"{oidc:Omit;OIDC:Omit;}":{"additionalProperties":false,"properties":{"OIDC":{"$ref":"#/definitions/Omit"},"oidc":{"$ref":"#/definitions/Omit"}},"required":["OIDC","oidc"],"type":"object"},"{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}":{"additionalProperties":false,"properties":{"RateLimit":{"$ref":"#/definitions/Omit"},"rateLimit":{"$ref":"#/definitions/Omit"},"rate_limit":{"$ref":"#/definitions/Omit"}},"required":["RateLimit","rateLimit","rate_limit"],"type":"object"},"{real_ip:Omit;realIP:Omit;RealIP:Omit;}":{"additionalProperties":false,"properties":{"RealIP":{"$ref":"#/definitions/Omit"},"realIP":{"$ref":"#/definitions/Omit"},"real_ip":{"$ref":"#/definitions/Omit"}},"required":["RealIP","realIP","real_ip"],"type":"object"},"{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}":{"additionalProperties":false,"properties":{"RedirectHTTP":{"$ref":"#/definitions/Omit"},"redirectHTTP":{"$ref":"#/definitions/Omit"},"redirect_http":{"$ref":"#/definitions/Omit"}},"required":["RedirectHTTP","redirectHTTP","redirect_http"],"type":"object"},"{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}":{"additionalProperties":false,"properties":{"ModifyRequest":{"$ref":"#/definitions/Omit"},"Request":{"$ref":"#/definitions/Omit"},"modifyRequest":{"$ref":"#/definitions/Omit"},"modify_request":{"$ref":"#/definitions/Omit"},"request":{"$ref":"#/definitions/Omit"}},"required":["ModifyRequest","Request","modifyRequest","modify_request","request"],"type":"object"},"{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}":{"additionalProperties":false,"properties":{"ModifyResponse":{"$ref":"#/definitions/Omit"},"Response":{"$ref":"#/definitions/Omit"},"modifyResponse":{"$ref":"#/definitions/Omit"},"modify_response":{"$ref":"#/definitions/Omit"},"response":{"$ref":"#/definitions/Omit"}},"required":["ModifyResponse","Response","modifyResponse","modify_response","response"],"type":"object"},"{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}":{"additionalProperties":false,"properties":{"SetXForwarded":{"$ref":"#/definitions/Omit"},"setXForwarded":{"$ref":"#/definitions/Omit"},"set_x_forwarded":{"$ref":"#/definitions/Omit"}},"required":["SetXForwarded","setXForwarded","set_x_forwarded"],"type":"object"}},"type":"object"} \ No newline at end of file diff --git a/schemas/middleware_compose.schema.json b/schemas/middleware_compose.schema.json index 557f7a8..9c3ed3e 100644 --- a/schemas/middleware_compose.schema.json +++ b/schemas/middleware_compose.schema.json @@ -1,364 +1 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "CIDR": { - "anyOf": [ - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*:.*:.*:.*:.*:.*:.*$", - "type": "string" - }, - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$", - "type": "string" - }, - { - "pattern": "^::[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*::/[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*::/[0-9]*$", - "type": "string" - } - ] - }, - "MiddlewareComposeMap": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "CustomErrorPage", - "ErrorPage", - "customErrorPage", - "custom_error_page", - "errorPage", - "error_page" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "RedirectHTTP", - "redirectHTTP", - "redirect_http" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "SetXForwarded", - "setXForwarded", - "set_x_forwarded" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "use": { - "enum": [ - "HideXForwarded", - "hideXForwarded", - "hide_x_forwarded" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "allow": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "message": { - "default": "IP not allowed", - "description": "Error message when blocked", - "type": "string" - }, - "status": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked (alias of status_code)" - }, - "status_code": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked" - }, - "use": { - "enum": [ - "CIDRWhitelist", - "cidrWhitelist", - "cidr_whitelist" - ], - "type": "string" - } - }, - "required": [ - "allow", - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "recursive": { - "default": false, - "description": "Recursively resolve the IP", - "type": "boolean" - }, - "use": { - "enum": [ - "cloudflareRealIp", - "cloudflare_real_ip" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - }, - "use": { - "enum": [ - "ModifyRequest", - "Request", - "modifyRequest", - "modify_request", - "request" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - }, - "use": { - "enum": [ - "ModifyResponse", - "Response", - "modifyResponse", - "modify_response", - "response" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "allowed_groups": { - "description": "Allowed groups", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "allowed_users": { - "description": "Allowed users", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "use": { - "enum": [ - "OIDC", - "oidc" - ], - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "average": { - "description": "Average number of requests allowed in a period", - "type": "number" - }, - "burst": { - "description": "Maximum number of requests allowed in a period", - "type": "number" - }, - "period": { - "default": "1s", - "description": "Duration of the rate limit", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "use": { - "enum": [ - "RateLimit", - "rateLimit", - "rate_limit" - ], - "type": "string" - } - }, - "required": [ - "average", - "burst", - "use" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "from": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "header": { - "default": "X-Real-IP", - "description": "Header to get the client IP from", - "pattern": "^[a-zA-Z0-9\\-]+$", - "type": "string" - }, - "recursive": { - "default": false, - "description": "Recursive resolve the IP", - "type": "boolean" - }, - "use": { - "enum": [ - "RealIP", - "realIP", - "real_ip" - ], - "type": "string" - } - }, - "required": [ - "from", - "use" - ], - "type": "object" - } - ] - }, - "StatusCode": { - "anyOf": [ - { - "pattern": "^[0-9]*$", - "type": "string" - }, - { - "type": "number" - } - ] - } - }, - "items": { - "$ref": "#/definitions/MiddlewareComposeMap" - }, - "type": "array" -} - +{"$schema":"http://json-schema.org/draft-07/schema#","definitions":{"CIDR":{"anyOf":[{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$","type":"string"},{"pattern":"^.*:.*:.*:.*:.*:.*:.*:.*$","type":"string"},{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$","type":"string"},{"pattern":"^::[0-9]*$","type":"string"},{"pattern":"^.*::/[0-9]*$","type":"string"},{"pattern":"^.*:.*::/[0-9]*$","type":"string"}]},"Duration":{"pattern":"^([0-9]+(ms|s|m|h))+$","type":"string"},"HTTPHeader":{"description":"HTTP Header","pattern":"^[a-zA-Z0-9\\-]+$","type":"string"},"MiddlewareComposeMap":{"anyOf":[{"additionalProperties":false,"properties":{"use":{"enum":["CustomErrorPage","ErrorPage","customErrorPage","custom_error_page","errorPage","error_page"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"use":{"enum":["RedirectHTTP","redirectHTTP","redirect_http"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"use":{"enum":["SetXForwarded","setXForwarded","set_x_forwarded"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"use":{"enum":["HideXForwarded","hideXForwarded","hide_x_forwarded"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"allow":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"message":{"default":"IP not allowed","description":"Error message when blocked","type":"string"},"status":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked (alias of status_code)"},"status_code":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked"},"use":{"enum":["CIDRWhitelist","cidrWhitelist","cidr_whitelist"],"type":"string"}},"required":["allow","use"],"type":"object"},{"additionalProperties":false,"properties":{"recursive":{"default":false,"description":"Recursively resolve the IP","type":"boolean"},"use":{"enum":["cloudflareRealIp","cloudflare_real_ip"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"},"use":{"enum":["ModifyRequest","Request","modifyRequest","modify_request","request"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"},"use":{"enum":["ModifyResponse","Response","modifyResponse","modify_response","response"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"allowed_groups":{"description":"Allowed groups","items":{"type":"string"},"minItems":1,"type":"array"},"allowed_users":{"description":"Allowed users","items":{"type":"string"},"minItems":1,"type":"array"},"use":{"enum":["OIDC","oidc"],"type":"string"}},"required":["use"],"type":"object"},{"additionalProperties":false,"properties":{"average":{"description":"Average number of requests allowed in a period","type":"number"},"burst":{"description":"Maximum number of requests allowed in a period","type":"number"},"period":{"$ref":"#/definitions/Duration","default":"1s","description":"Duration of the rate limit"},"use":{"enum":["RateLimit","rateLimit","rate_limit"],"type":"string"}},"required":["average","burst","use"],"type":"object"},{"additionalProperties":false,"properties":{"from":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"header":{"$ref":"#/definitions/HTTPHeader","default":"X-Real-IP","description":"Header to get the client IP from"},"recursive":{"default":false,"description":"Recursive resolve the IP","type":"boolean"},"use":{"enum":["RealIP","realIP","real_ip"],"type":"string"}},"required":["from","use"],"type":"object"}]},"StatusCode":{"anyOf":[{"pattern":"^[0-9]*$","type":"string"},{"type":"number"}]}},"items":{"$ref":"#/definitions/MiddlewareComposeMap"},"type":"array"} \ No newline at end of file diff --git a/schemas/middlewares/middleware_compose.ts b/schemas/middlewares/middleware_compose.ts index 0bfae2d..3aef0fb 100644 --- a/schemas/middlewares/middleware_compose.ts +++ b/schemas/middlewares/middleware_compose.ts @@ -1,3 +1,3 @@ import { MiddlewareComposeMap } from "./middlewares"; -export type MiddlewareCompose = MiddlewareComposeMap[]; \ No newline at end of file +export type MiddlewareCompose = MiddlewareComposeMap[]; diff --git a/schemas/middlewares/middlewares.ts b/schemas/middlewares/middlewares.ts index 483fde2..9c9f7fe 100644 --- a/schemas/middlewares/middlewares.ts +++ b/schemas/middlewares/middlewares.ts @@ -2,11 +2,13 @@ import * as types from "../types"; export type MiddlewareComposeObjectRef = `${string}@file`; -export type KeyOptMapping = { - [key in T["use"]]: Omit; -} | { use: MiddlewareComposeObjectRef }; +export type KeyOptMapping = + | { + [key in T["use"]]: Omit; + } + | { use: MiddlewareComposeObjectRef }; -export type MiddlewaresMap = ( +export type MiddlewaresMap = | KeyOptMapping | KeyOptMapping | KeyOptMapping @@ -18,10 +20,9 @@ export type MiddlewaresMap = ( | KeyOptMapping | KeyOptMapping | KeyOptMapping - | { [key in MiddlewareComposeObjectRef]: types.NullOrEmptyMap } -); + | { [key in MiddlewareComposeObjectRef]: types.NullOrEmptyMap }; -export type MiddlewareComposeMap = ( +export type MiddlewareComposeMap = | CustomErrorPage | RedirectHTTP | SetXForwarded @@ -32,11 +33,16 @@ export type MiddlewareComposeMap = ( | ModifyResponse | OIDC | RateLimit - | RealIP -); + | RealIP; export type CustomErrorPage = { - use: "error_page" | "errorPage" | "ErrorPage" | "custom_error_page" | "customErrorPage" | "CustomErrorPage"; + use: + | "error_page" + | "errorPage" + | "ErrorPage" + | "custom_error_page" + | "customErrorPage" + | "CustomErrorPage"; }; export type RedirectHTTP = { @@ -81,7 +87,12 @@ export type CloudflareRealIP = { }; export type ModifyRequest = { - use: "request" | "Request" | "modify_request" | "modifyRequest" | "ModifyRequest"; + use: + | "request" + | "Request" + | "modify_request" + | "modifyRequest" + | "ModifyRequest"; /** Set HTTP headers */ set_headers?: { [key: types.HTTPHeader]: string }; /** Add HTTP headers */ @@ -91,7 +102,12 @@ export type ModifyRequest = { }; export type ModifyResponse = { - use: "response" | "Response" | "modify_response" | "modifyResponse" | "ModifyResponse"; + use: + | "response" + | "Response" + | "modify_response" + | "modifyResponse" + | "ModifyResponse"; /** Set HTTP headers */ set_headers?: { [key: types.HTTPHeader]: string }; /** Add HTTP headers */ diff --git a/schemas/providers/homepage.ts b/schemas/providers/homepage.ts index 20e499c..148a757 100644 --- a/schemas/providers/homepage.ts +++ b/schemas/providers/homepage.ts @@ -12,7 +12,7 @@ export type HomepageConfig = { /* Display name on dashboard */ name?: string; /* Display icon on dashboard */ - icon?: URL | WalkxcodeIcon | TargetRelativeIconPath; + icon?: URL | WalkxcodeIcon | ExternalIcon | TargetRelativeIconPath; /* App description */ description?: string; /* Override url */ @@ -25,12 +25,14 @@ export type HomepageConfig = { }; }; -/** - * @pattern ^(png|svg|webp)\\/[\\w\\d\\-_]+\\.\\1$ - */ -export type WalkxcodeIcon = string; +/* Walkxcode icon */ +export type WalkxcodeIcon = `${ + | "png" + | "svg" + | "webp"}/${string}/${string}.${string}`; -/** - * @pattern ^@target/.+$ - */ -export type TargetRelativeIconPath = string; +/* Walkxcode / selfh.st icon */ +export type ExternalIcon = `@${"selfhst" | "walkxcode"}/${string}.${string}`; + +/* Relative path to proxy target */ +export type TargetRelativeIconPath = `@target/${string}` | `/${string}`; diff --git a/schemas/providers/idlewatcher.ts b/schemas/providers/idlewatcher.ts index df24bbf..8047f1c 100644 --- a/schemas/providers/idlewatcher.ts +++ b/schemas/providers/idlewatcher.ts @@ -26,7 +26,7 @@ export type IdleWatcherConfig = { wake_timeout?: Duration; /** Stop timeout * - * @default 10s + * @default 30s */ stop_timeout?: Duration; /** Stop method diff --git a/schemas/routes.schema.json b/schemas/routes.schema.json index e533ef2..59de93f 100644 --- a/schemas/routes.schema.json +++ b/schemas/routes.schema.json @@ -1,1123 +1 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": { - "$ref": "#/definitions/Route" - }, - "definitions": { - "AccessLogFieldMode": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "AccessLogFormat": { - "enum": [ - "combined", - "common", - "json" - ], - "type": "string" - }, - "CIDR": { - "anyOf": [ - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*:.*:.*:.*:.*:.*:.*$", - "type": "string" - }, - { - "pattern": "^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$", - "type": "string" - }, - { - "pattern": "^::[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*::/[0-9]*$", - "type": "string" - }, - { - "pattern": "^.*:.*::/[0-9]*$", - "type": "string" - } - ] - }, - "LoadBalanceConfig": { - "additionalProperties": false, - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "link": { - "description": "Alias (subdomain or FDN) of load-balancer", - "minLength": 1, - "type": "string" - }, - "mode": { - "const": "round_robin", - "type": "string" - }, - "weight": { - "description": "Load-balance weight (reserved for future use)", - "maximum": 100, - "minimum": 0, - "type": "number" - } - }, - "required": [ - "link", - "mode" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "link": { - "description": "Alias (subdomain or FDN) of load-balancer", - "minLength": 1, - "type": "string" - }, - "mode": { - "const": "least_conn", - "type": "string" - }, - "weight": { - "description": "Load-balance weight (reserved for future use)", - "maximum": 100, - "minimum": 0, - "type": "number" - } - }, - "required": [ - "link", - "mode" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": false, - "description": "Real IP config, header to get client IP from", - "properties": { - "from": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "header": { - "default": "X-Real-IP", - "description": "Header to get the client IP from", - "pattern": "^[a-zA-Z0-9\\-]+$", - "type": "string" - }, - "recursive": { - "default": false, - "description": "Recursive resolve the IP", - "type": "boolean" - }, - "use": { - "enum": [ - "RealIP", - "realIP", - "real_ip" - ], - "type": "string" - } - }, - "required": [ - "from", - "use" - ], - "type": "object" - }, - "link": { - "description": "Alias (subdomain or FDN) of load-balancer", - "minLength": 1, - "type": "string" - }, - "mode": { - "const": "ip_hash", - "type": "string" - }, - "weight": { - "description": "Load-balance weight (reserved for future use)", - "maximum": 100, - "minimum": 0, - "type": "number" - } - }, - "required": [ - "config", - "link", - "mode" - ], - "type": "object" - } - ] - }, - "MiddlewaresMap": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "use": { - "pattern": "^.*@file$", - "type": "string" - } - }, - "required": [ - "use" - ], - "type": "object" - }, - { - "$ref": "#/definitions/{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}" - }, - { - "$ref": "#/definitions/{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}" - }, - { - "$ref": "#/definitions/{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}" - }, - { - "$ref": "#/definitions/{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}" - }, - { - "$ref": "#/definitions/{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}" - }, - { - "$ref": "#/definitions/{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}" - }, - { - "$ref": "#/definitions/{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}" - }, - { - "$ref": "#/definitions/{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}" - }, - { - "$ref": "#/definitions/{oidc:Omit;OIDC:Omit;}" - }, - { - "$ref": "#/definitions/{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}" - }, - { - "$ref": "#/definitions/{real_ip:Omit;realIP:Omit;RealIP:Omit;}" - }, - { - "$ref": "#/definitions/{[x:`${string}@file`]:NullOrEmptyMap;}" - } - ] - }, - "Omit": { - "additionalProperties": false, - "properties": { - "allow": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "message": { - "default": "IP not allowed", - "description": "Error message when blocked", - "type": "string" - }, - "status": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked (alias of status_code)" - }, - "status_code": { - "$ref": "#/definitions/StatusCode", - "default": 403, - "description": "HTTP status code when blocked" - } - }, - "required": [ - "allow" - ], - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "recursive": { - "default": false, - "description": "Recursively resolve the IP", - "type": "boolean" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "add_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Add HTTP headers", - "type": "object" - }, - "hide_headers": { - "description": "Hide HTTP headers", - "items": { - "type": "string" - }, - "type": "array" - }, - "set_headers": { - "additionalProperties": { - "type": "string" - }, - "description": "Set HTTP headers", - "type": "object" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "allowed_groups": { - "description": "Allowed groups", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - }, - "allowed_users": { - "description": "Allowed users", - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array" - } - }, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "average": { - "description": "Average number of requests allowed in a period", - "type": "number" - }, - "burst": { - "description": "Maximum number of requests allowed in a period", - "type": "number" - }, - "period": { - "default": "1s", - "description": "Duration of the rate limit", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - } - }, - "required": [ - "average", - "burst" - ], - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "properties": { - "from": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - }, - "header": { - "default": "X-Real-IP", - "description": "Header to get the client IP from", - "pattern": "^[a-zA-Z0-9\\-]+$", - "type": "string" - }, - "recursive": { - "default": false, - "description": "Recursive resolve the IP", - "type": "boolean" - } - }, - "required": [ - "from" - ], - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "Omit": { - "additionalProperties": false, - "type": "object" - }, - "ProxyScheme": { - "enum": [ - "http", - "https" - ], - "type": "string" - }, - "Route": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "access_log": { - "additionalProperties": false, - "description": "Access log config", - "examples": [ - { - "fields": { - "headers": { - "config": { - "foo": "redact" - }, - "default": "keep" - } - }, - "filters": { - "status_codes": { - "values": [ - "200-299" - ] - } - }, - "format": "combined", - "path": "/var/log/access.log" - } - ], - "properties": { - "buffer_size": { - "default": 65536, - "description": "The size of the buffer.", - "minimum": 0, - "type": "integer" - }, - "fields": { - "additionalProperties": false, - "properties": { - "cookie": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - }, - "header": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - }, - "query": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "enum": [ - "drop", - "keep", - "redact" - ], - "type": "string" - }, - "type": "object" - }, - "default": { - "$ref": "#/definitions/AccessLogFieldMode" - } - }, - "required": [ - "config" - ], - "type": "object" - } - }, - "type": "object" - }, - "filters": { - "additionalProperties": false, - "properties": { - "cidr": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "$ref": "#/definitions/CIDR" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "headers": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "host": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "method": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "enum": [ - "CONNECT", - "DELETE", - "GET", - "HEAD", - "OPTIONS", - "PATCH", - "POST", - "PUT", - "TRACE" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - }, - "status_code": { - "additionalProperties": false, - "properties": { - "negative": { - "default": false, - "description": "Whether the filter is negative.", - "type": "boolean" - }, - "values": { - "items": { - "$ref": "#/definitions/StatusCodeRange" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - } - }, - "type": "object" - }, - "format": { - "$ref": "#/definitions/AccessLogFormat", - "default": "combined", - "description": "The format of the access log." - }, - "path": { - "format": "uri-reference", - "type": "string" - } - }, - "required": [ - "path" - ], - "type": "object" - }, - "alias": { - "description": "Alias (subdomain or FDN)", - "minLength": 1, - "type": "string" - }, - "healthcheck": { - "additionalProperties": false, - "description": "Healthcheck config", - "properties": { - "disable": { - "default": false, - "description": "Disable healthcheck", - "type": "boolean" - }, - "interval": { - "default": "5s", - "description": "Healthcheck interval", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "path": { - "default": "/", - "description": "Healthcheck path", - "format": "uri-reference", - "type": "string" - }, - "timeout": { - "default": "5s", - "description": "Healthcheck timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "use_get": { - "default": false, - "description": "Use GET instead of HEAD", - "type": "boolean" - } - }, - "type": "object" - }, - "homepage": { - "additionalProperties": false, - "description": "Homepage config", - "examples": [ - { - "category": "Arr suite", - "icon": "png/sonarr.png", - "name": "Sonarr" - }, - { - "icon": "@target/favicon.ico", - "name": "App" - } - ], - "properties": { - "category": { - "type": "string" - }, - "description": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "name": { - "type": "string" - }, - "show": { - "default": true, - "description": "Whether show in dashboard", - "type": "boolean" - }, - "url": { - "format": "uri", - "type": "string" - }, - "widget_config": { - "additionalProperties": {}, - "type": "object" - } - }, - "type": "object" - }, - "host": { - "default": "localhost", - "description": "Proxy host", - "type": "string" - }, - "load_balance": { - "$ref": "#/definitions/LoadBalanceConfig", - "description": "Load balance config" - }, - "middlewares": { - "$ref": "#/definitions/MiddlewaresMap", - "description": "Middlewares" - }, - "no_tls_verify": { - "default": false, - "description": "Skip TLS verification", - "type": "boolean" - }, - "path_patterns": { - "description": "Path patterns (only patterns that match will be proxied).\n\nSee https://pkg.go.dev/net/http#hdr-Patterns-ServeMux", - "items": { - "type": "string" - }, - "type": "array" - }, - "port": { - "default": 80, - "description": "Proxy port", - "maximum": 65535, - "minimum": 0, - "type": "integer" - }, - "scheme": { - "$ref": "#/definitions/ProxyScheme", - "default": "http", - "description": "Proxy scheme" - } - }, - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "alias": { - "description": "Alias (subdomain or FDN)", - "minLength": 1, - "type": "string" - }, - "healthcheck": { - "additionalProperties": false, - "description": "Healthcheck config", - "properties": { - "disable": { - "default": false, - "description": "Disable healthcheck", - "type": "boolean" - }, - "interval": { - "default": "5s", - "description": "Healthcheck interval", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "path": { - "default": "/", - "description": "Healthcheck path", - "format": "uri-reference", - "type": "string" - }, - "timeout": { - "default": "5s", - "description": "Healthcheck timeout", - "pattern": "^([0-9]+(ms|s|m|h))+$", - "type": "string" - }, - "use_get": { - "default": false, - "description": "Use GET instead of HEAD", - "type": "boolean" - } - }, - "type": "object" - }, - "host": { - "default": "localhost", - "description": "Stream host", - "type": "string" - }, - "port": { - "pattern": "^\\d+:\\d+$", - "type": "string" - }, - "scheme": { - "$ref": "#/definitions/StreamScheme", - "default": "tcp", - "description": "Stream scheme" - } - }, - "required": [ - "port", - "scheme" - ], - "type": "object" - } - ] - }, - "StatusCode": { - "anyOf": [ - { - "pattern": "^[0-9]*$", - "type": "string" - }, - { - "type": "number" - } - ] - }, - "StatusCodeRange": { - "anyOf": [ - { - "pattern": "^[0-9]*$", - "type": "string" - }, - { - "pattern": "^[0-9]*-[0-9]*$", - "type": "string" - }, - { - "type": "number" - } - ] - }, - "StreamScheme": { - "enum": [ - "tcp", - "udp" - ], - "type": "string" - }, - "{[x:`${string}@file`]:NullOrEmptyMap;}": { - "additionalProperties": false, - "type": "object" - }, - "{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}": { - "additionalProperties": false, - "properties": { - "CIDRWhitelist": { - "$ref": "#/definitions/Omit" - }, - "cidrWhitelist": { - "$ref": "#/definitions/Omit" - }, - "cidr_whitelist": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "CIDRWhitelist", - "cidrWhitelist", - "cidr_whitelist" - ], - "type": "object" - }, - "{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}": { - "additionalProperties": false, - "properties": { - "cloudflareRealIp": { - "$ref": "#/definitions/Omit" - }, - "cloudflare_real_ip": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "cloudflareRealIp", - "cloudflare_real_ip" - ], - "type": "object" - }, - "{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}": { - "additionalProperties": false, - "properties": { - "CustomErrorPage": { - "$ref": "#/definitions/Omit" - }, - "ErrorPage": { - "$ref": "#/definitions/Omit" - }, - "customErrorPage": { - "$ref": "#/definitions/Omit" - }, - "custom_error_page": { - "$ref": "#/definitions/Omit" - }, - "errorPage": { - "$ref": "#/definitions/Omit" - }, - "error_page": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "CustomErrorPage", - "ErrorPage", - "customErrorPage", - "custom_error_page", - "errorPage", - "error_page" - ], - "type": "object" - }, - "{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}": { - "additionalProperties": false, - "properties": { - "HideXForwarded": { - "$ref": "#/definitions/Omit" - }, - "hideXForwarded": { - "$ref": "#/definitions/Omit" - }, - "hide_x_forwarded": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "HideXForwarded", - "hideXForwarded", - "hide_x_forwarded" - ], - "type": "object" - }, - "{oidc:Omit;OIDC:Omit;}": { - "additionalProperties": false, - "properties": { - "OIDC": { - "$ref": "#/definitions/Omit" - }, - "oidc": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "OIDC", - "oidc" - ], - "type": "object" - }, - "{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}": { - "additionalProperties": false, - "properties": { - "RateLimit": { - "$ref": "#/definitions/Omit" - }, - "rateLimit": { - "$ref": "#/definitions/Omit" - }, - "rate_limit": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "RateLimit", - "rateLimit", - "rate_limit" - ], - "type": "object" - }, - "{real_ip:Omit;realIP:Omit;RealIP:Omit;}": { - "additionalProperties": false, - "properties": { - "RealIP": { - "$ref": "#/definitions/Omit" - }, - "realIP": { - "$ref": "#/definitions/Omit" - }, - "real_ip": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "RealIP", - "realIP", - "real_ip" - ], - "type": "object" - }, - "{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}": { - "additionalProperties": false, - "properties": { - "RedirectHTTP": { - "$ref": "#/definitions/Omit" - }, - "redirectHTTP": { - "$ref": "#/definitions/Omit" - }, - "redirect_http": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "RedirectHTTP", - "redirectHTTP", - "redirect_http" - ], - "type": "object" - }, - "{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}": { - "additionalProperties": false, - "properties": { - "ModifyRequest": { - "$ref": "#/definitions/Omit" - }, - "Request": { - "$ref": "#/definitions/Omit" - }, - "modifyRequest": { - "$ref": "#/definitions/Omit" - }, - "modify_request": { - "$ref": "#/definitions/Omit" - }, - "request": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "ModifyRequest", - "Request", - "modifyRequest", - "modify_request", - "request" - ], - "type": "object" - }, - "{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}": { - "additionalProperties": false, - "properties": { - "ModifyResponse": { - "$ref": "#/definitions/Omit" - }, - "Response": { - "$ref": "#/definitions/Omit" - }, - "modifyResponse": { - "$ref": "#/definitions/Omit" - }, - "modify_response": { - "$ref": "#/definitions/Omit" - }, - "response": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "ModifyResponse", - "Response", - "modifyResponse", - "modify_response", - "response" - ], - "type": "object" - }, - "{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}": { - "additionalProperties": false, - "properties": { - "SetXForwarded": { - "$ref": "#/definitions/Omit" - }, - "setXForwarded": { - "$ref": "#/definitions/Omit" - }, - "set_x_forwarded": { - "$ref": "#/definitions/Omit" - } - }, - "required": [ - "SetXForwarded", - "setXForwarded", - "set_x_forwarded" - ], - "type": "object" - } - }, - "type": "object" -} - +{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{"$ref":"#/definitions/Route"},"definitions":{"AccessLogFieldMode":{"enum":["drop","keep","redact"],"type":"string"},"AccessLogFormat":{"enum":["combined","common","json"],"type":"string"},"CIDR":{"anyOf":[{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*$","type":"string"},{"pattern":"^.*:.*:.*:.*:.*:.*:.*:.*$","type":"string"},{"pattern":"^[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/[0-9]*$","type":"string"},{"pattern":"^::[0-9]*$","type":"string"},{"pattern":"^.*::/[0-9]*$","type":"string"},{"pattern":"^.*:.*::/[0-9]*$","type":"string"}]},"Duration":{"pattern":"^([0-9]+(ms|s|m|h))+$","type":"string"},"HTTPHeader":{"description":"HTTP Header","pattern":"^[a-zA-Z0-9\\-]+$","type":"string"},"LoadBalanceConfig":{"anyOf":[{"additionalProperties":false,"properties":{"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["link"],"type":"object"},{"additionalProperties":false,"properties":{"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"mode":{"const":"round_robin","type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["link","mode"],"type":"object"},{"additionalProperties":false,"properties":{"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"mode":{"const":"least_conn","type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["link","mode"],"type":"object"},{"additionalProperties":false,"properties":{"config":{"additionalProperties":false,"description":"Real IP config, header to get client IP from","properties":{"from":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"header":{"$ref":"#/definitions/HTTPHeader","default":"X-Real-IP","description":"Header to get the client IP from"},"recursive":{"default":false,"description":"Recursive resolve the IP","type":"boolean"},"use":{"enum":["RealIP","realIP","real_ip"],"type":"string"}},"required":["from","use"],"type":"object"},"link":{"description":"Alias (subdomain or FDN) of load-balancer","minLength":1,"type":"string"},"mode":{"const":"ip_hash","type":"string"},"weight":{"description":"Load-balance weight (reserved for future use)","maximum":100,"minimum":0,"type":"number"}},"required":["config","link","mode"],"type":"object"}]},"MiddlewaresMap":{"anyOf":[{"additionalProperties":false,"properties":{"use":{"pattern":"^.*@file$","type":"string"}},"required":["use"],"type":"object"},{"$ref":"#/definitions/{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}"},{"$ref":"#/definitions/{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}"},{"$ref":"#/definitions/{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}"},{"$ref":"#/definitions/{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}"},{"$ref":"#/definitions/{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}"},{"$ref":"#/definitions/{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}"},{"$ref":"#/definitions/{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}"},{"$ref":"#/definitions/{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}"},{"$ref":"#/definitions/{oidc:Omit;OIDC:Omit;}"},{"$ref":"#/definitions/{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}"},{"$ref":"#/definitions/{real_ip:Omit;realIP:Omit;RealIP:Omit;}"},{"$ref":"#/definitions/{[x:`${string}@file`]:NullOrEmptyMap;}"}]},"Omit":{"additionalProperties":false,"properties":{"allow":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"message":{"default":"IP not allowed","description":"Error message when blocked","type":"string"},"status":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked (alias of status_code)"},"status_code":{"$ref":"#/definitions/StatusCode","default":403,"description":"HTTP status code when blocked"}},"required":["allow"],"type":"object"},"Omit":{"additionalProperties":false,"properties":{"recursive":{"default":false,"description":"Recursively resolve the IP","type":"boolean"}},"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"Omit":{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"}},"type":"object"},"Omit":{"additionalProperties":false,"properties":{"add_headers":{"additionalProperties":false,"description":"Add HTTP headers","items":{"type":"string"},"type":"array"},"hide_headers":{"description":"Hide HTTP headers","items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"},"set_headers":{"additionalProperties":false,"description":"Set HTTP headers","items":{"type":"string"},"type":"array"}},"type":"object"},"Omit":{"additionalProperties":false,"properties":{"allowed_groups":{"description":"Allowed groups","items":{"type":"string"},"minItems":1,"type":"array"},"allowed_users":{"description":"Allowed users","items":{"type":"string"},"minItems":1,"type":"array"}},"type":"object"},"Omit":{"additionalProperties":false,"properties":{"average":{"description":"Average number of requests allowed in a period","type":"number"},"burst":{"description":"Maximum number of requests allowed in a period","type":"number"},"period":{"$ref":"#/definitions/Duration","default":"1s","description":"Duration of the rate limit"}},"required":["average","burst"],"type":"object"},"Omit":{"additionalProperties":false,"properties":{"from":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"},"header":{"$ref":"#/definitions/HTTPHeader","default":"X-Real-IP","description":"Header to get the client IP from"},"recursive":{"default":false,"description":"Recursive resolve the IP","type":"boolean"}},"required":["from"],"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"Omit":{"additionalProperties":false,"type":"object"},"PathPattern":{"pattern":"^(?:([A-Z]+) )?(?:([a-zA-Z0-9.-]+)\\\\/)?(\\\\/[^\\\\s]*)$","type":"string"},"Port":{"maximum":65535,"minimum":0,"type":"integer"},"ProxyScheme":{"enum":["http","https"],"type":"string"},"Route":{"anyOf":[{"additionalProperties":false,"properties":{"access_log":{"additionalProperties":false,"description":"Access log config","examples":[{"fields":{"headers":{"config":{"foo":"redact"},"default":"keep"}},"filters":{"status_codes":{"values":["200-299"]}},"format":"combined","path":"/var/log/access.log"}],"properties":{"buffer_size":{"default":65536,"description":"The size of the buffer.","minimum":0,"type":"integer"},"fields":{"additionalProperties":false,"properties":{"cookie":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"},"header":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"},"query":{"additionalProperties":false,"properties":{"config":{"additionalProperties":{"enum":["drop","keep","redact"],"type":"string"},"type":"object"},"default":{"$ref":"#/definitions/AccessLogFieldMode"}},"required":["config"],"type":"object"}},"type":"object"},"filters":{"additionalProperties":false,"properties":{"cidr":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/CIDR"},"type":"array"}},"required":["values"],"type":"object"},"headers":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/HTTPHeader"},"type":"array"}},"required":["values"],"type":"object"},"host":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"type":"string"},"type":"array"}},"required":["values"],"type":"object"},"method":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"enum":["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],"type":"string"},"type":"array"}},"required":["values"],"type":"object"},"status_code":{"additionalProperties":false,"properties":{"negative":{"default":false,"description":"Whether the filter is negative.","type":"boolean"},"values":{"items":{"$ref":"#/definitions/StatusCodeRange"},"type":"array"}},"required":["values"],"type":"object"}},"type":"object"},"format":{"$ref":"#/definitions/AccessLogFormat","default":"combined","description":"The format of the access log."},"path":{"$ref":"#/definitions/URI"}},"required":["path"],"type":"object"},"alias":{"description":"Alias (subdomain or FDN)","minLength":1,"type":"string"},"healthcheck":{"additionalProperties":false,"description":"Healthcheck config","properties":{"disable":{"default":false,"description":"Disable healthcheck","type":"boolean"},"interval":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck interval"},"path":{"$ref":"#/definitions/URI","default":"/","description":"Healthcheck path"},"timeout":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck timeout"},"use_get":{"default":false,"description":"Use GET instead of HEAD","type":"boolean"}},"type":"object"},"homepage":{"additionalProperties":false,"description":"Homepage config","examples":[{"category":"Arr suite","icon":"png/sonarr.png","name":"Sonarr"},{"icon":"@target/favicon.ico","name":"App"}],"properties":{"category":{"type":"string"},"description":{"type":"string"},"icon":{"anyOf":[{"format":"uri","type":"string"},{"pattern":"^png/.*/.*\\..*$","type":"string"},{"pattern":"^svg/.*/.*\\..*$","type":"string"},{"pattern":"^webp/.*/.*\\..*$","type":"string"},{"pattern":"^@selfhst/.*\\..*$","type":"string"},{"pattern":"^@walkxcode/.*\\..*$","type":"string"},{"pattern":"^@target/.*$","type":"string"},{"pattern":"^/.*$","type":"string"}]},"name":{"type":"string"},"show":{"default":true,"description":"Whether show in dashboard","type":"boolean"},"url":{"$ref":"#/definitions/URL"},"widget_config":{"additionalProperties":{},"type":"object"}},"type":"object"},"host":{"anyOf":[{"format":"hostname","type":"string"},{"format":"ipv4","type":"string"},{"format":"ipv6","type":"string"}],"default":"localhost","description":"Proxy host"},"load_balance":{"$ref":"#/definitions/LoadBalanceConfig","description":"Load balance config"},"middlewares":{"$ref":"#/definitions/MiddlewaresMap","description":"Middlewares"},"no_tls_verify":{"default":false,"description":"Skip TLS verification","type":"boolean"},"path_patterns":{"description":"Path patterns (only patterns that match will be proxied).\n\nSee https://pkg.go.dev/net/http#hdr-Patterns-ServeMux","items":{"$ref":"#/definitions/PathPattern"},"type":"array"},"port":{"$ref":"#/definitions/Port","default":80,"description":"Proxy port"},"scheme":{"$ref":"#/definitions/ProxyScheme","default":"http","description":"Proxy scheme"}},"type":"object"},{"additionalProperties":false,"properties":{"alias":{"description":"Alias (subdomain or FDN)","minLength":1,"type":"string"},"healthcheck":{"additionalProperties":false,"description":"Healthcheck config","properties":{"disable":{"default":false,"description":"Disable healthcheck","type":"boolean"},"interval":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck interval"},"path":{"$ref":"#/definitions/URI","default":"/","description":"Healthcheck path"},"timeout":{"$ref":"#/definitions/Duration","default":"5s","description":"Healthcheck timeout"},"use_get":{"default":false,"description":"Use GET instead of HEAD","type":"boolean"}},"type":"object"},"host":{"anyOf":[{"format":"hostname","type":"string"},{"format":"ipv4","type":"string"},{"format":"ipv6","type":"string"}],"default":"localhost","description":"Stream host"},"port":{"$ref":"#/definitions/StreamPort"},"scheme":{"$ref":"#/definitions/StreamScheme","default":"tcp","description":"Stream scheme"}},"required":["port","scheme"],"type":"object"}]},"StatusCode":{"anyOf":[{"pattern":"^[0-9]*$","type":"string"},{"type":"number"}]},"StatusCodeRange":{"anyOf":[{"pattern":"^[0-9]*$","type":"string"},{"pattern":"^[0-9]*-[0-9]*$","type":"string"},{"type":"number"}]},"StreamPort":{"pattern":"^\\d+:\\d+$","type":"string"},"StreamScheme":{"enum":["tcp","udp"],"type":"string"},"URI":{"format":"uri-reference","type":"string"},"URL":{"format":"uri","type":"string"},"{[x:`${string}@file`]:NullOrEmptyMap;}":{"additionalProperties":false,"type":"object"},"{cidr_whitelist:Omit;cidrWhitelist:Omit;CIDRWhitelist:Omit;}":{"additionalProperties":false,"properties":{"CIDRWhitelist":{"$ref":"#/definitions/Omit"},"cidrWhitelist":{"$ref":"#/definitions/Omit"},"cidr_whitelist":{"$ref":"#/definitions/Omit"}},"required":["CIDRWhitelist","cidrWhitelist","cidr_whitelist"],"type":"object"},"{cloudflare_real_ip:Omit;cloudflareRealIp:Omit;}":{"additionalProperties":false,"properties":{"cloudflareRealIp":{"$ref":"#/definitions/Omit"},"cloudflare_real_ip":{"$ref":"#/definitions/Omit"}},"required":["cloudflareRealIp","cloudflare_real_ip"],"type":"object"},"{error_page:Omit;errorPage:Omit;ErrorPage:Omit;custom_error_page:Omit;customErrorPage:Omit;CustomErrorPage:Omit;}":{"additionalProperties":false,"properties":{"CustomErrorPage":{"$ref":"#/definitions/Omit"},"ErrorPage":{"$ref":"#/definitions/Omit"},"customErrorPage":{"$ref":"#/definitions/Omit"},"custom_error_page":{"$ref":"#/definitions/Omit"},"errorPage":{"$ref":"#/definitions/Omit"},"error_page":{"$ref":"#/definitions/Omit"}},"required":["CustomErrorPage","ErrorPage","customErrorPage","custom_error_page","errorPage","error_page"],"type":"object"},"{hide_x_forwarded:Omit;hideXForwarded:Omit;HideXForwarded:Omit;}":{"additionalProperties":false,"properties":{"HideXForwarded":{"$ref":"#/definitions/Omit"},"hideXForwarded":{"$ref":"#/definitions/Omit"},"hide_x_forwarded":{"$ref":"#/definitions/Omit"}},"required":["HideXForwarded","hideXForwarded","hide_x_forwarded"],"type":"object"},"{oidc:Omit;OIDC:Omit;}":{"additionalProperties":false,"properties":{"OIDC":{"$ref":"#/definitions/Omit"},"oidc":{"$ref":"#/definitions/Omit"}},"required":["OIDC","oidc"],"type":"object"},"{rate_limit:Omit;rateLimit:Omit;RateLimit:Omit;}":{"additionalProperties":false,"properties":{"RateLimit":{"$ref":"#/definitions/Omit"},"rateLimit":{"$ref":"#/definitions/Omit"},"rate_limit":{"$ref":"#/definitions/Omit"}},"required":["RateLimit","rateLimit","rate_limit"],"type":"object"},"{real_ip:Omit;realIP:Omit;RealIP:Omit;}":{"additionalProperties":false,"properties":{"RealIP":{"$ref":"#/definitions/Omit"},"realIP":{"$ref":"#/definitions/Omit"},"real_ip":{"$ref":"#/definitions/Omit"}},"required":["RealIP","realIP","real_ip"],"type":"object"},"{redirect_http:Omit;redirectHTTP:Omit;RedirectHTTP:Omit;}":{"additionalProperties":false,"properties":{"RedirectHTTP":{"$ref":"#/definitions/Omit"},"redirectHTTP":{"$ref":"#/definitions/Omit"},"redirect_http":{"$ref":"#/definitions/Omit"}},"required":["RedirectHTTP","redirectHTTP","redirect_http"],"type":"object"},"{request:Omit;Request:Omit;modify_request:Omit;modifyRequest:Omit;ModifyRequest:Omit;}":{"additionalProperties":false,"properties":{"ModifyRequest":{"$ref":"#/definitions/Omit"},"Request":{"$ref":"#/definitions/Omit"},"modifyRequest":{"$ref":"#/definitions/Omit"},"modify_request":{"$ref":"#/definitions/Omit"},"request":{"$ref":"#/definitions/Omit"}},"required":["ModifyRequest","Request","modifyRequest","modify_request","request"],"type":"object"},"{response:Omit;Response:Omit;modify_response:Omit;modifyResponse:Omit;ModifyResponse:Omit;}":{"additionalProperties":false,"properties":{"ModifyResponse":{"$ref":"#/definitions/Omit"},"Response":{"$ref":"#/definitions/Omit"},"modifyResponse":{"$ref":"#/definitions/Omit"},"modify_response":{"$ref":"#/definitions/Omit"},"response":{"$ref":"#/definitions/Omit"}},"required":["ModifyResponse","Response","modifyResponse","modify_response","response"],"type":"object"},"{set_x_forwarded:Omit;setXForwarded:Omit;SetXForwarded:Omit;}":{"additionalProperties":false,"properties":{"SetXForwarded":{"$ref":"#/definitions/Omit"},"setXForwarded":{"$ref":"#/definitions/Omit"},"set_x_forwarded":{"$ref":"#/definitions/Omit"}},"required":["SetXForwarded","setXForwarded","set_x_forwarded"],"type":"object"}},"type":"object"} \ No newline at end of file diff --git a/schemas/types.ts b/schemas/types.ts index 2ed18d5..d141bc5 100644 --- a/schemas/types.ts +++ b/schemas/types.ts @@ -18,22 +18,28 @@ export const HTTP_METHODS = [ ] as const; export type HTTPMethod = (typeof HTTP_METHODS)[number]; + +// "string & {}" Prevents skipping schema generation + /** * HTTP Header * @pattern ^[a-zA-Z0-9\-]+$ + * @type string */ -export type HTTPHeader = string; +export type HTTPHeader = string & {}; /** * HTTP Query * @pattern ^[a-zA-Z0-9\-_]+$ + * @type string */ -export type HTTPQuery = string; +export type HTTPQuery = string & {}; /** * HTTP Cookie * @pattern ^[a-zA-Z0-9\-_]+$ + * @type string */ -export type HTTPCookie = string; +export type HTTPCookie = string & {}; export type StatusCode = number | `${number}`; export type StatusCodeRange = number | `${number}` | `${number}-${number}`; @@ -48,16 +54,19 @@ export type DomainNames = string[]; export type DomainOrWildcards = string[]; /** * @format hostname + * @type string */ -export type Hostname = string; +export type Hostname = string & {}; /** * @format ipv4 + * @type string */ -export type IPv4 = string; +export type IPv4 = string & {}; /** * @format ipv6 + * @type string */ -export type IPv6 = string; +export type IPv6 = string & {}; /* CIDR / IPv4 / IPv6 */ export type CIDR = @@ -73,39 +82,46 @@ export type CIDR = * @minimum 0 * @maximum 65535 */ -export type Port = number; +export type Port = number | `${number}`; /** * @pattern ^\d+:\d+$ + * @type string */ -export type StreamPort = string; +export type StreamPort = string & {}; /** * @format email + * @type string */ -export type Email = string; +export type Email = string & {}; /** * @format uri + * @type string */ -export type URL = string; +export type URL = string & {}; /** * @format uri-reference + * @type string */ -export type URI = string; +export type URI = string & {}; /** * @pattern ^(?:([A-Z]+) )?(?:([a-zA-Z0-9.-]+)\\/)?(\\/[^\\s]*)$ + * @type string */ -export type PathPattern = string; +export type PathPattern = string & {}; /** * @pattern ^([0-9]+(ms|s|m|h))+$ + * @type string */ -export type Duration = string; +export type Duration = string & {}; /** * @format date-time + * @type string */ -export type DateTime = string; +export type DateTime = string & {}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d8899d4 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Node", + "strict": true + }, + "include": ["schemas/**/*.ts"] +}