Skip to content

Conversation

@oleksandr-nc
Copy link
Contributor

Partitially related to the nextcloud/app_api#531

In this pull request we add a wrapper around Docker Commands for AppAPI for Nextcloud 32.

All the wrapper logic is written in Python, all the main commands for which complex regular expressions for access control were written are covered in this PR.

This is what remains to be done for the future (most likely it will be for Nextcloud 33 or 34 when we drop DockerDockerProxy support):

# docker system _ping
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/_ping$ } METH_GET
# docker inspect image
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/images/.*/json } METH_GET
# container inspect: GET containers/%s/json
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/json } METH_GET
# container inspect: GET containers/%s/logs 
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/logs } METH_GET
# image pulling
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/images/create } METH_POST

Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works quite flawlessly, tested even with custom ssl certs. 🚀

@oleksandr-nc oleksandr-nc force-pushed the feat/Docker-API-wrapper branch from 28ceb51 to 8d44b25 Compare May 28, 2025 12:58
Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@oleksandr-nc oleksandr-nc merged commit 94ac45a into main May 29, 2025
3 checks passed
@oleksandr-nc oleksandr-nc deleted the feat/Docker-API-wrapper branch May 29, 2025 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants