branding: add LEDE branding
[openwrt/staging/mkresin.git] / package / network / services / uhttpd / files / uhttpd.init
index fcde52a5640f6a037b49f50a25da01bcd050f561..1b457a2b37ab8a2beb5168dbc6eaf37a97a9c567 100755 (executable)
@@ -45,8 +45,8 @@ generate_keys() {
 
        [ -x "$PX5G_BIN" ] && {
                $PX5G_BIN selfsigned -der \
-                       -days ${days:-730} -newkey rsa:${bits:-1024} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \
-                       -subj /C="${country:-DE}"/ST="${state:-Saxony}"/L="${location:-Leipzig}"/CN="${commonname:-OpenWrt}"
+                       -days ${days:-730} -newkey rsa:${bits:-2048} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \
+                       -subj /C="${country:-DE}"/ST="${state:-Saxony}"/L="${location:-Leipzig}"/CN="${commonname:-Lede}"
                sync
                mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}"
                mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}"
@@ -80,6 +80,7 @@ start_instance()
        [ -f /usr/lib/uhttpd_ubus.so ] && {
                append_arg "$cfg" ubus_prefix "-u"
                append_arg "$cfg" ubus_socket "-U"
+               append_bool "$cfg" ubus_cors "-X" 0
        }
        append_arg "$cfg" script_timeout "-t"
        append_arg "$cfg" network_timeout "-T"
@@ -135,6 +136,10 @@ start_instance()
                append_bool "$cfg" redirect_https "-q" 0
        }
 
+       for file in /etc/uhttpd/*.json; do
+               [ -s "$file" ] && procd_append_param command -H "$file"
+       done
+
        procd_close_instance
 }