Some radius fixes

This commit is contained in:
kjeld Schouten-Lebbing 2021-09-01 13:36:10 +02:00
parent 67503ec988
commit a09829bac9
No known key found for this signature in database
GPG Key ID: 4CDAD4A532BC1EDB
5 changed files with 14 additions and 11 deletions

View File

@ -24,4 +24,4 @@ sources:
- https://hub.docker.com/r/freeradius/freeradius-server/
- https://freeradius.org/
type: application
version: 1.7.12
version: 1.7.13

View File

@ -558,6 +558,10 @@ questions:
enum:
- value: "pvc"
description: "pvc"
- value: "emptyDir"
description: "emptyDir"
- value: "hostPath"
description: "hostPath"
- variable: storageClass
label: "(Advanced) storageClass"
description: " Warning: Anything other than SCALE-ZFS will break rollback!"
@ -611,7 +615,7 @@ questions:
description: "Path inside the container the storage is mounted"
schema:
type: string
default: "/config"
default: "/etc/raddb"
hidden: true
- variable: medium
label: "EmptyDir Medium"

View File

@ -41,7 +41,7 @@ env: {}
persistence:
config:
enabled: true
mountPath: "/config"
mountPath: "/etc/raddb"
type: pvc
accessMode: ReadWriteOnce
size: "100Gi"

View File

@ -4,14 +4,13 @@ ARG VERSION
FROM freeradius/freeradius-server:${VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
VOLUME /config
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
rm /docker-entrypoint.sh && \
rm -Rf /etc/raddb
VOLUME /etc/raddb
COPY ./containers/apps/freeradius/entrypoint.sh /docker-entrypoint.sh
LABEL "maintainer"="TrueCharts <info@truecharts.org>"

View File

@ -1,32 +1,32 @@
#!/bin/sh
set -e
if [ -f "/config/clients.conf" ]; then
if [ -f "/etc/raddb/clients.conf" ]; then
echo "Radius config already exists, skipping config copy..."
else
echo "Radius config does not exist, copying..."
cp -Rf /etc/freeradius/* /config/
cp -Rf /etc/freeradius/* /etc/raddb/
fi
chown -R freerad:freerad /config
chown -R freerad:freerad /etc/raddb/
# this if will check if the first argument is a flag
# but only works if all arguments require a hyphenated flag
# -v; -SL; -f arg; etc will work, but not arg1 arg2
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
set -- freeradius -d /config "$@"
set -- freeradius "$@"
fi
# check for the expected command
if [ "$1" = 'freeradius' ]; then
shift
exec freeradius -f -d /config "$@"
exec freeradius -f "$@"
fi
# many people are likely to call "radiusd" as well, so allow that
if [ "$1" = 'radiusd' ]; then
shift
exec freeradius -f -d /config "$@"
exec freeradius -f "$@"
fi
# else default to run whatever the user wanted like "bash" or "sh"