Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load home_servers from SQL #1264

Closed
jpereira opened this issue Sep 23, 2015 · 11 comments
Closed

Load home_servers from SQL #1264

jpereira opened this issue Sep 23, 2015 · 11 comments
Labels
feature enhancement category: a new feature (an extension of functionality) v4.0.x meta: relates to the v4.0.x branch
Milestone

Comments

@jpereira
Copy link
Member

Hi,

I would like to load the "home_server" from SQL. But, currently we don't have support to do that. btw, I have started to develop this capability based in the same idea of current "read_client" in raddb/mods-available/sql

We can register all suggestions about that in this issue.

@jpereira
Copy link
Member Author

@alandekok bless the idea for v3.0.x?

@arr2036
Copy link
Member

arr2036 commented Sep 23, 2015

No, this is a feature, features don't get introduced into the stable branch unless they're minor. Fix whatever politics are preventing you from using v3.1.x.

@arr2036
Copy link
Member

arr2036 commented Sep 24, 2015

Well we need bulk loading, but it's not just about home servers, you need to create pools and realms too. We need to think about how that data could be represented in SQL, whether we need multiple tables to load in the different types of objects, or whether we use a single table with a flat representation.

@jpereira
Copy link
Member Author

@arr2036 What do you think?

#
# Table structure for table 'radhomeserver'
CREATE TABLE radhomeserver (
  id int(10) NOT NULL auto_increment,
  name varchar(128) NOT NULL,
  secret varchar(60) NOT NULL,
  type varchar(30) NOT NULL,
  proto varchar(5) NOT NULL,
  ipaddr varchar(64) NOT NULL,
  port int(5) NOT NULL,
  description varchar(200) DEFAULT 'RADIUS Home Server',
  PRIMARY KEY (id),
  KEY name (name)
);

#
# Table structure for table 'radhomeserver_pool'
CREATE TABLE radhomeserver_pool (
  id int(10) NOT NULL auto_increment,
  name varchar(128) NOT NULL,
  type varchar(30) NOT NULL,
  home_server varchar(30) NOT NULL,
  virtual_server varchar(30) DEFAULT 'NULL',
  description varchar(200) DEFAULT 'RADIUS Home Server Pool',
  PRIMARY KEY (id),
  KEY name (name)
);

@jpereira
Copy link
Member Author

@arr2036 I have a sample that works well in my repo[1] using the home_server_afrom_cs()

[1] v3.0.x...jpereira:feature/home-server-sql

Mon Sep 28 02:54:36 2015 : Debug: rlm_sql (sql): Home Server "fromsql-hs-1" added
Mon Sep 28 02:54:36 2015 : Debug: home_server fromsql-hs-2 {
Mon Sep 28 02:54:36 2015 : Debug:       ipaddr = 10.1.22.11
Mon Sep 28 02:54:36 2015 : Debug:       port = 3799
Mon Sep 28 02:54:36 2015 : Debug:       type = "coa"
Mon Sep 28 02:54:36 2015 : Debug:       proto = "udp"
Mon Sep 28 02:54:36 2015 : Debug:       secret = "thesecret"
Mon Sep 28 02:54:36 2015 : Debug:       response_window = 30.000000
Mon Sep 28 02:54:36 2015 : Debug:       response_timeouts = 1
Mon Sep 28 02:54:36 2015 : Debug:       max_outstanding = 65536
Mon Sep 28 02:54:36 2015 : Debug:       zombie_period = 40
Mon Sep 28 02:54:36 2015 : Debug:       status_check = "none"
Mon Sep 28 02:54:36 2015 : Debug:       ping_interval = 30
Mon Sep 28 02:54:36 2015 : Debug:       check_timeout = 4
Mon Sep 28 02:54:36 2015 : Debug:       num_answers_to_alive = 3
Mon Sep 28 02:54:36 2015 : Debug:       revive_interval = 300
Mon Sep 28 02:54:36 2015 : Debug:  limit {
Mon Sep 28 02:54:36 2015 : Debug:       max_connections = 16
Mon Sep 28 02:54:36 2015 : Debug:       max_requests = 0
Mon Sep 28 02:54:36 2015 : Debug:       lifetime = 0
Mon Sep 28 02:54:36 2015 : Debug:       idle_timeout = 0
Mon Sep 28 02:54:36 2015 : Debug:  }
Mon Sep 28 02:54:36 2015 : Debug:  coa {
Mon Sep 28 02:54:36 2015 : Debug:       irt = 2
Mon Sep 28 02:54:36 2015 : Debug:       mrt = 16
Mon Sep 28 02:54:36 2015 : Debug:       mrc = 5
Mon Sep 28 02:54:36 2015 : Debug:       mrd = 30
Mon Sep 28 02:54:36 2015 : Debug:  }

@jpereira
Copy link
Member Author

@arr2036 I believe that we can simplify the set in an single line in SQL and option to do "home_server" generate a "home_server_pool" automatically like the behavior found in $source/src/modules/rlm_realm/trustrouter.c

flag like: auto_pool = yes

all

home_server hs_name {
....
}

will generate a

home_server_pool pool_hs_name {
....
}

What do you think @arr2036 and @alandekok ?

@arr2036 arr2036 added feature enhancement category: a new feature (an extension of functionality) v4.0.x meta: relates to the v4.0.x branch labels Oct 31, 2015
@arr2036 arr2036 added this to the 3.2.0 release milestone Jan 4, 2016
@arr2036 arr2036 modified the milestones: 4.0.0 release, 3.2.0 release Jul 13, 2016
@erindru
Copy link

erindru commented Apr 10, 2017

Any progress on this? Sending HUP to the freeradius process does not reload the home_servers unfortunatey, so it seems the only way to have "dynamic" home servers is to have another process writing the files and then periodically restarting the freeradius process.

My use-case is allowing a user to dynamically add NAS devices (with CoA enabled) to the system - currently the dynamic_clients module takes care of allowing the NAS device to work, but unfortunately CoA requires a home_server definition which doesnt appear to be possible to add dynamically

@alandekok
Copy link
Member

We're not going to add this feature to version 3. Doing so would require substantial changes to the server.

This feature will be in v4, whenever that is released.

@alandekok
Copy link
Member

This functionality will need to be dynamic in rlm_radius in v4.

For v4, we're removed proxies && home servers from the server core. It is all just in rlm_radius now.

Once we get more time, rlm_radius will allow for dynamic creation of home servers. At which point, all of this becomes simpler.

@erindru
Copy link

erindru commented Sep 18, 2017

Thanks for the update @alandekok . I look forward to this feature being available, whenever that is :) In the meantime, I will continue to use my dirty python script to maintain the home server definitions file

@alandekok
Copy link
Member

We've rewritten all of this for v4, and will close this as no longer relevant. We will be able to dynamically load home servers in v4, just not using this method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature enhancement category: a new feature (an extension of functionality) v4.0.x meta: relates to the v4.0.x branch
Projects
None yet
Development

No branches or pull requests

4 participants