Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e87d332394 | |||
| bc7f93ad1e | |||
| 9f822dd2b8 | |||
| 3cba2cb1ec | |||
| 834c680f97 | |||
| f075e92f08 | |||
| fbb512cb5a | |||
| 0f80523736 | |||
| 01e1f677c7 | |||
| cf929e730f | |||
| 5c32ba49e2 | |||
| 2ccbff3b98 | |||
| d00f0fb1f4 | |||
| 7fd7e53e4a | |||
| ed502673f4 | |||
| 87d2eb5f9a | |||
| 0c501b760f | |||
| 0a047d790f | |||
| c4d17d939d | |||
| 561025ba32 | |||
| 15e77e9c0f | |||
| 120e581865 | |||
| 528aabf49c | |||
| 18d9f18642 | |||
| a983df4848 | |||
| 0559edd1cd | |||
| 2683b340ae | |||
| cc7b68b7c5 | |||
| 104009b3a9 | |||
| e01eb734b4 | |||
| cb57cfa1a6 | |||
| 146adce3d6 | |||
| 2c4647a980 | |||
| 7690320f0f | |||
| 4575649e10 | |||
| d53a54d900 | |||
| 479da33092 | |||
| f650fc83ae | |||
| 17a7844e40 | |||
| 864e113256 | |||
| e7e8f2f63a | |||
| 3063a84fe2 | |||
| 5a35405cd5 | |||
| 4ef2d08456 | |||
| ede5a353e8 | |||
| b88fa6f617 | |||
| 3882c4d514 | |||
| d24dc4e9c8 | |||
| afaf68159d | |||
| a7f578089a | |||
| 173d9761ca | |||
| 9dc9d75502 | |||
| 06db65e108 | |||
| cc958f7787 | |||
| 8781c8346b | |||
| ad4b41730e |
@@ -35,3 +35,6 @@
|
||||
/src/ejabberd.app.src
|
||||
/src/eldap_filter_yecc.erl
|
||||
/vars.config
|
||||
/dialyzer/
|
||||
/test/*.beam
|
||||
/logs/
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ before_script:
|
||||
|
||||
script:
|
||||
- ./autogen.sh
|
||||
- ./configure --enable-all --disable-odbc
|
||||
- ./configure --enable-all --disable-odbc --disable-elixir
|
||||
- make xref
|
||||
- ERL_LIBS=$PWD make test
|
||||
- grep -q 'TEST COMPLETE, \([[:digit:]]*\) ok, .* of \1 ' logs/raw.log
|
||||
|
||||
+15
@@ -11,6 +11,9 @@ DESTDIR =
|
||||
# /etc/ejabberd/
|
||||
ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
|
||||
|
||||
# /bin/
|
||||
BINDIR = $(DESTDIR)@bindir@
|
||||
|
||||
# /sbin/
|
||||
SBINDIR = $(DESTDIR)@sbindir@
|
||||
|
||||
@@ -118,6 +121,7 @@ install: all
|
||||
|| $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
|
||||
$(SED) -e "s*{{rootdir}}*@prefix@*" \
|
||||
-e "s*{{installuser}}*@INSTALLUSER@*" \
|
||||
-e "s*{{bindir}}*@bindir@*" \
|
||||
-e "s*{{libdir}}*@libdir@*" \
|
||||
-e "s*{{sysconfdir}}*@sysconfdir@*" \
|
||||
-e "s*{{localstatedir}}*@localstatedir@*" \
|
||||
@@ -132,6 +136,11 @@ install: all
|
||||
# Administration script
|
||||
[ -d $(SBINDIR) ] || $(INSTALL) -d -m 755 $(SBINDIR)
|
||||
$(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
|
||||
# Elixir binaries
|
||||
[ -d $(BINDIR) ] || $(INSTALL) -d -m 755 $(BINDIR)
|
||||
-[ -f deps/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/iex $(BINDIR)/iex
|
||||
-[ -f deps/elixir/bin/elixir ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/elixir $(BINDIR)/elixir
|
||||
-[ -f deps/elixir/bin/mix ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/mix $(BINDIR)/mix
|
||||
#
|
||||
# Init script
|
||||
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*" \
|
||||
@@ -145,6 +154,9 @@ install: all
|
||||
$(INSTALL) -m 644 ebin/*.beam $(BEAMDIR)
|
||||
$(INSTALL) -m 644 deps/*/ebin/*.app $(BEAMDIR)
|
||||
$(INSTALL) -m 644 deps/*/ebin/*.beam $(BEAMDIR)
|
||||
# Install Elixir and Elixir dependancies
|
||||
-$(INSTALL) -m 644 deps/*/lib/*/ebin/*.app $(BEAMDIR)
|
||||
-$(INSTALL) -m 644 deps/*/lib/*/ebin/*.beam $(BEAMDIR)
|
||||
rm -f $(BEAMDIR)/configure.beam
|
||||
#
|
||||
# ejabberd header files
|
||||
@@ -201,6 +213,9 @@ uninstall: uninstall-binary
|
||||
|
||||
uninstall-binary:
|
||||
rm -f $(SBINDIR)/ejabberdctl
|
||||
rm -f $(BINDIR)/iex
|
||||
rm -f $(BINDIR)/elixir
|
||||
rm -f $(BINDIR)/mix
|
||||
rm -fr $(DOCDIR)
|
||||
rm -f $(BEAMDIR)/*.beam
|
||||
rm -f $(BEAMDIR)/*.app
|
||||
|
||||
@@ -1,138 +1,145 @@
|
||||
Ejabberd Community Edition, by ProcessOne
|
||||
-----------------------------------------
|
||||
|
||||
ejabberd Community Edition, by ProcessOne
|
||||
=========================================
|
||||
|
||||
ejabberd is a distributed, fault-tolerant technology that allows the creation
|
||||
of large-scale instant messaging applications.
|
||||
The server can reliably support thousands of simultaneous users on a single
|
||||
node and has been designed to provide exceptional standards of fault
|
||||
tolerance.
|
||||
As an open source technology, based on industry-standards, ejabberd can be
|
||||
used to build bespoke solutions very cost effectively.
|
||||
of large-scale instant messaging applications. The server can reliably support
|
||||
thousands of simultaneous users on a single node and has been designed to
|
||||
provide exceptional standards of fault tolerance. As an open source
|
||||
technology, based on industry-standards, ejabberd can be used to build bespoke
|
||||
solutions very cost effectively.
|
||||
|
||||
|
||||
Key Features:
|
||||
=============
|
||||
Key Features
|
||||
------------
|
||||
|
||||
- **Cross-platform**
|
||||
ejabberd runs under Microsoft Windows and Unix-derived systems such as
|
||||
Linux, FreeBSD and NetBSD.
|
||||
|
||||
- **Distributed**
|
||||
You can run ejabberd on a cluster of machines and all of them will serve the
|
||||
same XMPP domain(s). When you need more capacity you can simply add a new
|
||||
cheap node to your cluster. Accordingly, you do not need to buy an expensive
|
||||
high-end machine to support tens of thousands concurrent users.
|
||||
|
||||
- **Fault-tolerant**
|
||||
You can deploy an ejabberd cluster so that all the information required for
|
||||
a properly working service will be replicated permanently on all nodes. This
|
||||
means that if one of the nodes crashes, the others will continue working
|
||||
without disruption. In addition, nodes also can be added or replaced ‘on
|
||||
the fly’.
|
||||
|
||||
- **Administrator-friendly**
|
||||
ejabberd is built on top of the Open Source Erlang. As a result you do not
|
||||
need to install an external database, an external web server, amongst others
|
||||
because everything is already included, and ready to run out of the box.
|
||||
Other administrator benefits include:
|
||||
- Comprehensive documentation.
|
||||
- Straightforward installers for Linux and Mac OS X.
|
||||
- Web administration.
|
||||
- Shared roster groups.
|
||||
- Command line administration tool.
|
||||
- Can integrate with existing authentication mechanisms.
|
||||
- Capability to send announce messages.
|
||||
|
||||
- **Internationalized**
|
||||
ejabberd leads in internationalization. Hence it is very well suited in a
|
||||
globalized world. Related features are:
|
||||
- Translated to 25 languages.
|
||||
- Support for IDNA.
|
||||
|
||||
- **Open Standards**
|
||||
ejabberd is the first Open Source Jabber server claiming to fully comply to
|
||||
the XMPP standard.
|
||||
- Fully XMPP-compliant.
|
||||
- XML-based protocol.
|
||||
- Many protocols supported.
|
||||
|
||||
|
||||
- Cross-platform: ejabberd runs under Microsoft Windows and Unix derived
|
||||
systems such as Linux, FreeBSD and NetBSD.
|
||||
- Distributed: You can run ejabberd on a cluster of machines and all of them
|
||||
will serve the same Jabber domain(s). When you need more capacity you can
|
||||
simply add a new cheap node to your cluster. Accordingly, you do not need to
|
||||
buy an expensive high-end machine to support tens of thousands concurrent
|
||||
users.
|
||||
- Fault-tolerant: You can deploy an ejabberd cluster so that all the
|
||||
information required for a properly working service will be replicated
|
||||
permanently on all nodes. This means that if one of the nodes crashes, the
|
||||
others will continue working without disruption. In addition, nodes also can
|
||||
be added or replaced ‘on the fly’.
|
||||
- Administrator Friendly: ejabberd is built on top of the Open Source
|
||||
Erlang. As a result you do not need to install an external database, an
|
||||
external web server, amongst others because everything is already included,
|
||||
and ready to run out of the box. Other administrator benefits include:
|
||||
Comprehensive documentation.
|
||||
Straightforward installers for Linux, Mac OS X.
|
||||
Web Administration.
|
||||
Shared Roster Groups.
|
||||
Command line administration tool.
|
||||
Can integrate with existing authentication mechanisms.
|
||||
Capability to send announce messages._
|
||||
- Internationalized: ejabberd leads in internationalization. Hence it is
|
||||
very well suited in a globalized world. Related features are:
|
||||
Translated to 25 languages.
|
||||
Support for IDNA._
|
||||
- Open Standards: ejabberd is the first Open Source Jabber server claiming
|
||||
to fully comply to the XMPP standard.
|
||||
Fully XMPP compliant.
|
||||
XML-based protocol.
|
||||
Many protocols supported._
|
||||
|
||||
|
||||
Additional Features:
|
||||
====================
|
||||
|
||||
Additional Features
|
||||
-------------------
|
||||
|
||||
Moreover, ejabberd comes with a wide range of other state-of-the-art features:
|
||||
|
||||
- Modular
|
||||
Load only the modules you want.
|
||||
Extend ejabberd with your own custom modules.
|
||||
- Security
|
||||
SASL and STARTTLS for c2s and s2s connections.
|
||||
STARTTLS and Dialback s2s connections.
|
||||
Web Admin accessible via HTTPS secure access.
|
||||
- Databases
|
||||
Internal database for fast deployment (Mnesia).
|
||||
Native MySQL support.
|
||||
Native PostgreSQL support.
|
||||
ODBC data storage support.
|
||||
Microsoft SQL Server support.
|
||||
- Authentication
|
||||
Internal Authentication.
|
||||
PAM, LDAP and ODBC.
|
||||
External Authentication script.
|
||||
- Others
|
||||
Support for virtual hosting.
|
||||
Compressing XML streams with Stream Compression (XEP-0138).
|
||||
Statistics via Statistics Gathering (XEP-0039).
|
||||
IPv6 support both for c2s and s2s connections.
|
||||
Multi-User Chat module with support for clustering and HTML logging.
|
||||
Users Directory based on users vCards.
|
||||
Publish-Subscribe component with support for Personal Eventing.
|
||||
Support for web clients: HTTP Polling and HTTP Binding (BOSH).
|
||||
IRC transport.
|
||||
Component support: interface with networks such as AIM, ICQ and MSN
|
||||
- **Modularity**
|
||||
- Load only the modules you want.
|
||||
- Extend ejabberd with your own custom modules.
|
||||
|
||||
- **Security**
|
||||
- SASL and STARTTLS for c2s and s2s connections.
|
||||
- STARTTLS and Dialback s2s connections.
|
||||
- Web Admin accessible via HTTPS secure access.
|
||||
|
||||
- **Databases**
|
||||
- Internal database for fast deployment (Mnesia).
|
||||
- Native MySQL support.
|
||||
- Native PostgreSQL support.
|
||||
- ODBC data storage support.
|
||||
- Microsoft SQL Server support.
|
||||
|
||||
- **Authentication**
|
||||
- Internal authentication.
|
||||
- PAM, LDAP and ODBC.
|
||||
- External authentication script.
|
||||
|
||||
- **Others**
|
||||
- Support for virtual hosting.
|
||||
- Compressing XML streams with Stream Compression (XEP-0138).
|
||||
- Statistics via Statistics Gathering (XEP-0039).
|
||||
- IPv6 support both for c2s and s2s connections.
|
||||
- Multi-User Chat module with support for clustering and HTML logging.
|
||||
- Users Directory based on users vCards.
|
||||
- Publish-Subscribe component with support for Personal Eventing.
|
||||
- Support for web clients: HTTP Polling and HTTP Binding (BOSH).
|
||||
- IRC transport.
|
||||
- Component support: interface with networks such as AIM, ICQ and MSN.
|
||||
|
||||
|
||||
Quickstart guide:
|
||||
=================
|
||||
Quickstart guide
|
||||
----------------
|
||||
|
||||
|
||||
0. Requirements
|
||||
---------------
|
||||
### 0. Requirements
|
||||
|
||||
To compile ejabberd you need:
|
||||
|
||||
- GNU Make
|
||||
- GCC
|
||||
- Libexpat 1.95 or higher
|
||||
- Libyaml 0.1.4 or higher
|
||||
- GNU Make.
|
||||
- GCC.
|
||||
- Libexpat 1.95 or higher.
|
||||
- Libyaml 0.1.4 or higher.
|
||||
- Erlang/OTP R15B or higher.
|
||||
- OpenSSL 0.9.8 or higher, for STARTTLS, SASL and SSL encryption.
|
||||
- Zlib 1.2.3 or higher, for Stream Compression support
|
||||
(XEP-0138). Optional.
|
||||
- Zlib 1.2.3 or higher, for Stream Compression support (XEP-0138). Optional.
|
||||
- PAM library. Optional. For Pluggable Authentication Modules (PAM).
|
||||
- GNU Iconv 1.8 or higher, for the IRC Transport
|
||||
(mod_irc). Optional. Not needed on systems with GNU Libc.
|
||||
- GNU Iconv 1.8 or higher, for the IRC Transport (mod_irc). Optional. Not
|
||||
needed on systems with GNU Libc.
|
||||
- ImageMagick's Convert program. Optional. For CAPTCHA challenges.
|
||||
|
||||
|
||||
1. Compile and install on *nix systems
|
||||
--------------------------------------
|
||||
### 1. Compile and install on *nix systems
|
||||
|
||||
To compile ejabberd execute the commands:
|
||||
To compile ejabberd, execute the following commands. The first one is only
|
||||
necessary if your source tree didn't come with a `configure` script.
|
||||
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
|
||||
To install ejabberd, run this command with system administrator rights
|
||||
(root user):
|
||||
To install ejabberd, run this command with system administrator rights (root
|
||||
user):
|
||||
|
||||
sudo make install
|
||||
|
||||
These commands will:
|
||||
|
||||
- Install the configuration files in `/etc/ejabberd/`
|
||||
- Install ejabberd binary, header and runtime files in `/lib/ejabberd/`
|
||||
- Install the administration script: `/sbin/ejabberdctl`
|
||||
- Install ejabberd documentation in `/share/doc/ejabberd/`
|
||||
- Create a spool directory: `/var/lib/ejabberd/`
|
||||
- Create a directory for log files: `/var/log/ejabberd/`
|
||||
- Install the configuration files in `/etc/ejabberd/`
|
||||
- Install ejabberd binary, header and runtime files in `/lib/ejabberd/`
|
||||
- Install the administration script: `/sbin/ejabberdctl`
|
||||
- Install ejabberd documentation in `/share/doc/ejabberd/`
|
||||
- Create a spool directory: `/var/lib/ejabberd/`
|
||||
- Create a directory for log files: `/var/log/ejabberd/`
|
||||
|
||||
|
||||
2. Start ejabberd
|
||||
-----------------
|
||||
### 2. Start ejabberd
|
||||
|
||||
You can use the `ejabberdctl` command line administration script to
|
||||
start and stop ejabberd. For example:
|
||||
@@ -141,15 +148,14 @@ start and stop ejabberd. For example:
|
||||
|
||||
|
||||
For detailed information please refer to the ejabberd Installation and
|
||||
Operation Guide available online and in the doc directory of sources tarball.
|
||||
Operation Guide available online and in the `doc` directory of the source
|
||||
tarball.
|
||||
|
||||
|
||||
Links:
|
||||
======
|
||||
|
||||
|
||||
- Guide: http://www.process-one.net/docs/ejabberd/guide_en.html
|
||||
- Official site: https://www.process-one.net/en/ejabberd
|
||||
- Community site: http://www.ejabberd.im
|
||||
- Forum: http://www.process-one.net/en/forum
|
||||
Links
|
||||
-----
|
||||
|
||||
- Guide: https://www.process-one.net/docs/ejabberd/guide_en.html
|
||||
- Official site: https://www.process-one.net/en/ejabberd
|
||||
- Community site: https://www.ejabberd.im
|
||||
- Forum: https://www.process-one.net/en/forum
|
||||
|
||||
+14
-5
@@ -82,12 +82,12 @@ AC_ARG_ENABLE(roster_gateway_workaround,
|
||||
esac],[roster_gateway_workaround=false])
|
||||
|
||||
AC_ARG_ENABLE(transient_supervisors,
|
||||
[AC_HELP_STRING([--enable-transient_supervisors], [use Erlang supervision for transient process (default: no)])],
|
||||
[AC_HELP_STRING([--disable-transient-supervisors], [disable Erlang supervision for transient processes (default: no)])],
|
||||
[case "${enableval}" in
|
||||
yes) transient_supervisors=true ;;
|
||||
no) transient_supervisors=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-transient_supervisors) ;;
|
||||
esac],[transient_supervisors=false])
|
||||
esac],[transient_supervisors=true])
|
||||
|
||||
AC_ARG_ENABLE(full_xml,
|
||||
[AC_HELP_STRING([--enable-full-xml], [use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)])],
|
||||
@@ -106,10 +106,10 @@ AC_ARG_ENABLE(mssql,
|
||||
esac],[db_type=generic])
|
||||
|
||||
AC_ARG_ENABLE(all,
|
||||
[AC_HELP_STRING([--enable-all], [same as --enable-nif --enable-odbc --enable-mysql --enable-pgsql --enable-pam --enable-zlib --enable-riak --enable-json --enable-iconv --enable-debug --enable-lager --enable-tools (useful for Dialyzer checks, default: no)])],
|
||||
[AC_HELP_STRING([--enable-all], [same as --enable-nif --enable-odbc --enable-mysql --enable-pgsql --enable-pam --enable-zlib --enable-riak --enable-json --enable-elixir --enable-iconv --enable-debug --enable-lager --enable-tools (useful for Dialyzer checks, default: no)])],
|
||||
[case "${enableval}" in
|
||||
yes) nif=true odbc=true mysql=true pgsql=true pam=true zlib=true riak=true json=true iconv=true debug=true lager=true tools=true ;;
|
||||
no) nif=false odbc=false mysql=false pgsql=false pam=false zlib=false riak=false json=false iconv=false debug=false lager=false tools=false ;;
|
||||
yes) nif=true odbc=true mysql=true pgsql=true pam=true zlib=true riak=true json=true elixir=true iconv=true debug=true lager=true tools=true ;;
|
||||
no) nif=false odbc=false mysql=false pgsql=false pam=false zlib=false riak=false json=false elixir=false iconv=false debug=false lager=false tools=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;;
|
||||
esac],[])
|
||||
|
||||
@@ -185,6 +185,14 @@ AC_ARG_ENABLE(json,
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-json) ;;
|
||||
esac],[if test "x$json" = "x"; then json=false; fi])
|
||||
|
||||
AC_ARG_ENABLE(elixir,
|
||||
[AC_HELP_STRING([--enable-elixir], [enable Elixir support (default: no)])],
|
||||
[case "${enableval}" in
|
||||
yes) elixir=true ;;
|
||||
no) elixir=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-elixir) ;;
|
||||
esac],[if test "x$elixir" = "x"; then elixir=false; fi])
|
||||
|
||||
AC_ARG_ENABLE(iconv,
|
||||
[AC_HELP_STRING([--enable-iconv], [enable iconv support (default: yes)])],
|
||||
[case "${enableval}" in
|
||||
@@ -240,6 +248,7 @@ AC_SUBST(pam)
|
||||
AC_SUBST(zlib)
|
||||
AC_SUBST(riak)
|
||||
AC_SUBST(json)
|
||||
AC_SUBST(elixir)
|
||||
AC_SUBST(iconv)
|
||||
AC_SUBST(debug)
|
||||
AC_SUBST(lager)
|
||||
|
||||
+91
-19
@@ -343,7 +343,7 @@ Alternatively, the latest development source code can be retrieved from the Git
|
||||
\begin{verbatim}
|
||||
git clone git://github.com/processone/ejabberd.git ejabberd
|
||||
cd ejabberd
|
||||
git checkout -b 2.1.x origin/2.1.x
|
||||
./autogen.sh
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
@@ -693,6 +693,29 @@ in Erlang terms. The format is still supported, but it is highly recommended
|
||||
to convert it to the new YAML format using \term{convert\_to\_yaml} command
|
||||
from \term{ejabberdctl} (see~\ref{ejabberdctl} and \ref{list-eja-commands} for details).
|
||||
|
||||
If you want to specify some options using the old Erlang format,
|
||||
you can set them in an additional cfg file, and include it using
|
||||
the \option{include\_config\_file} option, see \ref{includeconfigfile}
|
||||
for the option description and a related example in \ref{accesscommands}.
|
||||
|
||||
If you just want to provide an erlang term inside an option,
|
||||
you can use the \term{"> erlangterm."} syntax for embedding erlang terms in a YAML file, for example:
|
||||
\begin{verbatim}
|
||||
modules:
|
||||
mod_cron:
|
||||
tasks:
|
||||
- time: 10
|
||||
units: seconds
|
||||
module: mnesia
|
||||
function: info
|
||||
arguments: "> []."
|
||||
- time: 3
|
||||
units: seconds
|
||||
module: ejabberd_auth
|
||||
function: try_register
|
||||
arguments: "> [\"user1\", \"localhost\", \"pass\"]."
|
||||
\end{verbatim}
|
||||
|
||||
\makesubsection{hostnames}{Host Names}
|
||||
\ind{options!hosts}\ind{host names}
|
||||
|
||||
@@ -2083,7 +2106,7 @@ listen:
|
||||
port: 3478
|
||||
transport: udp
|
||||
use_turn: true
|
||||
turn_ip: 10.20.30.1
|
||||
turn_ip: "10.20.30.1"
|
||||
module: ejabberd_stun
|
||||
...
|
||||
\end{verbatim}
|
||||
@@ -3930,9 +3953,9 @@ modules:
|
||||
\makesubsection{modprivacy}{\modprivacy{}}
|
||||
\ind{modules!\modprivacy{}}\ind{Blocking Communication}\ind{Privacy Rules}\ind{protocols!RFC 3921: XMPP IM}
|
||||
|
||||
This module implements Blocking Communication (also known as Privacy Rules)
|
||||
as defined in section 10 from XMPP IM. If end users have support for it in
|
||||
their \XMPP{} client, they will be able to:
|
||||
This module implements \footahref{http://xmpp.org/rfcs/rfc3921.html\#privacy}{Blocking Communication}
|
||||
(also known as Privacy Rules).
|
||||
If end users have support for it in their \XMPP{} client, they will be able to:
|
||||
\begin{quote}
|
||||
\begin{itemize}
|
||||
\item Retrieving one's privacy lists.
|
||||
@@ -4330,10 +4353,10 @@ It is important to include the last / character in the URL,
|
||||
otherwise the subpages URL will be incorrect.
|
||||
|
||||
\makesubsection{modroster}{\modroster{}}
|
||||
\ind{modules!\modroster{}}\ind{roster management}\ind{protocols!RFC 3921: XMPP IM}
|
||||
\ind{modules!\modroster{}}\ind{roster management}\ind{protocols!RFC 6121: XMPP IM}
|
||||
|
||||
This module implements roster management as defined in
|
||||
\footahref{http://xmpp.org/rfcs/rfc3921.html\#roster}{RFC 3921: XMPP IM}.
|
||||
\footahref{http://tools.ietf.org/html/rfc6121\#section-2}{RFC 6121: XMPP IM}.
|
||||
It also supports Roster Versioning (\xepref{0237}).
|
||||
|
||||
Options:
|
||||
@@ -5403,15 +5426,10 @@ The \term{ejabberdctl commands} are:
|
||||
|
||||
The \term{ejabberdctl} script can be restricted to require authentication
|
||||
and execute some \term{ejabberd commands}; see \ref{accesscommands}.
|
||||
Add the option to the file \term{ejabberd.yml}.
|
||||
In this example there is no restriction:
|
||||
\begin{verbatim}
|
||||
ejabberdctl_access_commands: []
|
||||
\end{verbatim}
|
||||
|
||||
If account \term{robot1@example.org} is registered in \ejabberd{} with password \term{abcdef}
|
||||
(which MD5 is E8B501798950FC58AAD83C8C14978E),
|
||||
and \term{ejabberd.yml} contains this setting:
|
||||
and your old-format configuration file contains this setting:
|
||||
\begin{verbatim}
|
||||
{hosts, ["example.org"]}.
|
||||
{acl, bots, {user, "robot1", "example.org"}}.
|
||||
@@ -5533,7 +5551,7 @@ Other known frontends that can be installed to execute ejabberd commands in diff
|
||||
|
||||
\makesubsection{list-eja-commands}{List of ejabberd Commands}
|
||||
|
||||
\ejabberd{} includes a few ejabberd Commands by default.
|
||||
\ejabberd{} includes a few ejabberd Commands by default as listed below.
|
||||
When more modules are installed, new commands may be available in the frontends.
|
||||
|
||||
The easiest way to get a list of the available commands, and get help for them is to use
|
||||
@@ -5549,8 +5567,11 @@ Available commands in this ejabberd node:
|
||||
...
|
||||
\end{verbatim}
|
||||
|
||||
The most interesting ones are:
|
||||
The commands included in ejabberd by default are:
|
||||
\begin{description}
|
||||
\titem{stop\_kindly delay announcement} Inform users and rooms, wait, and stop the server.
|
||||
Provide the delay in seconds, and the announcement quoted.
|
||||
\titem{registered\_vhosts} List all registered vhosts in SERVER
|
||||
\titem{reopen\_log} Reopen the log files after they were renamed.
|
||||
If the old files were not renamed before calling this command,
|
||||
they are automatically renamed to \term{"*-old.log"}. See section \ref{logfiles}.
|
||||
@@ -5573,8 +5594,6 @@ The most interesting ones are:
|
||||
Restore immediately from a text file dump.
|
||||
This is not recommended for big databases, as it will consume much time,
|
||||
memory and processor. In that case it's preferable to use \term{backup} and \term{install\_fallback}.
|
||||
%%More information about backuping can
|
||||
%% be found in section~\ref{backup}.
|
||||
\titem{import\_piefxis, export\_piefxis, export\_piefxis\_host} \ind{migrate between servers}
|
||||
These options can be used to migrate accounts
|
||||
using \xepref{0227} formatted XML files
|
||||
@@ -5587,20 +5606,45 @@ The most interesting ones are:
|
||||
from other Jabber/XMPP servers
|
||||
There exist tutorials to
|
||||
\footahref{http://www.ejabberd.im/migrate-to-ejabberd}{migrate from other software to ejabberd}.
|
||||
\titem{set\_master nodename}
|
||||
Set master node of the clustered Mnesia tables.
|
||||
If you provide as nodename "self", this node will be set as its own master.
|
||||
\titem{mnesia\_change\_nodename oldnodename newnodename oldbackup newbackup}
|
||||
Change the erlang node name in a backup file
|
||||
\titem{export2odbc virtualhost directory} \ind{export mnesia data to SQL files}
|
||||
Export virtual host information from Mnesia tables to SQL files.
|
||||
\titem{update\_list} List modified modules that can be updated
|
||||
\titem{update module} Update the given module, or use the keyword: all
|
||||
\titem{reload\_config} Reload ejabberd configuration file into memory
|
||||
\titem{delete\_expired\_messages} This option can be used to delete old messages
|
||||
in offline storage. This might be useful when the number of offline messages
|
||||
is very high.
|
||||
\titem{delete\_old\_messages days} Delete offline messages older than the given days.
|
||||
\titem{incoming\_s2s\_number} Number of incoming s2s connections on the node
|
||||
\titem{outgoing\_s2s\_number} Number of outgoing s2s connections on the node
|
||||
\titem{register user host password} Register an account in that domain with the given password.
|
||||
\titem{unregister user host} Unregister the given account.
|
||||
\titem{registered\_users host} List all registered users in HOST
|
||||
\titem{connected\_users} List all established sessions
|
||||
\titem{connected\_users\_number} Get the number of established sessions
|
||||
\titem{user\_resources user host} List user's connected resources
|
||||
\titem{kick\_user user host} Disconnect user's active sessions
|
||||
|
||||
\end{description}
|
||||
|
||||
\makesubsection{accesscommands}{Restrict Execution with AccessCommands}
|
||||
|
||||
The frontends can be configured to restrict access to certain commands.
|
||||
The frontends can be configured to restrict access to certain commands
|
||||
using the \term{AccessCommands}.
|
||||
In that case, authentication information must be provided.
|
||||
|
||||
This option allows quite complex settings, so it does not use the YAML format,
|
||||
instead it uses the Erlang format.
|
||||
If you want to set that option,
|
||||
then you must move the frontend definition to another config file
|
||||
and include it using the \term{include\_config\_file} option
|
||||
(see section~\ref{includeconfigfile} and the example below).
|
||||
|
||||
In each frontend the \term{AccessCommands} option is defined
|
||||
in a different place. But in all cases the option syntax is the same:
|
||||
\begin{verbatim}
|
||||
@@ -5658,6 +5702,34 @@ See another list of restrictions (the corresponding ACL and ACCESS are not shown
|
||||
]
|
||||
\end{verbatim}
|
||||
|
||||
In summary, you put the frontends configurations in a CFG file using Erlang format, for example a file called \term{additional.cfg}:
|
||||
\begin{verbatim}
|
||||
{ejabberdctl_access_commands, [ {ctlaccess, [registered_users, register], []} ]}.
|
||||
|
||||
{listen, [
|
||||
{4560, ejabberd_xmlrpc, [{maxsessions, 10}, {timeout, 5000},
|
||||
{access_commands, [
|
||||
{ctlaccess, [registered_users], [{host, "localhost"}]}
|
||||
]}
|
||||
]}
|
||||
]}.
|
||||
|
||||
{modules, [
|
||||
{mod_rest, [
|
||||
{allowed_ips, [ {127,0,0,1}, {192,168,1,12} ]},
|
||||
{allowed_destinations, [ "nolan@localhost", "admin@example.com" ]},
|
||||
{allowed_stanza_types, [ "message", "presence", "iq" ]},
|
||||
{access_commands, [
|
||||
{ctlaccess, [registered_users], [{host, "localhost"}]}
|
||||
]}
|
||||
]}
|
||||
]}.
|
||||
\end{verbatim}
|
||||
and then add this line at the end of your main ejabberd configuration file, usually called \term{ejabberd.yml}:
|
||||
\begin{verbatim}
|
||||
include_config_file: "/etc/ejabberd/additional.cfg"
|
||||
\end{verbatim}
|
||||
|
||||
\makesection{webadmin}{Web Admin}
|
||||
\ind{web admin}
|
||||
|
||||
@@ -6376,7 +6448,7 @@ Thanks to all people who contributed to this guide:
|
||||
\makechapter{copyright}{Copyright Information}
|
||||
|
||||
Ejabberd Installation and Operation Guide.\\
|
||||
Copyright \copyright{} 2003 --- 2014 ProcessOne
|
||||
Copyright \copyright{} 2003 --- 2015 ProcessOne
|
||||
|
||||
This document is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
||||
@@ -69,7 +69,7 @@ Peter Saint-Andr\'e, Executive Director of the Jabber Software Foundation}
|
||||
\item \marking{Internationalized:} \ejabberd{} leads in internationalization. Hence it is very well suited in a globalized world. Related features are:
|
||||
\begin{itemize}
|
||||
\item Translated to 25 languages. %%\improved{}
|
||||
\item Support for \footahref{http://www.ietf.org/rfc/rfc3490.txt}{IDNA}.
|
||||
\item Support for \footahref{http://tools.ietf.org/html/rfc3490}{IDNA}.
|
||||
\end{itemize}
|
||||
|
||||
\item \marking{Open Standards:} \ejabberd{} is the first Open Source Jabber server claiming to fully comply to the XMPP standard.
|
||||
|
||||
@@ -148,6 +148,17 @@
|
||||
#
|
||||
#EJABBERD_PID_PATH=/var/run/ejabberd/ejabberd.pid
|
||||
|
||||
#.
|
||||
#' EJABBERD_CONFIG_PATH: ejabberd configuration file
|
||||
#
|
||||
# Specify the full path to the ejabberd configuration file. If the file name has
|
||||
# a ".yml" extension, it is parsed as a YAML file; otherwise, Erlang syntax is
|
||||
# expected.
|
||||
#
|
||||
# Default: $ETC_DIR/ejabberd.yml
|
||||
#
|
||||
#EJABBERD_CONFIG_PATH=/etc/ejabberd/ejabberd.yml
|
||||
|
||||
#.
|
||||
#'
|
||||
# vim: foldmarker=#',#. foldmethod=marker:
|
||||
|
||||
+75
-30
@@ -12,6 +12,7 @@ ERLANG_NODE=ejabberd@localhost
|
||||
# define default environment variables
|
||||
SCRIPT_DIR=`cd ${0%/*} && pwd`
|
||||
ERL={{erl}}
|
||||
IEX={{bindir}}/iex
|
||||
INSTALLUSER={{installuser}}
|
||||
|
||||
# Compatibility in ZSH
|
||||
@@ -128,6 +129,7 @@ if [ "$ERLANG_NODE" = "${ERLANG_NODE%.*}" ] ; then
|
||||
else
|
||||
NAME="-name"
|
||||
fi
|
||||
IEXNAME="-$NAME"
|
||||
|
||||
# define ejabberd environment parameters
|
||||
if [ "$EJABBERD_CONFIG_PATH" != "${EJABBERD_CONFIG_PATH%.yml}" ] ; then
|
||||
@@ -182,6 +184,67 @@ start()
|
||||
|
||||
# attach to server
|
||||
debug()
|
||||
{
|
||||
debugwarning
|
||||
TTY=`tty | sed -e 's/.*\///g'`
|
||||
$EXEC_CMD "$ERL \
|
||||
$NAME debug-${TTY}-${ERLANG_NODE} \
|
||||
-remsh $ERLANG_NODE \
|
||||
-hidden \
|
||||
$KERNEL_OPTS \
|
||||
$ERLANG_OPTS $ARGS \"$@\""
|
||||
}
|
||||
|
||||
# attach to server using Elixir
|
||||
iexdebug()
|
||||
{
|
||||
debugwarning
|
||||
TTY=`tty | sed -e 's/.*\///g'`
|
||||
# Elixir shell is hidden as default
|
||||
$EXEC_CMD "$IEX \
|
||||
$IEXNAME debug-${TTY}-${ERLANG_NODE} \
|
||||
--remsh $ERLANG_NODE \
|
||||
--erl \"$KERNEL_OPTS\" \
|
||||
--erl \"$ERLANG_OPTS\" --erl \"$ARGS\" --erl \"$@\""
|
||||
}
|
||||
|
||||
# start interactive server
|
||||
live()
|
||||
{
|
||||
livewarning
|
||||
$EXEC_CMD "$ERL \
|
||||
$NAME $ERLANG_NODE \
|
||||
-pa $EJABBERD_EBIN_PATH \
|
||||
-mnesia dir \"\\\"$SPOOL_DIR\\\"\" \
|
||||
$KERNEL_OPTS \
|
||||
$EJABBERD_OPTS \
|
||||
-s ejabberd \
|
||||
$ERLANG_OPTS $ARGS \"$@\""
|
||||
}
|
||||
|
||||
# start interactive server with Elixir
|
||||
iexlive()
|
||||
{
|
||||
livewarning
|
||||
$EXEC_CMD "$IEX \
|
||||
$IEXNAME $ERLANG_NODE \
|
||||
-pa $EJABBERD_EBIN_PATH \
|
||||
--erl \"-mnesia dir \\\"$SPOOL_DIR\\\"\" \
|
||||
--erl \"$KERNEL_OPTS\" \
|
||||
--erl \"$EJABBERD_OPTS\" \
|
||||
--app ejabberd \
|
||||
--erl \"$ERLANG_OPTS\" --erl $ARGS --erl \"$@\""
|
||||
}
|
||||
|
||||
etop()
|
||||
{
|
||||
$EXEC_CMD "$ERL \
|
||||
$NAME debug-${TTY}-${ERLANG_NODE} \
|
||||
-hidden -s etop -s erlang halt -output text -node $ERLANG_NODE"
|
||||
}
|
||||
|
||||
# TODO: refactor debug warning and livewarning
|
||||
debugwarning()
|
||||
{
|
||||
if [ "$EJABBERD_BYPASS_WARNINGS" != "true" ] ; then
|
||||
echo "--------------------------------------------------------------------"
|
||||
@@ -199,21 +262,13 @@ debug()
|
||||
echo "--------------------------------------------------------------------"
|
||||
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
|
||||
echo " EJABBERD_BYPASS_WARNINGS=true"
|
||||
echo "Press any key to continue"
|
||||
echo "Press return to continue"
|
||||
read foo
|
||||
echo ""
|
||||
fi
|
||||
TTY=`tty | sed -e 's/.*\///g'`
|
||||
$EXEC_CMD "$ERL \
|
||||
$NAME debug-${TTY}-${ERLANG_NODE} \
|
||||
-remsh $ERLANG_NODE \
|
||||
-hidden \
|
||||
$KERNEL_OPTS \
|
||||
$ERLANG_OPTS $ARGS \"$@\""
|
||||
fi
|
||||
}
|
||||
|
||||
# start interactive server
|
||||
live()
|
||||
livewarning()
|
||||
{
|
||||
check_start
|
||||
if [ "$EJABBERD_BYPASS_WARNINGS" != "true" ] ; then
|
||||
@@ -231,34 +286,22 @@ live()
|
||||
echo "--------------------------------------------------------------------"
|
||||
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
|
||||
echo " EJABBERD_BYPASS_WARNINGS=true"
|
||||
echo "Press any key to continue"
|
||||
echo "Press return to continue"
|
||||
read foo
|
||||
echo ""
|
||||
fi
|
||||
$EXEC_CMD "$ERL \
|
||||
$NAME $ERLANG_NODE \
|
||||
-pa $EJABBERD_EBIN_PATH \
|
||||
-mnesia dir \"\\\"$SPOOL_DIR\\\"\" \
|
||||
$KERNEL_OPTS \
|
||||
$EJABBERD_OPTS \
|
||||
-s ejabberd \
|
||||
$ERLANG_OPTS $ARGS \"$@\""
|
||||
}
|
||||
|
||||
etop()
|
||||
{
|
||||
$EXEC_CMD "$ERL \
|
||||
$NAME debug-${TTY}-${ERLANG_NODE} \
|
||||
-hidden -s etop -s erlang halt -output text -node $ERLANG_NODE"
|
||||
}
|
||||
|
||||
# TODO: Make iex command display only if ejabberd Elixir support has been enabled
|
||||
help()
|
||||
{
|
||||
echo ""
|
||||
echo "Commands to start an ejabberd node:"
|
||||
echo " start Start an ejabberd node in server mode"
|
||||
echo " debug Attach an interactive Erlang shell to a running ejabberd node"
|
||||
echo " live Start an ejabberd node in live (interactive) mode"
|
||||
echo " start Start an ejabberd node in server mode"
|
||||
echo " debug Attach an interactive Erlang shell to a running ejabberd node"
|
||||
echo " iexdebug Attach an interactive Elixir shell to a running ejabberd node"
|
||||
echo " live Start an ejabberd node in live (interactive) mode"
|
||||
echo " iexlive Start an ejabberd node in live (interactive) mode, within an Elixir shell"
|
||||
echo ""
|
||||
echo "Optional parameters when starting an ejabberd node:"
|
||||
echo " --config-dir dir Config ejabberd: $ETC_DIR"
|
||||
@@ -409,7 +452,9 @@ wait_for_status()
|
||||
case $ARGS in
|
||||
' start') start;;
|
||||
' debug') debug;;
|
||||
' iexdebug') iexdebug;;
|
||||
' live') live;;
|
||||
' iexlive') iexlive;;
|
||||
' etop') etop;;
|
||||
' started') wait_for_status 0 30 2;; # wait 30x2s before timeout
|
||||
' stopped') wait_for_status 3 15 2 && stop_epmd;; # wait 15x2s before timeout
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
%%% RFC 1928 constants.
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+3
-3
@@ -13,12 +13,12 @@
|
||||
%%%
|
||||
%%%
|
||||
%%% The Initial Developer of the Original Code is ProcessOne.
|
||||
%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne
|
||||
%%% Portions created by ProcessOne are Copyright 2006-2015, ProcessOne
|
||||
%%% All Rights Reserved.''
|
||||
%%% This software is copyright 2006-2014, ProcessOne.
|
||||
%%% This software is copyright 2006-2015, ProcessOne.
|
||||
%%%
|
||||
%%%
|
||||
%%% copyright 2006-2014 ProcessOne
|
||||
%%% copyright 2006-2015 ProcessOne
|
||||
%%%
|
||||
%%% This file contains pubsub types definition.
|
||||
%%% ====================================================================
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
defmodule Ejabberd.Hooks do
|
||||
|
||||
# Generic hook setting features
|
||||
def add(hook_name, host, module, function, priority) do
|
||||
:ejabberd_hooks.add(hook_name, host, module, function, priority)
|
||||
end
|
||||
|
||||
# Should be named 'removed'
|
||||
def delete(hook_name, host, module, function, priority) do
|
||||
:ejabberd_hooks.delete(hook_name, host, module, function, priority)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
defmodule Ejabberd.Logger do
|
||||
|
||||
def critical(message, args \\ []), do: :lager.log(:critical, [], message, args)
|
||||
def error(message, args \\ []), do: :lager.log(:error, [], message, args)
|
||||
def warning(message, args \\ []), do: :lager.log(:warning, [], message, args)
|
||||
def info(message, args \\ []), do: :lager.log(:info, [], message, args)
|
||||
def debug(message, args \\ []), do: :lager.log(:debug, [], message, args)
|
||||
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
defmodule Ejabberd do
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
defmodule ModPresenceDemo do
|
||||
import Ejabberd.Logger # this allow using info, error, etc for logging
|
||||
@behaviour :gen_mod
|
||||
|
||||
def start(host, _opts) do
|
||||
info('Starting ejabberd module Presence Demo')
|
||||
Ejabberd.Hooks.add(:set_presence_hook, host, __ENV__.module, :on_presence, 50)
|
||||
:ok
|
||||
end
|
||||
|
||||
def stop(host) do
|
||||
info('Stopping ejabberd module Presence Demo')
|
||||
Ejabberd.Hooks.delete(:set_presence_hook, host, __ENV__.module, :on_presence, 50)
|
||||
:ok
|
||||
end
|
||||
|
||||
def on_presence(user, _server, _resource, _packet) do
|
||||
info('Receive presence for #{user}')
|
||||
:none
|
||||
end
|
||||
end
|
||||
+11
-1
@@ -95,6 +95,9 @@ CfgDeps = lists:flatmap(
|
||||
{tag, "1.4.2"}}}];
|
||||
({json, true}) ->
|
||||
[{jiffy, ".*", {git, "git://github.com/davisp/jiffy"}}];
|
||||
({elixir, true}) ->
|
||||
[{rebar_elixir_plugin, ".*", {git, "git://github.com/yrashk/rebar_elixir_plugin"}},
|
||||
{elixir, "1.1.*", {git, "git://github.com/elixir-lang/elixir"}}];
|
||||
({iconv, true}) ->
|
||||
[{p1_iconv, ".*", {git, "git://github.com/processone/eiconv"}}];
|
||||
({lager, true}) ->
|
||||
@@ -142,6 +145,13 @@ CfgXrefs = lists:flatmap(
|
||||
[]
|
||||
end, Cfg),
|
||||
|
||||
ElixirConfig = case lists:keysearch(elixir, 1, Cfg) of
|
||||
{value, {elixir, true}} ->
|
||||
[{plugins, [rebar_elixir_compiler, rebar_exunit] },
|
||||
{lib_dirs, ["deps/elixir/lib"]}];
|
||||
_ ->
|
||||
[]
|
||||
end,
|
||||
|
||||
{ok, Cwd} = file:get_cwd(),
|
||||
|
||||
@@ -157,7 +167,7 @@ Config = [{erl_opts, Macros ++ HiPE ++ DebugInfo ++
|
||||
[{"(XC - UC) || (XU - X - B - "
|
||||
++ string:join(CfgXrefs, " - ") ++ ")", []}]},
|
||||
{post_hooks, PostHooks ++ CfgPostHooks},
|
||||
{deps, Deps ++ CfgDeps}],
|
||||
{deps, Deps ++ CfgDeps}] ++ ElixirConfig,
|
||||
%%io:format("ejabberd configuration:~n ~p~n", [Config]),
|
||||
Config.
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
* ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
* ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
* ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
--
|
||||
-- ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
-- ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
--
|
||||
-- ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
-- ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 18 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Oct 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Mar 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% Created : 23 Aug 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 11 Mar 2003 by Alexey Shchepin <alexey@sevcom.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Mar 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 7 Aug 2011 by Stephen Röttger <stephen.roettger@googlemail.com>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -76,9 +76,11 @@ mech_step(#state{step = 2} = State, ClientIn) ->
|
||||
UserName ->
|
||||
case parse_attribute(ClientNonceAttribute) of
|
||||
{$r, ClientNonce} ->
|
||||
case (State#state.get_password)(UserName) of
|
||||
{Ret, _AuthModule} = (State#state.get_password)(UserName),
|
||||
case {Ret, jlib:resourceprep(Ret)} of
|
||||
{false, _} -> {error, <<"not-authorized">>, UserName};
|
||||
{Ret, _AuthModule} ->
|
||||
{_, error} when is_binary(Ret) -> ?WARNING_MSG("invalid plain password", []), {error, <<"not-authorized">>, UserName};
|
||||
{Ret, _} ->
|
||||
{StoredKey, ServerKey, Salt, IterationCount} =
|
||||
if is_tuple(Ret) -> Ret;
|
||||
true ->
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+16
-4
@@ -5,7 +5,7 @@
|
||||
%%% Created : 7 May 2006 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -31,6 +31,7 @@
|
||||
status/0, reopen_log/0,
|
||||
stop_kindly/2, send_service_message_all_mucs/2,
|
||||
registered_vhosts/0,
|
||||
reload_config/0,
|
||||
%% Erlang
|
||||
update_list/0, update/1,
|
||||
%% Accounts
|
||||
@@ -134,6 +135,11 @@ commands() ->
|
||||
module = ?MODULE, function = registered_vhosts,
|
||||
args = [],
|
||||
result = {vhosts, {list, {vhost, string}}}},
|
||||
#ejabberd_commands{name = reload_config, tags = [server],
|
||||
desc = "Reload ejabberd configuration file into memory",
|
||||
module = ?MODULE, function = reload_config,
|
||||
args = [],
|
||||
result = {res, rescode}},
|
||||
|
||||
#ejabberd_commands{name = import_file, tags = [mnesia],
|
||||
desc = "Import user data from jabberd14 spool file",
|
||||
@@ -252,9 +258,10 @@ reopen_log() ->
|
||||
%%% Stop Kindly
|
||||
%%%
|
||||
|
||||
stop_kindly(DelaySeconds, AnnouncementText) ->
|
||||
Subject = io_lib:format("Server stop in ~p seconds!", [DelaySeconds]),
|
||||
WaitingDesc = io_lib:format("Waiting ~p seconds", [DelaySeconds]),
|
||||
stop_kindly(DelaySeconds, AnnouncementTextString) ->
|
||||
Subject = list_to_binary(io_lib:format("Server stop in ~p seconds!", [DelaySeconds])),
|
||||
WaitingDesc = list_to_binary(io_lib:format("Waiting ~p seconds", [DelaySeconds])),
|
||||
AnnouncementText = list_to_binary(AnnouncementTextString),
|
||||
Steps = [
|
||||
{"Stopping ejabberd port listeners",
|
||||
ejabberd_listener, stop_listeners, []},
|
||||
@@ -351,6 +358,11 @@ registered_users(Host) ->
|
||||
registered_vhosts() ->
|
||||
?MYHOSTS.
|
||||
|
||||
reload_config() ->
|
||||
ejabberd_config:reload_file(),
|
||||
acl:start(),
|
||||
shaper:start().
|
||||
|
||||
%%%
|
||||
%%% Migration management
|
||||
%%%
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -300,7 +300,7 @@ get_password_with_authmodule(User, Server) ->
|
||||
|
||||
-spec is_user_exists(binary(), binary()) -> boolean().
|
||||
|
||||
is_user_exists(User, <<"">>) ->
|
||||
is_user_exists(_User, <<"">>) ->
|
||||
false;
|
||||
|
||||
is_user_exists(User, Server) ->
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 17 Feb 2006 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -77,10 +77,7 @@ update_reg_users_counter_table(Server) ->
|
||||
mnesia:sync_dirty(F).
|
||||
|
||||
plain_password_required() ->
|
||||
case is_scrammed() of
|
||||
false -> false;
|
||||
true -> true
|
||||
end.
|
||||
is_scrammed().
|
||||
|
||||
store_type() ->
|
||||
case is_scrammed() of
|
||||
@@ -150,7 +147,7 @@ set_password(User, Server, Password) ->
|
||||
ok
|
||||
end.
|
||||
|
||||
%% @spec (User, Server, Password) -> {atomic, ok} | {atomic, exists} | {error, invalid_jid} | {aborted, Reason}
|
||||
%% @spec (User, Server, Password) -> {atomic, ok} | {atomic, exists} | {error, invalid_jid} | {error, not_allowed} | {error, Reason}
|
||||
try_register(User, Server, PasswordList) ->
|
||||
LUser = jlib:nodeprep(User),
|
||||
LServer = jlib:nameprep(Server),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 5 Jul 2007 by Evgeniy Khramtsov <xram@jabber.ru>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Nov 2012 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2012 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% Created : 2 Nov 2007 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+10
-10
@@ -5,7 +5,7 @@
|
||||
%%% Created : 26 Apr 2008 by Evgeniy Khramtsov <xramtsov@gmail.com>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -549,10 +549,11 @@ get_transfer_protocol(PortString) ->
|
||||
|
||||
get_port_listeners(PortNumber) ->
|
||||
AllListeners = ejabberd_config:get_option(listen, fun(V) -> V end),
|
||||
lists:filter(fun ({{Port, _Ip, _Netp}, _Module1,
|
||||
_Opts1})
|
||||
when Port == PortNumber ->
|
||||
true;
|
||||
lists:filter(fun (Listener) when is_list(Listener) ->
|
||||
case proplists:get_value(port, Listener) of
|
||||
PortNumber -> true;
|
||||
_ -> false
|
||||
end;
|
||||
(_) -> false
|
||||
end,
|
||||
AllListeners).
|
||||
@@ -562,12 +563,11 @@ get_captcha_transfer_protocol([]) ->
|
||||
"is not a ejabberd_http listener with "
|
||||
"'captcha' option. Change the port number "
|
||||
"or specify http:// in that option.">>);
|
||||
get_captcha_transfer_protocol([{{_Port, _Ip, tcp},
|
||||
ejabberd_http, Opts}
|
||||
| Listeners]) ->
|
||||
case lists:member(captcha, Opts) of
|
||||
get_captcha_transfer_protocol([Listener | Listeners]) when is_list(Listener) ->
|
||||
case proplists:get_value(module, Listener) == ejabberd_http andalso
|
||||
proplists:get_bool(captcha, Listener) of
|
||||
true ->
|
||||
case lists:member(tls, Opts) of
|
||||
case proplists:get_bool(tls, Listener) of
|
||||
true -> https;
|
||||
false -> http
|
||||
end;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 20 May 2008 by Badlop <badlop@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -399,7 +399,14 @@ check_auth({User, Server, Password}) ->
|
||||
check_access(all, _) ->
|
||||
true;
|
||||
check_access(Access, Auth) ->
|
||||
{ok, User, Server} = check_auth(Auth),
|
||||
case check_auth(Auth) of
|
||||
{ok, User, Server} ->
|
||||
check_access(Access, User, Server);
|
||||
_ ->
|
||||
false
|
||||
end.
|
||||
|
||||
check_access(Access, User, Server) ->
|
||||
%% Check this user has access permission
|
||||
case acl:match_rule(Server, Access, jlib:make_jid(User, Server, <<"">>)) of
|
||||
allow -> true;
|
||||
|
||||
+60
-24
@@ -5,7 +5,7 @@
|
||||
%%% Created : 14 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -26,7 +26,7 @@
|
||||
-module(ejabberd_config).
|
||||
-author('alexey@process-one.net').
|
||||
|
||||
-export([start/0, load_file/1, read_file/1,
|
||||
-export([start/0, load_file/1, reload_file/0, read_file/1,
|
||||
add_global_option/2, add_local_option/2,
|
||||
get_global_option/2, get_local_option/2,
|
||||
get_global_option/3, get_local_option/3,
|
||||
@@ -125,6 +125,12 @@ load_file(File) ->
|
||||
State = read_file(File),
|
||||
set_opts(State).
|
||||
|
||||
-spec reload_file() -> ok.
|
||||
|
||||
reload_file() ->
|
||||
Config = get_ejabberd_config_path(),
|
||||
load_file(Config).
|
||||
|
||||
-spec convert_to_yaml(file:filename()) -> ok | {error, any()}.
|
||||
|
||||
convert_to_yaml(File) ->
|
||||
@@ -184,7 +190,7 @@ consult(File) ->
|
||||
{ok, []} ->
|
||||
{ok, []};
|
||||
{ok, [Document|_]} ->
|
||||
{ok, Document};
|
||||
{ok, parserl(Document)};
|
||||
{error, Err} ->
|
||||
Msg1 = "Cannot load " ++ File ++ ": ",
|
||||
Msg2 = p1_yaml:format_error(Err),
|
||||
@@ -201,6 +207,17 @@ consult(File) ->
|
||||
end
|
||||
end.
|
||||
|
||||
parserl(<<"> ", Term/binary>>) ->
|
||||
{ok, A2, _} = erl_scan:string(binary_to_list(Term)),
|
||||
{ok, A3} = erl_parse:parse_term(A2),
|
||||
A3;
|
||||
parserl({A, B}) ->
|
||||
{parserl(A), parserl(B)};
|
||||
parserl([El|Tail]) ->
|
||||
[parserl(El) | parserl(Tail)];
|
||||
parserl(Other) ->
|
||||
Other.
|
||||
|
||||
%% @doc Convert configuration filename to absolute path.
|
||||
%% Input is an absolute or relative path to an ejabberd configuration file.
|
||||
%% And returns an absolute path to the configuration file.
|
||||
@@ -690,26 +707,40 @@ replace_module(mod_roster_odbc) -> {mod_roster, odbc};
|
||||
replace_module(mod_shared_roster_odbc) -> {mod_shared_roster, odbc};
|
||||
replace_module(mod_vcard_odbc) -> {mod_vcard, odbc};
|
||||
replace_module(mod_vcard_xupdate_odbc) -> {mod_vcard_xupdate, odbc};
|
||||
replace_module(Module) -> Module.
|
||||
replace_module(Module) ->
|
||||
case is_elixir_module(Module) of
|
||||
true -> expand_elixir_module(Module);
|
||||
false -> Module
|
||||
end.
|
||||
|
||||
replace_modules(Modules) ->
|
||||
lists:map(
|
||||
fun({Module, Opts}) ->
|
||||
case replace_module(Module) of
|
||||
{NewModule, DBType} ->
|
||||
emit_deprecation_warning(Module, NewModule, DBType),
|
||||
NewOpts = [{db_type, DBType} |
|
||||
lists:keydelete(db_type, 1, Opts)],
|
||||
{NewModule, transform_module_options(Module, NewOpts)};
|
||||
NewModule ->
|
||||
if Module /= NewModule ->
|
||||
emit_deprecation_warning(Module, NewModule);
|
||||
true ->
|
||||
ok
|
||||
end,
|
||||
{NewModule, transform_module_options(Module, Opts)}
|
||||
end
|
||||
end, Modules).
|
||||
replace_modules(Modules) -> lists:map( fun({Module, Opts}) -> case
|
||||
replace_module(Module) of {NewModule, DBType} ->
|
||||
emit_deprecation_warning(Module, NewModule, DBType), NewOpts =
|
||||
[{db_type, DBType} | lists:keydelete(db_type, 1, Opts)],
|
||||
{NewModule, transform_module_options(Module, NewOpts)}; NewModule
|
||||
-> if Module /= NewModule -> emit_deprecation_warning(Module,
|
||||
NewModule); true -> ok end, {NewModule,
|
||||
transform_module_options(Module, Opts)} end end, Modules).
|
||||
|
||||
%% Elixir module naming
|
||||
%% ====================
|
||||
|
||||
%% If module name start with uppercase letter, this is an Elixir module:
|
||||
is_elixir_module(Module) ->
|
||||
case atom_to_list(Module) of
|
||||
[H|_] when H >= 65, H =< 90 -> true;
|
||||
_ ->false
|
||||
end.
|
||||
|
||||
%% We assume we know this is an elixir module
|
||||
expand_elixir_module(Module) ->
|
||||
case atom_to_list(Module) of
|
||||
%% Module name already specified as an Elixir from Erlang module name
|
||||
"Elixir." ++ _ -> Module;
|
||||
%% if start with uppercase letter, this is an Elixir module: Append 'Elixir.' to module name.
|
||||
ModuleString ->
|
||||
list_to_atom("Elixir." ++ ModuleString)
|
||||
end.
|
||||
|
||||
strings_to_binary([]) ->
|
||||
[];
|
||||
@@ -992,5 +1023,10 @@ emit_deprecation_warning(Module, NewModule, DBType) ->
|
||||
" instead", [Module, NewModule, DBType]).
|
||||
|
||||
emit_deprecation_warning(Module, NewModule) ->
|
||||
?WARNING_MSG("Module ~s is deprecated, use ~s instead",
|
||||
[Module, NewModule]).
|
||||
case is_elixir_module(NewModule) of
|
||||
%% Do not emit deprecation warning for Elixir
|
||||
true -> ok;
|
||||
false ->
|
||||
?WARNING_MSG("Module ~s is deprecated, use ~s instead",
|
||||
[Module, NewModule])
|
||||
end.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 11 Jan 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -210,7 +210,7 @@ process(Args) ->
|
||||
|
||||
%% @spec (Args::[string()], AccessCommands) -> {String::string(), Code::integer()}
|
||||
process2(["--auth", User, Server, Pass | Args], AccessCommands) ->
|
||||
process2(Args, {User, Server, Pass}, AccessCommands);
|
||||
process2(Args, {list_to_binary(User), list_to_binary(Server), list_to_binary(Pass)}, AccessCommands);
|
||||
process2(Args, AccessCommands) ->
|
||||
process2(Args, noauth, AccessCommands).
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Aug 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Aug 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 27 Feb 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -280,7 +280,7 @@ process_header(State, Data) ->
|
||||
[]),
|
||||
throw(http_request_no_host_header);
|
||||
{ok, http_eoh} ->
|
||||
?DEBUG("(~w) http query: ~w ~s~n",
|
||||
?DEBUG("(~w) http query: ~w ~p~n",
|
||||
[State#state.socket, State#state.request_method,
|
||||
element(2, State#state.request_path)]),
|
||||
{HostProvided, Port, TP} =
|
||||
@@ -299,13 +299,16 @@ process_header(State, Data) ->
|
||||
_ -> ok
|
||||
end,
|
||||
#state{sockmod = SockMod, socket = Socket,
|
||||
options = State#state.options,
|
||||
request_handlers = State#state.request_handlers};
|
||||
_ ->
|
||||
#state{end_of_request = true,
|
||||
options = State#state.options,
|
||||
request_handlers = State#state.request_handlers}
|
||||
end;
|
||||
_ ->
|
||||
#state{end_of_request = true,
|
||||
options = State#state.options,
|
||||
request_handlers = State#state.request_handlers}
|
||||
end.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 4 Mar 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 30 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
%%% Created : 12 May 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2013 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2013-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -61,9 +61,9 @@ get_log_path() ->
|
||||
|
||||
-ifdef(LAGER).
|
||||
|
||||
get_pos_integer_env(Name, Default) ->
|
||||
get_integer_env(Name, Default) ->
|
||||
case application:get_env(ejabberd, Name) of
|
||||
{ok, I} when is_integer(I), I>0 ->
|
||||
{ok, I} when is_integer(I), I>=0 ->
|
||||
I;
|
||||
undefined ->
|
||||
Default;
|
||||
@@ -73,7 +73,7 @@ get_pos_integer_env(Name, Default) ->
|
||||
[Name, Junk, Default]),
|
||||
Default
|
||||
end.
|
||||
get_pos_string_env(Name, Default) ->
|
||||
get_string_env(Name, Default) ->
|
||||
case application:get_env(ejabberd, Name) of
|
||||
{ok, L} when is_list(L) ->
|
||||
L;
|
||||
@@ -94,10 +94,10 @@ start() ->
|
||||
Dir = filename:dirname(ConsoleLog),
|
||||
ErrorLog = filename:join([Dir, "error.log"]),
|
||||
CrashLog = filename:join([Dir, "crash.log"]),
|
||||
LogRotateDate = get_pos_string_env(log_rotate_date, ""),
|
||||
LogRotateSize = get_pos_integer_env(log_rotate_size, 10*1024*1024),
|
||||
LogRotateCount = get_pos_integer_env(log_rotate_count, 1),
|
||||
LogRateLimit = get_pos_integer_env(log_rate_limit, 100),
|
||||
LogRotateDate = get_string_env(log_rotate_date, ""),
|
||||
LogRotateSize = get_integer_env(log_rotate_size, 10*1024*1024),
|
||||
LogRotateCount = get_integer_env(log_rotate_count, 1),
|
||||
LogRateLimit = get_integer_env(log_rate_limit, 100),
|
||||
application:set_env(lager, error_logger_hwm, LogRateLimit),
|
||||
application:set_env(
|
||||
lager, handlers,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 1 Nov 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 22 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
%%% @doc
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 10 Nov 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Dec 2011 by Badlop
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
%%% Interface for Riak database
|
||||
%%% @end
|
||||
%%% Created : 29 Dec 2011 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%% @copyright (C) 2002-2014 ProcessOne
|
||||
%%% @copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 29 Dec 2011 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2011 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 27 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 7 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 24 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -604,7 +604,7 @@ do_route(From, To, #xmlel{} = Packet) ->
|
||||
?ERR_SERVICE_UNAVAILABLE),
|
||||
ejabberd_router:route(To, From, Err)
|
||||
end;
|
||||
_ -> ?DEBUG("packet droped~n", [])
|
||||
_ -> ?DEBUG("packet dropped~n", [])
|
||||
end;
|
||||
Ss ->
|
||||
Session = lists:max(Ss),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Aug 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,6 +5,23 @@
|
||||
%%%
|
||||
%%% @end
|
||||
%%% Created : 8 May 2014 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2013-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
%%% published by the Free Software Foundation; either version 2 of the
|
||||
%%% License, or (at your option) any later version.
|
||||
%%%
|
||||
%%% This program is distributed in the hope that it will be useful,
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License along
|
||||
%%% with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(ejabberd_stun).
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 21 Mar 2007 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 18 Jul 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -36,4 +36,4 @@ init(Module) ->
|
||||
{ok,
|
||||
{{simple_one_for_one, 10, 1},
|
||||
[{undefined, {Module, start_link, []}, temporary,
|
||||
brutal_kill, worker, [Module]}]}}.
|
||||
1000, worker, [Module]}]}}.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 27 Jan 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% Created : 28 Feb 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 9 Apr 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -340,7 +340,7 @@ make_xhtml(Els, Host, Node, Lang, JID) ->
|
||||
?XAE(<<"div">>, [{<<"id">>, <<"copyrightouter">>}],
|
||||
[?XAE(<<"div">>, [{<<"id">>, <<"copyright">>}],
|
||||
[?XC(<<"p">>,
|
||||
<<"ejabberd (c) 2002-2014 ProcessOne">>)])])])]}}.
|
||||
<<"ejabberd (c) 2002-2015 ProcessOne">>)])])])]}}.
|
||||
|
||||
get_base_path(global, cluster) -> <<"/admin/">>;
|
||||
get_base_path(Host, cluster) ->
|
||||
|
||||
@@ -360,23 +360,17 @@ build_fault_response(Code, ParseString, ParseArgs) ->
|
||||
FaultString = "Error " ++ integer_to_list(Code) ++ "\n"
|
||||
++ lists:flatten(io_lib:format(ParseString, ParseArgs)),
|
||||
?WARNING_MSG(FaultString, []),
|
||||
{false, {response, {fault, Code, FaultString}}}.
|
||||
{false, {response, {fault, Code, list_to_binary(FaultString)}}}.
|
||||
|
||||
do_command(AccessCommands, Auth, Command, AttrL, ArgsF,
|
||||
ResultF) ->
|
||||
ArgsFormatted = format_args(AttrL, ArgsF),
|
||||
AuthBin = convert_auth(Auth),
|
||||
Result =
|
||||
ejabberd_commands:execute_command(AccessCommands, AuthBin,
|
||||
ejabberd_commands:execute_command(AccessCommands, Auth,
|
||||
Command, ArgsFormatted),
|
||||
ResultFormatted = format_result(Result, ResultF),
|
||||
{command_result, ResultFormatted}.
|
||||
|
||||
convert_auth(noauth) ->
|
||||
noauth;
|
||||
convert_auth({UserT, ServerT, PasswordT}) ->
|
||||
{list_to_binary(UserT), list_to_binary(ServerT), list_to_binary(PasswordT)}.
|
||||
|
||||
%%-----------------------------
|
||||
%% Format arguments
|
||||
%%-----------------------------
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 22 Aug 2005 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+8
-9
@@ -828,7 +828,7 @@ send_command(Command, From, S) ->
|
||||
Message = #'LDAPMessage'{messageID = Id,
|
||||
protocolOp = {Name, Request}},
|
||||
?DEBUG("~p~n", [{Name, Request}]),
|
||||
{ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage',
|
||||
{ok, Bytes} = 'ELDAPv3':encode('LDAPMessage',
|
||||
Message),
|
||||
case (S#eldap.sockmod):send(S#eldap.fd, Bytes) of
|
||||
ok ->
|
||||
@@ -863,11 +863,10 @@ gen_req({modify_dn, Entry, NewRDN, DelOldRDN,
|
||||
#'ModifyDNRequest'{entry = Entry, newrdn = NewRDN,
|
||||
deleteoldrdn = DelOldRDN, newSuperior = NewSup}};
|
||||
gen_req({modify_passwd, DN, Passwd}) ->
|
||||
{ok, ReqVal} = asn1rt:encode('ELDAPv3',
|
||||
'PasswdModifyRequestValue',
|
||||
#'PasswdModifyRequestValue'{userIdentity = DN,
|
||||
newPasswd =
|
||||
Passwd}),
|
||||
{ok, ReqVal} = 'ELDAPv3':encode('PasswdModifyRequestValue',
|
||||
#'PasswdModifyRequestValue'{userIdentity = DN,
|
||||
newPasswd =
|
||||
Passwd}),
|
||||
{extendedReq,
|
||||
#'ExtendedRequest'{requestName = ?passwdModifyOID,
|
||||
requestValue = iolist_to_binary(ReqVal)}};
|
||||
@@ -887,7 +886,7 @@ gen_req({bind, RootDN, Passwd}) ->
|
||||
%% {'EXIT', Reason} - Broke
|
||||
%%-----------------------------------------------------------------------
|
||||
recvd_packet(Pkt, S) ->
|
||||
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
|
||||
case 'ELDAPv3':decode('LDAPMessage', Pkt) of
|
||||
{ok, Msg} ->
|
||||
Op = Msg#'LDAPMessage'.protocolOp,
|
||||
?DEBUG("~p", [Op]),
|
||||
@@ -1005,7 +1004,7 @@ get_op_rec(Id, Dict) ->
|
||||
%% {'EXIT', Reason} - Broken packet
|
||||
%%-----------------------------------------------------------------------
|
||||
recvd_wait_bind_response(Pkt, S) ->
|
||||
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
|
||||
case 'ELDAPv3':decode('LDAPMessage', Pkt) of
|
||||
{ok, Msg} ->
|
||||
?DEBUG("~p", [Msg]),
|
||||
check_id(S#eldap.id, Msg#'LDAPMessage'.messageID),
|
||||
@@ -1152,7 +1151,7 @@ bind_request(Socket, S) ->
|
||||
Message = #'LDAPMessage'{messageID = Id,
|
||||
protocolOp = {bindRequest, Req}},
|
||||
?DEBUG("Bind Request Message:~p~n", [Message]),
|
||||
{ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage',
|
||||
{ok, Bytes} = 'ELDAPv3':encode('LDAPMessage',
|
||||
Message),
|
||||
case (S#eldap.sockmod):send(Socket, Bytes) of
|
||||
ok -> {ok, S#eldap{id = Id}};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% Author: Evgeniy Khramtsov <ekhramtsov@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Nov 2006 by Evgeniy Khramtsov <xram@jabber.ru>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Oct 2006 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% Created : 30 Jul 2004 by Leif Johansson <leifj@it.su.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 22 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
%%% Created : 24 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2014 ProcessOne
|
||||
%%% ejabberd, Copyright (C) 2002-2015 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user