runtipi/runtipi

[REQUEST] Make `rmdir` of app directories optional for apps (either as a global option or per app)

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Yes, I've installed runtipi on a Debian machine with a ZFS on Linux file-system.
This allows me to map mountpoints to separate ZFS datasets (which helps with snapshot management)

However, when installing and updating an app, runtipi expects to rmdir the runtipi/apps/<app-name> directory - which is an operation that fails, because it's not a directory, but a ZFS dataset. (I've added the log output from an attempted update of my dockge app)

Describe the solution you'd like
What I'm hoping to see is:

  1. An option to clear the directory instead of removing it.
    I've tested the following command line as an alternative to rmdir, this removes everything from <app-path> but leaves the directory itself empty:

    find <app-path> -xdev -mindepth 1 -delete
  2. A request to consent clearing an existing <app-dir> when adding the app for the first-time.

  3. Some way to have the system remember whether dir-clearing is preferred over rmdir.
    This can either be a global option, or a per-app (metadata?) depending on the creation process.

Describe alternatives you've considered
At this point, since what I'm interested in is just an upgrade, I'll update the text files manually myself (something I really LOVE about your system's design), but the only other 'proper' alternative is to NOT use datasets, which, for me, isn't going to happen.

Additional context

System Logs of the update operation
runtipi                | dashboard: 2024-11-02T13:50:57.545Z - info > 	Dispatching event {"type":"app","command":"update","appid":"dockge","form":{"exposed":false},"performBackup":true}.
runtipi                | worker: 2024-11-02T13:50:57.559Z - info > 	Processing job 7 with data {"type":"app","command":"update","appid":"dockge","form":{"exposed":false,"openPort":true},"performBackup":true}
runtipi                | worker: 2024-11-02T13:50:57.565Z - info > 	Stopping app dockge
runtipi                | worker: 2024-11-02T13:50:57.570Z - info > 	Running docker compose with args --env-file /app-data/dockge/app.env --project-name dockge -f /data/apps/dockge/docker-compose.yml -f /data/repos/29ca930bfdaffa1dfabf5726336380ede7066bc53297e3c0c868b27c97282903/apps/docker-compose.common.yml --file /data/user-config/dockge/docker-compose.yml rm --force --stop
runtipi                | worker: 2024-11-02T13:51:03.074Z - info > 	App stopped!
runtipi                | worker: 2024-11-02T13:51:03.090Z - info > 	Copying files to backup location...
runtipi                | worker: 2024-11-02T13:51:03.123Z - info > 	Creating archive...
runtipi                | worker: 2024-11-02T13:51:03.146Z - info > 	Moving archive to backup directory...
runtipi                | worker: 2024-11-02T13:51:03.177Z - info > 	Backup completed!
runtipi                | worker: 2024-11-02T13:51:03.177Z - info > 	Backup completed!
runtipi                | worker: 2024-11-02T13:51:03.178Z - info > 	Updating app dockge
runtipi                | worker: 2024-11-02T13:51:03.205Z - info > 	Running docker compose with args --env-file /app-data/dockge/app.env --project-name dockge -f /data/apps/dockge/docker-compose.yml -f /data/repos/29ca930bfdaffa1dfabf5726336380ede7066bc53297e3c0c868b27c97282903/apps/docker-compose.common.yml --file /data/user-config/dockge/docker-compose.yml up --detach --force-recreate --remove-orphans
runtipi                | worker: 2024-11-02T13:51:04.129Z - info > 	Running docker compose with args --env-file /app-data/dockge/app.env --project-name dockge -f /data/apps/dockge/docker-compose.yml -f /data/repos/29ca930bfdaffa1dfabf5726336380ede7066bc53297e3c0c868b27c97282903/apps/docker-compose.common.yml --file /data/user-config/dockge/docker-compose.yml down --rmi all --remove-orphans
runtipi                | worker: 2024-11-02T13:51:18.248Z - error > 	Error deleting folder /data/apps/dockge: {"errno":-16,"code":"EBUSY","syscall":"rmdir","path":"/data/apps/dockge"}
runtipi                | worker: 2024-11-02T13:51:18.248Z - info > 	Deleting app dockge folder if exists
runtipi                | worker: 2024-11-02T13:51:18.253Z - error > 	An error occurred: EBUSY: resource busy or locked, rmdir '/data/apps/dockge'
runtipi                | worker: 2024-11-02T13:51:18.255Z - info > 	Job 7 completed with result: {"success":false,"stdout":"EBUSY: resource busy or locked, rmdir '/data/apps/dockge'"}
runtipi                | dashboard: 2024-11-02T13:51:18.281Z - error > 	Failed to update app dockge: EBUSY: resource busy or locked, rmdir '/data/apps/dockge'
runtipi                | dashboard: 2024-11-02T13:52:42.500Z - info > 	Dispatching event {"type":"app","command":"start","appid":"dockge","form":{"exposed":false}}.
runtipi                | worker: 2024-11-02T13:52:42.504Z - info > 	Processing job 8 with data {"type":"app","command":"start","appid":"dockge","skipEnv":false,"form":{"exposed":false,"openPort":true}}
runtipi                | worker: 2024-11-02T13:52:42.506Z - info > 	Starting app dockge
runtipi                | worker: 2024-11-02T13:52:42.513Z - info > 	Regenerating app.env file for app dockge
runtipi                | worker: 2024-11-02T13:52:42.521Z - info > 	Running docker compose with args --env-file /app-data/dockge/app.env --project-name dockge -f /data/apps/dockge/docker-compose.yml -f /data/repos/29ca930bfdaffa1dfabf5726336380ede7066bc53297e3c0c868b27c97282903/apps/docker-compose.common.yml --file /data/user-config/dockge/docker-compose.yml up --detach --force-recreate --remove-orphans --pull always
runtipi                | worker: 2024-11-02T13:53:07.563Z - info > 	App dockge started
runtipi                | worker: 2024-11-02T13:53:07.623Z - info > 	Job 8 completed with result: {"success":true,"stdout":"App dockge started successfully"}