cleanup: Move old compose example to devtools directory

We agreed to move the 'opencloud_full' example to a new directory to
avoid confusion with the supported compose examples in
opencloud-compose.

This commit keeps the bare-metal example in place as that is still
mentioned in the documentation.
This commit is contained in:
Ralf Haferkamp
2025-09-24 08:33:03 +02:00
committed by Ralf Haferkamp
parent 2445c79c44
commit 5023642885
53 changed files with 6 additions and 2 deletions
@@ -0,0 +1,17 @@
package postprocessing
import future.keywords.if
import data.utils
default granted := true
granted = false if {
not utils.is_extension_allowed(input.resource.name)
}
granted = false if {
bytes := opencloud.resource.download(input.resource.url)
mimetype := opencloud.mimetype.detect(bytes)
not utils.is_mimetype_allowed(mimetype)
}
@@ -0,0 +1,33 @@
package proxy
import future.keywords.if
import data.utils
default granted := true
granted = false if {
input.request.method == "PUT"
pathPrefixes := [
"/dav",
"/remote.php/webdav",
"/remote.php/dav",
"/webdav",
]
restricted := pathPrefixes[_]
startswith(input.request.path, restricted)
not utils.is_extension_allowed(input.resource.name)
}
granted = false if {
input.request.method == "POST"
pathPrefixes := [
"/data",
"/dav",
"/remote.php/webdav",
"/remote.php/dav",
"/webdav",
]
restricted := pathPrefixes[_]
startswith(input.request.path, restricted)
not utils.is_extension_allowed(input.resource.name)
}
@@ -0,0 +1,22 @@
package utils
ALLOWED_RESOURCE_EXTENSIONS := [
".apk", ".avi", ".bat", ".bmp", ".css", ".csv", ".doc", ".docm", ".docx",
".docxf", ".dotx", ".eml", ".epub", ".htm", ".html", ".ipa", ".jar", ".java",
".jpg", ".js", ".json", ".mp3", ".mp4", ".msg", ".odp", ".ods", ".odt", ".oform",
".ots", ".ott", ".pdf", ".php", ".png", ".potm", ".potx", ".ppsm", ".ppsx", ".ppt",
".pptm", ".pptx", ".py", ".rtf", ".sb3", ".sprite3", ".sql", ".svg", ".tif", ".tiff",
".txt", ".xls", ".xlsm", ".xlsx", ".xltm", ".xltx", ".xml", ".zip", ".md"
]
is_extension_allowed(identifier) {
extension := ALLOWED_RESOURCE_EXTENSIONS[_]
endswith(identifier, extension)
}
is_mimetype_allowed(mimetype) {
extensions := opencloud.mimetype.extensions(mimetype)
extension := extensions[_]
is_extension_allowed(extension)
}