aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2019-10-02 12:31:04 +0200
committerBadlop <badlop@process-one.net>2019-10-02 12:42:59 +0200
commit949e71efb644f6b79030e26ed880bb2e74b93da0 (patch)
tree5c48db1d8b9cae2c5d00a974549dee798754ba02
parentSupport custom base path in WebAdmin by using relative URLs (#3043) (diff)
Update Guide links in WebAdmin to website, as local file isn't included
-rw-r--r--include/ejabberd_web_admin.hrl2
-rw-r--r--src/ejabberd_web_admin.erl24
2 files changed, 1 insertions, 25 deletions
diff --git a/include/ejabberd_web_admin.hrl b/include/ejabberd_web_admin.hrl
index 9700ab0b3..731087054 100644
--- a/include/ejabberd_web_admin.hrl
+++ b/include/ejabberd_web_admin.hrl
@@ -93,7 +93,7 @@
-define(GL(Ref, Title),
?XAE(<<"div">>, [{<<"class">>, <<"guidelink">>}],
[?XAE(<<"a">>,
- [{<<"href">>, <<"/admin/doc/guide.html#", Ref/binary>>},
+ [{<<"href">>, <<"https://docs.ejabberd.im/admin/configuration/#", Ref/binary>>},
{<<"target">>, <<"_blank">>}],
[?C(<<"[Guide: ", Title/binary, "]">>)])])).
diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl
index d16e28206..bc0fc8e7b 100644
--- a/src/ejabberd_web_admin.erl
+++ b/src/ejabberd_web_admin.erl
@@ -150,30 +150,6 @@ url_to_path(URL) -> str:tokens(URL, <<"/">>).
%%%==================================
%%%% process/2
-process([<<"doc">>, LocalFile], _Request) ->
- DocPath = case os:getenv("EJABBERD_DOC_PATH") of
- P when is_list(P) -> P;
- false -> <<"/share/doc/ejabberd/">>
- end,
- FileName = filename:join(DocPath, LocalFile),
- case file:read_file(FileName) of
- {ok, FileContents} ->
- ?DEBUG("Delivering content.", []),
- {200, [{<<"Server">>, <<"ejabberd">>}], FileContents};
- {error, Error} ->
- Help = <<" ", FileName/binary,
- " - Try to specify the path to ejabberd "
- "documentation with the environment variable "
- "EJABBERD_DOC_PATH. Check the ejabberd "
- "Guide for more information.">>,
- ?WARNING_MSG("Problem '~p' accessing the local Guide file ~ts", [Error, Help]),
- case Error of
- eacces -> {403, [], <<"Forbidden", Help/binary>>};
- enoent -> {307, [{<<"Location">>, <<"http://docs.ejabberd.im/admin/guide/configuration/">>}], <<"Not found", Help/binary>>};
- _Else ->
- {404, [], <<(iolist_to_binary(atom_to_list(Error)))/binary, Help/binary>>}
- end
- end;
process([<<"server">>, SHost | RPath] = Path,
#request{auth = Auth, lang = Lang, host = HostHTTP,
method = Method} =