2025-12-05 07:14:11 +00:00
|
|
|
#!/bin/sh
|
2025-12-05 11:14:59 +03:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
# Ensure the ctf user exists (defensive in case the base image changes)
|
|
|
|
|
if ! id ctf >/dev/null 2>&1; then
|
|
|
|
|
useradd -m -u 1001 ctf
|
|
|
|
|
fi
|
2025-12-05 07:14:11 +00:00
|
|
|
|
|
|
|
|
# Ensure the history directory exists and has correct ownership
|
|
|
|
|
mkdir -p /app/history
|
|
|
|
|
chown -R ctf:ctf /app/history
|
|
|
|
|
|
|
|
|
|
# Run the grob service as ctf user
|
2025-12-05 11:14:59 +03:00
|
|
|
exec runuser -u ctf -- /app/grob
|