From f7663a284ef9378b0829a9248e8335fcd66b0bf4 Mon Sep 17 00:00:00 2001 From: Tygozwolle Date: Fri, 24 Jul 2026 14:10:25 +0200 Subject: [PATCH] feat: add PostgreSQL schema initialization and FreeRADIUS SQL module configuration --- radiuscontroller/raddb/mods-enabled/sql | 17 ++++++++++++++++- sql/init.sql | 9 +++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/radiuscontroller/raddb/mods-enabled/sql b/radiuscontroller/raddb/mods-enabled/sql index 04bc130..4f2bc32 100644 --- a/radiuscontroller/raddb/mods-enabled/sql +++ b/radiuscontroller/raddb/mods-enabled/sql @@ -8,8 +8,23 @@ sql { password = "radpass" radius_db = "radius" - read_clients = yes + # Standard FreeRADIUS SQL Table Mappings + authcheck_table = "radcheck" + authreply_table = "radreply" + groupcheck_table = "radgroupcheck" + groupreply_table = "radgroupreply" + usergroup_table = "radusergroup" + + # Accounting Table Mappings + acct_table1 = "radacct" + acct_table2 = "radacct" + + # Post-auth Table Mapping + postauth_table = "radpostauth" + + # NAS Client Table Mapping client_table = "nas" + read_clients = yes group_attribute = "User-Group" diff --git a/sql/init.sql b/sql/init.sql index f67c8bf..077db02 100644 --- a/sql/init.sql +++ b/sql/init.sql @@ -86,6 +86,15 @@ CREATE TABLE IF NOT EXISTS nas ( description VARCHAR(200) DEFAULT 'RADIUS Client' ); +CREATE TABLE IF NOT EXISTS radpostauth ( + id BIGSERIAL PRIMARY KEY, + username VARCHAR(64) NOT NULL DEFAULT '', + pass VARCHAR(64) NOT NULL DEFAULT '', + reply VARCHAR(32) NOT NULL DEFAULT '', + authdate TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP +); +CREATE INDEX IF NOT EXISTS radpostauth_username ON radpostauth (username); + -- Application Management Tables CREATE TABLE IF NOT EXISTS guest_profiles ( id SERIAL PRIMARY KEY,