refactor progress
This commit is contained in:
32
packages/config/src/schema/defs/services/admin.json
Normal file
32
packages/config/src/schema/defs/services/admin.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"admin_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the Admin Panel service.",
|
||||
"additionalProperties": false,
|
||||
"required": ["secret_key_base", "oauth_client_secret"],
|
||||
"properties": {
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 3001
|
||||
},
|
||||
"secret_key_base": {
|
||||
"type": "string",
|
||||
"description": "Base secret key for signing admin session tokens."
|
||||
},
|
||||
"base_path": {
|
||||
"type": "string",
|
||||
"description": "URL base path for the admin interface.",
|
||||
"default": "/admin"
|
||||
},
|
||||
"oauth_client_secret": {
|
||||
"type": "string",
|
||||
"description": "OAuth Client Secret for admin authentication."
|
||||
},
|
||||
"rate_limit": {
|
||||
"description": "Rate limiting configuration for the Admin service.",
|
||||
"$ref": "#/$defs/rate_limit"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
packages/config/src/schema/defs/services/api.json
Normal file
27
packages/config/src/schema/defs/services/api.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"api_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the main API service.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 8080
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "Network interface to bind to.",
|
||||
"default": "0.0.0.0"
|
||||
},
|
||||
"unfurl_ignored_hosts": {
|
||||
"type": "array",
|
||||
"description": "List of hostnames or IPs to ignore when unfurling URLs.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": ["localhost", "127.0.0.1"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
93
packages/config/src/schema/defs/services/app_proxy.json
Normal file
93
packages/config/src/schema/defs/services/app_proxy.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"app_proxy_kv": {
|
||||
"type": "object",
|
||||
"description": "Valkey/Redis settings for the App Proxy.",
|
||||
"additionalProperties": false,
|
||||
"required": ["url"],
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "Full URL to Valkey/Redis."
|
||||
},
|
||||
"timeout_ms": {
|
||||
"type": "number",
|
||||
"description": "Request timeout for Valkey/Redis in milliseconds.",
|
||||
"default": 5000
|
||||
}
|
||||
}
|
||||
},
|
||||
"app_proxy_sentry_rate_limit": {
|
||||
"type": "object",
|
||||
"description": "Rate limiting for Sentry error reporting requests.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "number",
|
||||
"description": "Number of Sentry requests allowed per window.",
|
||||
"default": 100
|
||||
},
|
||||
"window_ms": {
|
||||
"type": "number",
|
||||
"description": "Time window for Sentry rate limiting in milliseconds.",
|
||||
"default": 1000
|
||||
}
|
||||
}
|
||||
},
|
||||
"app_proxy_rate_limit": {
|
||||
"type": "object",
|
||||
"description": "Rate limit settings for the App Proxy.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"sentry": {
|
||||
"description": "Sentry reporting rate limit configuration.",
|
||||
"$ref": "#/$defs/app_proxy_sentry_rate_limit",
|
||||
"default": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"app_proxy_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the App Proxy service (frontend server).",
|
||||
"additionalProperties": false,
|
||||
"required": ["sentry_report_host", "sentry_dsn"],
|
||||
"properties": {
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 8773
|
||||
},
|
||||
"static_cdn_endpoint": {
|
||||
"type": "string",
|
||||
"description": "URL endpoint for serving static assets via CDN.",
|
||||
"default": ""
|
||||
},
|
||||
"sentry_proxy_path": {
|
||||
"type": "string",
|
||||
"description": "URL path for proxying Sentry requests.",
|
||||
"default": "/error-reporting-proxy"
|
||||
},
|
||||
"sentry_report_host": {
|
||||
"type": "string",
|
||||
"description": "Hostname to which Sentry reports should be sent."
|
||||
},
|
||||
"sentry_dsn": {
|
||||
"type": "string",
|
||||
"description": "Sentry DSN (Data Source Name) for frontend error tracking."
|
||||
},
|
||||
"assets_dir": {
|
||||
"type": "string",
|
||||
"description": "Filesystem directory containing static assets.",
|
||||
"default": "./assets"
|
||||
},
|
||||
"kv": {
|
||||
"description": "Valkey/Redis configuration for the proxy.",
|
||||
"$ref": "#/$defs/app_proxy_kv"
|
||||
},
|
||||
"rate_limit": {
|
||||
"description": "Rate limiting configuration for the App Proxy.",
|
||||
"$ref": "#/$defs/app_proxy_rate_limit",
|
||||
"default": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
112
packages/config/src/schema/defs/services/gateway.json
Normal file
112
packages/config/src/schema/defs/services/gateway.json
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"gateway_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the Gateway service (WebSocket).",
|
||||
"additionalProperties": false,
|
||||
"required": ["api_host", "admin_reload_secret", "media_proxy_endpoint"],
|
||||
"properties": {
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 8771
|
||||
},
|
||||
"rpc_tcp_port": {
|
||||
"type": "number",
|
||||
"description": "Port for API-to-Gateway internal RPC over TCP.",
|
||||
"default": 8772
|
||||
},
|
||||
"api_host": {
|
||||
"type": "string",
|
||||
"description": "Host/Port of the API service to communicate with."
|
||||
},
|
||||
"api_canary_host": {
|
||||
"type": "string",
|
||||
"description": "Host/Port of the Canary API service (optional).",
|
||||
"default": ""
|
||||
},
|
||||
"admin_reload_secret": {
|
||||
"type": "string",
|
||||
"description": "Secret used to trigger code hot-swapping/reloads."
|
||||
},
|
||||
"identify_rate_limit_enabled": {
|
||||
"type": "boolean",
|
||||
"description": "Enable rate limiting for Gateway IDENTIFY opcodes.",
|
||||
"default": false
|
||||
},
|
||||
"push_enabled": {
|
||||
"type": "boolean",
|
||||
"description": "Enable push notification delivery.",
|
||||
"default": true
|
||||
},
|
||||
"push_user_guild_settings_cache_mb": {
|
||||
"type": "number",
|
||||
"description": "Memory cache size (MB) for user guild settings.",
|
||||
"default": 1024
|
||||
},
|
||||
"push_subscriptions_cache_mb": {
|
||||
"type": "number",
|
||||
"description": "Memory cache size (MB) for push subscriptions.",
|
||||
"default": 1024
|
||||
},
|
||||
"push_blocked_ids_cache_mb": {
|
||||
"type": "number",
|
||||
"description": "Memory cache size (MB) for blocked user IDs.",
|
||||
"default": 1024
|
||||
},
|
||||
"push_badge_counts_cache_mb": {
|
||||
"type": "number",
|
||||
"description": "Memory cache size (MB) for badge counts.",
|
||||
"default": 256
|
||||
},
|
||||
"push_badge_counts_cache_ttl_seconds": {
|
||||
"type": "number",
|
||||
"description": "TTL in seconds for badge counts cache.",
|
||||
"default": 60
|
||||
},
|
||||
"media_proxy_endpoint": {
|
||||
"type": "string",
|
||||
"description": "Endpoint URL of the Media Proxy service."
|
||||
},
|
||||
"logger_level": {
|
||||
"type": "string",
|
||||
"description": "Logging level (e.g., debug, info, warn, error).",
|
||||
"default": "info"
|
||||
},
|
||||
"release_node": {
|
||||
"type": "string",
|
||||
"description": "Erlang node name for the release.",
|
||||
"default": "fluxer_gateway@gateway"
|
||||
},
|
||||
"gateway_metrics_enabled": {
|
||||
"type": "boolean",
|
||||
"description": "Enable collection of gateway metrics.",
|
||||
"default": false
|
||||
},
|
||||
"gateway_metrics_report_interval_ms": {
|
||||
"type": "number",
|
||||
"description": "Interval in milliseconds to report gateway metrics.",
|
||||
"default": 30000
|
||||
},
|
||||
"presence_cache_shards": {
|
||||
"type": "number",
|
||||
"description": "Number of shards for presence cache.",
|
||||
"default": 1
|
||||
},
|
||||
"presence_bus_shards": {
|
||||
"type": "number",
|
||||
"description": "Number of shards for presence message bus.",
|
||||
"default": 1
|
||||
},
|
||||
"presence_shards": {
|
||||
"type": "number",
|
||||
"description": "Number of shards for presence handling.",
|
||||
"default": 1
|
||||
},
|
||||
"guild_shards": {
|
||||
"type": "number",
|
||||
"description": "Number of shards for guild handling.",
|
||||
"default": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
34
packages/config/src/schema/defs/services/marketing.json
Normal file
34
packages/config/src/schema/defs/services/marketing.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"marketing_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the Marketing site service.",
|
||||
"additionalProperties": false,
|
||||
"required": ["secret_key_base"],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to enable the Marketing service within fluxer_server.",
|
||||
"default": false
|
||||
},
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 8774
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "Network interface to bind to.",
|
||||
"default": "0.0.0.0"
|
||||
},
|
||||
"secret_key_base": {
|
||||
"type": "string",
|
||||
"description": "Base secret key for marketing site sessions/tokens."
|
||||
},
|
||||
"base_path": {
|
||||
"type": "string",
|
||||
"description": "URL base path for the marketing site.",
|
||||
"default": "/marketing"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
packages/config/src/schema/defs/services/media_proxy.json
Normal file
38
packages/config/src/schema/defs/services/media_proxy.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"media_proxy_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the Media Proxy service.",
|
||||
"additionalProperties": false,
|
||||
"required": ["secret_key"],
|
||||
"properties": {
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "Network interface to bind to.",
|
||||
"default": "0.0.0.0"
|
||||
},
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 8080
|
||||
},
|
||||
"secret_key": {
|
||||
"type": "string",
|
||||
"description": "Secret key used to sign and verify media URLs."
|
||||
},
|
||||
"require_cloudflare_edge": {
|
||||
"type": "boolean",
|
||||
"description": "If true, strictly requires requests to originate from Cloudflare edge IPs.",
|
||||
"default": false
|
||||
},
|
||||
"static_mode": {
|
||||
"type": "boolean",
|
||||
"description": "If true, enables serving static files directly.",
|
||||
"default": false
|
||||
},
|
||||
"rate_limit": {
|
||||
"description": "Rate limiting configuration for the Media Proxy.",
|
||||
"$ref": "#/$defs/rate_limit"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
79
packages/config/src/schema/defs/services/queue.json
Normal file
79
packages/config/src/schema/defs/services/queue.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"queue_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the Job Queue service.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 8080
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "Network interface to bind to.",
|
||||
"default": "0.0.0.0"
|
||||
},
|
||||
"data_dir": {
|
||||
"type": "string",
|
||||
"description": "Filesystem path to store queue data.",
|
||||
"default": "./data/queue"
|
||||
},
|
||||
"default_visibility_timeout_ms": {
|
||||
"type": "number",
|
||||
"description": "Default time in milliseconds a message remains invisible after being received.",
|
||||
"default": 30000
|
||||
},
|
||||
"snapshot_every_ms": {
|
||||
"type": "number",
|
||||
"description": "Interval in milliseconds to take queue snapshots.",
|
||||
"default": 60000
|
||||
},
|
||||
"snapshot_after_ops": {
|
||||
"type": "number",
|
||||
"description": "Number of operations after which to take a queue snapshot.",
|
||||
"default": 10000
|
||||
},
|
||||
"snapshot_zstd_level": {
|
||||
"type": "number",
|
||||
"description": "Zstd compression level for snapshots (1-22).",
|
||||
"minimum": 1,
|
||||
"maximum": 22,
|
||||
"default": 3
|
||||
},
|
||||
"visibility_timeout_backoff_ms": {
|
||||
"type": "number",
|
||||
"description": "Backoff duration in milliseconds for visibility timeouts.",
|
||||
"default": 1000
|
||||
},
|
||||
"max_receive_batch": {
|
||||
"type": "number",
|
||||
"description": "Maximum number of messages to retrieve in a single batch.",
|
||||
"default": 10
|
||||
},
|
||||
"command_buffer": {
|
||||
"type": "number",
|
||||
"description": "Size of the internal command buffer.",
|
||||
"default": 1000
|
||||
},
|
||||
"export_timeout": {
|
||||
"type": "number",
|
||||
"description": "Timeout in milliseconds for data export operations.",
|
||||
"default": 30000
|
||||
},
|
||||
"concurrency": {
|
||||
"type": "number",
|
||||
"description": "Number of concurrent worker threads.",
|
||||
"default": 2
|
||||
},
|
||||
"rate_limit": {
|
||||
"description": "Rate limiting configuration for the Queue service.",
|
||||
"$ref": "#/$defs/rate_limit"
|
||||
},
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"description": "Authentication secret for the Queue service."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
packages/config/src/schema/defs/services/s3.json
Normal file
33
packages/config/src/schema/defs/services/s3.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"s3_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the S3-compatible storage service.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 3900
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "Network interface to bind to.",
|
||||
"default": "0.0.0.0"
|
||||
},
|
||||
"data_dir": {
|
||||
"type": "string",
|
||||
"description": "Filesystem path to store S3 data objects.",
|
||||
"default": "./data/s3"
|
||||
},
|
||||
"export_timeout": {
|
||||
"type": "number",
|
||||
"description": "Timeout in milliseconds for data export operations.",
|
||||
"default": 30000
|
||||
},
|
||||
"rate_limit": {
|
||||
"description": "Rate limiting configuration for the S3 service.",
|
||||
"$ref": "#/$defs/rate_limit"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
packages/config/src/schema/defs/services/server.json
Normal file
23
packages/config/src/schema/defs/services/server.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"server_service": {
|
||||
"type": "object",
|
||||
"description": "Configuration for the main Fluxer Server.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "Network interface to bind to.",
|
||||
"default": "0.0.0.0"
|
||||
},
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "Port to listen on.",
|
||||
"default": 8772
|
||||
},
|
||||
"static_dir": {
|
||||
"type": "string",
|
||||
"description": "Path to static assets directory for the web app. Required in production."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
packages/config/src/schema/defs/services/services.json
Normal file
41
packages/config/src/schema/defs/services/services.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"services": {
|
||||
"type": "object",
|
||||
"description": "Container for all service-specific configurations.",
|
||||
"additionalProperties": false,
|
||||
"required": ["media_proxy", "admin", "gateway"],
|
||||
"properties": {
|
||||
"s3": {
|
||||
"$ref": "#/$defs/s3_service",
|
||||
"default": {}
|
||||
},
|
||||
"queue": {
|
||||
"$ref": "#/$defs/queue_service",
|
||||
"default": {}
|
||||
},
|
||||
"media_proxy": {
|
||||
"$ref": "#/$defs/media_proxy_service"
|
||||
},
|
||||
"admin": {
|
||||
"$ref": "#/$defs/admin_service"
|
||||
},
|
||||
"marketing": {
|
||||
"$ref": "#/$defs/marketing_service"
|
||||
},
|
||||
"api": {
|
||||
"$ref": "#/$defs/api_service",
|
||||
"default": {}
|
||||
},
|
||||
"app_proxy": {
|
||||
"$ref": "#/$defs/app_proxy_service"
|
||||
},
|
||||
"gateway": {
|
||||
"$ref": "#/$defs/gateway_service"
|
||||
},
|
||||
"server": {
|
||||
"$ref": "#/$defs/server_service",
|
||||
"default": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user