Radius inside #6
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user