user$ svn checkout svn.process-one.net/ejabberd
user$ cd ejabberd/trunk/src/
user$ ./configure --enable-odbc
user$ make
user$ sudo make install
user$ wget -c www.ejabberd.im/files/contributions/mod_shared_roster_ldap.erl
user$ erlc -I ejabberd/trunk/src/ mod_shared_roster_ldap.erl
./mod_shared_roster_ldap.erl:19: Warning: behaviour gen_mod undefined
./mod_shared_roster_ldap.erl:289: Warning: variable 'User' is unused
user$ sudo cp mod_shared_roster_ldap.beam /lib/ejabberd/ebin/
override_global.
override_local.
override_acls.
{loglevel, 4}.
%% ,
, admin@domain %%
{watchdog_admins, ["admin@domain"]}.
%% , ejabberd,
cartman. hostname %%
{hosts, ["cartman"]}.
{listen,
[
%% %%
{5222, ejabberd_c2s, [
{access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536}
]},
%% , . SSL %%
{5223, ejabberd_c2s, [
{access, c2s},
{shaper, c2s_shaper},
%% , %%
{certfile, "/etc/ejabberd/cert/ejabberd.pem"}, tls,
{max_stanza_size, 65536}
]},
%% jabber %%
{5269, ejabberd_s2s_in, [
{shaper, s2s_shaper},
{max_stanza_size, 131072}
]},
%% , pyucq-t %%
{8888, ejabberd_service, [
{access, all},
{shaper_rule, fast},
{ip, {127, 0, 0, 1}},
%% %%
{hosts, ["icq.cartman"],
%% , pyicq-t %%
[{password, "123456"}]}
]},
%% ejabberd, %%
{5280, ejabberd_http, [
http_poll,
web_admin
]}
]}.
%% ldap %%
{auth_method, ldap}.
%% , domain.local %%
{ldap_servers, ["domain.local"]}.
{ldap_uids, [{"sAMAccountName"}]}.
{ldap_base, "dc=domain,dc=local"}.
%% , root, "" "" Users, ldap ( ?) %%
{ldap_rootdn, "cn=root,cn=Users,dc=domain,dc=local"}.
%% %%
{ldap_password, "123456"}.
%% , jabber ( ) %%
{shaper, normal, {maxrate, 10000}}.
{shaper, fast, {maxrate, 500000}}.
%% , admin %%
{acl, admin, {user, "admin", "cartman"}}.
%% , %%
{acl, admin, {user, "admin2", "cartman"}}.
{acl, local, {user_regexp, ""}}.
{access, max_user_sessions, [{10, all}]}.
{access, local, [{allow, local}]}.
%% , , jabber %%
{access, c2s, [{deny, blocked},
{allow, all}]}.
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
{access, s2s_shaper, [{fast, all}]}.
{access, announce, [{allow, admin}]}.
{access, configure, [{allow, admin}]}.
{access, muc_admin, [{allow, admin}]}.
{access, muc, [{allow, all}]}.
{access, pubsub_createnode, [{allow, all}]}.
%% , AD %%
{access, register, [{deny, all}]}.
{language, "ru"}.
{modules,
[
{mod_adhoc, []},
{mod_announce, [{access, announce}]}, % recommends mod_adhoc
{mod_caps, []},
{mod_configure,[]}, % requires mod_adhoc
{mod_disco, []},
{mod_echo, [{host, "echo.localhost"}]},
{mod_last, []},
{mod_muc, [
{access, muc},
{access_create, muc},
{access_persistent, muc},
{access_admin, muc_admin}
]},
%% , , , . %%
{mod_muc_log, [
{access, muc},
{access_create, muc},
{access_admin, muc_admin},
{access_log, muc},
{outdir, "/var/log/muc_log"},
{top_link, {"http://cartman/", "JABBER SERVER"}}
]},
{mod_offline, []},
{mod_privacy, []},
{mod_private, []},
{mod_pubsub, [ % requires mod_caps
{access_createnode, pubsub_createnode},
{plugins, ["default", "pep"]}
]},
{mod_register, [
{welcome_message, {"Welcome",
"Hi! Welcome to this Jabber server."}},
%% , , , , , . %%
{registration_watchers, ["admin@cartman"]},
{access, register}
]},
{mod_roster, []},
{mod_stats, []},
{mod_time, []},
%% vcard AD, %%
{mod_vcard_ldap,
[{host, "users.cartman"},
{ldap_vcard_map,
[{"NICKNAME", "%u", []},
{"GIVEN", "%s", ["givenName"]},
{"MIDDLE", "%s", ["initials"]},
{"FAMILY", "%s", ["sn"]},
{"FN", "%s", ["displayName"]},
{"EMAIL", "%s", ["mail"]},
{"ORGNAME", "%s", ["company"]},
{"ORGUNIT", "%s", ["department"]},
{"CTRY", "%s", ["c"]},
{"LOCALITY", "%s", ["l"]},
{"STREET", "%s", ["streetAddress"]},
{"REGION", "%s", ["st"]},
{"PCODE", "%s", ["postalCode"]},
{"TITLE", "%s", ["title"]},
{"URL", "%s", ["wWWHomePage"]},
{"DESC", "%s", ["description"]},
{"TEL", "%s", ["telephoneNumber"]}]},
{ldap_search_fields,
[{"User", "%u"},
{"Name", "givenName"},
{"Family Name", "sn"},
{"Email", "mail"},
{"Phone", "telephoneNumber"}
]},
{ldap_search_reported,
[{"Full Name", "FN"},
{"Nickname", "NICKNAME"},
{"Email", "EMAIL"}]}
]},
%% shared_roster. department, AD %%
{mod_shared_roster_ldap,
[{ldap_groupattr,"department"},
{ldap_groupdesc,"department"},
%% , , AD JabberUsers, "" Users. , JabberUsers %%
{ldap_rfilter, "(&(memberOf=CN=JabberUsers,CN=Users,DC=klondike,DC=local) (|(userAccountControl=66050)(userAccountControl=66048)))"},
{ldap_memberattr,"sAMAccountName"},
{ldap_userdesc,"cn"}
]
},
{mod_version, []}
]}.
mkdir /etc/ejabberd/cert
cd /etc/ejabberd/cert
openssl req -new -x509 -newkey rsa:1024 -days 3650 -keyout privkey.pem -out server.pem
openssl rsa -in privkey.pem -out privkey.pem
cat privkey.pem >> ejabberd.pem
rm privkey.pem
user$ sudo emerge net-im/pyicq-t
<pyicqt>
<jid>icq.cartman</jid>
<spooldir>/var/spool/jabber</spooldir>
<pid>/var/run/jabber/pyicq-t.pid</pid>
<mainServer>127.0.0.1</mainServer>
<mainServerJID>cartman</mainServerJID>
<website>http://cartman/</website>
<supportJid>admin@cartman</supportJid>
<port>8888</port>
<webport>12345</webport>
<secret>123456</secret>
<lang>ru</lang>
<encoding>cp-1251</encoding>
<icqServer>login.icq.com</icqServer>
<icqPort>5190</icqPort>
<usemd5auth/>
<sessionGreeting>Welcome to icq gate of Cartman server</sessionGreeting>
<enableShutdownMessage/>
<customShutdownMessage>Sorry but icq gete will be shutdown.</customShutdownMessage>
<registerMessage>You have succsefull registed</registerMessage>
<crossChat/>
<enableAutoInvite/>
<xstatusessupport/>
<detectunicode>1</detectunicode>
<admins>
<jid>admin@cartman</jid>
</admins>
<reactor>epoll</reactor>
<!--<xdbDriver>xmlfiles</xdbDriver>-->
<xdbDriver>mysql</xdbDriver>
<xdbDriver_mysql>
<username>pyicqt</username>
<password>12345678</password>
<database>pyicqt</database>
<server>localhost</server>
<format>encrypted</format>
</xdbDriver_mysql>
<avatarsOnlyOnChat/>
</pyicqt>
user$ mysql -u pyicqt -D pyicqt -p
mysql> \. db-setup.mysql
user$ sudo ejabberdctl start
user$ sudo /etc/init.d/pyicq-t start
user$ sudo tail -F /var/log/ejabberd/ejabberd.log
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import os
import re
import sys
username = os.getenv('USERNAME')
find_accountname = re.compile('^\s{0,3}<jid type="QString" >(.+)@cartman</jid>$')
change_username = re.compile('QWERTYUIOP')
fr = open('accounts_old', 'r')
fw = open('accounts.xml', 'w+')
for i in fr.readlines():
if find_accountname.search(i):
i = change_username.sub(username, i)
fw.write(i)
fr.close()
fw.close()
@Echo off
IF EXIST "C:\Python25\python.exe" (
IF NOT EXIST "C:\Documents and Settings\%USERNAME%\Psi\psi.exe" (
xcopy \dc\Soft\ezotrank\psi_ad\* "C:\Documents and Settings\%USERNAME%" /E /C
cd "C:\Documents and Settings\%USERNAME%\PsiData\profiles\default"
python psi_settings.py
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v psi_run /d "C:\Documents and Settings\%USERNAME%\Psi\psi.exe"
)
)
Source: https://habr.com/ru/post/56916/
All Articles