luci-base: make rpc webserver path configurable
Currently the ubus path that provide the webserver is hardcoded to be /ubus.
Change this to make it configurable from the luci config file.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(backported from commit 529bde4408
)
This commit is contained in:
parent
e28f94bf01
commit
14a81ccb63
3 changed files with 4 additions and 2 deletions
|
@ -2536,8 +2536,8 @@
|
|||
if (rpcBaseURL == null) {
|
||||
var rpcFallbackURL = this.url('admin/ubus');
|
||||
|
||||
rpcBaseURL = Request.get('/ubus/').then(function(res) {
|
||||
return (rpcBaseURL = (res.status == 400) ? '/ubus/' : rpcFallbackURL);
|
||||
rpcBaseURL = Request.get(this.env.ubuspath).then(function(res) {
|
||||
return (rpcBaseURL = (res.status == 400) ? L.env.ubuspath : rpcFallbackURL);
|
||||
}, function() {
|
||||
return (rpcBaseURL = rpcFallbackURL);
|
||||
}).then(function(url) {
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
requestpath = luci.dispatcher.context.requestpath,
|
||||
dispatchpath = luci.dispatcher.context.path,
|
||||
pollinterval = luci.config.main.pollinterval or 5,
|
||||
ubuspath = luci.config.main.ubuspath or '/ubus',
|
||||
sessionid = luci.dispatcher.context.authsession,
|
||||
apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30),
|
||||
apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1),
|
||||
|
|
|
@ -2,6 +2,7 @@ config core main
|
|||
option lang auto
|
||||
option mediaurlbase /luci-static/bootstrap
|
||||
option resourcebase /luci-static/resources
|
||||
option ubuspath /ubus
|
||||
|
||||
config extern flash_keep
|
||||
option uci "/etc/config/"
|
||||
|
|
Loading…
Reference in a new issue