Skip to content

Commit

Permalink
Simplify entrypoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
thmull committed Aug 22, 2023
1 parent 1f1a81e commit efa695c
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: docker/build-push-action@v2.9.0
with:
build-args: VERSION=${{ env.VERSION }}
file: ./docker/Eps.dockerfile
file: ./docker/Hyper.dockerfile
tags: ${{ steps.meta_hyper.outputs.tags }}
push: true
labels: |
Expand Down
40 changes: 0 additions & 40 deletions .scripts/entrypoint-hyper.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
#!/bin/sh

if [[ -z "${MOUNT_POINTS}" ]]
then
echo "The environment variable MOUNT_POINTS can be set to a comma separated list of the mount points in the container. Use default now."
READ_MOUNT_POINTS="/config,/tls,/app/settings"
WRITE_MOUNT_POINTS=""
MOUNT_POINTS=$READ_MOUNT_POINTS,$WRITE_MOUNT_POINTS
fi

echo "MOUNT_POINTS is set to \"${MOUNT_POINTS}\""
echo "READ_MOUNT_POINTS is set to \"${READ_MOUNT_POINTS}\""
echo "WRITE_MOUNT_POINTS is set to \"${WRITE_MOUNT_POINTS}\""

for point in ${MOUNT_POINTS//,/ }
do
if [ ! -d ${point} ]
then
echo "Skip non-existent directory: \"${point}\""
continue
fi

echo "chown is made for \"${point}\""
chown -R hyper:hyper ${point}

echo "chmod u+r is made for \"${point}\""
chmod -R u+r ${point}
done

for point in ${WRITE_MOUNT_POINTS//,/ }
do
if [ ! -d ${point} ]
then
continue
fi

echo "chmod u+w is made for \"${point}\""
chmod -R u+w ${point}
done

echo "Execute hyper with user hyper"

exec su hyper -c "./hyper $*"
40 changes: 0 additions & 40 deletions .scripts/entrypoint-proxy.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
#!/bin/sh

if [[ -z "${MOUNT_POINTS}" ]]
then
echo "The environment variable MOUNT_POINTS can be set to a comma separated list of the mount points in the container. Use default now."
READ_MOUNT_POINTS="/config,/tls,/app/settings"
WRITE_MOUNT_POINTS="/storage,/app/db,/tmp"
MOUNT_POINTS=$READ_MOUNT_POINTS,$WRITE_MOUNT_POINTS
fi

echo "MOUNT_POINTS is set to \"${MOUNT_POINTS}\""
echo "READ_MOUNT_POINTS is set to \"${READ_MOUNT_POINTS}\""
echo "WRITE_MOUNT_POINTS is set to \"${WRITE_MOUNT_POINTS}\""

for point in ${MOUNT_POINTS//,/ }
do
if [ ! -d ${point} ]
then
echo "Skip non-existent directory: \"${point}\""
continue
fi

echo "chown is made for \"${point}\""
chown -R hyper:hyper ${point}

echo "chmod u+r is made for \"${point}\""
chmod -R u+r ${point}
done

for point in ${WRITE_MOUNT_POINTS//,/ }
do
if [ ! -d ${point} ]
then
continue
fi

echo "chmod u+w is made for \"${point}\""
chmod -R u+w ${point}
done

echo "Execute proxy with user hyper"

exec su hyper -c "./proxy $*"
40 changes: 0 additions & 40 deletions .scripts/entrypoint-sd.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
#!/bin/sh

if [[ -z "${MOUNT_POINTS}" ]]
then
echo "The environment variable MOUNT_POINTS can be set to a comma separated list of the mount points in the container. Use default now."
READ_MOUNT_POINTS="/config,/tls,/app/settings"
WRITE_MOUNT_POINTS="/storage,/app/db,/tmp"
MOUNT_POINTS=$READ_MOUNT_POINTS,$WRITE_MOUNT_POINTS
fi

echo "MOUNT_POINTS is set to \"${MOUNT_POINTS}\""
echo "READ_MOUNT_POINTS is set to \"${READ_MOUNT_POINTS}\""
echo "WRITE_MOUNT_POINTS is set to \"${WRITE_MOUNT_POINTS}\""

for point in ${MOUNT_POINTS//,/ }
do
if [ ! -d ${point} ]
then
echo "Skip non-existent directory: \"${point}\""
continue
fi

echo "chown is made for \"${point}\""
chown -R hyper:hyper ${point}

echo "chmod u+r is made for \"${point}\""
chmod -R u+r ${point}
done

for point in ${WRITE_MOUNT_POINTS//,/ }
do
if [ ! -d ${point} ]
then
continue
fi

echo "chmod u+w is made for \"${point}\""
chmod -R u+w ${point}
done

echo "Execute sd with user hyper"

exec su hyper -c "./sd $*"
File renamed without changes.

0 comments on commit efa695c

Please sign in to comment.