Skip to content
Snippets Groups Projects
Commit 27b967fc authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

support multiple dirs for setfacl

parent f6aeddd5
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# 2021-11-nn <axel.hahn@iml.unibe.ch> # 2021-11-nn <axel.hahn@iml.unibe.ch>
# 2022-07-19 <axel.hahn@iml.unibe.ch> support multiple dirs for setfacl
# ====================================================================== # ======================================================================
cd $( dirname $0 ) cd $( dirname $0 )
...@@ -46,20 +47,27 @@ function _setWritepermissions(){ ...@@ -46,20 +47,27 @@ function _setWritepermissions(){
typeset -i local DOCKER_USER_OUTSIDE=$_user_uid+$DOCKER_USER_UID typeset -i local DOCKER_USER_OUTSIDE=$_user_uid+$DOCKER_USER_UID
set -vx set -vx
for mywritedir in ${WRITABLEDIR}
do
echo "--- ${mywritedir}"
# remove current acl # remove current acl
sudo setfacl -bR "${WRITABLEDIR}" sudo setfacl -bR "${mywritedir}"
# default permissions: both the host user and the user with UID 33 (www-data on many systems) are owners with rwx perms # default permissions: both the host user and the user with UID 33 (www-data on many systems) are owners with rwx perms
sudo setfacl -dRm u:${DOCKER_USER_OUTSIDE}:rwx,${_user}:rwx "${WRITABLEDIR}" sudo setfacl -dRm u:${DOCKER_USER_OUTSIDE}:rwx,${_user}:rwx "${mywritedir}"
# permissions: make both the host user and the user with UID 33 owner with rwx perms for all existing files/directories # permissions: make both the host user and the user with UID 33 owner with rwx perms for all existing files/directories
sudo setfacl -Rm u:${DOCKER_USER_OUTSIDE}:rwx,${_user}:rwx "${WRITABLEDIR}" sudo setfacl -Rm u:${DOCKER_USER_OUTSIDE}:rwx,${_user}:rwx "${mywritedir}"
done
set +vx set +vx
} }
# cleanup starterkit git data # cleanup starterkit git data
function _removeGitdata(){ function _removeGitdata(){
h2 "Remove git data from starterkit" h2 "Remove git data of starterkit"
echo -n "Current git remote url: " echo -n "Current git remote url: "
git config --get remote.origin.url git config --get remote.origin.url
git config --get remote.origin.url 2>/dev/null | grep $selfgitrepo >/dev/null git config --get remote.origin.url 2>/dev/null | grep $selfgitrepo >/dev/null
...@@ -275,12 +283,16 @@ while true; do ...@@ -275,12 +283,16 @@ while true; do
_wait _wait
;; ;;
u) u)
# docker-compose up -d --remove-orphans if docker-compose --verbose up -d --remove-orphans; then
docker-compose up -d --remove-orphans # test ! -z "${APP_ONSTARTUP}" && sleep 2 && docker exec -it appmonitor-server /bin/bash -c "${APP_ONSTARTUP}"
test ! -z "${APP_ONSTARTUP}" && sleep 2 && docker exec -it appmonitor-server /bin/bash -c "${APP_ONSTARTUP}"
echo "In a web browser:" echo "In a web browser:"
echo " $frontendurl" echo " $frontendurl"
else
echo "ERROR: docker-compose up failed :-/"
docker-compose logs | tail
fi
echo echo
_wait _wait
;; ;;
s) s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment