Test add JSON schema for env vars

Not really sure if this'll be useful
pull/858/merge
Lim Chee Aun 2025-09-09 17:44:44 +08:00
rodzic 30540387e5
commit 23ebc030fc
1 zmienionych plików z 84 dodań i 0 usunięć

84
env.schema.json 100644
Wyświetl plik

@ -0,0 +1,84 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["PHANPY_WEBSITE", "PHANPY_CLIENT_NAME"],
"properties": {
"PHANPY_CLIENT_NAME": {
"type": "string",
"default": "Phanpy",
"minLength": 1,
"maxLength": 100,
"description": "Client name that affects web page title, app title, OpenGraph card title, and client name for authentication"
},
"PHANPY_WEBSITE": {
"type": "string",
"default": "https://phanpy.social",
"format": "uri",
"description": "Canonical URL of the website, affects OpenGraph card URL and client URL for authentication"
},
"PHANPY_DEFAULT_INSTANCE": {
"type": "string",
"pattern": "^(?!https?://).*$",
"format": "hostname",
"description": "Default instance for log-in (e.g. 'mastodon.social', without https://)"
},
"PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL": {
"type": "string",
"format": "uri",
"description": "URL of the instance registration page (e.g. https://mastodon.social/auth/sign_up)"
},
"PHANPY_PRIVACY_POLICY_URL": {
"type": "string",
"format": "uri",
"description": "URL of the privacy policy page"
},
"PHANPY_DEFAULT_LANG": {
"type": "string",
"minLength": 2,
"maxLength": 10,
"description": "Default language fallback after multiple detection methods"
},
"PHANPY_REFERRER_POLICY": {
"type": "string",
"default": "origin",
"enum": [
"no-referrer",
"no-referrer-when-downgrade",
"origin",
"origin-when-cross-origin",
"same-origin",
"strict-origin",
"strict-origin-when-cross-origin",
"unsafe-url"
],
"description": "Referrer policy for the site, applied with meta tag on client-side"
},
"PHANPY_LINGVA_INSTANCES": {
"type": "string",
"separator": " ",
"deprecated": true,
"description": "DEPRECATED: Space-separated list of Lingva instances for translation"
},
"PHANPY_TRANSLANG_INSTANCES": {
"type": "string",
"separator": " ",
"default": "translang.phanpy.social",
"description": "Space-separated list of Translang instances for translation"
},
"PHANPY_IMG_ALT_API_URL": {
"type": "string",
"format": "uri",
"description": "API endpoint for self-hosted img-alt-api instance"
},
"PHANPY_GIPHY_API_KEY": {
"type": "string",
"minLength": 1,
"description": "API key for GIPHY integration"
},
"PHANPY_DISALLOW_ROBOTS": {
"type": ["string", "boolean"],
"description": "Set to any value to disallow all web crawlers from indexing the site"
}
},
"additionalProperties": false
}