mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-29 08:02:34 +02:00
207 lines
5.7 KiB
JSON
207 lines
5.7 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"type": "object",
|
|
"title": "go-proxy config file",
|
|
"properties": {
|
|
"autocert": {
|
|
"title": "Autocert configuration",
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"title": "ACME Email",
|
|
"type": "string",
|
|
"pattern": "^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$",
|
|
"patternErrorMessage": "Invalid email"
|
|
},
|
|
"domains": {
|
|
"title": "Cert Domains",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"minItems": 1
|
|
},
|
|
"cert_path": {
|
|
"title": "path of cert file to load/store",
|
|
"default": "certs/cert.crt",
|
|
"markdownDescription": "default: `certs/cert.crt`",
|
|
"type": "string"
|
|
},
|
|
"key_path": {
|
|
"title": "path of key file to load/store",
|
|
"default": "certs/priv.key",
|
|
"markdownDescription": "default: `certs/priv.key`",
|
|
"type": "string"
|
|
},
|
|
"provider": {
|
|
"title": "DNS Challenge Provider",
|
|
"default": "local",
|
|
"type": "string",
|
|
"enum": ["local", "cloudflare", "clouddns", "duckdns"]
|
|
},
|
|
"options": {
|
|
"title": "Provider specific options",
|
|
"type": "object"
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"not": {
|
|
"properties": {
|
|
"provider": {
|
|
"const": "local"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"required": ["email", "domains", "provider", "options"]
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"provider": {
|
|
"const": "cloudflare"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"options": {
|
|
"required": ["auth_token"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"auth_token": {
|
|
"description": "Cloudflare API Token with Zone Scope",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"provider": {
|
|
"const": "clouddns"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"options": {
|
|
"required": ["client_id", "email", "password"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"client_id": {
|
|
"description": "CloudDNS Client ID",
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"description": "CloudDNS Email",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "CloudDNS Password",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"provider": {
|
|
"const": "duckdns"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"options": {
|
|
"required": ["token"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"token": {
|
|
"description": "DuckDNS Token",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"providers": {
|
|
"title": "Proxy providers configuration",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"include": {
|
|
"title": "Proxy providers configuration files",
|
|
"description": "relative path to 'config'",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"pattern": "^[a-zA-Z0-9_-]+\\.(yml|yaml)$",
|
|
"patternErrorMessage": "Invalid file name"
|
|
}
|
|
},
|
|
"docker": {
|
|
"title": "Docker provider configuration",
|
|
"description": "docker clients (name-address pairs)",
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^[a-zA-Z0-9-_]+$": {
|
|
"type": "string",
|
|
"examples": [
|
|
"unix:///var/run/docker.sock",
|
|
"tcp://127.0.0.1:2375",
|
|
"ssh://user@host:port"
|
|
],
|
|
"oneOf": [
|
|
{
|
|
"const": "$DOCKER_HOST",
|
|
"description": "Use DOCKER_HOST environment variable"
|
|
},
|
|
{
|
|
"pattern": "^unix://.+$",
|
|
"description": "A Unix socket for local Docker communication."
|
|
},
|
|
{
|
|
"pattern": "^ssh://.+$",
|
|
"description": "An SSH connection to a remote Docker host."
|
|
},
|
|
{
|
|
"pattern": "^fd://.+$",
|
|
"description": "A file descriptor for Docker communication."
|
|
},
|
|
{
|
|
"pattern": "^tcp://.+$",
|
|
"description": "A TCP connection to a remote Docker host."
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"timeout_shutdown": {
|
|
"title": "Shutdown timeout (in seconds)",
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"redirect_to_https": {
|
|
"title": "Redirect to HTTPS on HTTP requests",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["providers"]
|
|
}
|