This commit is contained in:
Mateusz Gruszczyński committed 2026-11-14 21:52:48 +01:00
1 parent f48843e934
commit e2c8099d9c
64 files changed
+5354 -673

No files matched your search

+341 -4
View File
@@ -2,7 +2,7 @@
"openapi": "3.0.3",
"info": {
"title": "RustProxy Administration API",
"version": "0.37.1",
"version": "0.37.2",
"description": "Administration API for the active panel origin. Sign in through the panel; the same-origin HttpOnly cookie authenticates all private operations. Mutations also require the exact Origin, X-RustProxy-Request: 1 and a session-bound X-CSRF-Token. Loopback HTTP is the default; Settings can enable HTTPS before using a non-loopback administration bind. This document contains no live configuration or credentials. Object schemas marked extensible are summaries: full configuration validation is authoritative in Rust. The API also permits explicitly scoped GeneralApiBearer tokens on a narrow route allowlist, with RO/RW and source CIDR checks; API-token management and Prometheus-token management are browser-session-only."
},
"servers": [
@@ -1244,6 +1244,63 @@
"$ref": "#/components/schemas/UserAgentBlocking"
}
]
},
"alerts": {
"type": "object",
"description": "Since 0.37.2. General alert settings (Settings → Alerts): enabled, notifications, certificate_expiry, certificate_warning_days (1..90, default 14), certificate_error_days (below warning, default 3), certificate_renewal, acme_runtime, file_descriptors, file_descriptors_warning_percent (default 80), file_descriptors_error_percent (default 95), geoip, prometheus, update. Omitted when all values are defaults.",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean"
},
"notifications": {
"type": "boolean"
},
"certificate_expiry": {
"type": "boolean"
},
"certificate_renewal": {
"type": "boolean"
},
"acme_runtime": {
"type": "boolean"
},
"file_descriptors": {
"type": "boolean"
},
"geoip": {
"type": "boolean"
},
"prometheus": {
"type": "boolean"
},
"update": {
"type": "boolean"
},
"certificate_warning_days": {
"type": "integer",
"minimum": 1,
"maximum": 90,
"default": 14
},
"certificate_error_days": {
"type": "integer",
"minimum": 0,
"default": 3
},
"file_descriptors_warning_percent": {
"type": "integer",
"minimum": 50,
"maximum": 99,
"default": 80
},
"file_descriptors_error_percent": {
"type": "integer",
"minimum": 50,
"maximum": 100,
"default": 95
}
}
}
},
"additionalProperties": false,
@@ -3281,6 +3338,25 @@
"default": false,
"description": "Enable the normal RustProxy cache policy for this generated Docker vhost."
},
"cache_default_ttl_seconds": {
"type": "integer",
"minimum": 0,
"nullable": true,
"description": "Since 0.37.2. Default cache TTL for this Docker vhost; null uses the global cache default."
},
"cache_rules": {
"type": "array",
"maxItems": 128,
"items": {
"$ref": "#/components/schemas/CacheRule"
},
"description": "Since 0.37.2. Cache rules for this Docker vhost (same format as vhost cache.rules); they run before global rules."
},
"cache_ignore_global_rules": {
"type": "boolean",
"default": false,
"description": "Since 0.37.2. Do not apply global cache rules to this Docker vhost."
},
"health_check": {
"$ref": "#/components/schemas/DockerHealthCheck"
},
@@ -3352,6 +3428,11 @@
},
"description": "Up to 8 additional reusable ACL profiles. Explicit IP denies and country blocks beat all allows; otherwise explicit allows combine as OR; unmatched defaults require unanimous allow. Legacy acl_profile_id is still honored. Inline and global policies remain cumulative."
},
"inherit_acl_profiles": {
"type": "boolean",
"default": true,
"description": "Since 0.37.2. When no ACL profiles are selected for the service, the agent default ACL profiles apply. false publishes the service without the agent default profiles (public Docker vhost); inline and global policies still apply."
},
"allow_certificate_mismatch": {
"type": "boolean",
"default": false,
@@ -4345,6 +4426,36 @@
},
"description": "Optional per-card heights in Overview row units (1-32; a compact stat card spans 2 rows). Cards without an entry size to their content; a height smaller than the content needs is raised automatically. Keys must be registered Overview widget IDs."
},
"dashboard_widget_positions": {
"type": "object",
"nullable": true,
"description": "Since 0.37.2. Fixed Overview card positions saved with *Arrange manually*: grid column count and, per card ID, [column, row] (0-based; rows in Overview row units). Applied only when Fit to screen is off and the grid has the same column count; omitted for the flowing layout.",
"additionalProperties": false,
"properties": {
"columns": {
"type": "integer",
"minimum": 1,
"maximum": 24
},
"items": {
"type": "object",
"additionalProperties": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"type": "integer",
"minimum": 0,
"maximum": 2048
}
}
}
},
"required": [
"columns",
"items"
]
},
"dashboard_auto_fit": {
"type": "boolean",
"default": true,
@@ -8663,7 +8774,7 @@
"maxItems": 16,
"items": {
"type": "object",
"description": "type: pass, strip_cookies{keep}, strip_query{params,keep_only}, hash_header{name}, hash_cookie{name} (request); ttl{seconds}, grace{seconds}, no_store, ignore_cache_control, strip_set_cookie (response); set_header{name,value}, remove_header{name} (deliver).",
"description": "type: pass, strip_cookies{keep}, strip_query{params,keep_only}, hash_header{name}, hash_cookie{name} (request); ttl{seconds}, grace{seconds}, no_store, ignore_cache_control, strip_set_cookie (response); set_header{name,value}, default_header{name,value} (only when the response lacks the header, since 0.37.2), remove_header{name} (deliver; deliver rules apply to every response of the vhost, also when caching is off).",
"additionalProperties": true
}
},
@@ -11834,7 +11945,8 @@
"host-policies",
"global-security",
"web-services",
"php-fpm-profiles"
"php-fpm-profiles",
"alerts"
]
},
"description": "Configuration section to replace."
@@ -11951,6 +12063,9 @@
],
"global-security": [
"global_security"
],
"alerts": [
"alerts"
]
}
},
@@ -11991,7 +12106,8 @@
"host-policies",
"global-security",
"web-services",
"php-fpm-profiles"
"php-fpm-profiles",
"alerts"
]
},
"description": "Exactly one supported configuration section."
@@ -12119,10 +12235,139 @@
],
"global-security": [
"global_security"
],
"alerts": [
"alerts"
]
}
}
},
"/api/alerts": {
"get": {
"summary": "Active general and Docker alerts",
"tags": [
"Cache"
],
"operationId": "get_api_alerts",
"responses": {
"200": {
"description": "Active alerts",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alerts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"certificate_expired",
"certificate_expiring",
"certificate_renewal_failed",
"acme_runtime",
"file_descriptors_high",
"geoip_missing",
"prometheus_exposed",
"update_available"
]
},
"severity": {
"type": "string",
"enum": [
"error",
"warning",
"info"
]
},
"subject": {
"type": "string"
},
"value": {
"type": "string",
"nullable": true
},
"threshold": {
"type": "string",
"nullable": true
},
"message": {
"type": "string",
"nullable": true
}
}
}
},
"docker": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
},
"401": {
"description": "Authentication required or revoked",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Host, origin or CSRF validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Bounded worker/session/rate limit",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Control-plane storage/worker unavailable",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
],
"description": "Since 0.37.2. Alerts computed from the current state only (no history): certificate expired/expiring within 14 days/renewal failed, ACME environment not ready while ACME certificates exist, file descriptors at 80% of the limit or more, country rules without a GeoIP database, Prometheus exporter reachable without token or address restriction, and an available update (severity info). General alerts are recomputed at most every 30 seconds and are also included as `alerts` in /api/status. `docker` repeats the Docker agent alerts."
}
},
"/api/docker": {
"get": {
"summary": "Read cached Docker agent observations",
@@ -15652,6 +15897,98 @@
]
}
},
"/api/cache/rules/targets": {
"get": {
"summary": "Vhosts that cache rules can target",
"tags": [
"Cache"
],
"operationId": "get_api_cache_rules_targets",
"responses": {
"200": {
"description": "Rule targets",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"hosts": {
"type": "array",
"items": {
"type": "string"
}
},
"docker": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"401": {
"description": "Authentication required or revoked",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Host, origin or CSRF validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Bounded worker/session/rate limit",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Control-plane storage/worker unavailable",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
],
"description": "Since 0.37.2. Lists configured vhosts and the Docker vhosts generated from agent assignments and container labels (id, up to four hosts, docker flag), for the global rule vhost picker and the rule tester."
}
},
"/api/cache/rules/test": {
"post": {
"summary": "Simulate cache rules for a request",