Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-php-starterkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
docker-php-starterkit
Commits
27b967fc
Commit
27b967fc
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
support multiple dirs for setfacl
parent
f6aeddd5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/init.sh
+24
-12
24 additions, 12 deletions
docker/init.sh
with
24 additions
and
12 deletions
docker/init.sh
+
24
−
12
View file @
27b967fc
...
@@ -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 f
rom
starterkit"
h2
"Remove git data
o
f 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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment