1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

permit regexes for permissions.url in manifest v2 schema

This commit is contained in:
OniriCorpe 2024-03-21 04:16:55 +01:00 committed by Bram
parent b220cc1fd7
commit e4cf6d8c16

View file

@ -3,14 +3,15 @@
"$id": "https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json", "$id": "https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json",
"title": "Yunohost app manifest.toml schema", "title": "Yunohost app manifest.toml schema",
"version": "0", "version": "0",
"type": "object", "type": "object",
"$defs": { "$defs": {
"translated_string": { "translated_string": {
"anyOf": [ "anyOf": [
{ {
"type": "object", "type": "object",
"required": ["en"], "required": [
"en"
],
"additionalProperties": false, "additionalProperties": false,
"patternProperties": { "patternProperties": {
"^[a-z]{2}$": { "^[a-z]{2}$": {
@ -68,7 +69,6 @@
] ]
} }
}, },
"properties": { "properties": {
"packaging_format": { "packaging_format": {
"description": "Packaging format / version", "description": "Packaging format / version",
@ -87,7 +87,9 @@
"type": "string", "type": "string",
"pattern": "^[0-9a-z]*([\\.+-][0-9a-z]*)*~ynh[0-9]*$" "pattern": "^[0-9a-z]*([\\.+-][0-9a-z]*)*~ynh[0-9]*$"
}, },
"description": {"$ref": "#/$defs/translated_string"}, "description": {
"$ref": "#/$defs/translated_string"
},
"maintainers": { "maintainers": {
"description": "List of maintainers", "description": "List of maintainers",
"type": "array", "type": "array",
@ -97,22 +99,52 @@
}, },
"upstream": { "upstream": {
"type": "object", "type": "object",
"required": ["license"], "required": [
"license"
],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"license": {"type": "string"}, "license": {
"website": {"type": "string", "format": "uri-reference"}, "type": "string"
"demo": {"type": "string", "format": "uri-reference"}, },
"admindoc": {"type": "string", "format": "uri-reference"}, "website": {
"userdoc": {"type": "string", "format": "uri-reference"}, "type": "string",
"code": {"type": "string", "format": "uri-reference"}, "format": "uri-reference"
"fund": {"type": "string", "format": "uri-reference"}, },
"cpe": {"$ref": "#/$defs/cpe_id"} "demo": {
"type": "string",
"format": "uri-reference"
},
"admindoc": {
"type": "string",
"format": "uri-reference"
},
"userdoc": {
"type": "string",
"format": "uri-reference"
},
"code": {
"type": "string",
"format": "uri-reference"
},
"fund": {
"type": "string",
"format": "uri-reference"
},
"cpe": {
"$ref": "#/$defs/cpe_id"
}
} }
}, },
"integration": { "integration": {
"type": "object", "type": "object",
"required": ["yunohost", "architectures", "multi_instance", "ldap", "sso"], "required": [
"yunohost",
"architectures",
"multi_instance",
"ldap",
"sso"
],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"yunohost": { "yunohost": {
@ -129,22 +161,39 @@
"type": "array", "type": "array",
"items": { "items": {
"type": "string", "type": "string",
"enum": ["amd64", "i386", "armhf", "arm64"] "enum": [
"amd64",
"i386",
"armhf",
"arm64"
]
} }
} }
] ]
}, },
"multi_instance": {"$ref": "#/$defs/boolean_or_not_relevant"}, "multi_instance": {
"ldap": {"$ref": "#/$defs/boolean_or_not_relevant"}, "$ref": "#/$defs/boolean_or_not_relevant"
"sso": {"$ref": "#/$defs/boolean_or_not_relevant"}, },
"disk": {"$ref": "#/$defs/byte_size"}, "ldap": {
"$ref": "#/$defs/boolean_or_not_relevant"
},
"sso": {
"$ref": "#/$defs/boolean_or_not_relevant"
},
"disk": {
"$ref": "#/$defs/byte_size"
},
"ram": { "ram": {
"type": "object", "type": "object",
"required": [], "required": [],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"build": {"$ref": "#/$defs/byte_size"}, "build": {
"runtime": {"$ref": "#/$defs/byte_size"} "$ref": "#/$defs/byte_size"
},
"runtime": {
"$ref": "#/$defs/byte_size"
}
} }
} }
} }
@ -154,7 +203,9 @@
"required": [], "required": [],
"additionalProperties": false, "additionalProperties": false,
"patternProperties": { "patternProperties": {
"^[a-zA-Z0-9_-]*$": {"$ref": "#/$defs/translated_string"} "^[a-zA-Z0-9_-]*$": {
"$ref": "#/$defs/translated_string"
}
} }
}, },
"install": { "install": {
@ -164,22 +215,60 @@
"patternProperties": { "patternProperties": {
"^[a-z][a-z0-9_]*$": { "^[a-z][a-z0-9_]*$": {
"type": "object", "type": "object",
"required": ["type"], "required": [
"type"
],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"type": { "type": {
"type": "string", "type": "string",
"enum": [ "enum": [
"string", "text", "select", "tags", "email", "url", "date", "time", "string",
"color", "password", "path", "boolean", "domain", "user", "group", "text",
"number", "range", "alert", "markdown", "file", "app" "select",
"tags",
"email",
"url",
"date",
"time",
"color",
"password",
"path",
"boolean",
"domain",
"user",
"group",
"number",
"range",
"alert",
"markdown",
"file",
"app"
] ]
}, },
"default": {"type": ["string", "number", "boolean"]}, "default": {
"example": {"type": ["string", "number", "boolean"]}, "type": [
"optional": {"type": "boolean"}, "string",
"ask": {"$ref": "#/$defs/translated_string"}, "number",
"help": {"$ref": "#/$defs/translated_string"}, "boolean"
]
},
"example": {
"type": [
"string",
"number",
"boolean"
]
},
"optional": {
"type": "boolean"
},
"ask": {
"$ref": "#/$defs/translated_string"
},
"help": {
"$ref": "#/$defs/translated_string"
},
"choices": { "choices": {
"anyOf": [ "anyOf": [
{ {
@ -228,7 +317,9 @@
"required": [], "required": [],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"packages": {"$ref": "#/$defs/string_or_array_of"}, "packages": {
"$ref": "#/$defs/string_or_array_of"
},
"packages_from_raw_bash": { "packages_from_raw_bash": {
"type": "string" "type": "string"
}, },
@ -237,7 +328,10 @@
"patternProperties": { "patternProperties": {
"^.[a-z][a-z0-9_]*$": { "^.[a-z][a-z0-9_]*$": {
"type": "object", "type": "object",
"required": ["repo", "packages"], "required": [
"repo",
"packages"
],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"repo": { "repo": {
@ -246,7 +340,9 @@
"key": { "key": {
"type": "string" "type": "string"
}, },
"packages": {"$ref": "#/$defs/string_or_array_of"} "packages": {
"$ref": "#/$defs/string_or_array_of"
}
} }
} }
} }
@ -258,25 +354,36 @@
"required": [], "required": [],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"dir": {"$ref": "#/$defs/path_absolute"}, "dir": {
"$ref": "#/$defs/path_absolute"
},
"subdirs": { "subdirs": {
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} }
}, },
"owner": {"$ref": "#/$defs/name_and_permission"}, "owner": {
"group": {"$ref": "#/$defs/name_and_permission"} "$ref": "#/$defs/name_and_permission"
},
"group": {
"$ref": "#/$defs/name_and_permission"
}
} }
}, },
"database": { "database": {
"type": "object", "type": "object",
"required": ["type"], "required": [
"type"
],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"type": { "type": {
"type": "string", "type": "string",
"enum": ["mysql", "postgresql"] "enum": [
"mysql",
"postgresql"
]
} }
} }
}, },
@ -285,9 +392,15 @@
"required": [], "required": [],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"dir": {"$ref": "#/$defs/path_absolute"}, "dir": {
"owner": {"$ref": "#/$defs/name_and_permission"}, "$ref": "#/$defs/path_absolute"
"group": {"$ref": "#/$defs/name_and_permission"} },
"owner": {
"$ref": "#/$defs/name_and_permission"
},
"group": {
"$ref": "#/$defs/name_and_permission"
}
} }
}, },
"permissions": { "permissions": {
@ -300,7 +413,10 @@
"required": [], "required": [],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"url": {"$ref": "#/$defs/path_absolute"}, "url": {
"type": "string",
"pattern": "^((re:.*)?|(__[A-Z_]*__)?\/.*)$"
},
"show_tile": { "show_tile": {
"type": "boolean" "type": "boolean"
}, },
@ -315,7 +431,9 @@
}, },
"additional_urls": { "additional_urls": {
"type": "array", "type": "array",
"items": {"$ref": "#/$defs/path_absolute"} "items": {
"$ref": "#/$defs/path_absolute"
}
}, },
"label": { "label": {
"type": "string" "type": "string"
@ -344,7 +462,11 @@
}, },
{ {
"type": "string", "type": "string",
"enum": ["TCP", "UDP", "Both"] "enum": [
"TCP",
"UDP",
"Both"
]
} }
] ]
}, },
@ -369,7 +491,9 @@
"type": "string", "type": "string",
"format": "uri" "format": "uri"
}, },
"sha256": {"$ref": "#/$defs/sha256sum"}, "sha256": {
"$ref": "#/$defs/sha256sum"
},
"in_subdir": { "in_subdir": {
"anyOf": [ "anyOf": [
{ {
@ -465,7 +589,9 @@
"type": "string", "type": "string",
"format": "uri" "format": "uri"
}, },
"sha256": {"$ref": "#/$defs/sha256sum"} "sha256": {
"$ref": "#/$defs/sha256sum"
}
} }
} }
} }
@ -486,12 +612,13 @@
"allow_email": { "allow_email": {
"type": "boolean" "type": "boolean"
}, },
"home": {"$ref": "#/$defs/path_absolute"} "home": {
"$ref": "#/$defs/path_absolute"
}
} }
} }
} }
} }
}, },
"required": [ "required": [
"packaging_format", "packaging_format",