Skip to content

Commit

Permalink
MB-15736 make angular UI unavailable in sherlock
Browse files Browse the repository at this point in the history
...so nobody can accidentally stumble upon half baked ui

to enable:
export ENABLE_ANGULAR_UI=true

Change-Id: I592e653428ddbd4fba487527190bef4d00c68531
Reviewed-on: http://review.couchbase.org/53686
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
  • Loading branch information
vzasade authored and aartamonau committed Jul 28, 2015
1 parent 6ff0ff6 commit 4a4a9dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/menelaus_web.erl
Expand Up @@ -371,6 +371,8 @@ loop_inner(Req, AppRoot, Path, PathTokens) ->
["sampleBuckets"] -> {auth_ro, fun handle_sample_buckets/1};
["_metakv" | _] ->
{auth, fun menelaus_metakv:handle_get/2, [Path]};
["angular" | _] ->
{done, serve_angular_ui(Req, Path, AppRoot)};
_ ->
{done, menelaus_util:serve_file(Req, Path, AppRoot,
[{"Cache-Control", "max-age=10"}])}
Expand Down Expand Up @@ -615,6 +617,14 @@ loop_inner(Req, AppRoot, Path, PathTokens) ->
auth_check_bucket_uuid(Req, F, Args)
end.

serve_angular_ui(Req, Path, AppRoot) ->
case os:getenv("ENABLE_ANGULAR_UI") of
"true" ->
menelaus_util:serve_file(Req, Path, AppRoot, [{"Cache-Control", "max-age=10"}]);
_ ->
reply_text(Req, "Not found.", 404)
end.

handle_uilogin(Req) ->
Params = Req:parse_post(),
User = proplists:get_value("user", Params),
Expand Down

0 comments on commit 4a4a9dd

Please sign in to comment.