summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2022-08-18 15:01:22 +0200
committerValery Piashchynski <[email protected]>2022-08-18 15:01:22 +0200
commit3d2381075a98f3b65f645fbcc66ad0280c8069ec (patch)
tree8c86b149a82041a959e8b39548edf2f4b4df7aea
parente6d0c8dd3cf07a0020064010deb867f03ae4367f (diff)
update schema-json
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r--.rr.yaml99
-rw-r--r--schemas/config/2.0.schema.json359
2 files changed, 441 insertions, 17 deletions
diff --git a/.rr.yaml b/.rr.yaml
index df95d7b6..bd97ba4a 100644
--- a/.rr.yaml
+++ b/.rr.yaml
@@ -543,22 +543,87 @@ http:
# Error if empty. NEW_RELIC_LICENSE_KEY env variable should be set if the license_key key is empty. If both empty - error.
license_key: "key"
- # RFC 7234 (partially) RR Cache middleware
+ # RFC 7234 RR Cache middleware
+ #
+ # Link: https://github.com/darkweak/souin
cache:
- # Cache driver
- #
- # Default: memory. Available drivers: memory
- driver: memory
-
- # Methods to cache
- #
- # According to the RFC, we can cache only GET, HEAD or POST requests. Currently, only GET method supported.
- cache_methods: [ "GET", "HEAD", "POST" ]
-
- # Configuration for the driver
- #
- # Empty for the memory
- config: { }
+ api:
+ basepath: /souin-api
+ prometheus:
+ basepath: /anything-for-prometheus-metrics
+ souin:
+ basepath: /anything-for-souin
+ cache_keys:
+ '.*\.css':
+ disable_body: true
+ disable_host: true
+ disable_method: true
+ cdn:
+ api_key: XXXX
+ provider: fastly
+ strategy: soft
+ dynamic: true
+ default_cache:
+ allowed_http_verbs:
+ - GET
+ - POST
+ - HEAD
+ cache_name: Souin
+ distributed: true
+ headers:
+ - Authorization
+ key:
+ disable_body: true
+ disable_host: true
+ disable_method: true
+ etcd:
+ configuration:
+ endpoints:
+ - etcd-1:2379
+ - etcd-2:2379
+ - etcd-3:2379
+ olric:
+ url: 'olric:3320'
+ regex:
+ exclude: 'ARegexHere'
+ stale: 1000s
+ timeout:
+ backend: 10s
+ cache: 20ms
+ ttl: 1000s
+ default_cache_control: no-store
+ log_level: INFO
+ ssl_providers:
+ - traefik
+ urls:
+ 'https:\/\/domain.com\/first-.+':
+ ttl: 1000s
+ 'https:\/\/domain.com\/second-route':
+ ttl: 10s
+ headers:
+ - Authorization
+ 'https?:\/\/mysubdomain\.domain\.com':
+ ttl: 50s
+ headers:
+ - Authorization
+ - 'Content-Type'
+ default_cache_control: public, max-age=86400
+ ykeys:
+ The_First_Test:
+ headers:
+ Content-Type: '.+'
+ The_Second_Test:
+ url: 'the/second/.+'
+ The_Third_Test:
+ The_Fourth_Test:
+ surrogate_keys:
+ The_First_Test:
+ headers:
+ Content-Type: '.+'
+ The_Second_Test:
+ url: 'the/second/.+'
+ The_Third_Test:
+ The_Fourth_Test:
# File uploading settings.
uploads:
@@ -1413,7 +1478,9 @@ jobs:
- 1: 0
- 2: 0
- # not supported in beta.3
+ # Kafka group id
+ #
+ # Optional, default - empty
group_id: "foo"
# Max number of outstanding requests a connection is allowed to have before sending on it blocks
diff --git a/schemas/config/2.0.schema.json b/schemas/config/2.0.schema.json
index 22c59ba1..d3a794cf 100644
--- a/schemas/config/2.0.schema.json
+++ b/schemas/config/2.0.schema.json
@@ -406,8 +406,210 @@
"description": "Default route basepath for every additional APIs to avoid conflicts with existing routes",
"type": "string",
"default": null
+ },
+ "prometheus": {
+ "type": "object",
+ "description": "Prometheus exposed metrics",
+ "properties": {
+ "basepath": {
+ "type": "string",
+ "default": null
+ }
+ }
+ },
+ "souin": {
+ "type": "object",
+ "description": "Souin listing keys and cache management",
+ "properties": {
+ "basepath": {
+ "type": "string",
+ "default": null
+ }
+ }
+ }
+ }
+ },
+ "cache_keys": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9._-]+$": {
+ "description": "cache keys configuration",
+ "type": "object",
+ "properties": {
+ "disable_body": {
+ "type": "boolean",
+ "default": false
+ },
+ "disable_host": {
+ "type": "boolean",
+ "default": false
+ },
+ "disable_method": {
+ "type": "boolean",
+ "default": false
+ }
+ }
+ }
+ }
+ },
+ "cdn": {
+ "description": "If Souin is set after a CDN fill these information",
+ "type": "object",
+ "properties": {
+ "api_key": {
+ "type": "string",
+ "description": "Your provider API key if mandatory"
+ },
+ "provider": {
+ "description": "The provider placed before Souin (e.g. fastly, cloudflare, akamai, varnish)",
+ "type": "string",
+ "enum": [
+ "fastly",
+ "cloudflare",
+ "akamai",
+ "varnish"
+ ]
+ },
+ "strategy": {
+ "description": "The strategy to purge the CDN cache based on tags (e.g. soft, hard)",
+ "type": "string",
+ "enum": [
+ "soft",
+ "hard"
+ ]
+ },
+ "dynamic": {
+ "description": "If true, you'll be able to add custom keys than the ones defined under the surrogate_keys key",
+ "type": "boolean",
+ "default": false
+ }
+ }
+ },
+ "default_cache": {
+ "type": "object",
+ "properties": {
+ "allowed_http_verbs": {
+ "type": "array",
+ "default": [
+ "GET",
+ "POST"
+ ]
+ },
+ "cache_name": {
+ "description": "Override the cache name to use in the Cache-Status header",
+ "type": "string",
+ "default": "roadrunner"
+ },
+ "distributed": {
+ "type": "boolean",
+ "default": false,
+ "description": "Use Olric or Etcd distributed storage"
+ },
+ "headers": {
+ "description": "Default headers concatenated in stored keys",
+ "type": "array",
+ "default": null
+ },
+ "key": {
+ "type": "object",
+ "properties": {
+ "disable_body": {
+ "type": "boolean",
+ "default": false
+ },
+ "disable_host": {
+ "type": "boolean",
+ "default": false
+ },
+ "disable_method": {
+ "type": "boolean",
+ "default": false
+ }
+ }
+ },
+ "etcd": {
+ "description": "If distributed is set to true, you'll have to define either the etcd or olric section",
+ "type": "object",
+ "properties": {
+ "configuration": {
+ "type": "object",
+ "description": "Configure directly the Etcd client",
+ "properties": {
+ "endpoints": {
+ "description": "Define multiple endpoints",
+ "type": "array",
+ "default": null
+ }
+ }
+ }
+ }
+ },
+ "olric": {
+ "type": "object",
+ "description": "If distributed is set to true, you'll have to define either the etcd or olric section",
+ "properties": {
+ "url": {
+ "description": "Olric server",
+ "type": "string",
+ "default": "http://127.0.0.1:3320"
+ }
+ }
+ },
+ "regex": {
+ "type": "object",
+ "description": "Regex to exclude from cache",
+ "properties": {
+ "exclude": {
+ "type": "string",
+ "default": null
+ }
+ }
+ },
+ "stale": {
+ "type": "string",
+ "description": "Stale duration",
+ "default": "1000s"
+ },
+ "timeout": {
+ "description": "Timeout configuration",
+ "type": "object",
+ "properties": {
+ "backend": {
+ "description": "Backend timeout before returning an HTTP unavailable response",
+ "type": "string",
+ "default": "10s"
+ },
+ "cache": {
+ "description": "Cache provider (badger, etcd, nutsdb, olric, depending the configuration you set) timeout before returning a miss",
+ "type": "string",
+ "default": "20ms"
+ }
+ }
+ },
+ "ttl": {
+ "description": "Default TTL",
+ "type": "string",
+ "default": "1000s"
+ },
+ "default_cache_control": {
+ "description": "Set default value for Cache-Control response header if not set by upstream",
+ "type": "string",
+ "default": "no-store"
}
}
+ },
+ "log_level": {
+ "type": "string",
+ "description": "Logs verbosity",
+ "default": "INFO",
+ "enum": [
+ "DEBUG",
+ "INFO",
+ "WARN",
+ "DPANIC",
+ "PANIC",
+ "FATAL"
+ ]
}
}
},
@@ -1032,6 +1234,9 @@
"boltdb": {
"$ref": "#/definitions/BoltDB_J"
},
+ "kafka": {
+ "$ref": "#/definitions/KAFKA_J"
+ },
"amqp": {
"description": "AMQP jobs driver",
"type": "object",
@@ -1135,7 +1340,8 @@
"beanstalk",
"boltdb",
"memory",
- "nats"
+ "nats",
+ "kafka"
]
}
},
@@ -1208,6 +1414,141 @@
"type": "integer",
"default": 10
},
+ "topic": {
+ "description": "Topic name: https://kafka.apache.org/intro#intro_concepts_and_terms",
+ "type": "string",
+ "default": null
+ },
+ "partitions_offsets": {
+ "description": "Offsets for the partitions",
+ "type": "object",
+ "properties": {
+ "itemType": {
+ "$ref": "#/definitions/HashMapInt"
+ },
+ "itemCount": {
+ "$ref": "#/definitions/Hashmap"
+ }
+ },
+ "default": null
+ },
+ "group_id": {
+ "type": "string",
+ "description": "Kafka group id",
+ "default": "default"
+ },
+ "max_open_requests": {
+ "description": "Max number of outstanding requests a connection is allowed to have before sending on it blocks",
+ "type": "integer",
+ "default": 5
+ },
+ "client_id": {
+ "description": "A user provided string sent with every request to the brokers for logging, debugging, and auditing purposes.",
+ "type": "string",
+ "default": "roadrunner"
+ },
+ "kafka_version": {
+ "description": "Kafka version.",
+ "type": "string",
+ "default": "1.0.0.0"
+ },
+ "create_topics": {
+ "description": "Create topics configuration. If topic doesn't exist, RR may create a topic with provided configuration",
+ "type": "object",
+ "properties": {
+ "replication_factor": {
+ "description": "Replication factor for the data stored across several Kafka brokers.",
+ "type": "integer",
+ "default": 1
+ },
+ "replica_assignment": {
+ "type": "object",
+ "description": "Partition replica assigment.",
+ "default": null
+ },
+ "config_entries": {
+ "type": "object",
+ "description": "Topic creation options. Note: 'compression:type' will be replaced with 'compression.type', so ':' -> '.'. All options should use ':' as the delimiter.",
+ "default": null
+ }
+ }
+ },
+ "producer_options": {
+ "description": "Kafka producer options",
+ "type": "object",
+ "properties": {
+ "max_message_bytes": {
+ "type": "integer",
+ "default": 1000000
+ },
+ "required_acks": {
+ "description": "The level of acknowledgement reliability needed from the broker.",
+ "type": "integer",
+ "default": -1
+ },
+ "timeout": {
+ "description": "The maximum duration in seconds the broker will wait the receipt of the number of required_acks.",
+ "default": 10,
+ "type": "integer"
+ },
+ "compression_codec": {
+ "type": "string",
+ "default": "none",
+ "enum": [
+ "none",
+ "gzip",
+ "snappy",
+ "lz4",
+ "zstd"
+ ]
+ },
+ "compression_level": {
+ "description": "The level of compression to use on messages.",
+ "type": "integer",
+ "default": null
+ },
+ "idempotent": {
+ "description": "If enabled, the producer will ensure that exactly one copy of each message is written.",
+ "type": "boolean",
+ "default": false
+ }
+ }
+ },
+ "consumer_options": {
+ "description": "Kafka consumer options",
+ "type": "object",
+ "properties": {
+ "min_fetch_message_size": {
+ "description": "The minimum number of message bytes to fetch in a request",
+ "type": "integer",
+ "default": 1
+ },
+ "max_fetch_message_size": {
+ "type": "integer",
+ "description": "The default number of message bytes to fetch from the broker in each request",
+ "default": 1000000
+ },
+ "session_timeout": {
+ "type": "integer",
+ "description": "The timeout in seconds used to detect consumer failures when using Kafka's group management facility.",
+ "default": 10
+ },
+ "heartbeat_interval": {
+ "type": "integer",
+ "description": "The expected time in seconds between heartbeats to the consumer coordinator when using Kafka's group management facilities",
+ "default": 3
+ }
+ }
+ }
+ }
+ },
+ {
+ "properties": {
+ "priority": {
+ "description": "Pipeline priority. If the job pushed to the pipeline has priority set to 0, it will inherit the pipeline's priority",
+ "type": "integer",
+ "default": 10
+ },
"prefetch": {
"description": "Number of job to prefetch from the driver",
"type": "integer",
@@ -1915,6 +2256,12 @@
},
"additionalProperties": false
},
+ "HashMapInt": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ },
"NATS_J": {
"description": "NATS jobs driver",
"type": "object",
@@ -1926,6 +2273,16 @@
}
}
},
+ "KAFKA_J": {
+ "description": "Kafka jobs driver",
+ "type": "object",
+ "properties": {
+ "addr": {
+ "description": "Kafka server addresses",
+ "type": "array"
+ }
+ }
+ },
"BoltDB_J": {
"description": "Boltdb jobs driver",
"type": "object",