Skip to content

Commit

Permalink
Create ./volumes at cloning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ukkopahis committed Apr 30, 2022
1 parent 732889a commit 3c8c2b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ignore data folders for containers
/services/
/volumes/
/volumes/*
/backups/
/.tmp/*
__pycache__
Expand Down
2 changes: 2 additions & 0 deletions menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Empty file added volumes/.gitkeep
Empty file.

0 comments on commit 3c8c2b7

Please sign in to comment.