Remove hardcoded default values, implement defaults.json

This commit is contained in:
billz
2020-12-05 09:14:07 +00:00
parent 9f85daaa86
commit d35397f09e
6 changed files with 40 additions and 36 deletions

View File

@@ -2,7 +2,7 @@
define('RASPI_BRAND_TEXT', 'RaspAP');
define('RASPI_CONFIG', '/etc/raspap');
define('RASPI_CONFIG_NETWORK', RASPI_CONFIG.'/networking/network.json');
define('RASPI_CONFIG_NETWORK', RASPI_CONFIG.'/networking/defaults.json');
define('RASPI_ADMIN_DETAILS', RASPI_CONFIG.'/raspap.auth');
define('RASPI_WIFI_AP_INTERFACE', 'wlan0');
define('RASPI_CACHE_PATH', sys_get_temp_dir() . '/raspap');

22
config/defaults.json Normal file
View File

@@ -0,0 +1,22 @@
{
"dhcp": {
"wlan0": {
"static ip_address": [ "10.3.141.1/24" ],
"static routers": [ "10.3.141.1" ],
"static domain_name_server": [ "1.1.1.1 8.8.8.8" ]
},
"uap0": {
"static ip_address": [ "192.168.50.1/24" ],
"static routers": [ "192.168.50.1" ],
"static domain_name_server": [ "1.1.1.1 8.8.8.8" ]
}
},
"dnsmasq": {
"wlan0": {
"dhcp-range": [ "10.3.141.50,10.3.141.255,255.255.255.0,12h" ],
"uap0": {
"dhcp-range": [ "192.168.50.50,192.168.50.150,12h" ]
}
}
}

View File

@@ -1,15 +0,0 @@
{
"wlan0": {
"static ip_address": [ "10.3.141.1/24" ],
"static routers": [ "10.3.141.1" ],
"static domain_name_server": [ "1.1.1.1 8.8.8.8" ],
"dhcp-range": [ "10.3.141.50,10.3.141.255,255.255.255.0,12h" ]
},
"uap0": {
"static ip_address": [ "192.168.50.1/24" ],
"static routers": [ "192.168.50.1" ],
"static domain_name_server": [ "1.1.1.1 8.8.8.8" ],
"dhcp-range": [ "192.168.50.50,192.168.50.150,12h" ]
}
}