Skip to content
Snippets Groups Projects
Commit 0943a3bb authored by Griefed's avatar Griefed :joystick:
Browse files

Implement suggestion from derekoharrow in issue #2

parent 840fd9e1
No related branches found
No related tags found
No related merge requests found
......@@ -118,7 +118,9 @@ In some cases you may want to change the root directory / file manager root dire
In order to change the file manager root directory, go to the settings menu of your ICEcoder instance and edit the `file manager root`entry like this for example:
![change_root_dir](https://i.griefed.de/images/2020/12/28/change_root_dir.png)
That directory should be either one of the directories specified in the deployment section, or a subfolder of these. The reason for that being that these directories have their permissions and ownership set everytime the container starts, ensuring file access between host and container.
That directory should be either one of the directories specified in the deployment section, or a subfolder of these. The reason for that being that these directories have their permissions and ownership set everytime the container starts, ensuring file access between host and container. I recommend using the `/code`directory. It's specified in the volumes of the Dockerfile and setup during container creation.
However, said directory is not accessed by the config script which executes during container start, meaning it won't set file permissions for /code and the files inside, you need to manage these yourself. (Thanks to [derekoharrow ](https://github.com/derekoharrow) for the suggestion in [#2](https://github.com/Griefed/docker-ICEcoder/issues/2))
# Building the image yourself
......
#!/usr/bin/with-contenv bash
echo "[cont-init.d] Checking for lock.file"
# check for lock file to only run git operations once
if [ ! -e /lock.file ]; then
echo "**** Installing ICEcoder ****"
chsh abc -s /bin/bash
sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' \
-i /etc/sudoers
sed -e 's/^wheel:\(.*\)/wheel:\1,abc/g' \
-i /etc/group
chsh abc -s /bin/bash
# create directory for project
mkdir -p /code/ICEcoder
# make sure URL is set and folder is empty to clone code
if [ ${GITURL+x} ] && [ ! "$(/bin/ls -A /data/code/ICEcoder 2>/dev/null)" ] ; then \
# clone the url the user passed to this directory
git clone $GITURL /code/ICEcoder
fi
echo "[cont-init.d] Setting up ICEcoder environment"
chsh abc -s /bin/bash
echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel
adduser abc wheel
if [ -n ${GITURL} ] && [ ! -f /giturl.lock ]; then
echo "Cloning ${GITURL} into /code"
mkdir /code
git clone $GITURL /code
chown -R abc:abc \
/code
chmod -R 775 \
/code
touch /giturl.lock
elif [ -z ${GITURL} ] && [ ! -f /giturl.lock ]; then
mkdir /clone
chown -R abc:abc \
/code
chmod -R 775 \
/code
touch /giturl.lock
else
# lock exists not importing project this is a restart
echo "Lock exists just starting ICEcoder"
echo "Either GITURL was not specified or was already cloned"
fi
# make our folders
......@@ -31,7 +34,7 @@ touch /lock.file
# copy php ini for user editing
[[ ! -e "/config/php/php.ini" ]] && \
cp /etc/php7/php.ini /config/php/php.ini
cp /etc/php7/php.ini /config/php/php.ini
cp /config/php/php.ini /etc/php7/php.ini
# Link data, code and plugins
......@@ -41,18 +44,18 @@ ln -sf /code /app/ICEcoder/code
# permissions
mkdir -p /config/sessions
echo "[cont-init.d] Setting permissions this may take some time"
chown -R abc:abc \
/app/ICEcoder \
/data \
/config \
/plugins \
/code
chmod -R 775 \
/app/ICEcoder \
/data \
/config \
/plugins \
/code
echo "[cont-init.d] Setting permissions. This may take some time"
chown -R \
abc:abc \
/app/ICEcoder \
/data \
/config \
/plugins
chmod -R \
775 \
/app/ICEcoder \
/data \
/config \
/plugins
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment