From f6688e983e8cb7b68152487e231c6ef00673bb83 Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Thu, 28 Nov 2024 11:05:36 +0100 Subject: [PATCH] Test --- entrypoint.sh | 7 +++++-- k8s/bitlbee-deployment.yaml | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3053ef1..a1ccba0 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,10 @@ #!/bin/bash set -euxo pipefail -# Ensure proper permissions on the mounted data directory + if [ "$(stat -c %U /var/lib/bitlbee)" != "bitlbee" ]; then - chown -R bitlbee:nogroup /var/lib/bitlbee + echo "Directory is not owned by bitlbee. Skipping chown." +else + echo "Correct permissions detected." fi + exec "$@" diff --git a/k8s/bitlbee-deployment.yaml b/k8s/bitlbee-deployment.yaml index 151510e..d208b6a 100755 --- a/k8s/bitlbee-deployment.yaml +++ b/k8s/bitlbee-deployment.yaml @@ -13,9 +13,14 @@ spec: labels: app: bitlbee spec: + securityContext: + fsGroup: 1001 # The group ID for "nogroup" containers: - name: bitlbee image: docker.io/mbologna/docker-bitlbee:latest + securityContext: + runAsUser: 1001 # The user ID for "bitlbee" + runAsGroup: 1001 # The group ID for "nogroup" ports: - containerPort: 6667 volumeMounts: