feat: add FreeRADIUS client configuration, environment-based secret management, and custom entrypoint script
Build and Push Docker Image to Gitea Container Registry / build-and-push (push) Successful in 1m13s

This commit is contained in:
Tygozwolle
2026-07-24 14:53:01 +02:00
parent 0bb36ea502
commit 574bcbe69a
3 changed files with 16 additions and 1 deletions
+1
View File
@@ -31,5 +31,6 @@ services:
- DB_USER=radius
- DB_PASS=radpass
- DB_NAME=radius
- RADIUS_SECRET=radpass
- ConnectionStrings__DefaultConnection=Host=postgres;Port=5432;Database=radius;Username=radius;Password=radpass;
- ASPNETCORE_ENVIRONMENT=Production
+8
View File
@@ -7,10 +7,12 @@ DB_PORT="${DB_PORT:-5432}"
DB_USER="${DB_USER:-radius}"
DB_PASS="${DB_PASS:-radpass}"
DB_NAME="${DB_NAME:-radius}"
RADIUS_SECRET="${RADIUS_SECRET:-radpass}"
echo "================================================="
echo " Starting RADIUS Controller & FreeRADIUS Stack"
echo " DB Host: $DB_HOST:$DB_PORT | Database: $DB_NAME"
echo " RADIUS Secret: $RADIUS_SECRET (Allows all IP addresses)"
echo "================================================="
# Dynamically update FreeRADIUS SQL configuration with DB settings
@@ -23,6 +25,12 @@ if [ -f "$SQL_CONF" ]; then
sed -i "s/radius_db = .*/radius_db = \"$DB_NAME\"/" "$SQL_CONF"
fi
# Dynamically update RADIUS shared secret for all client networks from env
CLIENTS_CONF="/etc/freeradius/3.0/clients.conf"
if [ -f "$CLIENTS_CONF" ]; then
sed -i "s/secret = .*/secret = $RADIUS_SECRET/" "$CLIENTS_CONF"
fi
# Ensure correct permissions for FreeRADIUS config directory
chown -R freerad:freerad /etc/freeradius/3.0/ || true
+7 -1
View File
@@ -1,6 +1,6 @@
client localhost {
ipaddr = 127.0.0.1
secret = testing123
secret = radpass
shortname = localhost
}
@@ -9,3 +9,9 @@ client local_net {
secret = radpass
shortname = all_clients
}
client local_net_v6 {
ipv6addr = ::/0
secret = radpass
shortname = all_clients_v6
}