From 3e2048ace95f8b80ce43d77898f12f058b112e8b Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 20 Jan 2009 19:42:08 +0000 Subject: [PATCH] * src/Makefile.in: The path to the installed copy of ejabberd Guide is set in the environment variable EJABBERD_DOC_PATH (EJAB-837). * src/web/ejabberd_web_admin.erl: Likewise * src/ejabberdctl.template: Likewise * doc/guide.tex: Likewise * doc/guide.html: Likewise SVN Revision: 1835 --- ChangeLog | 8 ++++++++ doc/guide.html | 16 ++++++++-------- doc/guide.tex | 10 +++++----- src/Makefile.in | 1 + src/ejabberdctl.template | 4 ++++ src/web/ejabberd_web_admin.erl | 8 ++++---- 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48e3bf426..93772026d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2009-01-20 Badlop + * src/Makefile.in: The path to the installed copy of ejabberd + Guide is set in the environment variable + EJABBERD_DOC_PATH (EJAB-837). + * src/web/ejabberd_web_admin.erl: Likewise + * src/ejabberdctl.template: Likewise + * doc/guide.tex: Likewise + * doc/guide.html: Likewise + * src/mod_privacy.erl: Only run roster_get_jid_info if privacy list has subscription or group (thanks to George Hazan)(EJAB-851). Sort items in privacy list by order before storing (EJAB-848) diff --git a/doc/guide.html b/doc/guide.html index 3282fc3d8..5bf0b4a26 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -476,7 +476,7 @@ variable.

  • Install OpenSSL in C:\sdk\OpenSSL and add C:\sdk\OpenSSL\lib\VC to your path or copy the binaries to your system directory.
  • Install ZLib in C:\sdk\gnuWin32. Copy C:\sdk\GnuWin32\bin\zlib1.dll to your system directory. If you change your path it should already be set after libiconv install. -
  • Make sure the you can access Erlang binaries from your path. For example: set PATH=%PATH%;"C:\sdk\erl5.5.5\bin" +
  • Make sure the you can access Erlang binaries from your path. For example: set PATH=%PATH%;"C:\sdk\erl5.6.5\bin"
  • Depending on how you end up actually installing the library you might need to check and tweak the paths in the file configure.erl.
  • While in the directory ejabberd\src run:
    configure.bat
    @@ -914,8 +914,8 @@ connected to port 5237 with password ‘ggsecret’.
     {s2s_default_policy, deny}.
     {{s2s_host,"jabber.example.org"}, allow}.
     {{s2s_host,"example.com"}, allow}.
    -

    Note, that for jabberd 1.4- or WPJabber-based -services you have to make the transports log and do XDB by themselves: +

    Note, that for services based in jabberd14 or WPJabber +you have to make the transports log and do XDB by themselves:

      <!--
          You have to add elogger and rlogger entries here when using ejabberd.
          In this case the transport will do the logging.
    @@ -937,7 +937,7 @@ services you have to make the transports log and do XDB by themselves:
       <xdb id="xdb">
         <host/>
         <load>
    -      <!-- this is a lib of wpjabber or jabberd -->
    +      <!-- this is a lib of wpjabber or jabberd14 -->
           <xdb_file>/usr/lib/jabber/xdb_file.so</xdb_file>
           </load>
         <xdb_file xmlns="jabber:config:xdb_file">
    @@ -3019,6 +3019,8 @@ all the environment variables and command line parameters.

    The environment Path to the ejabberd service log file.

    EJABBERD_SO_PATH
    Path to the directory with binary system libraries. +
    EJABBERD_DOC_PATH
    + Path to the directory with ejabberd documentation.
    HOME
    Path to the directory that is considered ejabberd’s home. This path is used to read the file .erlang.cookie. @@ -3140,10 +3142,8 @@ be installed in the system. The file is searched by default in "/share/doc/ejabberd/guide.html". The directory of the documentation can be specified in -ejabberd.cfg with the option doc_path. -For example: -

    {doc_path, "/usr/local/share/doc/ejabberd/"}.
    -

    +the environment variable EJABBERD_DOC_PATH. +See section 4.1.2.

    4.3  Ad-hoc Commands

    If you enable mod_configure and mod_adhoc, you can perform several administrative tasks in ejabberd with a Jabber client. diff --git a/doc/guide.tex b/doc/guide.tex index 9ee7be777..04e87e3bf 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -3894,6 +3894,8 @@ The environment variables: Path to the ejabberd service log file. \titem{EJABBERD\_SO\_PATH} Path to the directory with binary system libraries. + \titem{EJABBERD\_DOC\_PATH} + Path to the directory with ejabberd documentation. \titem{HOME} Path to the directory that is considered \ejabberd{}'s home. This path is used to read the file \term{.erlang.cookie}. @@ -4030,11 +4032,9 @@ be installed in the system. The file is searched by default in \term{"/share/doc/ejabberd/guide.html"}. The directory of the documentation can be specified in -\term{ejabberd.cfg} with the option \term{doc\_path}. -For example: -\begin{verbatim} -{doc_path, "/usr/local/share/doc/ejabberd/"}. -\end{verbatim} +the environment variable \term{EJABBERD\_DOC\_PATH}. +See section \ref{erlangconfiguration}. + \makesection{adhoccommands}{Ad-hoc Commands} diff --git a/src/Makefile.in b/src/Makefile.in index 8917df636..28c126826 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -172,6 +172,7 @@ install: all -e "s*@LIBDIR@*@libdir@*" \ -e "s*@SYSCONFDIR@*@sysconfdir@*" \ -e "s*@LOCALSTATEDIR@*@localstatedir@*" \ + -e "s*@DOCDIR@*@docdir@*" \ -e "s*@erl@*@ERL@*" ejabberdctl.template \ > ejabberdctl.example [ -f $(ETCDIR)/ejabberdctl.cfg ] \ diff --git a/src/ejabberdctl.template b/src/ejabberdctl.template index b71531c19..32a31d105 100644 --- a/src/ejabberdctl.template +++ b/src/ejabberdctl.template @@ -48,6 +48,9 @@ fi if [ "$SPOOLDIR" = "" ] ; then SPOOLDIR=@LOCALSTATEDIR@/lib/ejabberd fi +if [ "$EJABBERD_DOC_PATH" = "" ] ; then + EJABBERD_DOC_PATH=@DOCDIR@ +fi # check the proper system user is used ID=`id -g` @@ -99,6 +102,7 @@ export EJABBERD_MSGS_PATH export EJABBERD_LOG_PATH export EJABBERD_SO_PATH export EJABBERD_BIN_PATH +export EJABBERD_DOC_PATH export ERL_CRASH_DUMP export ERL_INETRC export ERL_MAX_PORTS diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index ea1a936eb..832983914 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -41,9 +41,9 @@ process(["doc", LocalFile], _Request) -> - DocPath = case ejabberd_config:get_global_option(doc_path) of + DocPath = case os:getenv("EJABBERD_DOC_PATH") of P when is_list(P) -> P; - _ -> "/share/doc/ejabberd/" + false -> "/share/doc/ejabberd/" end, %% Code based in mod_http_fileserver FileName = filename:join(DocPath, LocalFile), @@ -55,8 +55,8 @@ process(["doc", LocalFile], _Request) -> FileContents}; {error, Error} -> ?DEBUG("Delivering error: ~p", [Error]), - Help = " " ++ FileName ++ " - Try to specify the path to ejabberd guide.html " - "with the option doc_path. Check the ejabberd Guide for more information", + Help = " " ++ FileName ++ " - Try to specify the path to ejabberd documentation " + "with the environment variable EJABBERD_DOC_PATH. Check the ejabberd Guide for more information.", case Error of eacces -> {403, [], "Forbidden"++Help}; enoent -> {404, [], "Not found"++Help};