Merge pull request #6467 from JimMoen/update-dashboard

fix(dashboard): enable dashboard by default
This commit is contained in:
JimMoen 2021-12-17 12:35:08 +08:00 committed by GitHub
commit 2891518f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 11 deletions

View File

@ -7,7 +7,7 @@ export EMQX_DEFAULT_BUILDER = ghcr.io/emqx/emqx-builder/4.4-2:23.3.4.9-3-alpine3
export EMQX_DEFAULT_RUNNER = alpine:3.14 export EMQX_DEFAULT_RUNNER = alpine:3.14
export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh) export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh)
export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh) export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh)
export EMQX_DASHBOARD_VERSION ?= v0.5.0 export EMQX_DASHBOARD_VERSION ?= v0.7.0
export DOCKERFILE := deploy/docker/Dockerfile export DOCKERFILE := deploy/docker/Dockerfile
export DOCKERFILE_TESTING := deploy/docker/Dockerfile.testing export DOCKERFILE_TESTING := deploy/docker/Dockerfile.testing
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)

View File

@ -48,16 +48,10 @@ start_listeners() ->
'basicAuth' => #{type => http, scheme => basic}, 'basicAuth' => #{type => http, scheme => basic},
'bearerAuth' => #{type => http, scheme => bearer} 'bearerAuth' => #{type => http, scheme => bearer}
}}}, }}},
Dispatch = Dispatch = [ {"/", cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}
case os:getenv("_EMQX_ENABLE_DASHBOARD") of , {"/static/[...]", cowboy_static, {priv_dir, emqx_dashboard, "www/static"}}
V when V =:= "true" orelse V =:= "1" -> , {'_', cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}
[{"/", cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}, ],
{"/static/[...]", cowboy_static, {priv_dir, emqx_dashboard, "www/static"}},
{'_', cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}
];
_ ->
[]
end,
BaseMinirest = #{ BaseMinirest = #{
base_path => ?BASE_PATH, base_path => ?BASE_PATH,
modules => minirest_api:find_api_modules(apps()), modules => minirest_api:find_api_modules(apps()),