[1/3] makes fff-web config a uci-defaults script

Submitted by Tobias Klaus on June 8, 2016, 8:24 a.m.

Details

Message ID 20160608082409.5161-2-tk+ff@meskal.net
State Accepted, archived
Commit d16f7cdc0adafd3e14555d27141afa02182fd977
Headers show

Commit Message

Tobias Klaus June 8, 2016, 8:24 a.m.
Signed-off-by: Tobias Klaus <tk+ff@meskal.net>
---
 src/packages/fff/fff-web/files/etc/config/uhttpd   | 35 ----------------------
 .../fff-web/files/etc/uci-defaults/93-fff-uhttpd   | 34 +++++++++++++++++++++
 2 files changed, 34 insertions(+), 35 deletions(-)
 delete mode 100644 src/packages/fff/fff-web/files/etc/config/uhttpd
 create mode 100644 src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-web/files/etc/config/uhttpd b/src/packages/fff/fff-web/files/etc/config/uhttpd
deleted file mode 100644
index bf95281..0000000
--- a/src/packages/fff/fff-web/files/etc/config/uhttpd
+++ /dev/null
@@ -1,35 +0,0 @@ 
-
-config uhttpd public
-	list listen_http 80
-	option home /www/public
-	option rfc1918_filter 1
-	option cgi_prefix /cgi-bin
-	option script_timeout 60
-	option network_timeout 30
-	option tcp_keepalive 1
-	option config "_"
-
-config uhttpd ssl
-	list listen_https 443
-	option home /www/ssl
-	option rfc1918_filter 1
-	option cert /etc/uhttpd.crt
-	option key /etc/uhttpd.key
-	option cgi_prefix /cgi-bin
-	option script_timeout 60
-	option network_timeout 30
-	option tcp_keepalive 1
-	option config "/etc/httpd.conf"
-
-
-# Certificate defaults for px5g key generator
-config cert px5g
-
-# Validity time
-option days 1400
-
-# RSA key size
-option bits 2048
-
-# Common name
-option commonname OpenWrt
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
new file mode 100644
index 0000000..ab96acf
--- /dev/null
+++ b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
@@ -0,0 +1,34 @@ 
+#!/bin/sh
+
+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'
+  set uhttpd.public.rfc1918_filter='1'
+  set uhttpd.public.cgi_prefix='/cgi-bin'
+  set uhttpd.public.script_timeout='60'
+  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'
+  set uhttpd.ssl.rfc1918_filter='1'
+  set uhttpd.ssl.cert='/etc/uhttpd.crt'
+  set uhttpd.ssl.key='/etc/uhttpd.key'
+  set uhttpd.ssl.cgi_prefix='/cgi-bin'
+  set uhttpd.ssl.script_timeout='60'
+  set uhttpd.ssl.network_timeout='30'
+  set uhttpd.ssl.tcp_keepalive='1'
+  set uhttpd.ssl.config='/etc/httpd.conf'
+  set uhttpd.px5g=cert
+  set uhttpd.px5g.days='1400'
+  set uhttpd.px5g.bits='2048'
+  set uhttpd.px5g.commonname='OpenWrt'
+EOF
+
+uci commit
+exit 0

Comments

Jan Kraus June 9, 2016, 12:16 p.m.
sieht gut aus:
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>

Am Mittwoch, den 08.06.2016, 10:24 +0200 schrieb Tobias Klaus:
> Signed-off-by: Tobias Klaus <tk+ff@meskal.net>
> ---
>  src/packages/fff/fff-web/files/etc/config/uhttpd   | 35 ----------------------
>  .../fff-web/files/etc/uci-defaults/93-fff-uhttpd   | 34 +++++++++++++++++++++
>  2 files changed, 34 insertions(+), 35 deletions(-)
>  delete mode 100644 src/packages/fff/fff-web/files/etc/config/uhttpd
>  create mode 100644 src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> 
> diff --git a/src/packages/fff/fff-web/files/etc/config/uhttpd b/src/packages/fff/fff-web/files/etc/config/uhttpd
> deleted file mode 100644
> index bf95281..0000000
> --- a/src/packages/fff/fff-web/files/etc/config/uhttpd
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -
> -config uhttpd public
> -	list listen_http 80
> -	option home /www/public
> -	option rfc1918_filter 1
> -	option cgi_prefix /cgi-bin
> -	option script_timeout 60
> -	option network_timeout 30
> -	option tcp_keepalive 1
> -	option config "_"
> -
> -config uhttpd ssl
> -	list listen_https 443
> -	option home /www/ssl
> -	option rfc1918_filter 1
> -	option cert /etc/uhttpd.crt
> -	option key /etc/uhttpd.key
> -	option cgi_prefix /cgi-bin
> -	option script_timeout 60
> -	option network_timeout 30
> -	option tcp_keepalive 1
> -	option config "/etc/httpd.conf"
> -
> -
> -# Certificate defaults for px5g key generator
> -config cert px5g
> -
> -# Validity time
> -option days 1400
> -
> -# RSA key size
> -option bits 2048
> -
> -# Common name
> -option commonname OpenWrt
> 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
> new file mode 100644
> index 0000000..ab96acf
> --- /dev/null
> +++ b/src/packages/fff/fff-web/files/etc/uci-defaults/93-fff-uhttpd
> @@ -0,0 +1,34 @@
> +#!/bin/sh
> +
> +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'
> +  set uhttpd.public.rfc1918_filter='1'
> +  set uhttpd.public.cgi_prefix='/cgi-bin'
> +  set uhttpd.public.script_timeout='60'
> +  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'
> +  set uhttpd.ssl.rfc1918_filter='1'
> +  set uhttpd.ssl.cert='/etc/uhttpd.crt'
> +  set uhttpd.ssl.key='/etc/uhttpd.key'
> +  set uhttpd.ssl.cgi_prefix='/cgi-bin'
> +  set uhttpd.ssl.script_timeout='60'
> +  set uhttpd.ssl.network_timeout='30'
> +  set uhttpd.ssl.tcp_keepalive='1'
> +  set uhttpd.ssl.config='/etc/httpd.conf'
> +  set uhttpd.px5g=cert
> +  set uhttpd.px5g.days='1400'
> +  set uhttpd.px5g.bits='2048'
> +  set uhttpd.px5g.commonname='OpenWrt'
> +EOF
> +
> +uci commit
> +exit 0
> -- 
> 2.8.3
>