summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungjae Yoo <seungjaeyoo@google.com>2023-05-15 12:35:22 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-05-15 12:35:22 +0000
commit88c91d0df0150f6d2ed123861a924144e2df29fa (patch)
treed0897532c3cb7b76d06fbdf1cbf5d2bed2392356
parentd770550efb49899396aa9bdd94d8109f6bfa8126 (diff)
parent73b36ae30bcff3683919e6daec6e312eeb962da0 (diff)
downloadopenwrt-prebuilts-88c91d0df0150f6d2ed123861a924144e2df29fa.tar.gz
Change luci home directory to apply reverse proxy on CF WebUI am: abcf10382d am: c965764959 am: 435f07192a am: 63017ddfce am: 73b36ae30b
Original change: https://android-review.googlesource.com/c/platform/external/openwrt-prebuilts/+/2585253 Change-Id: Ic7c01349494c218b96637d7d1fbec01cf3a183e4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--shared/uci-defaults/0_default_config25
1 files changed, 25 insertions, 0 deletions
diff --git a/shared/uci-defaults/0_default_config b/shared/uci-defaults/0_default_config
index deeac1f..010de78 100644
--- a/shared/uci-defaults/0_default_config
+++ b/shared/uci-defaults/0_default_config
@@ -7,6 +7,7 @@ rule_name=$(uci add network rule)
# Extract configs from /proc/cmdline
bridged_wifi_tap=false
+instance_name="cvd-1"
words=$(cat /proc/cmdline)
while
word=${words%%" "*}
@@ -18,6 +19,8 @@ while
uci set network.wan.ipaddr=${word#*"="}
elif echo "$word" | grep "^wan_broadcast="; then
uci set network.wan.broadcast=${word#*"="}
+ elif echo "$word" | grep "^instance_name="; then
+ instance_name=${word#*"="}
fi
next=${words#*" "}
[ "$words" != "$next" ]
@@ -31,6 +34,28 @@ else
uci set network.wan.netmask="255.255.255.252"
fi
+# Modify the path of the web service, luci.
+ln -sf $(readlink -f /www/cgi-bin/cgi-backup) /www/cgi-bin/cgi-backup
+ln -sf $(readlink -f /www/cgi-bin/cgi-download) /www/cgi-bin/cgi-download
+ln -sf $(readlink -f /www/cgi-bin/cgi-exec) /www/cgi-bin/cgi-exec
+ln -sf $(readlink -f /www/cgi-bin/cgi-upload) /www/cgi-bin/cgi-upload
+web_base="devices/$instance_name/openwrt"
+mkdir -p "/www/$web_base/"
+mv /www/cgi-bin "/www/$web_base/"
+mv /www/luci-static "/www/$web_base/"
+mv /www/index.html "/www/$web_base/"
+echo "<meta http-equiv=\"refresh\" content=\"0; url=$web_base/\" />" > /www/index.html
+uci set uhttpd.main.cgi_prefix="/$web_base/cgi-bin"
+uci delete uhttpd.main.lua_prefix
+uci add_list uhttpd.main.lua_prefix="/$web_base/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua"
+uci set uhttpd.main.ubus_prefix="/$web_base/ubus"
+uci set luci.main.mediaurlbase="/$web_base/luci-static/bootstrap"
+uci set luci.main.resourcebase="/$web_base/luci-static/resources"
+uci set luci.main.ubuspath="/$web_base/ubus/"
+uci set luci.themes.Bootstrap="/$web_base/luci-static/bootstrap"
+uci set luci.themes.BootstrapDark="/$web_base/luci-static/bootstrap-dark"
+uci set luci.themes.BootstrapLight="/$web_base/luci-static/bootstrap-light"
+
uci commit
# Regarding hostapd issue of OpenWRT 22.03.X versions, reboot it.