summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungjae Yoo <seungjaeyoo@google.com>2023-05-15 13:26:10 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-05-15 13:26:10 +0000
commitd289d268288379b376ba51d7b33c1b4f58f4e77c (patch)
treed0897532c3cb7b76d06fbdf1cbf5d2bed2392356
parentc0ab4cdb2961e661fa1f4db8cb509496186a9287 (diff)
parent88c91d0df0150f6d2ed123861a924144e2df29fa (diff)
downloadopenwrt-prebuilts-d289d268288379b376ba51d7b33c1b4f58f4e77c.tar.gz
Change luci home directory to apply reverse proxy on CF WebUI am: abcf10382d am: c965764959 am: 435f07192a am: 63017ddfce am: 73b36ae30b am: 88c91d0df0
Original change: https://android-review.googlesource.com/c/platform/external/openwrt-prebuilts/+/2585253 Change-Id: I4f592a7e51af85a591a504f786a93bceefdf8a29 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.