From 3c8c2b71ed8eb69c6cb1c772890ec3bb2f3ebb27 Mon Sep 17 00:00:00 2001 From: ukkopahis <95980324+ukkopahis@users.noreply.github.com> Date: Fri, 29 Apr 2022 15:32:16 +0300 Subject: [PATCH] Create ./volumes at cloning Menu usually won't explicitly create the ./volumes -folder, hence Docker will create it as owned by root. This will later cause problems for build hooks trying to prepare directories into a now root-owned folder. E.g. adding nextcloud later will fail with: Error running PreBuildHook on 'nextcloud' [Errno 13] Permission denied: './volumes/nextcloud' Creating volumes as part of the initial git-clone will ensure it's owned by the correct user. For existing users, also add command to fix its owner when the menu is started. --- .gitignore | 2 +- menu.sh | 2 ++ volumes/.gitkeep | 0 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 volumes/.gitkeep diff --git a/.gitignore b/.gitignore index 19fb83c2..276526d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ #ignore data folders for containers /services/ -/volumes/ +/volumes/* /backups/ /.tmp/* __pycache__ diff --git a/menu.sh b/menu.sh index 55e19ae6..83757bba 100755 --- a/menu.sh +++ b/menu.sh @@ -339,6 +339,8 @@ function do_project_checks() { [ -f .project_outofdate ] && rm .project_outofdate echo "Project is up to date" >&2 fi + # volumes shouldn't be owned by root, change it to the current user + [[ $(id -u) != "0" ]] && sudo chown $(id -u):$(id -g) volumes } function do_env_checks() { diff --git a/volumes/.gitkeep b/volumes/.gitkeep new file mode 100644 index 00000000..e69de29b