nunofgs / docker-octoprint

Dockerfile to set up Octoprint with x86, armv6, armv7 and arm64 support!
https://hub.docker.com/r/nunofgs/octoprint/
GNU Affero General Public License v3.0
58 stars 32 forks source link

Basedir as a subdir in the docker volume, allows backup plugin restor… #35

Open jaisor opened 4 years ago

jaisor commented 4 years ago

The backup plugin wants to move the base dir to a backup location as a final step: https://github.com/foosel/OctoPrint/blob/master/src/octoprint/plugins/backup/__init__.py#L858

This fails with default basedir /root/.octoprint linked to /data.

Moved the basedir inside the /data volume which seems to fix the issue.

Added healtcheck to debian but have not tested it very well.

nunofgs commented 4 years ago

Hi @jaisor, thanks for the contribution.

I couldn't actually reproduce the backup basedir problem though. I tested with your patch and saw no difference other than the backup zip being saved in the /data/data folder.

Can you provide an example of what the issue is?

jaisor commented 4 years ago

Hi @nunofgs, its been a while, but if I recall right - it was a permissions issue. See the backup plugin I likned in the comment above? It tries to move (rename) the basedir to a backup location

shutil.move(basedir, basedir_backup)

This was an issue for me because /data was linked to /root/.octoprint which is owner by root. The backup plugin is running by a different user so it does not have permissions to rename the root owned location.

Moving everything one level deeper (/data/data) solved the issue as all operations were done on folders owned and created by the user running OctoPi