Skip to content

Commit

Permalink
fix security opt in phoebus launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Dec 10, 2024
1 parent 2d9328d commit 6cd4e30
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions template/opi/phoebus-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ settings="
-settings /tmp/settings.ini
"

if which phoebus.sh &>/dev/null ; then
if which phoebus.sh &>/dev/null && [[ -z ${use_container} ]] ; then
echo "Using phoebus.sh from PATH"
set -x
phoebus.sh ${settings} "${@}"

elif module load phoebus 2>/dev/null; then
elif module load phoebus 2>/dev/null && [[ -z ${use_container} ]] ; then
echo "Using phoebus module"
set -x
phoebus.sh ${settings} "${@}"
Expand All @@ -33,16 +33,14 @@ else
# prefer podman but use docker if USE_DOCKER is set
if podman version &> /dev/null && [[ -z $USE_DOCKER ]]
then docker=podman; UIDGID=0:0
else docker=docker; UIDGID=$(id -u):$(id -g)
else docker=docker; UIDGID=$(id -u):$(id -g); xhost +SI:localuser:$(id -un)
fi
echo "Using $docker as container runtime"

# ensure local container users can access X11 server
xhost +SI:localuser:$(id -un)

# settings for container launch
x11="-e DISPLAY --net host"
args="--rm -it --security-opt=label=none --user ${UIDGID}"
args="--rm -it --security-opt=label=disable --user ${UIDGID}"
mounts="-v=/tmp:/tmp -v=${workspace}:/workspace -v=${workspace}/..:/workspaces"
image="ghcr.io/epics-containers/ec-phoebus:latest"

Expand Down

0 comments on commit 6cd4e30

Please sign in to comment.