mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/freeradius: follow-ups for initial import
This commit is contained in:
@@ -32,6 +32,7 @@ devel/debug -- Debugging Tools
|
||||
devel/helloworld -- A sample framework application
|
||||
dns/dyndns -- Dynamic DNS Support
|
||||
dns/rfc2136 -- RFC-2136 Support
|
||||
net/freeradius -- RADIUS Authentication, Authorization and Accounting Server
|
||||
net/ftp-proxy -- Control ftp-proxy processes
|
||||
net/haproxy -- Reliable, high performance TCP/HTTP load balancer
|
||||
net/igmp-proxy -- IGMP-Proxy Service
|
||||
|
||||
@@ -3,5 +3,6 @@ PLUGIN_VERSION= 0.3.0
|
||||
PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server
|
||||
PLUGIN_DEPENDS= freeradius3
|
||||
PLUGIN_MAINTAINER= m.muenz@gmail.com
|
||||
PLUGIN_DEVEL= yes
|
||||
|
||||
.include "../../Mk/plugins.mk"
|
||||
|
||||
+8
-8
@@ -49,7 +49,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function setAction()
|
||||
{
|
||||
$result = array("result"=>"failed");
|
||||
@@ -74,7 +74,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function searchClientAction()
|
||||
{
|
||||
$this->sessionClose();
|
||||
@@ -85,7 +85,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
array("enabled", "name", "secret", "ip" )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getClientAction($uuid = null)
|
||||
{
|
||||
$mdlClient = $this->getModel();
|
||||
@@ -101,7 +101,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
public function addClientAction()
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
@@ -126,7 +126,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function delClientAction($uuid)
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
@@ -144,7 +144,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function setClientAction($uuid)
|
||||
{
|
||||
if ($this->request->isPost() && $this->request->hasPost("client")) {
|
||||
@@ -172,7 +172,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return array("result" => "failed");
|
||||
}
|
||||
|
||||
|
||||
public function toggle_handler($uuid, $elements, $element)
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
@@ -196,7 +196,7 @@ class ClientController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function toggleClientAction($uuid)
|
||||
{
|
||||
return $this->toggle_handler($uuid, 'clients', 'client');
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ class GeneralController extends ApiControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function setAction()
|
||||
{
|
||||
$result = array("result"=>"failed");
|
||||
|
||||
+8
-8
@@ -39,7 +39,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
{
|
||||
static protected $internalModelName = 'User';
|
||||
static protected $internalModelClass = '\OPNsense\Freeradius\User';
|
||||
|
||||
|
||||
public function getAction()
|
||||
{
|
||||
// define list of configurable settings
|
||||
@@ -50,7 +50,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function setAction()
|
||||
{
|
||||
$result = array("result"=>"failed");
|
||||
@@ -75,7 +75,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function searchUserAction()
|
||||
{
|
||||
$this->sessionClose();
|
||||
@@ -86,7 +86,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
array("enabled", "username", "password", "description", "ip", "subnet", "vlan" )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getUserAction($uuid = null)
|
||||
{
|
||||
$mdlUser = $this->getModel();
|
||||
@@ -102,7 +102,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
public function addUserAction()
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
@@ -127,7 +127,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function delUserAction($uuid)
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
@@ -145,7 +145,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function setUserAction($uuid)
|
||||
{
|
||||
if ($this->request->isPost() && $this->request->hasPost("user")) {
|
||||
@@ -197,7 +197,7 @@ class UserController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function toggleUserAction($uuid)
|
||||
{
|
||||
return $this->toggle_handler($uuid, 'users', 'user');
|
||||
|
||||
@@ -57,4 +57,3 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
user=radiusd
|
||||
group=radiusd
|
||||
RADIUS_FILES=/var/log/radius.log /var/log/radutmp /var/log/radwtmp
|
||||
RADIUS_DIRS=/usr/local/etc/raddb /var/run/radiusd /var/log/radacct
|
||||
RADIUS_USER=freeradius
|
||||
RADIUS_GROUP=freeradius
|
||||
|
||||
mkdir -p /var/run/radiusd
|
||||
chown $user:$group /var/run/radiusd
|
||||
chmod 750 /var/run/radiusd
|
||||
for DIR in ${RADIUS_DIRS}; do
|
||||
mkdir -p ${DIR}
|
||||
chmod -R 750 ${DIR}
|
||||
chown -R ${RADIUS_USER}:${RADIUS_GROUP} ${DIR}
|
||||
done
|
||||
|
||||
mkdir -p /usr/local/etc/raddb/
|
||||
chown $user:$group /usr/local/etc/raddb/
|
||||
chmod 750 /usr/local/etc/raddb/
|
||||
|
||||
chown -R $user:$group /usr/local/etc/raddb
|
||||
chown -R $user:$group /var/run/radiusd
|
||||
for FILE in ${RADIUS_FILES}; do
|
||||
touch ${FILE}
|
||||
chmod 700 ${FILE}
|
||||
done
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% if client_list.enabled == '1' %}
|
||||
client {{ client_list.ip }} {
|
||||
secret = {{ client_list.secret }}
|
||||
shortname = {{ client_list.name }}
|
||||
shortname = {{ client_list.name }}
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
|
||||
@@ -643,7 +643,7 @@ eap {
|
||||
#
|
||||
# allowed values: {no, yes}
|
||||
#
|
||||
{% if helpers.exists('OPNsense.freeradius.general.vlanassign') and OPNsense.freeradius.general.vlanassign == '1' %}
|
||||
{% if helpers.exists('OPNsense.freeradius.general.vlanassign') and OPNsense.freeradius.general.vlanassign == '1' %}
|
||||
use_tunneled_reply = yes
|
||||
{% else %}
|
||||
use_tunneled_reply = no
|
||||
@@ -760,7 +760,7 @@ eap {
|
||||
#
|
||||
# This will cache attributes for the final Access-Accept.
|
||||
#
|
||||
{% if helpers.exists('OPNsense.freeradius.general.vlanassign') and OPNsense.freeradius.general.vlanassign == '1' %}
|
||||
{% if helpers.exists('OPNsense.freeradius.general.vlanassign') and OPNsense.freeradius.general.vlanassign == '1' %}
|
||||
use_tunneled_reply = yes
|
||||
{% else %}
|
||||
use_tunneled_reply = no
|
||||
|
||||
Reference in New Issue
Block a user