Add FreeRadius container (#675)

* Add radius container with logic to automatically add config

* fix typo

* donnot define a user

* whoops

* try adding goss

* switch to udp
This commit is contained in:
Kjeld Schouten-Lebbing
2021-07-06 21:40:43 +02:00
committed by GitHub
parent c4c8374bec
commit f799ad2612
7 changed files with 62 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
focal-20210609
+16
View File
@@ -0,0 +1,16 @@
ARG TARGETPLATFORM
ARG VERSION
# hadolint ignore=DL3007
FROM freeradius/freeradius-server:${VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
mkdir -p /defaults/raddb/ && \
cp -Rf /etc/raddb/* /defaults/raddb/
COPY ./containers/apps/freeradius/entrypoint.sh /entrypoint.sh
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
+1
View File
@@ -0,0 +1 @@
3.0.23
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
set -e
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 /defaults/raddb/* /etc/raddb/
fi
# 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 "$@"
fi
# check for the expected command
if [ "$1" = 'freeradius' ]; then
shift
exec freeradius -f "$@"
fi
# many people are likely to call "radiusd" as well, so allow that
if [ "$1" = 'radiusd' ]; then
shift
exec freeradius -f "$@"
fi
# else default to run whatever the user wanted like "bash" or "sh"
exec "$@"
+5
View File
@@ -0,0 +1,5 @@
---
port:
udp:1812:
listening: true
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cat "./containers/base/ubuntu/VERSION"
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
version=$(curl "https://registry.hub.docker.com/v1/repositories/freeradius/freeradius-server/tags" | jq --raw-output '.[].name' | grep -v layer | grep -v alpine | grep -v latest | tail -n1)
version="${version#*v}"
version="${version#*release-}"
echo "${version}"