Remove obsolete doc and win32 files (EJAB-1738)
15
Makefile.in
@ -101,10 +101,6 @@ xref: all
|
|||||||
translations:
|
translations:
|
||||||
contrib/extract_translations/prepare-translation.sh -updateall
|
contrib/extract_translations/prepare-translation.sh -updateall
|
||||||
|
|
||||||
doc:
|
|
||||||
echo making $$target in doc; \
|
|
||||||
(cd doc && $(MAKE) $$target) || exit 1
|
|
||||||
|
|
||||||
edoc:
|
edoc:
|
||||||
$(ERL) -noinput +B -eval \
|
$(ERL) -noinput +B -eval \
|
||||||
'case edoc:application(ejabberd, ".", []) of ok -> halt(0); error -> halt(1) end.'
|
'case edoc:application(ejabberd, ".", []) of ok -> halt(0); error -> halt(1) end.'
|
||||||
@ -207,16 +203,9 @@ install: all
|
|||||||
#
|
#
|
||||||
# Documentation
|
# Documentation
|
||||||
$(INSTALL) -d $(DOCDIR)
|
$(INSTALL) -d $(DOCDIR)
|
||||||
[ -f doc/dev.html ] \
|
|
||||||
&& $(INSTALL) -m 644 doc/dev.html $(DOCDIR) \
|
|
||||||
|| echo "No doc/dev.html was built"
|
|
||||||
[ -f doc/guide.html ] \
|
[ -f doc/guide.html ] \
|
||||||
&& $(INSTALL) -m 644 doc/guide.html $(DOCDIR) \
|
&& $(INSTALL) -m 644 doc/guide.html $(DOCDIR) \
|
||||||
|| echo "No doc/guide.html was built"
|
|| echo "Documentation not included in sources"
|
||||||
[ -f doc/guide.pdf ] \
|
|
||||||
&& $(INSTALL) -m 644 doc/guide.pdf $(DOCDIR) \
|
|
||||||
|| echo "No doc/guide.pdf was built"
|
|
||||||
$(INSTALL) -m 644 doc/*.png $(DOCDIR)
|
|
||||||
$(INSTALL) -m 644 COPYING $(DOCDIR)
|
$(INSTALL) -m 644 COPYING $(DOCDIR)
|
||||||
|
|
||||||
uninstall: uninstall-binary
|
uninstall: uninstall-binary
|
||||||
@ -326,6 +315,6 @@ test:
|
|||||||
quicktest:
|
quicktest:
|
||||||
$(REBAR) skip_deps=true ct suites=elixir
|
$(REBAR) skip_deps=true ct suites=elixir
|
||||||
|
|
||||||
.PHONY: src doc edoc dialyzer Makefile TAGS clean clean-rel distclean rel \
|
.PHONY: src edoc dialyzer Makefile TAGS clean clean-rel distclean rel \
|
||||||
install uninstall uninstall-binary uninstall-all translations deps test spec \
|
install uninstall uninstall-binary uninstall-all translations deps test spec \
|
||||||
quicktest erlang_plt deps_plt ejabberd_plt
|
quicktest erlang_plt deps_plt ejabberd_plt
|
||||||
|
176
Makefile.win32
@ -1,176 +0,0 @@
|
|||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
ALL : build
|
|
||||||
|
|
||||||
REL=..\release
|
|
||||||
EREL=$(REL)\ejabberd-$(EJABBERD_VERSION)
|
|
||||||
EBIN_DIR=$(EREL)\ebin
|
|
||||||
SRC_DIR=$(EREL)\src
|
|
||||||
PRIV_DIR=$(EREL)\priv
|
|
||||||
SO_DIR=$(EREL)
|
|
||||||
MSGS_DIR=$(EREL)\msgs
|
|
||||||
WIN32_DIR=$(EREL)\win32
|
|
||||||
DOC_DIR=$(EREL)\doc
|
|
||||||
|
|
||||||
NSIS_SCRIPT=win32\ejabberd.nsi
|
|
||||||
NSIS_HEADER=win32\ejabberd.nsh
|
|
||||||
|
|
||||||
installer : $(NSIS_SCRIPT) $(NSIS_HEADER)
|
|
||||||
makensis $(NSIS_SCRIPT)
|
|
||||||
|
|
||||||
$(NSIS_HEADER) : Makefile.inc
|
|
||||||
echo !define OUTFILEDIR "..\$(REL)" >$(NSIS_HEADER)
|
|
||||||
echo !define TESTDIR "..\$(REL)\ejabberd-$(EJABBERD_VERSION)" >>$(NSIS_HEADER)
|
|
||||||
echo !define VERSION "$(EJABBERD_VERSION)" >>$(NSIS_HEADER)
|
|
||||||
|
|
||||||
release_clean :
|
|
||||||
if exist $(REL) rd /s /q $(REL)
|
|
||||||
|
|
||||||
|
|
||||||
release : build release_clean
|
|
||||||
mkdir $(REL)
|
|
||||||
mkdir $(EREL)
|
|
||||||
mkdir $(EBIN_DIR)
|
|
||||||
copy *.beam $(EBIN_DIR)
|
|
||||||
@erase $(EBIN_DIR)\configure.beam
|
|
||||||
copy *.app $(EBIN_DIR)
|
|
||||||
copy *.dll $(SO_DIR)
|
|
||||||
mkdir $(MSGS_DIR)
|
|
||||||
copy msgs\*.msg $(MSGS_DIR)
|
|
||||||
mkdir $(WIN32_DIR)
|
|
||||||
copy win32\ejabberd.cfg $(EREL)
|
|
||||||
copy win32\inetrc $(EREL)
|
|
||||||
copy $(SYSTEMROOT)\system32\libeay32.dll $(EREL)
|
|
||||||
copy $(SYSTEMROOT)\system32\ssleay32.dll $(EREL)
|
|
||||||
copy win32\ejabberd.ico $(WIN32_DIR)
|
|
||||||
mkdir $(SRC_DIR)
|
|
||||||
copy *.app $(SRC_DIR)
|
|
||||||
copy *.erl $(SRC_DIR)
|
|
||||||
copy *.hrl $(SRC_DIR)
|
|
||||||
copy *.c $(SRC_DIR)
|
|
||||||
mkdir $(SRC_DIR)\eldap
|
|
||||||
copy eldap\eldap.* $(SRC_DIR)\eldap
|
|
||||||
copy eldap\ELDAPv3.asn $(SRC_DIR)\eldap
|
|
||||||
mkdir $(SRC_DIR)\mod_irc
|
|
||||||
copy mod_irc\*.erl $(SRC_DIR)\mod_irc
|
|
||||||
copy mod_irc\*.c $(SRC_DIR)\mod_irc
|
|
||||||
mkdir $(SRC_DIR)\mod_muc
|
|
||||||
copy mod_muc\*.erl $(SRC_DIR)\mod_muc
|
|
||||||
mkdir $(SRC_DIR)\mod_pubsub
|
|
||||||
copy mod_pubsub\*.erl $(SRC_DIR)\mod_pubsub
|
|
||||||
mkdir $(SRC_DIR)\mod_proxy65
|
|
||||||
copy mod_proxy65\*.erl $(SRC_DIR)\mod_proxy65
|
|
||||||
copy mod_proxy65\*.hrl $(SRC_DIR)\mod_proxy65
|
|
||||||
mkdir $(SRC_DIR)\stringprep
|
|
||||||
copy stringprep\*.erl $(SRC_DIR)\stringprep
|
|
||||||
copy stringprep\*.c $(SRC_DIR)\stringprep
|
|
||||||
copy stringprep\*.tcl $(SRC_DIR)\stringprep
|
|
||||||
mkdir $(SRC_DIR)\stun
|
|
||||||
copy stun\*.erl $(SRC_DIR)\stun
|
|
||||||
copy stun\*.hrl $(SRC_DIR)\stun
|
|
||||||
mkdir $(SRC_DIR)\tls
|
|
||||||
copy tls\*.erl $(SRC_DIR)\tls
|
|
||||||
copy tls\*.c $(SRC_DIR)\tls
|
|
||||||
mkdir $(SRC_DIR)\ejabberd_zlib
|
|
||||||
copy ejabberd_zlib\*.erl $(SRC_DIR)\ejabberd_zlib
|
|
||||||
copy ejabberd_zlib\*.c $(SRC_DIR)\ejabberd_zlib
|
|
||||||
mkdir $(SRC_DIR)\web
|
|
||||||
copy web\*.erl $(SRC_DIR)\web
|
|
||||||
mkdir $(SRC_DIR)\odbc
|
|
||||||
copy odbc\*.erl $(SRC_DIR)\odbc
|
|
||||||
copy odbc\*.sql $(EREL)
|
|
||||||
mkdir $(DOC_DIR)
|
|
||||||
copy ..\doc\*.txt $(DOC_DIR)
|
|
||||||
copy ..\doc\*.html $(DOC_DIR)
|
|
||||||
copy ..\doc\*.png $(DOC_DIR)
|
|
||||||
|
|
||||||
SOURCE = expat_erl.c
|
|
||||||
OBJECT = expat_erl.o
|
|
||||||
DLL = expat_erl.dll
|
|
||||||
|
|
||||||
build : $(DLL) compile-beam all-recursive
|
|
||||||
|
|
||||||
all-recursive :
|
|
||||||
cd eldap
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\mod_irc
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\mod_muc
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\mod_pubsub
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\mod_proxy65
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\stringprep
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\stun
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\tls
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\ejabberd_zlib
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\web
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..\odbc
|
|
||||||
nmake -nologo -f Makefile.win32
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
compile-beam : XmppAddr.hrl
|
|
||||||
erl -s make all report -noinput -s erlang halt
|
|
||||||
|
|
||||||
XmppAddr.hrl : XmppAddr.asn1
|
|
||||||
erlc -bber_bin +der +compact_bit_string +optimize +noobj XmppAddr.asn1
|
|
||||||
|
|
||||||
CLEAN : clean-recursive clean-local
|
|
||||||
|
|
||||||
clean-local :
|
|
||||||
-@erase $(OBJECT)
|
|
||||||
-@erase $(DLL)
|
|
||||||
-@erase expat_erl.exp
|
|
||||||
-@erase expat_erl.lib
|
|
||||||
-@erase *.beam
|
|
||||||
-@erase XmppAddr.asn1db
|
|
||||||
-@erase XmppAddr.erl
|
|
||||||
-@erase XmppAddr.hrl
|
|
||||||
|
|
||||||
clean-recursive :
|
|
||||||
cd eldap
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\mod_irc
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\mod_muc
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\mod_pubsub
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\mod_proxy65
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\stringprep
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\stun
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\tls
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\ejabberd_zlib
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\web
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..\odbc
|
|
||||||
nmake -nologo -f Makefile.win32 clean
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
distclean : release_clean clean
|
|
||||||
-@erase $(NSIS_HEADER)
|
|
||||||
-@erase Makefile.inc
|
|
||||||
|
|
||||||
CC=cl.exe
|
|
||||||
CC_FLAGS=-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT $(EXPAT_FLAG) -MD -Ox -I"$(ERLANG_DIR)\usr\include" -I"$(EI_DIR)\include" -I"$(EXPAT_DIR)\source\lib"
|
|
||||||
|
|
||||||
LD=link.exe
|
|
||||||
LD_FLAGS=-release -nologo -incremental:no -dll "$(EI_DIR)\lib\ei_md.lib" "$(EI_DIR)\lib\erl_interface_md.lib" "$(EXPAT_LIB)" MSVCRT.LIB kernel32.lib advapi32.lib gdi32.lib user32.lib comctl32.lib comdlg32.lib shell32.lib
|
|
||||||
|
|
||||||
$(DLL) : $(OBJECT)
|
|
||||||
$(LD) $(LD_FLAGS) -out:$@ $<
|
|
||||||
|
|
||||||
$(OBJECT) : $(SOURCE)
|
|
||||||
$(CC) $(CC_FLAGS) -c -Fo$@ $<
|
|
62
doc/Makefile
@ -1,62 +0,0 @@
|
|||||||
# $Id$
|
|
||||||
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
CONTRIBUTED_MODULES = ""
|
|
||||||
#ifeq ($(shell ls mod_http_bind.tex),mod_http_bind.tex)
|
|
||||||
# CONTRIBUTED_MODULES += "\\n\\setboolean{modhttpbind}{true}"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
all: release pdf html
|
|
||||||
|
|
||||||
release:
|
|
||||||
@printf '%s\n' "Notes for the releaser:"
|
|
||||||
@printf '%s\n' "* Do not forget to add a link to the release notes in guide.tex"
|
|
||||||
@printf '%s\n' "* Do not forget to update the version number in ebin/ejabberd.app!"
|
|
||||||
@printf '%s\n' "* Do not forget to update the features in introduction.tex (including \new{} and \improved{} tags)."
|
|
||||||
@printf '%s\n' "Press any key to continue"
|
|
||||||
##@read foo
|
|
||||||
@printf '%s\n' "% ejabberd version (automatically generated)." > version.tex
|
|
||||||
@printf '%s\n' "\newcommand{\version}{"`sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../ebin/ejabberd.app`"}" >> version.tex
|
|
||||||
@printf '%s' "% Contributed modules (automatically generated)." > contributed_modules.tex
|
|
||||||
@printf '%b\n' "$(CONTRIBUTED_MODULES)" >> contributed_modules.tex
|
|
||||||
|
|
||||||
html: guide.html dev.html features.html
|
|
||||||
|
|
||||||
pdf: guide.pdf features.pdf
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.aux
|
|
||||||
rm -f *.haux
|
|
||||||
rm -f *.htoc
|
|
||||||
rm -f *.idx
|
|
||||||
rm -f *.ilg
|
|
||||||
rm -f *.ind
|
|
||||||
rm -f *.log
|
|
||||||
rm -f *.out
|
|
||||||
rm -f *.pdf
|
|
||||||
rm -f *.toc
|
|
||||||
[ ! -f contributed_modules.tex ] || rm contributed_modules.tex
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f *.html
|
|
||||||
|
|
||||||
guide.html: guide.tex
|
|
||||||
hevea -fix -pedantic guide.tex
|
|
||||||
|
|
||||||
dev.html: dev.tex
|
|
||||||
hevea -fix -pedantic dev.tex
|
|
||||||
|
|
||||||
features.html: features.tex
|
|
||||||
hevea -fix -pedantic features.tex
|
|
||||||
|
|
||||||
guide.pdf: guide.tex
|
|
||||||
pdflatex guide.tex
|
|
||||||
pdflatex guide.tex
|
|
||||||
pdflatex guide.tex
|
|
||||||
makeindex guide.idx
|
|
||||||
pdflatex guide.tex
|
|
||||||
|
|
||||||
features.pdf: features.tex
|
|
||||||
pdflatex features.tex
|
|
@ -1,18 +0,0 @@
|
|||||||
APPNAME = ejabberd
|
|
||||||
VSN = $(shell sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../../src/ejabberd.app)
|
|
||||||
|
|
||||||
DOCDIR=.
|
|
||||||
SRCDIR=../../src
|
|
||||||
|
|
||||||
.PHONY = all
|
|
||||||
|
|
||||||
all: docs
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.html
|
|
||||||
rm edoc-info
|
|
||||||
rm erlang.png
|
|
||||||
|
|
||||||
docs:
|
|
||||||
erl -noshell -run edoc_run application \
|
|
||||||
"'$(APPNAME)'" '"$(SRCDIR)"' '[{dir,"$(DOCDIR)"},{packages, false},{todo,true},{private,true},{def,{vsn,"$(VSN)"}},{stylesheet,"process-one.css"},{overview,"$(DOCDIR)/overview.edoc"}]' -s init stop
|
|
@ -1,10 +0,0 @@
|
|||||||
@author Mickael Remond <mickael.remond@process-one.net>
|
|
||||||
[http://www.process-one.net/]
|
|
||||||
@copyright 2013 ProcessOne
|
|
||||||
@version {@vsn}, {@date} {@time}
|
|
||||||
@title ejabberd Development API Documentation
|
|
||||||
|
|
||||||
@doc
|
|
||||||
== Introduction ==
|
|
||||||
|
|
||||||
TODO: Insert content from Jerome documentation.
|
|
@ -1,92 +0,0 @@
|
|||||||
html, body {
|
|
||||||
font-family: Verdana, sans-serif;
|
|
||||||
color: #000;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
color: #4a5389;
|
|
||||||
border-bottom: solid 1px #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 24px;
|
|
||||||
text-align: right;
|
|
||||||
color: #4a5389;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 18px;
|
|
||||||
color: #900;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
a[href] {
|
|
||||||
color: #4a5389;
|
|
||||||
}
|
|
||||||
|
|
||||||
a[href]:hover {
|
|
||||||
background-color: #ecefff;
|
|
||||||
}
|
|
||||||
|
|
||||||
p, li, dd {
|
|
||||||
text-align: justify;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
margin-top: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
li:first-child {
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
|
|
||||||
caption {
|
|
||||||
font-style: italic;
|
|
||||||
color: #009;
|
|
||||||
text-align: left;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table[border="1"] {
|
|
||||||
border-collapse: collapse;
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table[border="1"] td {
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre, tt, code {
|
|
||||||
color: #461b7e;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
margin:1ex 2ex;
|
|
||||||
border:1px dashed lightgrey;
|
|
||||||
background-color:#f9f9f9;
|
|
||||||
padding:0.5ex;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre em {
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt {
|
|
||||||
margin:0ex 2ex;
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd {
|
|
||||||
margin:0ex 0ex 1ex 4ex;
|
|
||||||
}
|
|
437
doc/dev.html
@ -1,437 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
||||||
<meta name="generator" content="hevea 2.09">
|
|
||||||
<style type="text/css">
|
|
||||||
.li-itemize{margin:1ex 0ex;}
|
|
||||||
.li-enumerate{margin:1ex 0ex;}
|
|
||||||
.dd-description{margin:0ex 0ex 1ex 4ex;}
|
|
||||||
.dt-description{margin:0ex;}
|
|
||||||
.toc{list-style:none;}
|
|
||||||
.footnotetext{margin:0ex; padding:0ex;}
|
|
||||||
div.footnotetext P{margin:0px; text-indent:1em;}
|
|
||||||
.thefootnotes{text-align:left;margin:0ex;}
|
|
||||||
.dt-thefootnotes{margin:0em;}
|
|
||||||
.dd-thefootnotes{margin:0em 0em 0em 2em;}
|
|
||||||
.footnoterule{margin:1em auto 1em 0px;width:50%;}
|
|
||||||
.caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto}
|
|
||||||
.title{margin:2ex auto;text-align:center}
|
|
||||||
.titlemain{margin:1ex 2ex 2ex 1ex;}
|
|
||||||
.titlerest{margin:0ex 2ex;}
|
|
||||||
.center{text-align:center;margin-left:auto;margin-right:auto;}
|
|
||||||
.flushleft{text-align:left;margin-left:0ex;margin-right:auto;}
|
|
||||||
.flushright{text-align:right;margin-left:auto;margin-right:0ex;}
|
|
||||||
div table{margin-left:inherit;margin-right:inherit;margin-bottom:2px;margin-top:2px}
|
|
||||||
td table{margin:auto;}
|
|
||||||
table{border-collapse:collapse;}
|
|
||||||
td{padding:0;}
|
|
||||||
.cellpadding0 tr td{padding:0;}
|
|
||||||
.cellpadding1 tr td{padding:1px;}
|
|
||||||
pre{text-align:left;margin-left:0ex;margin-right:auto;}
|
|
||||||
blockquote{margin-left:4ex;margin-right:4ex;text-align:left;}
|
|
||||||
td p{margin:0px;}
|
|
||||||
.boxed{border:1px solid black}
|
|
||||||
.textboxed{border:1px solid black}
|
|
||||||
.vbar{border:none;width:2px;background-color:black;}
|
|
||||||
.hbar{border:none;height:2px;width:100%;background-color:black;}
|
|
||||||
.hfill{border:none;height:1px;width:200%;background-color:black;}
|
|
||||||
.vdisplay{border-collapse:separate;border-spacing:2px;width:auto; empty-cells:show; border:2px solid red;}
|
|
||||||
.vdcell{white-space:nowrap;padding:0px; border:2px solid green;}
|
|
||||||
.display{border-collapse:separate;border-spacing:2px;width:auto; border:none;}
|
|
||||||
.dcell{white-space:nowrap;padding:0px; border:none;}
|
|
||||||
.dcenter{margin:0ex auto;}
|
|
||||||
.vdcenter{border:solid #FF8000 2px; margin:0ex auto;}
|
|
||||||
.minipage{text-align:left; margin-left:0em; margin-right:auto;}
|
|
||||||
.marginpar{border:solid thin black; width:20%; text-align:left;}
|
|
||||||
.marginparleft{float:left; margin-left:0ex; margin-right:1ex;}
|
|
||||||
.marginparright{float:right; margin-left:1ex; margin-right:0ex;}
|
|
||||||
.theorem{text-align:left;margin:1ex auto 1ex 0ex;}
|
|
||||||
.part{margin:2ex auto;text-align:center}
|
|
||||||
</style>
|
|
||||||
<title>Ejabberd community 14.05-120-gedfb5fc Developers Guide
|
|
||||||
</title>
|
|
||||||
</head>
|
|
||||||
<body >
|
|
||||||
<!--HEVEA command line is: /usr/bin/hevea -fix -pedantic dev.tex -->
|
|
||||||
<!--CUT STYLE article--><!--CUT DEF section 1 --><p><a id="titlepage"></a>
|
|
||||||
|
|
||||||
</p><table class="title"><tr><td style="padding:1ex"><h1 class="titlemain">Ejabberd community 14.05-120-gedfb5fc Developers Guide</h1><h3 class="titlerest">Alexey Shchepin <br>
|
|
||||||
<a href="mailto:alexey@sevcom.net"><span style="font-family:monospace">mailto:alexey@sevcom.net</span></a> <br>
|
|
||||||
<a href="xmpp:aleksey@jabber.ru"><span style="font-family:monospace">xmpp:aleksey@jabber.ru</span></a></h3></td></tr>
|
|
||||||
</table><div class="center">
|
|
||||||
|
|
||||||
<img src="logo.png" alt="logo.png">
|
|
||||||
|
|
||||||
|
|
||||||
</div><blockquote class="quotation"><span style="font-style:italic">I can thoroughly recommend ejabberd for ease of setup –
|
|
||||||
Kevin Smith, Current maintainer of the Psi project</span></blockquote><!--TOC section id="intro" Contents-->
|
|
||||||
<h2 id="intro" class="section">Contents</h2><!--SEC END --><ul class="toc"><li class="li-toc">
|
|
||||||
<a href="#sec2">1  Key Features</a>
|
|
||||||
</li><li class="li-toc"><a href="#sec3">2  Additional Features</a>
|
|
||||||
</li><li class="li-toc"><a href="#sec4">3  How it Works</a>
|
|
||||||
<ul class="toc"><li class="li-toc">
|
|
||||||
<a href="#sec5">3.1  Router</a>
|
|
||||||
</li><li class="li-toc"><a href="#sec6">3.2  Local Router</a>
|
|
||||||
</li><li class="li-toc"><a href="#sec7">3.3  Session Manager</a>
|
|
||||||
</li><li class="li-toc"><a href="#sec8">3.4  S2S Manager</a>
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-toc"><a href="#sec9">4  Authentication</a>
|
|
||||||
<ul class="toc">
|
|
||||||
<ul class="toc"><li class="li-toc">
|
|
||||||
<a href="#sec10">4.0.1  External</a>
|
|
||||||
</li></ul>
|
|
||||||
</ul>
|
|
||||||
</li><li class="li-toc"><a href="#sec11">5  XML Representation</a>
|
|
||||||
</li><li class="li-toc"><a href="#sec12">6  Module <span style="font-family:monospace">xml</span></a>
|
|
||||||
</li><li class="li-toc"><a href="#sec13">7  Module <span style="font-family:monospace">xml_stream</span></a>
|
|
||||||
</li><li class="li-toc"><a href="#sec14">8  Modules</a>
|
|
||||||
<ul class="toc"><li class="li-toc">
|
|
||||||
<a href="#sec15">8.1  Module gen_iq_handler</a>
|
|
||||||
</li><li class="li-toc"><a href="#sec16">8.2  Services</a>
|
|
||||||
</li></ul>
|
|
||||||
</li></ul><p>Introduction
|
|
||||||
</p><p><span style="font-family:monospace">ejabberd</span> is a free and open source instant messaging server written in <a href="http://www.erlang.org/">Erlang/OTP</a>.</p><p><span style="font-family:monospace">ejabberd</span> is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication.</p><p><span style="font-family:monospace">ejabberd</span> is designed to be a rock-solid and feature rich XMPP server.</p><p><span style="font-family:monospace">ejabberd</span> is suitable for small deployments, whether they need to be scalable or not, as well as extremely big deployments.</p>
|
|
||||||
<!--TOC section id="sec2" Key Features-->
|
|
||||||
<h2 id="sec2" class="section">1  Key Features</h2><!--SEC END --><p>
|
|
||||||
<a id="keyfeatures"></a>
|
|
||||||
</p><p><span style="font-family:monospace">ejabberd</span> is:
|
|
||||||
</p><ul class="itemize"><li class="li-itemize">
|
|
||||||
Cross-platform: <span style="font-family:monospace">ejabberd</span> runs under Microsoft Windows and Unix derived systems such as Linux, FreeBSD and NetBSD.</li><li class="li-itemize">Distributed: You can run <span style="font-family:monospace">ejabberd</span> 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.</li><li class="li-itemize">Fault-tolerant: You can deploy an <span style="font-family:monospace">ejabberd</span> 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’.</li><li class="li-itemize">Administrator Friendly: <span style="font-family:monospace">ejabberd</span> 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:
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Comprehensive documentation.
|
|
||||||
</li><li class="li-itemize">Straightforward installers for Linux, Mac OS X, and Windows. </li><li class="li-itemize">Web Administration.
|
|
||||||
</li><li class="li-itemize">Shared Roster Groups.
|
|
||||||
</li><li class="li-itemize">Command line administration tool. </li><li class="li-itemize">Can integrate with existing authentication mechanisms.
|
|
||||||
</li><li class="li-itemize">Capability to send announce messages.
|
|
||||||
</li></ul></li><li class="li-itemize">Internationalized: <span style="font-family:monospace">ejabberd</span> leads in internationalization. Hence it is very well suited in a globalized world. Related features are:
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Translated to 25 languages. </li><li class="li-itemize">Support for <a href="http://www.ietf.org/rfc/rfc3490.txt">IDNA</a>.
|
|
||||||
</li></ul></li><li class="li-itemize">Open Standards: <span style="font-family:monospace">ejabberd</span> is the first Open Source Jabber server claiming to fully comply to the XMPP standard.
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Fully XMPP compliant.
|
|
||||||
</li><li class="li-itemize">XML-based protocol.
|
|
||||||
</li><li class="li-itemize"><a href="http://www.ejabberd.im/protocols">Many protocols supported</a>.
|
|
||||||
</li></ul></li></ul>
|
|
||||||
<!--TOC section id="sec3" Additional Features-->
|
|
||||||
<h2 id="sec3" class="section">2  Additional Features</h2><!--SEC END --><p>
|
|
||||||
<a id="addfeatures"></a>
|
|
||||||
</p><p>Moreover, <span style="font-family:monospace">ejabberd</span> comes with a wide range of other state-of-the-art features:
|
|
||||||
</p><ul class="itemize"><li class="li-itemize">
|
|
||||||
Modular
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Load only the modules you want.
|
|
||||||
</li><li class="li-itemize">Extend <span style="font-family:monospace">ejabberd</span> with your own custom modules.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Security
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
SASL and STARTTLS for c2s and s2s connections.
|
|
||||||
</li><li class="li-itemize">STARTTLS and Dialback s2s connections.
|
|
||||||
</li><li class="li-itemize">Web Admin accessible via HTTPS secure access.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Databases
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Internal database for fast deployment (Mnesia).
|
|
||||||
</li><li class="li-itemize">Native MySQL support.
|
|
||||||
</li><li class="li-itemize">Native PostgreSQL support.
|
|
||||||
</li><li class="li-itemize">ODBC data storage support.
|
|
||||||
</li><li class="li-itemize">Microsoft SQL Server support. </li><li class="li-itemize">Riak NoSQL database support.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Authentication
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Internal Authentication.
|
|
||||||
</li><li class="li-itemize">PAM, LDAP, ODBC and Riak. </li><li class="li-itemize">External Authentication script.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Others
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Support for virtual hosting.
|
|
||||||
</li><li class="li-itemize">Compressing XML streams with Stream Compression (<a href="http://www.xmpp.org/extensions/xep-0138.html">XEP-0138</a>).
|
|
||||||
</li><li class="li-itemize">Statistics via Statistics Gathering (<a href="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</a>).
|
|
||||||
</li><li class="li-itemize">IPv6 support both for c2s and s2s connections.
|
|
||||||
</li><li class="li-itemize"><a href="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</a> module with support for clustering and HTML logging. </li><li class="li-itemize">Users Directory based on users vCards.
|
|
||||||
</li><li class="li-itemize"><a href="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</a> component with support for <a href="http://www.xmpp.org/extensions/xep-0163.html">Personal Eventing via Pubsub</a>.
|
|
||||||
</li><li class="li-itemize">Support for web clients: <a href="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</a> and <a href="http://www.xmpp.org/extensions/xep-0206.html">HTTP Binding (BOSH)</a> services.
|
|
||||||
</li><li class="li-itemize">IRC transport.
|
|
||||||
</li><li class="li-itemize">SIP support.
|
|
||||||
</li><li class="li-itemize">Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
|
|
||||||
</li></ul>
|
|
||||||
</li></ul>
|
|
||||||
<!--TOC section id="sec4" How it Works-->
|
|
||||||
<h2 id="sec4" class="section">3  How it Works</h2><!--SEC END --><p>
|
|
||||||
<a id="howitworks"></a></p><p>A XMPP domain is served by one or more <span style="font-family:monospace">ejabberd</span> nodes. These nodes can
|
|
||||||
be run on different machines that are connected via a network. They all must
|
|
||||||
have the ability to connect to port 4369 of all another nodes, and must have
|
|
||||||
the same magic cookie (see Erlang/OTP documentation, in other words the file
|
|
||||||
<span style="font-family:monospace">~ejabberd/.erlang.cookie</span> must be the same on all nodes). This is
|
|
||||||
needed because all nodes exchange information about connected users, S2S
|
|
||||||
connections, registered services, etc…</p><p>Each <span style="font-family:monospace">ejabberd</span> node have following modules:
|
|
||||||
</p><ul class="itemize"><li class="li-itemize">
|
|
||||||
router;
|
|
||||||
</li><li class="li-itemize">local router.
|
|
||||||
</li><li class="li-itemize">session manager;
|
|
||||||
</li><li class="li-itemize">S2S manager;
|
|
||||||
</li></ul>
|
|
||||||
<!--TOC subsection id="sec5" Router-->
|
|
||||||
<h3 id="sec5" class="subsection">3.1  Router</h3><!--SEC END --><p>This module is the main router of XMPP packets on each node. It routes
|
|
||||||
them based on their destinations domains. It has two tables: local and global
|
|
||||||
routes. First, domain of packet destination searched in local table, and if it
|
|
||||||
found, then the packet is routed to appropriate process. If no, then it
|
|
||||||
searches in global table, and is routed to the appropriate <span style="font-family:monospace">ejabberd</span> node or
|
|
||||||
process. If it does not exists in either tables, then it sent to the S2S
|
|
||||||
manager.</p>
|
|
||||||
<!--TOC subsection id="sec6" Local Router-->
|
|
||||||
<h3 id="sec6" class="subsection">3.2  Local Router</h3><!--SEC END --><p>This module routes packets which have a destination domain equal to this server
|
|
||||||
name. If destination JID has a non-empty user part, then it routed to the
|
|
||||||
session manager, else it is processed depending on it’s content.</p>
|
|
||||||
<!--TOC subsection id="sec7" Session Manager-->
|
|
||||||
<h3 id="sec7" class="subsection">3.3  Session Manager</h3><!--SEC END --><p>This module routes packets to local users. It searches for what user resource
|
|
||||||
packet must be sent via presence table. If this resource is connected to
|
|
||||||
this node, it is routed to C2S process, if it connected via another node, then
|
|
||||||
the packet is sent to session manager on that node.</p>
|
|
||||||
<!--TOC subsection id="sec8" S2S Manager-->
|
|
||||||
<h3 id="sec8" class="subsection">3.4  S2S Manager</h3><!--SEC END --><p>This module routes packets to other XMPP servers. First, it checks if an
|
|
||||||
open S2S connection from the domain of the packet source to the domain of
|
|
||||||
packet destination already exists. If it is open on another node, then it
|
|
||||||
routes the packet to S2S manager on that node, if it is open on this node, then
|
|
||||||
it is routed to the process that serves this connection, and if a connection
|
|
||||||
does not exist, then it is opened and registered.</p>
|
|
||||||
<!--TOC section id="sec9" Authentication-->
|
|
||||||
<h2 id="sec9" class="section">4  Authentication</h2><!--SEC END -->
|
|
||||||
<!--TOC subsubsection id="sec10" External-->
|
|
||||||
<h4 id="sec10" class="subsubsection">4.0.1  External</h4><!--SEC END --><p>
|
|
||||||
<a id="externalauth"></a>
|
|
||||||
</p><p>The external authentication script follows
|
|
||||||
<a href="http://www.erlang.org/doc/tutorial/c_portdriver.html">the erlang port driver API</a>.</p><p>That script is supposed to do theses actions, in an infinite loop:
|
|
||||||
</p><ul class="itemize"><li class="li-itemize">
|
|
||||||
read from stdin: AABBBBBBBBB.....
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
A: 2 bytes of length data (a short in network byte order)
|
|
||||||
</li><li class="li-itemize">B: a string of length found in A that contains operation in plain text
|
|
||||||
operation are as follows:
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
auth:User:Server:Password (check if a username/password pair is correct)
|
|
||||||
</li><li class="li-itemize">isuser:User:Server (check if it’s a valid user)
|
|
||||||
</li><li class="li-itemize">setpass:User:Server:Password (set user’s password)
|
|
||||||
</li><li class="li-itemize">tryregister:User:Server:Password (try to register an account)
|
|
||||||
</li><li class="li-itemize">removeuser:User:Server (remove this account)
|
|
||||||
</li><li class="li-itemize">removeuser3:User:Server:Password (remove this account if the password is correct)
|
|
||||||
</li></ul>
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">write to stdout: AABB
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
A: the number 2 (coded as a short, which is bytes length of following result)
|
|
||||||
</li><li class="li-itemize">B: the result code (coded as a short), should be 1 for success/valid, or 0 for failure/invalid
|
|
||||||
</li></ul>
|
|
||||||
</li></ul><p>Example python script
|
|
||||||
</p><pre class="verbatim">#!/usr/bin/python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
from struct import *
|
|
||||||
|
|
||||||
def from_ejabberd():
|
|
||||||
input_length = sys.stdin.read(2)
|
|
||||||
(size,) = unpack('>h', input_length)
|
|
||||||
return sys.stdin.read(size).split(':')
|
|
||||||
|
|
||||||
def to_ejabberd(bool):
|
|
||||||
answer = 0
|
|
||||||
if bool:
|
|
||||||
answer = 1
|
|
||||||
token = pack('>hh', 2, answer)
|
|
||||||
sys.stdout.write(token)
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
def auth(username, server, password):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def isuser(username, server):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def setpass(username, server, password):
|
|
||||||
return True
|
|
||||||
|
|
||||||
while True:
|
|
||||||
data = from_ejabberd()
|
|
||||||
success = False
|
|
||||||
if data[0] == "auth":
|
|
||||||
success = auth(data[1], data[2], data[3])
|
|
||||||
elif data[0] == "isuser":
|
|
||||||
success = isuser(data[1], data[2])
|
|
||||||
elif data[0] == "setpass":
|
|
||||||
success = setpass(data[1], data[2], data[3])
|
|
||||||
to_ejabberd(success)
|
|
||||||
</pre>
|
|
||||||
<!--TOC section id="sec11" XML Representation-->
|
|
||||||
<h2 id="sec11" class="section">5  XML Representation</h2><!--SEC END --><p>
|
|
||||||
<a id="xmlrepr"></a></p><p>Each XML stanza is represented as the following tuple:
|
|
||||||
</p><pre class="verbatim">XMLElement = {xmlelement, Name, Attrs, [ElementOrCDATA]}
|
|
||||||
Name = string()
|
|
||||||
Attrs = [Attr]
|
|
||||||
Attr = {Key, Val}
|
|
||||||
Key = string()
|
|
||||||
Val = string()
|
|
||||||
ElementOrCDATA = XMLElement | CDATA
|
|
||||||
CDATA = {xmlcdata, string()}
|
|
||||||
</pre><p>E. g. this stanza:
|
|
||||||
</p><pre class="verbatim"><message to='test@conference.example.org' type='groupchat'>
|
|
||||||
<body>test</body>
|
|
||||||
</message>
|
|
||||||
</pre><p>is represented as the following structure:
|
|
||||||
</p><pre class="verbatim">{xmlelement, "message",
|
|
||||||
[{"to", "test@conference.example.org"},
|
|
||||||
{"type", "groupchat"}],
|
|
||||||
[{xmlelement, "body",
|
|
||||||
[],
|
|
||||||
[{xmlcdata, "test"}]}]}}
|
|
||||||
</pre>
|
|
||||||
<!--TOC section id="sec12" Module <span style="font-family:monospace">xml</span>-->
|
|
||||||
<h2 id="sec12" class="section">6  Module <span style="font-family:monospace">xml</span></h2><!--SEC END --><p>
|
|
||||||
<a id="xmlmod"></a></p><dl class="description"><dt class="dt-description">
|
|
||||||
</dt><dd class="dd-description"><code>element_to_string(El) -> string()</code>
|
|
||||||
<pre class="verbatim">El = XMLElement
|
|
||||||
</pre>Returns string representation of XML stanza <span style="font-family:monospace">El</span>.</dd><dt class="dt-description"></dt><dd class="dd-description"><code>crypt(S) -> string()</code>
|
|
||||||
<pre class="verbatim">S = string()
|
|
||||||
</pre>Returns string which correspond to <span style="font-family:monospace">S</span> with encoded XML special
|
|
||||||
characters.</dd><dt class="dt-description"></dt><dd class="dd-description"><code>remove_cdata(ECList) -> EList</code>
|
|
||||||
<pre class="verbatim">ECList = [ElementOrCDATA]
|
|
||||||
EList = [XMLElement]
|
|
||||||
</pre><span style="font-family:monospace">EList</span> is a list of all non-CDATA elements of ECList.</dd><dt class="dt-description"></dt><dd class="dd-description"><code>get_path_s(El, Path) -> Res</code>
|
|
||||||
<pre class="verbatim">El = XMLElement
|
|
||||||
Path = [PathItem]
|
|
||||||
PathItem = PathElem | PathAttr | PathCDATA
|
|
||||||
PathElem = {elem, Name}
|
|
||||||
PathAttr = {attr, Name}
|
|
||||||
PathCDATA = cdata
|
|
||||||
Name = string()
|
|
||||||
Res = string() | XMLElement
|
|
||||||
</pre>If <span style="font-family:monospace">Path</span> is empty, then returns <span style="font-family:monospace">El</span>. Else sequentially
|
|
||||||
consider elements of <span style="font-family:monospace">Path</span>. Each element is one of:
|
|
||||||
<dl class="description"><dt class="dt-description">
|
|
||||||
</dt><dd class="dd-description"><code>{elem, Name}</code> <span style="font-family:monospace">Name</span> is name of subelement of
|
|
||||||
<span style="font-family:monospace">El</span>, if such element exists, then this element considered in
|
|
||||||
following steps, else returns empty string.
|
|
||||||
</dd><dt class="dt-description"></dt><dd class="dd-description"><code>{attr, Name}</code> If <span style="font-family:monospace">El</span> have attribute <span style="font-family:monospace">Name</span>, then
|
|
||||||
returns value of this attribute, else returns empty string.
|
|
||||||
</dd><dt class="dt-description"></dt><dd class="dd-description"><code>cdata</code> Returns CDATA of <span style="font-family:monospace">El</span>.
|
|
||||||
</dd></dl></dd><dt class="dt-description"></dt><dd class="dd-description">TODO:
|
|
||||||
<pre class="verbatim"> get_cdata/1, get_tag_cdata/1
|
|
||||||
get_attr/2, get_attr_s/2
|
|
||||||
get_tag_attr/2, get_tag_attr_s/2
|
|
||||||
get_subtag/2
|
|
||||||
</pre></dd></dl>
|
|
||||||
<!--TOC section id="sec13" Module <span style="font-family:monospace">xml_stream</span>-->
|
|
||||||
<h2 id="sec13" class="section">7  Module <span style="font-family:monospace">xml_stream</span></h2><!--SEC END --><p>
|
|
||||||
<a id="xmlstreammod"></a></p><dl class="description"><dt class="dt-description">
|
|
||||||
</dt><dd class="dd-description"><code>parse_element(Str) -> XMLElement | {error, Err}</code>
|
|
||||||
<pre class="verbatim">Str = string()
|
|
||||||
Err = term()
|
|
||||||
</pre>Parses <span style="font-family:monospace">Str</span> using XML parser, returns either parsed element or error
|
|
||||||
tuple.
|
|
||||||
</dd></dl>
|
|
||||||
<!--TOC section id="sec14" Modules-->
|
|
||||||
<h2 id="sec14" class="section">8  Modules</h2><!--SEC END --><p>
|
|
||||||
<a id="emods"></a></p>
|
|
||||||
<!--TOC subsection id="sec15" Module gen_iq_handler-->
|
|
||||||
<h3 id="sec15" class="subsection">8.1  Module gen_iq_handler</h3><!--SEC END --><p>
|
|
||||||
<a id="geniqhandl"></a></p><p>The module <code>gen_iq_handler</code> allows to easily write handlers for IQ packets
|
|
||||||
of particular XML namespaces that addressed to server or to users bare JIDs.</p><p>In this module the following functions are defined:
|
|
||||||
</p><dl class="description"><dt class="dt-description">
|
|
||||||
</dt><dd class="dd-description"><code>add_iq_handler(Component, Host, NS, Module, Function, Type)</code>
|
|
||||||
<pre class="verbatim">Component = Module = Function = atom()
|
|
||||||
Host = NS = string()
|
|
||||||
Type = no_queue | one_queue | parallel
|
|
||||||
</pre>Registers function <code>Module:Function</code> as handler for IQ packets on
|
|
||||||
virtual host <code>Host</code> that contain child of namespace <code>NS</code> in
|
|
||||||
<code>Component</code>. Queueing discipline is <code>Type</code>. There are at least
|
|
||||||
two components defined:
|
|
||||||
<dl class="description"><dt class="dt-description">
|
|
||||||
</dt><dd class="dd-description"><code>ejabberd_local</code> Handles packets that addressed to server JID;
|
|
||||||
</dd><dt class="dt-description"></dt><dd class="dd-description"><code>ejabberd_sm</code> Handles packets that addressed to users bare JIDs.
|
|
||||||
</dd></dl>
|
|
||||||
</dd><dt class="dt-description"></dt><dd class="dd-description"><code>remove_iq_handler(Component, Host, NS)</code>
|
|
||||||
<pre class="verbatim">Component = atom()
|
|
||||||
Host = NS = string()
|
|
||||||
</pre>Removes IQ handler on virtual host <code>Host</code> for namespace <code>NS</code> from
|
|
||||||
<code>Component</code>.
|
|
||||||
</dd></dl><p>Handler function must have the following type:
|
|
||||||
</p><dl class="description"><dt class="dt-description">
|
|
||||||
</dt><dd class="dd-description"><code>Module:Function(From, To, IQ)</code>
|
|
||||||
<pre class="verbatim">From = To = jid()
|
|
||||||
</pre></dd></dl><pre class="verbatim">-module(mod_cputime).
|
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
|
||||||
|
|
||||||
-export([start/2,
|
|
||||||
stop/1,
|
|
||||||
process_local_iq/3]).
|
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
|
||||||
-include("jlib.hrl").
|
|
||||||
|
|
||||||
-define(NS_CPUTIME, "ejabberd:cputime").
|
|
||||||
|
|
||||||
start(Host, Opts) ->
|
|
||||||
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
|
|
||||||
gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?NS_CPUTIME,
|
|
||||||
?MODULE, process_local_iq, IQDisc).
|
|
||||||
|
|
||||||
stop(Host) ->
|
|
||||||
gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_CPUTIME).
|
|
||||||
|
|
||||||
process_local_iq(From, To, {iq, ID, Type, XMLNS, SubEl}) ->
|
|
||||||
case Type of
|
|
||||||
set ->
|
|
||||||
{iq, ID, error, XMLNS,
|
|
||||||
[SubEl, ?ERR_NOT_ALLOWED]};
|
|
||||||
get ->
|
|
||||||
CPUTime = element(1, erlang:statistics(runtime))/1000,
|
|
||||||
SCPUTime = lists:flatten(io_lib:format("~.3f", CPUTime)),
|
|
||||||
{iq, ID, result, XMLNS,
|
|
||||||
[{xmlelement, "query",
|
|
||||||
[{"xmlns", ?NS_CPUTIME}],
|
|
||||||
[{xmlelement, "cputime", [], [{xmlcdata, SCPUTime}]}]}]}
|
|
||||||
end.
|
|
||||||
</pre>
|
|
||||||
<!--TOC subsection id="sec16" Services-->
|
|
||||||
<h3 id="sec16" class="subsection">8.2  Services</h3><!--SEC END --><p>
|
|
||||||
<a id="services"></a></p><pre class="verbatim">-module(mod_echo).
|
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
|
||||||
|
|
||||||
-export([start/2, init/1, stop/1]).
|
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
|
||||||
-include("jlib.hrl").
|
|
||||||
|
|
||||||
start(Host, Opts) ->
|
|
||||||
MyHost = gen_mod:get_opt(host, Opts, "echo." ++ Host),
|
|
||||||
register(gen_mod:get_module_proc(Host, ?PROCNAME),
|
|
||||||
spawn(?MODULE, init, [MyHost])).
|
|
||||||
|
|
||||||
init(Host) ->
|
|
||||||
ejabberd_router:register_local_route(Host),
|
|
||||||
loop(Host).
|
|
||||||
|
|
||||||
loop(Host) ->
|
|
||||||
receive
|
|
||||||
{route, From, To, Packet} ->
|
|
||||||
ejabberd_router:route(To, From, Packet),
|
|
||||||
loop(Host);
|
|
||||||
stop ->
|
|
||||||
ejabberd_router:unregister_route(Host),
|
|
||||||
ok;
|
|
||||||
_ ->
|
|
||||||
loop(Host)
|
|
||||||
end.
|
|
||||||
|
|
||||||
stop(Host) ->
|
|
||||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
|
||||||
Proc ! stop,
|
|
||||||
{wait, Proc}.
|
|
||||||
</pre><!--CUT END -->
|
|
||||||
<!--HTMLFOOT-->
|
|
||||||
<!--ENDHTML-->
|
|
||||||
<!--FOOTER-->
|
|
||||||
<hr style="height:2"><blockquote class="quote"><em>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
|
|
||||||
</em><a href="http://hevea.inria.fr/index.html"><em>H</em><em><span style="font-size:small"><sup>E</sup></span></em><em>V</em><em><span style="font-size:small"><sup>E</sup></span></em><em>A</em></a><em>.</em></blockquote></body>
|
|
||||||
</html>
|
|
470
doc/dev.tex
@ -1,470 +0,0 @@
|
|||||||
\documentclass[a4paper,10pt]{article}
|
|
||||||
|
|
||||||
%% Packages
|
|
||||||
\usepackage{graphics}
|
|
||||||
\usepackage{hevea}
|
|
||||||
\usepackage{makeidx}
|
|
||||||
\usepackage{verbatim}
|
|
||||||
|
|
||||||
%% Index
|
|
||||||
\makeindex
|
|
||||||
% Remove the index anchors from the HTML version to save size and bandwith.
|
|
||||||
\newcommand{\ind}[1]{\begin{latexonly}\index{#1}\end{latexonly}}
|
|
||||||
|
|
||||||
%% Images
|
|
||||||
\newcommand{\logoscale}{0.7}
|
|
||||||
\newcommand{\imgscale}{0.58}
|
|
||||||
\newcommand{\insimg}[1]{\insscaleimg{\imgscale}{#1}}
|
|
||||||
\newcommand{\insscaleimg}[2]{
|
|
||||||
\imgsrc{#2}{}
|
|
||||||
\begin{latexonly}
|
|
||||||
\scalebox{#1}{\includegraphics{#2}}
|
|
||||||
\end{latexonly}
|
|
||||||
}
|
|
||||||
|
|
||||||
%% Various
|
|
||||||
\newcommand{\ns}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\ejabberd}{\texttt{ejabberd}}
|
|
||||||
\newcommand{\Jabber}{Jabber}
|
|
||||||
\newcommand{\XMPP}{XMPP}
|
|
||||||
|
|
||||||
%% Modules
|
|
||||||
\newcommand{\module}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\modadhoc}{\module{mod\_adhoc}}
|
|
||||||
\newcommand{\modannounce}{\module{mod\_announce}}
|
|
||||||
\newcommand{\modconfigure}{\module{mod\_configure}}
|
|
||||||
\newcommand{\moddisco}{\module{mod\_disco}}
|
|
||||||
\newcommand{\modecho}{\module{mod\_echo}}
|
|
||||||
\newcommand{\modirc}{\module{mod\_irc}}
|
|
||||||
\newcommand{\modlast}{\module{mod\_last}}
|
|
||||||
\newcommand{\modlastodbc}{\module{mod\_last\_odbc}}
|
|
||||||
\newcommand{\modmuc}{\module{mod\_muc}}
|
|
||||||
\newcommand{\modmuclog}{\module{mod\_muc\_log}}
|
|
||||||
\newcommand{\modoffline}{\module{mod\_offline}}
|
|
||||||
\newcommand{\modofflineodbc}{\module{mod\_offline\_odbc}}
|
|
||||||
\newcommand{\modprivacy}{\module{mod\_privacy}}
|
|
||||||
\newcommand{\modprivate}{\module{mod\_private}}
|
|
||||||
\newcommand{\modpubsub}{\module{mod\_pubsub}}
|
|
||||||
\newcommand{\modregister}{\module{mod\_register}}
|
|
||||||
\newcommand{\modroster}{\module{mod\_roster}}
|
|
||||||
\newcommand{\modrosterodbc}{\module{mod\_roster\_odbc}}
|
|
||||||
\newcommand{\modservicelog}{\module{mod\_service\_log}}
|
|
||||||
\newcommand{\modsharedroster}{\module{mod\_shared\_roster}}
|
|
||||||
\newcommand{\modstats}{\module{mod\_stats}}
|
|
||||||
\newcommand{\modtime}{\module{mod\_time}}
|
|
||||||
\newcommand{\modvcard}{\module{mod\_vcard}}
|
|
||||||
\newcommand{\modvcardldap}{\module{mod\_vcard\_ldap}}
|
|
||||||
\newcommand{\modvcardodbc}{\module{mod\_vcard\_odbc}}
|
|
||||||
\newcommand{\modversion}{\module{mod\_version}}
|
|
||||||
|
|
||||||
%% Title page
|
|
||||||
\include{version}
|
|
||||||
\title{Ejabberd \version\ Developers Guide}
|
|
||||||
\author{Alexey Shchepin \\
|
|
||||||
\ahrefurl{mailto:alexey@sevcom.net} \\
|
|
||||||
\ahrefurl{xmpp:aleksey@jabber.ru}}
|
|
||||||
|
|
||||||
%% Options
|
|
||||||
\newcommand{\marking}[1]{#1} % Marking disabled
|
|
||||||
\newcommand{\quoting}[2][yozhik]{} % Quotes disabled
|
|
||||||
\newcommand{\new}{\begin{latexonly}\marginpar{\textsc{new}}\end{latexonly}} % Highlight new features
|
|
||||||
\newcommand{\improved}{\begin{latexonly}\marginpar{\textsc{improved}}\end{latexonly}} % Highlight improved features
|
|
||||||
\newcommand{\moreinfo}[1]{} % Hide details
|
|
||||||
|
|
||||||
%% Footnotes
|
|
||||||
\newcommand{\txepref}[2]{\footahref{http://www.xmpp.org/extensions/xep-#1.html}{#2}}
|
|
||||||
\newcommand{\xepref}[1]{\txepref{#1}{XEP-#1}}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\label{titlepage}
|
|
||||||
\begin{titlepage}
|
|
||||||
\maketitle{}
|
|
||||||
|
|
||||||
\begin{center}
|
|
||||||
{\insscaleimg{\logoscale}{logo.png}
|
|
||||||
\par
|
|
||||||
}
|
|
||||||
\end{center}
|
|
||||||
|
|
||||||
\begin{quotation}\textit{I can thoroughly recommend ejabberd for ease of setup --
|
|
||||||
Kevin Smith, Current maintainer of the Psi project}\end{quotation}
|
|
||||||
|
|
||||||
\end{titlepage}
|
|
||||||
|
|
||||||
\tableofcontents{}
|
|
||||||
|
|
||||||
% Input introduction.tex
|
|
||||||
\input{introduction}
|
|
||||||
|
|
||||||
\section{How it Works}
|
|
||||||
\label{howitworks}
|
|
||||||
|
|
||||||
|
|
||||||
A \XMPP{} domain is served by one or more \ejabberd{} nodes. These nodes can
|
|
||||||
be run on different machines that are connected via a network. They all must
|
|
||||||
have the ability to connect to port 4369 of all another nodes, and must have
|
|
||||||
the same magic cookie (see Erlang/OTP documentation, in other words the file
|
|
||||||
\texttt{\~{}ejabberd/.erlang.cookie} must be the same on all nodes). This is
|
|
||||||
needed because all nodes exchange information about connected users, S2S
|
|
||||||
connections, registered services, etc\ldots
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Each \ejabberd{} node have following modules:
|
|
||||||
\begin{itemize}
|
|
||||||
\item router;
|
|
||||||
\item local router.
|
|
||||||
\item session manager;
|
|
||||||
\item S2S manager;
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Router}
|
|
||||||
|
|
||||||
This module is the main router of \XMPP{} packets on each node. It routes
|
|
||||||
them based on their destinations domains. It has two tables: local and global
|
|
||||||
routes. First, domain of packet destination searched in local table, and if it
|
|
||||||
found, then the packet is routed to appropriate process. If no, then it
|
|
||||||
searches in global table, and is routed to the appropriate \ejabberd{} node or
|
|
||||||
process. If it does not exists in either tables, then it sent to the S2S
|
|
||||||
manager.
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Local Router}
|
|
||||||
|
|
||||||
This module routes packets which have a destination domain equal to this server
|
|
||||||
name. If destination JID has a non-empty user part, then it routed to the
|
|
||||||
session manager, else it is processed depending on it's content.
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Session Manager}
|
|
||||||
|
|
||||||
This module routes packets to local users. It searches for what user resource
|
|
||||||
packet must be sent via presence table. If this resource is connected to
|
|
||||||
this node, it is routed to C2S process, if it connected via another node, then
|
|
||||||
the packet is sent to session manager on that node.
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{S2S Manager}
|
|
||||||
|
|
||||||
This module routes packets to other \XMPP{} servers. First, it checks if an
|
|
||||||
open S2S connection from the domain of the packet source to the domain of
|
|
||||||
packet destination already exists. If it is open on another node, then it
|
|
||||||
routes the packet to S2S manager on that node, if it is open on this node, then
|
|
||||||
it is routed to the process that serves this connection, and if a connection
|
|
||||||
does not exist, then it is opened and registered.
|
|
||||||
|
|
||||||
|
|
||||||
\section{Authentication}
|
|
||||||
|
|
||||||
\subsubsection{External}
|
|
||||||
\label{externalauth}
|
|
||||||
\ind{external authentication}
|
|
||||||
|
|
||||||
The external authentication script follows
|
|
||||||
\footahref{http://www.erlang.org/doc/tutorial/c_portdriver.html}{the erlang port driver API}.
|
|
||||||
|
|
||||||
That script is supposed to do theses actions, in an infinite loop:
|
|
||||||
\begin{itemize}
|
|
||||||
\item read from stdin: AABBBBBBBBB.....
|
|
||||||
\begin{itemize}
|
|
||||||
\item A: 2 bytes of length data (a short in network byte order)
|
|
||||||
\item B: a string of length found in A that contains operation in plain text
|
|
||||||
operation are as follows:
|
|
||||||
\begin{itemize}
|
|
||||||
\item auth:User:Server:Password (check if a username/password pair is correct)
|
|
||||||
\item isuser:User:Server (check if it's a valid user)
|
|
||||||
\item setpass:User:Server:Password (set user's password)
|
|
||||||
\item tryregister:User:Server:Password (try to register an account)
|
|
||||||
\item removeuser:User:Server (remove this account)
|
|
||||||
\item removeuser3:User:Server:Password (remove this account if the password is correct)
|
|
||||||
\end{itemize}
|
|
||||||
\end{itemize}
|
|
||||||
\item write to stdout: AABB
|
|
||||||
\begin{itemize}
|
|
||||||
\item A: the number 2 (coded as a short, which is bytes length of following result)
|
|
||||||
\item B: the result code (coded as a short), should be 1 for success/valid, or 0 for failure/invalid
|
|
||||||
\end{itemize}
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
Example python script
|
|
||||||
\begin{verbatim}
|
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
from struct import *
|
|
||||||
|
|
||||||
def from_ejabberd():
|
|
||||||
input_length = sys.stdin.read(2)
|
|
||||||
(size,) = unpack('>h', input_length)
|
|
||||||
return sys.stdin.read(size).split(':')
|
|
||||||
|
|
||||||
def to_ejabberd(bool):
|
|
||||||
answer = 0
|
|
||||||
if bool:
|
|
||||||
answer = 1
|
|
||||||
token = pack('>hh', 2, answer)
|
|
||||||
sys.stdout.write(token)
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
def auth(username, server, password):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def isuser(username, server):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def setpass(username, server, password):
|
|
||||||
return True
|
|
||||||
|
|
||||||
while True:
|
|
||||||
data = from_ejabberd()
|
|
||||||
success = False
|
|
||||||
if data[0] == "auth":
|
|
||||||
success = auth(data[1], data[2], data[3])
|
|
||||||
elif data[0] == "isuser":
|
|
||||||
success = isuser(data[1], data[2])
|
|
||||||
elif data[0] == "setpass":
|
|
||||||
success = setpass(data[1], data[2], data[3])
|
|
||||||
to_ejabberd(success)
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
\section{XML Representation}
|
|
||||||
\label{xmlrepr}
|
|
||||||
|
|
||||||
Each XML stanza is represented as the following tuple:
|
|
||||||
\begin{verbatim}
|
|
||||||
XMLElement = {xmlelement, Name, Attrs, [ElementOrCDATA]}
|
|
||||||
Name = string()
|
|
||||||
Attrs = [Attr]
|
|
||||||
Attr = {Key, Val}
|
|
||||||
Key = string()
|
|
||||||
Val = string()
|
|
||||||
ElementOrCDATA = XMLElement | CDATA
|
|
||||||
CDATA = {xmlcdata, string()}
|
|
||||||
\end{verbatim}
|
|
||||||
E.\,g. this stanza:
|
|
||||||
\begin{verbatim}
|
|
||||||
<message to='test@conference.example.org' type='groupchat'>
|
|
||||||
<body>test</body>
|
|
||||||
</message>
|
|
||||||
\end{verbatim}
|
|
||||||
is represented as the following structure:
|
|
||||||
\begin{verbatim}
|
|
||||||
{xmlelement, "message",
|
|
||||||
[{"to", "test@conference.example.org"},
|
|
||||||
{"type", "groupchat"}],
|
|
||||||
[{xmlelement, "body",
|
|
||||||
[],
|
|
||||||
[{xmlcdata, "test"}]}]}}
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\section{Module \texttt{xml}}
|
|
||||||
\label{xmlmod}
|
|
||||||
|
|
||||||
\begin{description}
|
|
||||||
\item{\verb|element_to_string(El) -> string()|}
|
|
||||||
\begin{verbatim}
|
|
||||||
El = XMLElement
|
|
||||||
\end{verbatim}
|
|
||||||
Returns string representation of XML stanza \texttt{El}.
|
|
||||||
|
|
||||||
\item{\verb|crypt(S) -> string()|}
|
|
||||||
\begin{verbatim}
|
|
||||||
S = string()
|
|
||||||
\end{verbatim}
|
|
||||||
Returns string which correspond to \texttt{S} with encoded XML special
|
|
||||||
characters.
|
|
||||||
|
|
||||||
\item{\verb|remove_cdata(ECList) -> EList|}
|
|
||||||
\begin{verbatim}
|
|
||||||
ECList = [ElementOrCDATA]
|
|
||||||
EList = [XMLElement]
|
|
||||||
\end{verbatim}
|
|
||||||
\texttt{EList} is a list of all non-CDATA elements of ECList.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\item{\verb|get_path_s(El, Path) -> Res|}
|
|
||||||
\begin{verbatim}
|
|
||||||
El = XMLElement
|
|
||||||
Path = [PathItem]
|
|
||||||
PathItem = PathElem | PathAttr | PathCDATA
|
|
||||||
PathElem = {elem, Name}
|
|
||||||
PathAttr = {attr, Name}
|
|
||||||
PathCDATA = cdata
|
|
||||||
Name = string()
|
|
||||||
Res = string() | XMLElement
|
|
||||||
\end{verbatim}
|
|
||||||
If \texttt{Path} is empty, then returns \texttt{El}. Else sequentially
|
|
||||||
consider elements of \texttt{Path}. Each element is one of:
|
|
||||||
\begin{description}
|
|
||||||
\item{\verb|{elem, Name}|} \texttt{Name} is name of subelement of
|
|
||||||
\texttt{El}, if such element exists, then this element considered in
|
|
||||||
following steps, else returns empty string.
|
|
||||||
\item{\verb|{attr, Name}|} If \texttt{El} have attribute \texttt{Name}, then
|
|
||||||
returns value of this attribute, else returns empty string.
|
|
||||||
\item{\verb|cdata|} Returns CDATA of \texttt{El}.
|
|
||||||
\end{description}
|
|
||||||
|
|
||||||
\item{TODO:}
|
|
||||||
\begin{verbatim}
|
|
||||||
get_cdata/1, get_tag_cdata/1
|
|
||||||
get_attr/2, get_attr_s/2
|
|
||||||
get_tag_attr/2, get_tag_attr_s/2
|
|
||||||
get_subtag/2
|
|
||||||
\end{verbatim}
|
|
||||||
\end{description}
|
|
||||||
|
|
||||||
|
|
||||||
\section{Module \texttt{xml\_stream}}
|
|
||||||
\label{xmlstreammod}
|
|
||||||
|
|
||||||
\begin{description}
|
|
||||||
\item{\verb!parse_element(Str) -> XMLElement | {error, Err}!}
|
|
||||||
\begin{verbatim}
|
|
||||||
Str = string()
|
|
||||||
Err = term()
|
|
||||||
\end{verbatim}
|
|
||||||
Parses \texttt{Str} using XML parser, returns either parsed element or error
|
|
||||||
tuple.
|
|
||||||
\end{description}
|
|
||||||
|
|
||||||
|
|
||||||
\section{Modules}
|
|
||||||
\label{emods}
|
|
||||||
|
|
||||||
|
|
||||||
%\subsection{gen\_mod behaviour}
|
|
||||||
%\label{genmod}
|
|
||||||
|
|
||||||
%TBD
|
|
||||||
|
|
||||||
\subsection{Module gen\_iq\_handler}
|
|
||||||
\label{geniqhandl}
|
|
||||||
|
|
||||||
The module \verb|gen_iq_handler| allows to easily write handlers for IQ packets
|
|
||||||
of particular XML namespaces that addressed to server or to users bare JIDs.
|
|
||||||
|
|
||||||
In this module the following functions are defined:
|
|
||||||
\begin{description}
|
|
||||||
\item{\verb|add_iq_handler(Component, Host, NS, Module, Function, Type)|}
|
|
||||||
\begin{verbatim}
|
|
||||||
Component = Module = Function = atom()
|
|
||||||
Host = NS = string()
|
|
||||||
Type = no_queue | one_queue | parallel
|
|
||||||
\end{verbatim}
|
|
||||||
Registers function \verb|Module:Function| as handler for IQ packets on
|
|
||||||
virtual host \verb|Host| that contain child of namespace \verb|NS| in
|
|
||||||
\verb|Component|. Queueing discipline is \verb|Type|. There are at least
|
|
||||||
two components defined:
|
|
||||||
\begin{description}
|
|
||||||
\item{\verb|ejabberd_local|} Handles packets that addressed to server JID;
|
|
||||||
\item{\verb|ejabberd_sm|} Handles packets that addressed to users bare JIDs.
|
|
||||||
\end{description}
|
|
||||||
\item{\verb|remove_iq_handler(Component, Host, NS)|}
|
|
||||||
\begin{verbatim}
|
|
||||||
Component = atom()
|
|
||||||
Host = NS = string()
|
|
||||||
\end{verbatim}
|
|
||||||
Removes IQ handler on virtual host \verb|Host| for namespace \verb|NS| from
|
|
||||||
\verb|Component|.
|
|
||||||
\end{description}
|
|
||||||
|
|
||||||
Handler function must have the following type:
|
|
||||||
\begin{description}
|
|
||||||
\item{\verb|Module:Function(From, To, IQ)|}
|
|
||||||
\begin{verbatim}
|
|
||||||
From = To = jid()
|
|
||||||
\end{verbatim}
|
|
||||||
\end{description}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\begin{verbatim}
|
|
||||||
-module(mod_cputime).
|
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
|
||||||
|
|
||||||
-export([start/2,
|
|
||||||
stop/1,
|
|
||||||
process_local_iq/3]).
|
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
|
||||||
-include("jlib.hrl").
|
|
||||||
|
|
||||||
-define(NS_CPUTIME, "ejabberd:cputime").
|
|
||||||
|
|
||||||
start(Host, Opts) ->
|
|
||||||
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
|
|
||||||
gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?NS_CPUTIME,
|
|
||||||
?MODULE, process_local_iq, IQDisc).
|
|
||||||
|
|
||||||
stop(Host) ->
|
|
||||||
gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_CPUTIME).
|
|
||||||
|
|
||||||
process_local_iq(From, To, {iq, ID, Type, XMLNS, SubEl}) ->
|
|
||||||
case Type of
|
|
||||||
set ->
|
|
||||||
{iq, ID, error, XMLNS,
|
|
||||||
[SubEl, ?ERR_NOT_ALLOWED]};
|
|
||||||
get ->
|
|
||||||
CPUTime = element(1, erlang:statistics(runtime))/1000,
|
|
||||||
SCPUTime = lists:flatten(io_lib:format("~.3f", CPUTime)),
|
|
||||||
{iq, ID, result, XMLNS,
|
|
||||||
[{xmlelement, "query",
|
|
||||||
[{"xmlns", ?NS_CPUTIME}],
|
|
||||||
[{xmlelement, "cputime", [], [{xmlcdata, SCPUTime}]}]}]}
|
|
||||||
end.
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Services}
|
|
||||||
\label{services}
|
|
||||||
|
|
||||||
%TBD
|
|
||||||
|
|
||||||
|
|
||||||
%TODO: use \verb|proc_lib|
|
|
||||||
\begin{verbatim}
|
|
||||||
-module(mod_echo).
|
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
|
||||||
|
|
||||||
-export([start/2, init/1, stop/1]).
|
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
|
||||||
-include("jlib.hrl").
|
|
||||||
|
|
||||||
start(Host, Opts) ->
|
|
||||||
MyHost = gen_mod:get_opt(host, Opts, "echo." ++ Host),
|
|
||||||
register(gen_mod:get_module_proc(Host, ?PROCNAME),
|
|
||||||
spawn(?MODULE, init, [MyHost])).
|
|
||||||
|
|
||||||
init(Host) ->
|
|
||||||
ejabberd_router:register_local_route(Host),
|
|
||||||
loop(Host).
|
|
||||||
|
|
||||||
loop(Host) ->
|
|
||||||
receive
|
|
||||||
{route, From, To, Packet} ->
|
|
||||||
ejabberd_router:route(To, From, Packet),
|
|
||||||
loop(Host);
|
|
||||||
stop ->
|
|
||||||
ejabberd_router:unregister_route(Host),
|
|
||||||
ok;
|
|
||||||
_ ->
|
|
||||||
loop(Host)
|
|
||||||
end.
|
|
||||||
|
|
||||||
stop(Host) ->
|
|
||||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
|
||||||
Proc ! stop,
|
|
||||||
{wait, Proc}.
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\end{document}
|
|
BIN
doc/discorus.png
Before Width: | Height: | Size: 9.8 KiB |
@ -1,143 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
||||||
<meta name="generator" content="hevea 2.09">
|
|
||||||
<style type="text/css">
|
|
||||||
.li-itemize{margin:1ex 0ex;}
|
|
||||||
.li-enumerate{margin:1ex 0ex;}
|
|
||||||
.dd-description{margin:0ex 0ex 1ex 4ex;}
|
|
||||||
.dt-description{margin:0ex;}
|
|
||||||
.toc{list-style:none;}
|
|
||||||
.footnotetext{margin:0ex; padding:0ex;}
|
|
||||||
div.footnotetext P{margin:0px; text-indent:1em;}
|
|
||||||
.thefootnotes{text-align:left;margin:0ex;}
|
|
||||||
.dt-thefootnotes{margin:0em;}
|
|
||||||
.dd-thefootnotes{margin:0em 0em 0em 2em;}
|
|
||||||
.footnoterule{margin:1em auto 1em 0px;width:50%;}
|
|
||||||
.caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto}
|
|
||||||
.title{margin:2ex auto;text-align:center}
|
|
||||||
.titlemain{margin:1ex 2ex 2ex 1ex;}
|
|
||||||
.titlerest{margin:0ex 2ex;}
|
|
||||||
.center{text-align:center;margin-left:auto;margin-right:auto;}
|
|
||||||
.flushleft{text-align:left;margin-left:0ex;margin-right:auto;}
|
|
||||||
.flushright{text-align:right;margin-left:auto;margin-right:0ex;}
|
|
||||||
div table{margin-left:inherit;margin-right:inherit;margin-bottom:2px;margin-top:2px}
|
|
||||||
td table{margin:auto;}
|
|
||||||
table{border-collapse:collapse;}
|
|
||||||
td{padding:0;}
|
|
||||||
.cellpadding0 tr td{padding:0;}
|
|
||||||
.cellpadding1 tr td{padding:1px;}
|
|
||||||
pre{text-align:left;margin-left:0ex;margin-right:auto;}
|
|
||||||
blockquote{margin-left:4ex;margin-right:4ex;text-align:left;}
|
|
||||||
td p{margin:0px;}
|
|
||||||
.boxed{border:1px solid black}
|
|
||||||
.textboxed{border:1px solid black}
|
|
||||||
.vbar{border:none;width:2px;background-color:black;}
|
|
||||||
.hbar{border:none;height:2px;width:100%;background-color:black;}
|
|
||||||
.hfill{border:none;height:1px;width:200%;background-color:black;}
|
|
||||||
.vdisplay{border-collapse:separate;border-spacing:2px;width:auto; empty-cells:show; border:2px solid red;}
|
|
||||||
.vdcell{white-space:nowrap;padding:0px; border:2px solid green;}
|
|
||||||
.display{border-collapse:separate;border-spacing:2px;width:auto; border:none;}
|
|
||||||
.dcell{white-space:nowrap;padding:0px; border:none;}
|
|
||||||
.dcenter{margin:0ex auto;}
|
|
||||||
.vdcenter{border:solid #FF8000 2px; margin:0ex auto;}
|
|
||||||
.minipage{text-align:left; margin-left:0em; margin-right:auto;}
|
|
||||||
.marginpar{border:solid thin black; width:20%; text-align:left;}
|
|
||||||
.marginparleft{float:left; margin-left:0ex; margin-right:1ex;}
|
|
||||||
.marginparright{float:right; margin-left:1ex; margin-right:0ex;}
|
|
||||||
.theorem{text-align:left;margin:1ex auto 1ex 0ex;}
|
|
||||||
.part{margin:2ex auto;text-align:center}
|
|
||||||
SPAN{width:20%; float:right; text-align:left; margin-left:auto;}
|
|
||||||
</style>
|
|
||||||
<title>Ejabberd community 14.05-120-gedfb5fc Feature Sheet
|
|
||||||
</title>
|
|
||||||
</head>
|
|
||||||
<body >
|
|
||||||
<!--HEVEA command line is: /usr/bin/hevea -fix -pedantic features.tex -->
|
|
||||||
<!--CUT STYLE article--><!--CUT DEF section 1 --><p><a id="titlepage"></a>
|
|
||||||
|
|
||||||
</p><table class="title"><tr><td style="padding:1ex"><h1 class="titlemain">Ejabberd community 14.05-120-gedfb5fc Feature Sheet</h1><h3 class="titlerest">Sander Devrieze <br>
|
|
||||||
<a href="mailto:s.devrieze@pandora.be"><span style="font-family:monospace">mailto:s.devrieze@pandora.be</span></a> <br>
|
|
||||||
<a href="xmpp:sander@devrieze.dyndns.org"><span style="font-family:monospace">xmpp:sander@devrieze.dyndns.org</span></a></h3></td></tr>
|
|
||||||
</table><div class="center">
|
|
||||||
|
|
||||||
<img src="logo.png" alt="logo.png">
|
|
||||||
|
|
||||||
|
|
||||||
</div><blockquote class="quotation"><span style="color:#921700"><span style="font-style:italic">I can thoroughly recommend ejabberd for ease of setup –
|
|
||||||
Kevin Smith, Current maintainer of the Psi project</span></span></blockquote><p>Introduction
|
|
||||||
<a id="intro"></a></p><blockquote class="quotation"><span style="color:#921700"><span style="font-style:italic">I just tried out ejabberd and was impressed both by ejabberd itself and the language it is written in, Erlang. —
|
|
||||||
Joeri</span></span></blockquote><p><span style="font-family:monospace">ejabberd</span> is a <span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">free and open source</span></span></span> instant messaging server written in <a href="http://www.erlang.org/">Erlang/OTP</a>.</p><p><span style="font-family:monospace">ejabberd</span> is <span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">cross-platform</span></span></span>, distributed, fault-tolerant, and based on open standards to achieve real-time communication.</p><p><span style="font-family:monospace">ejabberd</span> is designed to be a <span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">rock-solid and feature rich</span></span></span> XMPP server.</p><p><span style="font-family:monospace">ejabberd</span> is suitable for small deployments, whether they need to be <span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">scalable</span></span></span> or not, as well as extremely big deployments.</p>
|
|
||||||
<!--TOC section id="sec1" Key Features-->
|
|
||||||
<h2 id="sec1" class="section">Key Features</h2><!--SEC END --><p>
|
|
||||||
<a id="keyfeatures"></a>
|
|
||||||
</p><blockquote class="quotation"><span style="color:#921700"><span style="font-style:italic">Erlang seems to be tailor-made for writing stable, robust servers. —
|
|
||||||
Peter Saint-André, Executive Director of the Jabber Software Foundation</span></span></blockquote><p><span style="font-family:monospace">ejabberd</span> is:
|
|
||||||
</p><ul class="itemize"><li class="li-itemize">
|
|
||||||
<span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">Cross-platform:</span></span></span> <span style="font-family:monospace">ejabberd</span> runs under Microsoft Windows and Unix derived systems such as Linux, FreeBSD and NetBSD.</li><li class="li-itemize"><span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">Distributed:</span></span></span> You can run <span style="font-family:monospace">ejabberd</span> 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.</li><li class="li-itemize"><span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">Fault-tolerant:</span></span></span> You can deploy an <span style="font-family:monospace">ejabberd</span> 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’.</li><li class="li-itemize"><span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">Administrator Friendly:</span></span></span> <span style="font-family:monospace">ejabberd</span> 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:
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Comprehensive documentation.
|
|
||||||
</li><li class="li-itemize">Straightforward installers for Linux, Mac OS X, and Windows. </li><li class="li-itemize">Web Administration.
|
|
||||||
</li><li class="li-itemize">Shared Roster Groups.
|
|
||||||
</li><li class="li-itemize">Command line administration tool. </li><li class="li-itemize">Can integrate with existing authentication mechanisms.
|
|
||||||
</li><li class="li-itemize">Capability to send announce messages.
|
|
||||||
</li></ul></li><li class="li-itemize"><span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">Internationalized:</span></span></span> <span style="font-family:monospace">ejabberd</span> leads in internationalization. Hence it is very well suited in a globalized world. Related features are:
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Translated to 25 languages. </li><li class="li-itemize">Support for <a href="http://www.ietf.org/rfc/rfc3490.txt">IDNA</a>.
|
|
||||||
</li></ul></li><li class="li-itemize"><span style="font-weight:bold"><span style="font-size:large"><span style="color:#001376">Open Standards:</span></span></span> <span style="font-family:monospace">ejabberd</span> is the first Open Source Jabber server claiming to fully comply to the XMPP standard.
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Fully XMPP compliant.
|
|
||||||
</li><li class="li-itemize">XML-based protocol.
|
|
||||||
</li><li class="li-itemize"><a href="http://www.ejabberd.im/protocols">Many protocols supported</a>.
|
|
||||||
</li></ul></li></ul>
|
|
||||||
<!--TOC section id="sec2" Additional Features-->
|
|
||||||
<h2 id="sec2" class="section">Additional Features</h2><!--SEC END --><p>
|
|
||||||
<a id="addfeatures"></a>
|
|
||||||
</p><blockquote class="quotation"><span style="color:#921700"><span style="font-style:italic">ejabberd is making inroads to solving the "buggy incomplete server" problem —
|
|
||||||
Justin Karneges, Founder of the Psi and the Delta projects</span></span></blockquote><p>Moreover, <span style="font-family:monospace">ejabberd</span> comes with a wide range of other state-of-the-art features:
|
|
||||||
</p><ul class="itemize"><li class="li-itemize">
|
|
||||||
Modular
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Load only the modules you want.
|
|
||||||
</li><li class="li-itemize">Extend <span style="font-family:monospace">ejabberd</span> with your own custom modules.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Security
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
SASL and STARTTLS for c2s and s2s connections.
|
|
||||||
</li><li class="li-itemize">STARTTLS and Dialback s2s connections.
|
|
||||||
</li><li class="li-itemize">Web Admin accessible via HTTPS secure access.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Databases
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Internal database for fast deployment (Mnesia).
|
|
||||||
</li><li class="li-itemize">Native MySQL support.
|
|
||||||
</li><li class="li-itemize">Native PostgreSQL support.
|
|
||||||
</li><li class="li-itemize">ODBC data storage support.
|
|
||||||
</li><li class="li-itemize">Microsoft SQL Server support. </li><li class="li-itemize">Riak NoSQL database support.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Authentication
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Internal Authentication.
|
|
||||||
</li><li class="li-itemize">PAM, LDAP, ODBC and Riak. </li><li class="li-itemize">External Authentication script.
|
|
||||||
</li></ul>
|
|
||||||
</li><li class="li-itemize">Others
|
|
||||||
<ul class="itemize"><li class="li-itemize">
|
|
||||||
Support for virtual hosting.
|
|
||||||
</li><li class="li-itemize">Compressing XML streams with Stream Compression (<a href="http://www.xmpp.org/extensions/xep-0138.html">XEP-0138</a>).
|
|
||||||
</li><li class="li-itemize">Statistics via Statistics Gathering (<a href="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</a>).
|
|
||||||
</li><li class="li-itemize">IPv6 support both for c2s and s2s connections.
|
|
||||||
</li><li class="li-itemize"><a href="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</a> module with support for clustering and HTML logging. </li><li class="li-itemize">Users Directory based on users vCards.
|
|
||||||
</li><li class="li-itemize"><a href="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</a> component with support for <a href="http://www.xmpp.org/extensions/xep-0163.html">Personal Eventing via Pubsub</a>.
|
|
||||||
</li><li class="li-itemize">Support for web clients: <a href="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</a> and <a href="http://www.xmpp.org/extensions/xep-0206.html">HTTP Binding (BOSH)</a> services.
|
|
||||||
</li><li class="li-itemize">IRC transport.
|
|
||||||
</li><li class="li-itemize">SIP support.
|
|
||||||
</li><li class="li-itemize">Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
|
|
||||||
</li></ul>
|
|
||||||
</li></ul><!--CUT END -->
|
|
||||||
<!--HTMLFOOT-->
|
|
||||||
<!--ENDHTML-->
|
|
||||||
<!--FOOTER-->
|
|
||||||
<hr style="height:2"><blockquote class="quote"><em>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
|
|
||||||
</em><a href="http://hevea.inria.fr/index.html"><em>H</em><em><span style="font-size:small"><sup>E</sup></span></em><em>V</em><em><span style="font-size:small"><sup>E</sup></span></em><em>A</em></a><em>.</em></blockquote></body>
|
|
||||||
</html>
|
|
136
doc/features.tex
@ -1,136 +0,0 @@
|
|||||||
\documentclass[a4paper,10pt]{article}
|
|
||||||
|
|
||||||
%% Packages
|
|
||||||
\usepackage{epsfig}
|
|
||||||
\usepackage{fancyhdr}
|
|
||||||
\usepackage{graphics}
|
|
||||||
\usepackage{hevea}
|
|
||||||
\usepackage[pdftex,colorlinks,unicode,urlcolor=blue,linkcolor=blue,pdftitle=Ejabberd\
|
|
||||||
Feature\ Sheet,pdfauthor=Sander\
|
|
||||||
Devrieze,pdfsubject=ejabberd,pdfkeywords=ejabberd]{hyperref}
|
|
||||||
\usepackage{verbatim}
|
|
||||||
\usepackage{color}
|
|
||||||
|
|
||||||
%% Index
|
|
||||||
% Remove the index anchors from the HTML version to save size and bandwith.
|
|
||||||
\newcommand{\ind}[1]{\begin{latexonly}\index{#1}\end{latexonly}}
|
|
||||||
|
|
||||||
%% Images
|
|
||||||
\newcommand{\logoscale}{0.7}
|
|
||||||
\newcommand{\imgscale}{0.58}
|
|
||||||
\newcommand{\insimg}[1]{\insscaleimg{\imgscale}{#1}}
|
|
||||||
\newcommand{\insscaleimg}[2]{
|
|
||||||
\imgsrc{#2}{}
|
|
||||||
\begin{latexonly}
|
|
||||||
\scalebox{#1}{\includegraphics{#2}}
|
|
||||||
\end{latexonly}
|
|
||||||
}
|
|
||||||
|
|
||||||
%% Various
|
|
||||||
\newcommand{\bracehack}{\def\{{\char"7B}\def\}{\char"7D}}
|
|
||||||
\newcommand{\titem}[1]{\item[\bracehack\texttt{#1}]}
|
|
||||||
\newcommand{\ns}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\jid}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\option}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\poption}[1]{{\bracehack\texttt{#1}}}
|
|
||||||
\newcommand{\node}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\term}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\shell}[1]{\texttt{#1}}
|
|
||||||
\newcommand{\ejabberd}{\texttt{ejabberd}}
|
|
||||||
\newcommand{\Jabber}{Jabber}
|
|
||||||
|
|
||||||
%% Title page
|
|
||||||
\include{version}
|
|
||||||
\title{Ejabberd \version\ Feature Sheet}
|
|
||||||
\author{Sander Devrieze \\
|
|
||||||
\ahrefurl{mailto:s.devrieze@pandora.be} \\
|
|
||||||
\ahrefurl{xmpp:sander@devrieze.dyndns.org}}
|
|
||||||
|
|
||||||
% Options
|
|
||||||
\newcommand{\marking}[1]{\textbf{\begin{large}\textcolor{ejblue}{#1}\end{large}}} % Marking enabled
|
|
||||||
\newcommand{\quoting}[2][yozhik]{\begin{quotation}\textcolor{#1}{\textit{#2}}\end{quotation}} % Quotes enabled
|
|
||||||
\newcommand{\new}{\marginpar{\textcolor{red}{\textsc{new}}}} % Highlight new features
|
|
||||||
\newcommand{\improved}{\marginpar{\textcolor{orange}{\textsc{improved}}}} % Highlight improved features
|
|
||||||
\setcounter{secnumdepth}{-1} % Disable section numbering
|
|
||||||
|
|
||||||
%% To by-pass errors in the HTML version.
|
|
||||||
\newstyle{SPAN}{width:20\%; float:right; text-align:left; margin-left:auto;}
|
|
||||||
\definecolor{orange} {cmyk}{0.000,0.333,1.000,0.000}
|
|
||||||
|
|
||||||
%% Footnotes
|
|
||||||
\begin{latexonly}
|
|
||||||
\global\parskip=9pt plus 3pt minus 1pt
|
|
||||||
\global\parindent=0pt
|
|
||||||
\gdef\ahrefurl#1{\href{#1}{\texttt{#1}}}
|
|
||||||
\gdef\footahref#1#2{#2\footnote{\href{#1}{\texttt{#1}}}}
|
|
||||||
\end{latexonly}
|
|
||||||
\newcommand{\txepref}[2]{\footahref{http://www.xmpp.org/extensions/xep-#1.html}{#2}}
|
|
||||||
\newcommand{\xepref}[1]{\txepref{#1}{XEP-#1}}
|
|
||||||
|
|
||||||
%% Fancy header
|
|
||||||
\fancyhf{}
|
|
||||||
\pagestyle{fancy}
|
|
||||||
\rhead{\textcolor{ejblue}{The Expandable Jabber/XMPP Daemon.}}
|
|
||||||
\renewcommand{\headrule}{{\color{ejblue}%
|
|
||||||
\hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}
|
|
||||||
\lhead{\setlength{\unitlength}{-6mm}
|
|
||||||
\begin{picture}(0,0)
|
|
||||||
\put(5.8,3.25){\includegraphics[width=1.3\textwidth]{yozhikheader.png}}
|
|
||||||
\end{picture}}
|
|
||||||
|
|
||||||
% Official ejabberd colours
|
|
||||||
\definecolor{ejblue} {cmyk}{1.000,0.831,0.000,0.537} %RGB: 0,0,118 HTML: 000076
|
|
||||||
\definecolor{ejgreenyellow}{cmyk}{0.079,0.000,0.275,0.102} %RGB: 209,229,159 HTML: d1e59f
|
|
||||||
\definecolor{ejgreendark} {cmyk}{0.131,0.000,0.146,0.220} %RGB: 166,199,162 HTML: a6c7a2
|
|
||||||
\definecolor{ejgreen} {cmyk}{0.077,0.000,0.081,0.078} %RGB: 216,236,215 HTML: d8ecd7
|
|
||||||
\definecolor{ejgreenwhite} {cmyk}{0.044,0.000,0.048,0.020} %RGB: 239,250,238 HTML: effaee
|
|
||||||
\definecolor{yozhik} {cmyk}{0.000,0.837,1.000,0.424} %RGB: 147,0,0 HTML: 930000
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\label{titlepage}
|
|
||||||
\begin{titlepage}
|
|
||||||
\maketitle{}
|
|
||||||
|
|
||||||
\thispagestyle{empty}
|
|
||||||
|
|
||||||
\begin{center}
|
|
||||||
{\insscaleimg{\logoscale}{logo.png}
|
|
||||||
\par
|
|
||||||
}
|
|
||||||
\end{center}
|
|
||||||
\quoting{I can thoroughly recommend ejabberd for ease of setup --
|
|
||||||
Kevin Smith, Current maintainer of the Psi project}
|
|
||||||
|
|
||||||
\end{titlepage}
|
|
||||||
|
|
||||||
\newpage
|
|
||||||
% Set the page counter to 2 so that the titlepage and the second page do not
|
|
||||||
% have the same page number. This fixes the PDFLaTeX warning "destination with
|
|
||||||
% the same identifier".
|
|
||||||
\begin{latexonly}
|
|
||||||
\setcounter{page}{2}
|
|
||||||
\pagecolor{ejgreenwhite}
|
|
||||||
\end{latexonly}
|
|
||||||
|
|
||||||
% Input introduction.tex
|
|
||||||
\input{introduction}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||
%% TODO
|
|
||||||
% * illustrations (e.g. screenshot from web interface)
|
|
||||||
% * commented parts
|
|
||||||
% * slides, guide and html version
|
|
||||||
% * cleaning and improving LaTeX code
|
|
||||||
% * key features: something like this (shorter)? (more focussed on Erlang now): "To reach the goal of high
|
|
||||||
% availability, performance and clustering, ejabberd is written in Erlang, a programming language perfectly
|
|
||||||
% suited for this. Besides that, some parts are written in C to also incude the advantages of this language. In
|
|
||||||
% short, ejabberd is a perfect mix of mainly Erlang code, peppered with some C code to get the final touch!"
|
|
||||||
% <picture of a cocktail>
|
|
||||||
% * key features: saying that ejabberd the only XMPP server is that can do real clustering:
|
|
||||||
% http://www.jivesoftware.org/forums/thread.jspa?threadID=14602
|
|
||||||
% "What I find interesting is that *no* XMPP servers truly provide clustering. This includes all the commercial
|
|
||||||
% servers. The one partial exception appears to be ejabberd, which can cluster certain data such as sessions,
|
|
||||||
% but not all services such as MUC."
|
|
||||||
% * try it today: links to migration tutorials
|
|
105
doc/flow.dot
@ -1,105 +0,0 @@
|
|||||||
digraph messages {
|
|
||||||
//concentrate=true;
|
|
||||||
subgraph clusterclients {
|
|
||||||
client1 [shape = box];
|
|
||||||
client2 [shape = box];
|
|
||||||
client3 [shape = box];
|
|
||||||
|
|
||||||
style = dashed;
|
|
||||||
label = "Clients";
|
|
||||||
}
|
|
||||||
|
|
||||||
subgraph clusternode1 {
|
|
||||||
subgraph clusterc2s1 {
|
|
||||||
c2s11;
|
|
||||||
c2s12;
|
|
||||||
style = invis;
|
|
||||||
}
|
|
||||||
subgraph clusterservices1 {
|
|
||||||
service11;
|
|
||||||
service12;
|
|
||||||
service13;
|
|
||||||
style = invis;
|
|
||||||
}
|
|
||||||
//subgraph clusters2s1 {
|
|
||||||
//s2s11;
|
|
||||||
//s2s12;
|
|
||||||
//style = invis;
|
|
||||||
//}
|
|
||||||
c2s11 -> auth1;
|
|
||||||
c2s12 -> auth1;
|
|
||||||
auth1 -> c2s11;
|
|
||||||
auth1 -> c2s12;
|
|
||||||
c2s11 -> sm1;
|
|
||||||
c2s11 -> router1;
|
|
||||||
c2s12 -> sm1;
|
|
||||||
c2s12 -> router1;
|
|
||||||
router1 -> local1;
|
|
||||||
router1 -> service11;
|
|
||||||
router1 -> service12;
|
|
||||||
router1 -> service13;
|
|
||||||
router1 -> s2s11;
|
|
||||||
router1 -> s2s12;
|
|
||||||
service11 -> router1;
|
|
||||||
service12 -> router1;
|
|
||||||
service13 -> router1;
|
|
||||||
s2s11 -> router1;
|
|
||||||
s2s12 -> router1;
|
|
||||||
local1 -> sm1;
|
|
||||||
sm1 -> c2s11;
|
|
||||||
sm1 -> c2s12;
|
|
||||||
|
|
||||||
style = dashed;
|
|
||||||
label = "Node1";
|
|
||||||
}
|
|
||||||
|
|
||||||
subgraph clusternode2 {
|
|
||||||
c2s2 -> auth2;
|
|
||||||
auth2 -> c2s2;
|
|
||||||
c2s2 -> sm2;
|
|
||||||
c2s2 -> router2;
|
|
||||||
router2 -> local2;
|
|
||||||
router2 -> service21;
|
|
||||||
router2 -> s2s21;
|
|
||||||
service21 -> router2;
|
|
||||||
s2s21 -> router2;
|
|
||||||
local2 -> sm2;
|
|
||||||
sm2 -> c2s2;
|
|
||||||
|
|
||||||
style = dashed;
|
|
||||||
label = "Node2";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
subgraph clusterservers {
|
|
||||||
server1 [shape = box];
|
|
||||||
server2 [shape = box];
|
|
||||||
server3 [shape = box];
|
|
||||||
|
|
||||||
style = dashed;
|
|
||||||
label = "Servers";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
client1 -> c2s11;
|
|
||||||
client2 -> c2s12;
|
|
||||||
client3 -> c2s2;
|
|
||||||
c2s11 -> client1 [constraint=false];
|
|
||||||
c2s12 -> client2 [constraint=false];
|
|
||||||
c2s2 -> client3 [constraint=false];
|
|
||||||
|
|
||||||
s2s11 -> server1 [minlen = 2];
|
|
||||||
s2s12 -> server2 [minlen = 2];
|
|
||||||
s2s21 -> server3 [minlen = 2];
|
|
||||||
server1 -> s2s11 [constraint=false];
|
|
||||||
server2 -> s2s12 [constraint=false];
|
|
||||||
server3 -> s2s21 [constraint=false];
|
|
||||||
|
|
||||||
router1 -> router2;
|
|
||||||
router2 -> router1;
|
|
||||||
sm1 -> sm2;
|
|
||||||
sm2 -> sm1;
|
|
||||||
|
|
||||||
label = "Data Flows";
|
|
||||||
}
|
|
6494
doc/guide.tex
@ -1,135 +0,0 @@
|
|||||||
\chapter{Introduction}
|
|
||||||
\label{intro}
|
|
||||||
|
|
||||||
%% TODO: improve the feature sheet with a nice table to highlight new features.
|
|
||||||
|
|
||||||
\quoting{I just tried out ejabberd and was impressed both by ejabberd itself and the language it is written in, Erlang. ---
|
|
||||||
Joeri}
|
|
||||||
|
|
||||||
%ejabberd is a free and open source instant messaging server written in Erlang. ejabberd is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication (Jabber/XMPP).
|
|
||||||
|
|
||||||
\ejabberd{} is a \marking{free and open source} instant messaging server written in \footahref{http://www.erlang.org/}{Erlang/OTP}.
|
|
||||||
|
|
||||||
\ejabberd{} is \marking{cross-platform}, distributed, fault-tolerant, and based on open standards to achieve real-time communication.
|
|
||||||
|
|
||||||
\ejabberd{} is designed to be a \marking{rock-solid and feature rich} XMPP server.
|
|
||||||
|
|
||||||
\ejabberd{} is suitable for small deployments, whether they need to be \marking{scalable} or not, as well as extremely big deployments.
|
|
||||||
|
|
||||||
%\subsection{Layout with example deployment (title needs a better name)}
|
|
||||||
%\label{layout}
|
|
||||||
|
|
||||||
%In this section there will be a graphical overview like these:\\
|
|
||||||
%\verb|http://www.tipic.com/var/timp/timp_dep.gif| \\
|
|
||||||
%\verb|http://www.jabber.com/images/jabber_Com_Platform.jpg| \\
|
|
||||||
%\verb|http://www.antepo.com/files/OPN45systemdatasheet.pdf| \\
|
|
||||||
|
|
||||||
%A page full with names of Jabber client that are known to work with ejabberd. \begin{tiny}tiny font\end{tiny}
|
|
||||||
|
|
||||||
%\subsection{Try It Today}
|
|
||||||
%\label{trytoday}
|
|
||||||
|
|
||||||
%(Not sure if I will include/finish this section for the next version.)
|
|
||||||
|
|
||||||
%\begin{itemize}
|
|
||||||
%\item Erlang REPOS
|
|
||||||
%\item Packages in distributions
|
|
||||||
%\item Windows binary
|
|
||||||
%\item source tar.gz
|
|
||||||
%\item Migration from Jabberd14 (and so also Jabberd2 because you can migrate from version 2 back to 14) and Jabber Inc. XCP possible.
|
|
||||||
%\end{itemize}
|
|
||||||
|
|
||||||
\newpage
|
|
||||||
\section{Key Features}
|
|
||||||
\label{keyfeatures}
|
|
||||||
\ind{features!key features}
|
|
||||||
|
|
||||||
\quoting{Erlang seems to be tailor-made for writing stable, robust servers. ---
|
|
||||||
Peter Saint-Andr\'e, Executive Director of the Jabber Software Foundation}
|
|
||||||
|
|
||||||
\ejabberd{} is:
|
|
||||||
\begin{itemize}
|
|
||||||
\item \marking{Cross-platform:} \ejabberd{} runs under Microsoft Windows and Unix derived systems such as Linux, FreeBSD and NetBSD.
|
|
||||||
|
|
||||||
\item \marking{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.
|
|
||||||
|
|
||||||
\item \marking{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'.
|
|
||||||
|
|
||||||
\item \marking{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:
|
|
||||||
\begin{itemize}
|
|
||||||
\item Comprehensive documentation.
|
|
||||||
\item Straightforward installers for Linux, Mac OS X, and Windows. %%\improved{}
|
|
||||||
\item Web Administration.
|
|
||||||
\item Shared Roster Groups.
|
|
||||||
\item Command line administration tool. %%\improved{}
|
|
||||||
\item Can integrate with existing authentication mechanisms.
|
|
||||||
\item Capability to send announce messages.
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
\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://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.
|
|
||||||
\begin{itemize}
|
|
||||||
\item Fully XMPP compliant.
|
|
||||||
\item XML-based protocol.
|
|
||||||
\item \footahref{http://www.ejabberd.im/protocols}{Many protocols supported}.
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
\newpage
|
|
||||||
|
|
||||||
\section{Additional Features}
|
|
||||||
\label{addfeatures}
|
|
||||||
\ind{features!additional features}
|
|
||||||
|
|
||||||
\quoting{ejabberd is making inroads to solving the "buggy incomplete server" problem ---
|
|
||||||
Justin Karneges, Founder of the Psi and the Delta projects}
|
|
||||||
|
|
||||||
Moreover, \ejabberd{} comes with a wide range of other state-of-the-art features:
|
|
||||||
\begin{itemize}
|
|
||||||
\item Modular
|
|
||||||
\begin{itemize}
|
|
||||||
\item Load only the modules you want.
|
|
||||||
\item Extend \ejabberd{} with your own custom modules.
|
|
||||||
\end{itemize}
|
|
||||||
\item Security
|
|
||||||
\begin{itemize}
|
|
||||||
\item SASL and STARTTLS for c2s and s2s connections.
|
|
||||||
\item STARTTLS and Dialback s2s connections.
|
|
||||||
\item Web Admin accessible via HTTPS secure access.
|
|
||||||
\end{itemize}
|
|
||||||
\item Databases
|
|
||||||
\begin{itemize}
|
|
||||||
\item Internal database for fast deployment (Mnesia).
|
|
||||||
\item Native MySQL support.
|
|
||||||
\item Native PostgreSQL support.
|
|
||||||
\item ODBC data storage support.
|
|
||||||
\item Microsoft SQL Server support. %%\new{}
|
|
||||||
\item Riak NoSQL database support.
|
|
||||||
\end{itemize}
|
|
||||||
\item Authentication
|
|
||||||
\begin{itemize}
|
|
||||||
\item Internal Authentication.
|
|
||||||
\item PAM, LDAP, ODBC and Riak. %%\improved{}
|
|
||||||
\item External Authentication script.
|
|
||||||
\end{itemize}
|
|
||||||
\item Others
|
|
||||||
\begin{itemize}
|
|
||||||
\item Support for virtual hosting.
|
|
||||||
\item Compressing XML streams with Stream Compression (\xepref{0138}).
|
|
||||||
\item Statistics via Statistics Gathering (\xepref{0039}).
|
|
||||||
\item IPv6 support both for c2s and s2s connections.
|
|
||||||
\item \txepref{0045}{Multi-User Chat} module with support for clustering and HTML logging. %%\improved{}
|
|
||||||
\item Users Directory based on users vCards.
|
|
||||||
\item \txepref{0060}{Publish-Subscribe} component with support for \txepref{0163}{Personal Eventing via Pubsub}.
|
|
||||||
\item Support for web clients: \txepref{0025}{HTTP Polling} and \txepref{0206}{HTTP Binding (BOSH)} services.
|
|
||||||
\item IRC transport.
|
|
||||||
\item SIP support.
|
|
||||||
\item Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
|
|
||||||
\end{itemize}
|
|
||||||
\end{itemize}
|
|
BIN
doc/logo.png
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 140 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 157 KiB |