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