[v3] consistently use same webserver port for hoodfile on wifi and lan

Submitted by Adrian Schmutzler on Oct. 30, 2017, 7:02 p.m.

Details

Message ID 1509390152-6897-1-git-send-email-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler Oct. 30, 2017, 7:02 p.m.
From: Fabian Blaese <fabian@blaese.de>

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

Rebased onto sector-patch v5: Apply after that

Changes in v3:
- Also change sector stuff
---
 .../fff/fff-hoods/files/lib/functions/fff/keyxchange         |  4 ++--
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood      | 12 ++++++------
 .../fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd         | 10 ++++++++++
 src/packages/fff/fff-web/files/www/hood/.keep                |  0
 src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html     |  2 +-
 5 files changed, 19 insertions(+), 9 deletions(-)
 create mode 100644 src/packages/fff/fff-web/files/www/hood/.keep

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
index d7c2c13..a2fc651 100644
--- a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
+++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
@@ -6,8 +6,8 @@ 
 
 getJsonPath() {
 	jsonfile=""
-	if [ -s /www/public/keyxchangev2data ] ; then
-		jsonfile="/www/public/keyxchangev2data"
+	if [ -s /www/hood/keyxchangev2data ] ; then
+		jsonfile="/www/hood/keyxchangev2data"
 	elif [ -s /tmp/keyxchangev2data ] ; then
 		jsonfile="/tmp/keyxchangev2data"
 	fi
diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index 12cb395..2945cf4 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -6,7 +6,7 @@ 
 
 sectorlocal=/etc/sectorfile
 sectortmp=/tmp/sectorfile
-sectorcopy=/www/public/sectorfile
+sectorcopy=/www/hood/sectorfile
 
 rm -f /tmp/keyxchangev2data
 
@@ -74,7 +74,7 @@  else
 	if ! isGatewayAvailable ; then
 		#now we haven't a gateway in Range, we search for a hidden AP to get a keyxchangev2data file!
 		#first we delete all wifi settings
-		rm -f /www/public/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
+		rm -f /www/hood/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
 		rm -f "$sectorcopy" # always delete: no broadcast for isolated device
 		rm -f "$sectortmp"
 
@@ -108,10 +108,10 @@  else
 		# wait a moment to start the interface
 		sleep 10;
 		# and here we can download the Hoodfile from the other node
-		wget -T15 -t5 "http://[fe80::1%w2sta]/keyxchangev2data" -O /tmp/keyxchangev2data
+		wget -T15 -t5 "http://[fe80::1%w2sta]:2342/keyxchangev2data" -O /tmp/keyxchangev2data
 		#UPLINK: Set up uplink data on first contact:
 		if [ -s /tmp/keyxchangev2data ]; then
-			wget -T15 -t5 "http://[fe80::1%w2sta]/sectorfile" -O "$sectortmp"
+			wget -T15 -t5 "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp"
 		fi
 	else
 		echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
@@ -141,7 +141,7 @@  if [ -s /tmp/keyxchangev2data ]; then
 	fi
 
 	catnew="$(cat /tmp/keyxchangev2data | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
-	catold="$(cat /www/public/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
+	catold="$(cat /www/hood/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
 	sumnew=$(echo "$catnew" | sha256sum | cut -f1 -d " ")
 	sumold=$(echo "$catold" | sha256sum | cut -f1 -d " ")
 
@@ -221,7 +221,7 @@  if [ -s /tmp/keyxchangev2data ]; then
 
 		# copy the file to webroot so that other mesh routers can download it;
 		# copy only after all other steps so IF can be reentered if something goes wrong
-		cp /tmp/keyxchangev2data /www/public/
+		cp /tmp/keyxchangev2data /www/hood/
 		cp "$sectortmp" "$sectorcopy"
 
 	else
diff --git a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
index 28ae2b5..42376ad 100644
--- a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
+++ b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
@@ -5,6 +5,7 @@  uci batch <<EOF
   delete uhttpd.public
   delete uhttpd.ssl
   delete uhttpd.px5g
+
   set uhttpd.public=uhttpd
   add_list uhttpd.public.listen_http='80'
   set uhttpd.public.home='/www/public'
@@ -14,6 +15,7 @@  uci batch <<EOF
   set uhttpd.public.network_timeout='30'
   set uhttpd.public.tcp_keepalive='1'
   set uhttpd.public.config='_'
+
   set uhttpd.ssl=uhttpd
   add_list uhttpd.ssl.listen_https='443'
   set uhttpd.ssl.home='/www/ssl'
@@ -29,6 +31,14 @@  uci batch <<EOF
   set uhttpd.px5g.days='1400'
   set uhttpd.px5g.bits='2048'
   set uhttpd.px5g.commonname='OpenWrt'
+
+  set uhttpd.hood=uhttpd
+  add_list uhttpd.hood.listen_http='2342'
+  set uhttpd.hood.home='/www/hood'
+  set uhttpd.hood.rfc1918_filter='1'
+  set uhttpd.hood.network_timeout='30'
+  set uhttpd.hood.tcp_keepalive='1'
+  set uhttpd.hood.config='_'
 EOF
 
 uci commit uhttpd
diff --git a/src/packages/fff/fff-web/files/www/hood/.keep b/src/packages/fff/fff-web/files/www/hood/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
index cbce768..402670d 100755
--- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
+++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
@@ -5,7 +5,7 @@ 
 if [ "$REQUEST_METHOD" == "POST" ] ; then
 	if [ "$POST_resethood" != "" ] ; then
 		# reset hood
-		rm /www/public/keyxchangev2data 2> /dev/null
+		rm /www/hood/keyxchangev2data 2> /dev/null
 		MSG='<span class="green">Hood-Daten werden innerhalb von 5 Minuten neu prozessiert.</span>'
 	fi
 fi

Comments

Christian Dresel Oct. 30, 2017, 7:39 p.m.
hi

sieht gut aus und macht Sinn. Kurz getestet und scheint problemlos zu
laufen (wenn man alle hiddenAP Router in der Wohnung erwischt beim
umstellen und nicht einen vergisst ;)) Danke für die Arbeit.

Reviewed-by: Christian Dresel <fff@chrisi01.de>

mfg

Christian

On 30.10.2017 20:02, Adrian Schmutzler wrote:
> From: Fabian Blaese <fabian@blaese.de>
> 
> Signed-off-by: Fabian Bläse <fabian@blaese.de>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> Rebased onto sector-patch v5: Apply after that
> 
> Changes in v3:
> - Also change sector stuff
> ---
>  .../fff/fff-hoods/files/lib/functions/fff/keyxchange         |  4 ++--
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood      | 12 ++++++------
>  .../fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd         | 10 ++++++++++
>  src/packages/fff/fff-web/files/www/hood/.keep                |  0
>  src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html     |  2 +-
>  5 files changed, 19 insertions(+), 9 deletions(-)
>  create mode 100644 src/packages/fff/fff-web/files/www/hood/.keep
> 
> diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> index d7c2c13..a2fc651 100644
> --- a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> @@ -6,8 +6,8 @@
>  
>  getJsonPath() {
>  	jsonfile=""
> -	if [ -s /www/public/keyxchangev2data ] ; then
> -		jsonfile="/www/public/keyxchangev2data"
> +	if [ -s /www/hood/keyxchangev2data ] ; then
> +		jsonfile="/www/hood/keyxchangev2data"
>  	elif [ -s /tmp/keyxchangev2data ] ; then
>  		jsonfile="/tmp/keyxchangev2data"
>  	fi
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 12cb395..2945cf4 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -6,7 +6,7 @@
>  
>  sectorlocal=/etc/sectorfile
>  sectortmp=/tmp/sectorfile
> -sectorcopy=/www/public/sectorfile
> +sectorcopy=/www/hood/sectorfile
>  
>  rm -f /tmp/keyxchangev2data
>  
> @@ -74,7 +74,7 @@ else
>  	if ! isGatewayAvailable ; then
>  		#now we haven't a gateway in Range, we search for a hidden AP to get a keyxchangev2data file!
>  		#first we delete all wifi settings
> -		rm -f /www/public/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
> +		rm -f /www/hood/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
>  		rm -f "$sectorcopy" # always delete: no broadcast for isolated device
>  		rm -f "$sectortmp"
>  
> @@ -108,10 +108,10 @@ else
>  		# wait a moment to start the interface
>  		sleep 10;
>  		# and here we can download the Hoodfile from the other node
> -		wget -T15 -t5 "http://[fe80::1%w2sta]/keyxchangev2data" -O /tmp/keyxchangev2data
> +		wget -T15 -t5 "http://[fe80::1%w2sta]:2342/keyxchangev2data" -O /tmp/keyxchangev2data
>  		#UPLINK: Set up uplink data on first contact:
>  		if [ -s /tmp/keyxchangev2data ]; then
> -			wget -T15 -t5 "http://[fe80::1%w2sta]/sectorfile" -O "$sectortmp"
> +			wget -T15 -t5 "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp"
>  		fi
>  	else
>  		echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
> @@ -141,7 +141,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>  	fi
>  
>  	catnew="$(cat /tmp/keyxchangev2data | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
> -	catold="$(cat /www/public/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
> +	catold="$(cat /www/hood/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
>  	sumnew=$(echo "$catnew" | sha256sum | cut -f1 -d " ")
>  	sumold=$(echo "$catold" | sha256sum | cut -f1 -d " ")
>  
> @@ -221,7 +221,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>  
>  		# copy the file to webroot so that other mesh routers can download it;
>  		# copy only after all other steps so IF can be reentered if something goes wrong
> -		cp /tmp/keyxchangev2data /www/public/
> +		cp /tmp/keyxchangev2data /www/hood/
>  		cp "$sectortmp" "$sectorcopy"
>  
>  	else
> diff --git a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> index 28ae2b5..42376ad 100644
> --- a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> +++ b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> @@ -5,6 +5,7 @@ uci batch <<EOF
>    delete uhttpd.public
>    delete uhttpd.ssl
>    delete uhttpd.px5g
> +
>    set uhttpd.public=uhttpd
>    add_list uhttpd.public.listen_http='80'
>    set uhttpd.public.home='/www/public'
> @@ -14,6 +15,7 @@ uci batch <<EOF
>    set uhttpd.public.network_timeout='30'
>    set uhttpd.public.tcp_keepalive='1'
>    set uhttpd.public.config='_'
> +
>    set uhttpd.ssl=uhttpd
>    add_list uhttpd.ssl.listen_https='443'
>    set uhttpd.ssl.home='/www/ssl'
> @@ -29,6 +31,14 @@ uci batch <<EOF
>    set uhttpd.px5g.days='1400'
>    set uhttpd.px5g.bits='2048'
>    set uhttpd.px5g.commonname='OpenWrt'
> +
> +  set uhttpd.hood=uhttpd
> +  add_list uhttpd.hood.listen_http='2342'
> +  set uhttpd.hood.home='/www/hood'
> +  set uhttpd.hood.rfc1918_filter='1'
> +  set uhttpd.hood.network_timeout='30'
> +  set uhttpd.hood.tcp_keepalive='1'
> +  set uhttpd.hood.config='_'
>  EOF
>  
>  uci commit uhttpd
> diff --git a/src/packages/fff/fff-web/files/www/hood/.keep b/src/packages/fff/fff-web/files/www/hood/.keep
> new file mode 100644
> index 0000000..e69de29
> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> index cbce768..402670d 100755
> --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> @@ -5,7 +5,7 @@
>  if [ "$REQUEST_METHOD" == "POST" ] ; then
>  	if [ "$POST_resethood" != "" ] ; then
>  		# reset hood
> -		rm /www/public/keyxchangev2data 2> /dev/null
> +		rm /www/hood/keyxchangev2data 2> /dev/null
>  		MSG='<span class="green">Hood-Daten werden innerhalb von 5 Minuten neu prozessiert.</span>'
>  	fi
>  fi
>
Christian Dresel Oct. 30, 2017, 7:41 p.m.
noch ganz vergessen, sollte natürlich in dieser Reihenfolge NACH

[PATCH v8] fff-hoods: Use channel provided by gateway
[PATCH v5] fff-hoods: Introduce sector files for custom settings

applied werden.

mfg

Christian

On 30.10.2017 20:39, Christian Dresel wrote:
> hi
> 
> sieht gut aus und macht Sinn. Kurz getestet und scheint problemlos zu
> laufen (wenn man alle hiddenAP Router in der Wohnung erwischt beim
> umstellen und nicht einen vergisst ;)) Danke für die Arbeit.
> 
> Reviewed-by: Christian Dresel <fff@chrisi01.de>
> 
> mfg
> 
> Christian
> 
> On 30.10.2017 20:02, Adrian Schmutzler wrote:
>> From: Fabian Blaese <fabian@blaese.de>
>>
>> Signed-off-by: Fabian Bläse <fabian@blaese.de>
>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
>>
>> Rebased onto sector-patch v5: Apply after that
>>
>> Changes in v3:
>> - Also change sector stuff
>> ---
>>  .../fff/fff-hoods/files/lib/functions/fff/keyxchange         |  4 ++--
>>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood      | 12 ++++++------
>>  .../fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd         | 10 ++++++++++
>>  src/packages/fff/fff-web/files/www/hood/.keep                |  0
>>  src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html     |  2 +-
>>  5 files changed, 19 insertions(+), 9 deletions(-)
>>  create mode 100644 src/packages/fff/fff-web/files/www/hood/.keep
>>
>> diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
>> index d7c2c13..a2fc651 100644
>> --- a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
>> +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
>> @@ -6,8 +6,8 @@
>>  
>>  getJsonPath() {
>>  	jsonfile=""
>> -	if [ -s /www/public/keyxchangev2data ] ; then
>> -		jsonfile="/www/public/keyxchangev2data"
>> +	if [ -s /www/hood/keyxchangev2data ] ; then
>> +		jsonfile="/www/hood/keyxchangev2data"
>>  	elif [ -s /tmp/keyxchangev2data ] ; then
>>  		jsonfile="/tmp/keyxchangev2data"
>>  	fi
>> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
>> index 12cb395..2945cf4 100755
>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
>> @@ -6,7 +6,7 @@
>>  
>>  sectorlocal=/etc/sectorfile
>>  sectortmp=/tmp/sectorfile
>> -sectorcopy=/www/public/sectorfile
>> +sectorcopy=/www/hood/sectorfile
>>  
>>  rm -f /tmp/keyxchangev2data
>>  
>> @@ -74,7 +74,7 @@ else
>>  	if ! isGatewayAvailable ; then
>>  		#now we haven't a gateway in Range, we search for a hidden AP to get a keyxchangev2data file!
>>  		#first we delete all wifi settings
>> -		rm -f /www/public/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
>> +		rm -f /www/hood/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
>>  		rm -f "$sectorcopy" # always delete: no broadcast for isolated device
>>  		rm -f "$sectortmp"
>>  
>> @@ -108,10 +108,10 @@ else
>>  		# wait a moment to start the interface
>>  		sleep 10;
>>  		# and here we can download the Hoodfile from the other node
>> -		wget -T15 -t5 "http://[fe80::1%w2sta]/keyxchangev2data" -O /tmp/keyxchangev2data
>> +		wget -T15 -t5 "http://[fe80::1%w2sta]:2342/keyxchangev2data" -O /tmp/keyxchangev2data
>>  		#UPLINK: Set up uplink data on first contact:
>>  		if [ -s /tmp/keyxchangev2data ]; then
>> -			wget -T15 -t5 "http://[fe80::1%w2sta]/sectorfile" -O "$sectortmp"
>> +			wget -T15 -t5 "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp"
>>  		fi
>>  	else
>>  		echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
>> @@ -141,7 +141,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>>  	fi
>>  
>>  	catnew="$(cat /tmp/keyxchangev2data | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
>> -	catold="$(cat /www/public/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
>> +	catold="$(cat /www/hood/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
>>  	sumnew=$(echo "$catnew" | sha256sum | cut -f1 -d " ")
>>  	sumold=$(echo "$catold" | sha256sum | cut -f1 -d " ")
>>  
>> @@ -221,7 +221,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>>  
>>  		# copy the file to webroot so that other mesh routers can download it;
>>  		# copy only after all other steps so IF can be reentered if something goes wrong
>> -		cp /tmp/keyxchangev2data /www/public/
>> +		cp /tmp/keyxchangev2data /www/hood/
>>  		cp "$sectortmp" "$sectorcopy"
>>  
>>  	else
>> diff --git a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
>> index 28ae2b5..42376ad 100644
>> --- a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
>> +++ b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
>> @@ -5,6 +5,7 @@ uci batch <<EOF
>>    delete uhttpd.public
>>    delete uhttpd.ssl
>>    delete uhttpd.px5g
>> +
>>    set uhttpd.public=uhttpd
>>    add_list uhttpd.public.listen_http='80'
>>    set uhttpd.public.home='/www/public'
>> @@ -14,6 +15,7 @@ uci batch <<EOF
>>    set uhttpd.public.network_timeout='30'
>>    set uhttpd.public.tcp_keepalive='1'
>>    set uhttpd.public.config='_'
>> +
>>    set uhttpd.ssl=uhttpd
>>    add_list uhttpd.ssl.listen_https='443'
>>    set uhttpd.ssl.home='/www/ssl'
>> @@ -29,6 +31,14 @@ uci batch <<EOF
>>    set uhttpd.px5g.days='1400'
>>    set uhttpd.px5g.bits='2048'
>>    set uhttpd.px5g.commonname='OpenWrt'
>> +
>> +  set uhttpd.hood=uhttpd
>> +  add_list uhttpd.hood.listen_http='2342'
>> +  set uhttpd.hood.home='/www/hood'
>> +  set uhttpd.hood.rfc1918_filter='1'
>> +  set uhttpd.hood.network_timeout='30'
>> +  set uhttpd.hood.tcp_keepalive='1'
>> +  set uhttpd.hood.config='_'
>>  EOF
>>  
>>  uci commit uhttpd
>> diff --git a/src/packages/fff/fff-web/files/www/hood/.keep b/src/packages/fff/fff-web/files/www/hood/.keep
>> new file mode 100644
>> index 0000000..e69de29
>> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
>> index cbce768..402670d 100755
>> --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
>> +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
>> @@ -5,7 +5,7 @@
>>  if [ "$REQUEST_METHOD" == "POST" ] ; then
>>  	if [ "$POST_resethood" != "" ] ; then
>>  		# reset hood
>> -		rm /www/public/keyxchangev2data 2> /dev/null
>> +		rm /www/hood/keyxchangev2data 2> /dev/null
>>  		MSG='<span class="green">Hood-Daten werden innerhalb von 5 Minuten neu prozessiert.</span>'
>>  	fi
>>  fi
>>
> 
> 
>
Robert Langhammer Nov. 1, 2017, 7:46 p.m.
Hallo,

sollte man auf jeden Fall machen. Ob wir dann bei der Gatewayanfragerei
bleiben wird sich zeigen.

Reviewed-by: Robert Langhammer rlanghammer@web.de


Am 30.10.2017 um 20:02 schrieb Adrian Schmutzler:
> From: Fabian Blaese <fabian@blaese.de>
>
> Signed-off-by: Fabian Bläse <fabian@blaese.de>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
>
> Rebased onto sector-patch v5: Apply after that
>
> Changes in v3:
> - Also change sector stuff
> ---
>  .../fff/fff-hoods/files/lib/functions/fff/keyxchange         |  4 ++--
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood      | 12 ++++++------
>  .../fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd         | 10 ++++++++++
>  src/packages/fff/fff-web/files/www/hood/.keep                |  0
>  src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html     |  2 +-
>  5 files changed, 19 insertions(+), 9 deletions(-)
>  create mode 100644 src/packages/fff/fff-web/files/www/hood/.keep
>
> diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> index d7c2c13..a2fc651 100644
> --- a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> @@ -6,8 +6,8 @@
>  
>  getJsonPath() {
>  	jsonfile=""
> -	if [ -s /www/public/keyxchangev2data ] ; then
> -		jsonfile="/www/public/keyxchangev2data"
> +	if [ -s /www/hood/keyxchangev2data ] ; then
> +		jsonfile="/www/hood/keyxchangev2data"
>  	elif [ -s /tmp/keyxchangev2data ] ; then
>  		jsonfile="/tmp/keyxchangev2data"
>  	fi
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 12cb395..2945cf4 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -6,7 +6,7 @@
>  
>  sectorlocal=/etc/sectorfile
>  sectortmp=/tmp/sectorfile
> -sectorcopy=/www/public/sectorfile
> +sectorcopy=/www/hood/sectorfile
>  
>  rm -f /tmp/keyxchangev2data
>  
> @@ -74,7 +74,7 @@ else
>  	if ! isGatewayAvailable ; then
>  		#now we haven't a gateway in Range, we search for a hidden AP to get a keyxchangev2data file!
>  		#first we delete all wifi settings
> -		rm -f /www/public/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
> +		rm -f /www/hood/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
>  		rm -f "$sectorcopy" # always delete: no broadcast for isolated device
>  		rm -f "$sectortmp"
>  
> @@ -108,10 +108,10 @@ else
>  		# wait a moment to start the interface
>  		sleep 10;
>  		# and here we can download the Hoodfile from the other node
> -		wget -T15 -t5 "http://[fe80::1%w2sta]/keyxchangev2data" -O /tmp/keyxchangev2data
> +		wget -T15 -t5 "http://[fe80::1%w2sta]:2342/keyxchangev2data" -O /tmp/keyxchangev2data
>  		#UPLINK: Set up uplink data on first contact:
>  		if [ -s /tmp/keyxchangev2data ]; then
> -			wget -T15 -t5 "http://[fe80::1%w2sta]/sectorfile" -O "$sectortmp"
> +			wget -T15 -t5 "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp"
>  		fi
>  	else
>  		echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
> @@ -141,7 +141,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>  	fi
>  
>  	catnew="$(cat /tmp/keyxchangev2data | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
> -	catold="$(cat /www/public/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
> +	catold="$(cat /www/hood/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
>  	sumnew=$(echo "$catnew" | sha256sum | cut -f1 -d " ")
>  	sumold=$(echo "$catold" | sha256sum | cut -f1 -d " ")
>  
> @@ -221,7 +221,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>  
>  		# copy the file to webroot so that other mesh routers can download it;
>  		# copy only after all other steps so IF can be reentered if something goes wrong
> -		cp /tmp/keyxchangev2data /www/public/
> +		cp /tmp/keyxchangev2data /www/hood/
>  		cp "$sectortmp" "$sectorcopy"
>  
>  	else
> diff --git a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> index 28ae2b5..42376ad 100644
> --- a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> +++ b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> @@ -5,6 +5,7 @@ uci batch <<EOF
>    delete uhttpd.public
>    delete uhttpd.ssl
>    delete uhttpd.px5g
> +
>    set uhttpd.public=uhttpd
>    add_list uhttpd.public.listen_http='80'
>    set uhttpd.public.home='/www/public'
> @@ -14,6 +15,7 @@ uci batch <<EOF
>    set uhttpd.public.network_timeout='30'
>    set uhttpd.public.tcp_keepalive='1'
>    set uhttpd.public.config='_'
> +
>    set uhttpd.ssl=uhttpd
>    add_list uhttpd.ssl.listen_https='443'
>    set uhttpd.ssl.home='/www/ssl'
> @@ -29,6 +31,14 @@ uci batch <<EOF
>    set uhttpd.px5g.days='1400'
>    set uhttpd.px5g.bits='2048'
>    set uhttpd.px5g.commonname='OpenWrt'
> +
> +  set uhttpd.hood=uhttpd
> +  add_list uhttpd.hood.listen_http='2342'
> +  set uhttpd.hood.home='/www/hood'
> +  set uhttpd.hood.rfc1918_filter='1'
> +  set uhttpd.hood.network_timeout='30'
> +  set uhttpd.hood.tcp_keepalive='1'
> +  set uhttpd.hood.config='_'
>  EOF
>  
>  uci commit uhttpd
> diff --git a/src/packages/fff/fff-web/files/www/hood/.keep b/src/packages/fff/fff-web/files/www/hood/.keep
> new file mode 100644
> index 0000000..e69de29
> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> index cbce768..402670d 100755
> --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> @@ -5,7 +5,7 @@
>  if [ "$REQUEST_METHOD" == "POST" ] ; then
>  	if [ "$POST_resethood" != "" ] ; then
>  		# reset hood
> -		rm /www/public/keyxchangev2data 2> /dev/null
> +		rm /www/hood/keyxchangev2data 2> /dev/null
>  		MSG='<span class="green">Hood-Daten werden innerhalb von 5 Minuten neu prozessiert.</span>'
>  	fi
>  fi
Tim Niemeyer Nov. 2, 2017, 7:49 p.m.
Hi

Applied.

Am Montag, den 30.10.2017, 20:02 +0100 schrieb Adrian Schmutzler:
> From: Fabian Blaese <fabian@blaese.de>
> 
> Signed-off-by: Fabian Bläse <fabian@blaese.de>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> Rebased onto sector-patch v5: Apply after that
> 
> Changes in v3:
Leider ist auch in diesem Patch wieder die Commit-Message falsch. Commit
message (nicht wirklich vorhanden) und Kommentare für die Reviewer (wie
z.B. die Changes) sind beide in der Commit-Message vermischt.

Ein paar Patches lang werde ich das noch nachbearbeiten, aber irgendwann
werde ich sowas einfach nicht mehr applien!

Tim

> - Also change sector stuff
> ---
>  .../fff/fff-hoods/files/lib/functions/fff/keyxchange         |  4 ++--
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood      | 12 ++++++------
>  .../fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd         | 10 ++++++++++
>  src/packages/fff/fff-web/files/www/hood/.keep                |  0
>  src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html     |  2 +-
>  5 files changed, 19 insertions(+), 9 deletions(-)
>  create mode 100644 src/packages/fff/fff-web/files/www/hood/.keep
> 
> diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> index d7c2c13..a2fc651 100644
> --- a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
> @@ -6,8 +6,8 @@
>  
>  getJsonPath() {
>  	jsonfile=""
> -	if [ -s /www/public/keyxchangev2data ] ; then
> -		jsonfile="/www/public/keyxchangev2data"
> +	if [ -s /www/hood/keyxchangev2data ] ; then
> +		jsonfile="/www/hood/keyxchangev2data"
>  	elif [ -s /tmp/keyxchangev2data ] ; then
>  		jsonfile="/tmp/keyxchangev2data"
>  	fi
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 12cb395..2945cf4 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -6,7 +6,7 @@
>  
>  sectorlocal=/etc/sectorfile
>  sectortmp=/tmp/sectorfile
> -sectorcopy=/www/public/sectorfile
> +sectorcopy=/www/hood/sectorfile
>  
>  rm -f /tmp/keyxchangev2data
>  
> @@ -74,7 +74,7 @@ else
>  	if ! isGatewayAvailable ; then
>  		#now we haven't a gateway in Range, we search for a hidden AP to get a keyxchangev2data file!
>  		#first we delete all wifi settings
> -		rm -f /www/public/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
> +		rm -f /www/hood/keyxchangev2data # delete this, so interfaces are recreated if reconnect with unchanged hood file takes place
>  		rm -f "$sectorcopy" # always delete: no broadcast for isolated device
>  		rm -f "$sectortmp"
>  
> @@ -108,10 +108,10 @@ else
>  		# wait a moment to start the interface
>  		sleep 10;
>  		# and here we can download the Hoodfile from the other node
> -		wget -T15 -t5 "http://[fe80::1%w2sta]/keyxchangev2data" -O /tmp/keyxchangev2data
> +		wget -T15 -t5 "http://[fe80::1%w2sta]:2342/keyxchangev2data" -O /tmp/keyxchangev2data
>  		#UPLINK: Set up uplink data on first contact:
>  		if [ -s /tmp/keyxchangev2data ]; then
> -			wget -T15 -t5 "http://[fe80::1%w2sta]/sectorfile" -O "$sectortmp"
> +			wget -T15 -t5 "http://[fe80::1%w2sta]:2342/sectorfile" -O "$sectortmp"
>  		fi
>  	else
>  		echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
> @@ -141,7 +141,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>  	fi
>  
>  	catnew="$(cat /tmp/keyxchangev2data | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
> -	catold="$(cat /www/public/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
> +	catold="$(cat /www/hood/keyxchangev2data 2>/dev/null | sed 's/"timestamp":[0-9]*/"timestamp":0/')"
>  	sumnew=$(echo "$catnew" | sha256sum | cut -f1 -d " ")
>  	sumold=$(echo "$catold" | sha256sum | cut -f1 -d " ")
>  
> @@ -221,7 +221,7 @@ if [ -s /tmp/keyxchangev2data ]; then
>  
>  		# copy the file to webroot so that other mesh routers can download it;
>  		# copy only after all other steps so IF can be reentered if something goes wrong
> -		cp /tmp/keyxchangev2data /www/public/
> +		cp /tmp/keyxchangev2data /www/hood/
>  		cp "$sectortmp" "$sectorcopy"
>  
>  	else
> diff --git a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> index 28ae2b5..42376ad 100644
> --- a/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> +++ b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> @@ -5,6 +5,7 @@ uci batch <<EOF
>    delete uhttpd.public
>    delete uhttpd.ssl
>    delete uhttpd.px5g
> +
>    set uhttpd.public=uhttpd
>    add_list uhttpd.public.listen_http='80'
>    set uhttpd.public.home='/www/public'
> @@ -14,6 +15,7 @@ uci batch <<EOF
>    set uhttpd.public.network_timeout='30'
>    set uhttpd.public.tcp_keepalive='1'
>    set uhttpd.public.config='_'
> +
>    set uhttpd.ssl=uhttpd
>    add_list uhttpd.ssl.listen_https='443'
>    set uhttpd.ssl.home='/www/ssl'
> @@ -29,6 +31,14 @@ uci batch <<EOF
>    set uhttpd.px5g.days='1400'
>    set uhttpd.px5g.bits='2048'
>    set uhttpd.px5g.commonname='OpenWrt'
> +
> +  set uhttpd.hood=uhttpd
> +  add_list uhttpd.hood.listen_http='2342'
> +  set uhttpd.hood.home='/www/hood'
> +  set uhttpd.hood.rfc1918_filter='1'
> +  set uhttpd.hood.network_timeout='30'
> +  set uhttpd.hood.tcp_keepalive='1'
> +  set uhttpd.hood.config='_'
>  EOF
>  
>  uci commit uhttpd
> diff --git a/src/packages/fff/fff-web/files/www/hood/.keep b/src/packages/fff/fff-web/files/www/hood/.keep
> new file mode 100644
> index 0000000..e69de29
> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> index cbce768..402670d 100755
> --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
> @@ -5,7 +5,7 @@
>  if [ "$REQUEST_METHOD" == "POST" ] ; then
>  	if [ "$POST_resethood" != "" ] ; then
>  		# reset hood
> -		rm /www/public/keyxchangev2data 2> /dev/null
> +		rm /www/hood/keyxchangev2data 2> /dev/null
>  		MSG='<span class="green">Hood-Daten werden innerhalb von 5 Minuten neu prozessiert.</span>'
>  	fi
>  fi
> -- 
> 2.7.4
>