mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
hs20: prepare server using uci-defaults and ship files
Setup user database if non-existent, configure uhttpd .php interpreter and patch php scripts to work out-of-the-box. Also ship Hotspot 2.0 SPP and OMA DM XML schema/DTD files needed at run-time for both client and server. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
--- a/hs20/server/www/spp.php
|
||||
+++ b/hs20/server/www/spp.php
|
||||
@@ -141,7 +141,7 @@ $addr = $_SERVER["REMOTE_ADDR"];
|
||||
putenv("HS20ADDR=$addr");
|
||||
putenv("HS20TEST=$test");
|
||||
|
||||
-$last = exec("$osu_root/spp/hs20_spp_server -r$osu_root -f/tmp/hs20_spp_server.log", $output, $ret);
|
||||
+$last = exec("/usr/sbin/hs20_spp_server -r$osu_root -f/tmp/hs20_spp_server.log", $output, $ret);
|
||||
|
||||
if ($ret == 2) {
|
||||
if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
|
||||
@@ -0,0 +1,17 @@
|
||||
--- a/hs20/server/www/config.php
|
||||
+++ b/hs20/server/www/config.php
|
||||
@@ -1,7 +1,11 @@
|
||||
<?php
|
||||
-$osu_root = "/home/user/hs20-server";
|
||||
+$osu_root = "/etc/hs20";
|
||||
$osu_db = "sqlite:$osu_root/AS/DB/eap_user.db";
|
||||
$t_c_file = "$osu_root/terms-and-conditions";
|
||||
-$t_c_timestamp = 123456789;
|
||||
-$hostapd_ctrl = "udg:///home/user/hs20-server/AS/ctrl/as"
|
||||
+if (file_exists($t_c_file)) {
|
||||
+ $t_c_timestamp = filemtime($t_c_file);
|
||||
+} else {
|
||||
+ $t_c_timestamp = filemtime($osu_root);
|
||||
+}
|
||||
+$hostapd_ctrl = "udg:///var/run/hostapd/hs20-radius/lo"
|
||||
?>
|
||||
@@ -0,0 +1,24 @@
|
||||
--- a/hs20/server/ca/setup.sh
|
||||
+++ b/hs20/server/ca/setup.sh
|
||||
@@ -3,7 +3,7 @@
|
||||
if [ -z "$OPENSSL" ]; then
|
||||
OPENSSL=openssl
|
||||
fi
|
||||
-export OPENSSL_CONF=$PWD/openssl.cnf
|
||||
+export OPENSSL_CONF=/usr/share/hs20/ca/openssl.cnf
|
||||
PASS=whatever
|
||||
if [ -z "$DOMAIN" ]; then
|
||||
DOMAIN=w1.fi
|
||||
@@ -83,10 +83,10 @@ then
|
||||
fi
|
||||
|
||||
# Set the passphrase and some other common config accordingly.
|
||||
-cat openssl-root.cnf | sed "s/@PASSWORD@/$PASS/" \
|
||||
+cat /usr/share/hs20/ca/openssl-root.cnf | sed "s/@PASSWORD@/$PASS/" \
|
||||
> my-openssl-root.cnf
|
||||
|
||||
-cat openssl.cnf | sed "s/@PASSWORD@/$PASS/" |
|
||||
+cat /usr/share/hs20/ca/openssl.cnf | sed "s/@PASSWORD@/$PASS/" |
|
||||
sed "s,@OCSP_URI@,$OCSP_URI," |
|
||||
sed "s,@LOGO_URI@,$LOGO_URI," |
|
||||
sed "s,@LOGO_HASH1@,$LOGO_HASH1," |
|
||||
Reference in New Issue
Block a user