CasaOS
CasaOS copied to clipboard
[Feature Request] Settings -> Edit the docker-compose.yml
Is your feature request related to a problem? Please describe.
Currently the backend exposes the docker-compose.yml from http://$HOST:$PORT/v2/app_management/compose/$APP, it can be exported or modified by the Settings UI, which is somewhat restrictive, which is probably great for most of the users.
But for the "advanced" users they have to download the .yml modfiy it, remove the App, create a new one by uploading the .yml
Describe the solution you'd like
A new tab in the settings allowing editing of the raw docker-compose.yml
Additional context
totally agree with this and love the tab idea instead of using a new icon.
To address the challenge of advanced users needing to download, modify, and re-upload a docker-compose.yml file, a solution can be introduced by adding a new "Raw Compose Editor" tab in the app management settings. This would allow users to directly edit the raw docker-compose.yml file from the UI, without needing to follow the lengthy download-upload process.
Proposed Solution
-
New Tab in Settings UI:
- Introduce a new tab labeled "Raw Compose Editor" under the settings.
- This tab should contain a text editor to display and allow editing of the current
docker-compose.ymlfor the selected app.
-
Text Editor Features:
- The editor should support syntax highlighting for YAML.
- It could include a basic linter or validation to check for YAML syntax errors.
- It should allow advanced users to modify the file and apply changes directly.
-
Apply & Revert Options:
- Provide buttons to Apply changes or Revert to the last saved version if necessary.
- Ensure there is a confirmation prompt when applying changes, as changes to the compose file can affect app functionality.
-
Version Control:
- Optionally, a history of previous versions of the
docker-compose.ymlcould be available, allowing users to revert to an earlier version if needed.
- Optionally, a history of previous versions of the
-
Security & Access Control:
- Ensure that this tab is only accessible to users with the necessary permissions, preventing less experienced users from accidentally misconfiguring their apps.
Example Workflow
- The user navigates to Settings > App Management.
- In the Raw Compose Editor tab, they see the current
docker-compose.yml. - They make changes directly in the editor (e.g., updating resource limits, adding services, etc.).
- They click Apply, triggering the backend to update the app with the modified
docker-compose.yml. - If the changes are successful, the new configuration takes effect without needing to recreate the app from scratch.
This feature would enhance flexibility for advanced users while maintaining the simplicity of the existing UI for others.
Additional Context (Example Compose File)
Here's an example of how the docker-compose.yml might look in the raw editor:
version: '3.9'
services:
main_app:
container_name: vscode
image: ghcr.io/teneff/casaos-vscode:main
environment:
PUID: "1000"
PGID: "1000"
TZ: Europe/Sofia
HOME: /config
deploy:
resources:
limits:
memory: "16532897792"
cpu_shares: 90
command: []
labels:
icon: data:image/png;base64,iVBORwOKGgoAAA...