social_stream 0.11.2 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. data/Gemfile +0 -9
  2. data/base/app/assets/stylesheets/contacts.css.scss +8 -3
  3. data/base/app/assets/stylesheets/frontpage.css.scss +1 -1
  4. data/base/app/assets/stylesheets/search.css.scss +17 -1
  5. data/base/app/controllers/contacts_controller.rb +2 -5
  6. data/base/app/models/contact.rb +3 -2
  7. data/base/app/views/activities/_options.html.erb +1 -1
  8. data/base/app/views/contacts/_form.html.erb +14 -7
  9. data/base/app/views/frontpage/_social_networks.html.erb +3 -0
  10. data/base/app/views/groups/_new.html.erb +2 -2
  11. data/base/app/views/groups/_show.html.erb +1 -2
  12. data/base/app/views/groups/index.html.erb +1 -1
  13. data/base/app/views/layouts/_header_signed_out.erb +1 -3
  14. data/base/app/views/notifications/activities/_follow_subject.html.erb +5 -2
  15. data/base/app/views/notifications/activities/_like_subject.html.erb +6 -2
  16. data/base/app/views/notifications/activities/_make-friend_subject.html.erb +5 -2
  17. data/base/app/views/notifications/activities/_post_subject.html.erb +6 -1
  18. data/base/app/views/notifications/activities/_update_body.html.erb +5 -1
  19. data/base/app/views/notifications/activities/_update_subject.html.erb +5 -1
  20. data/base/app/views/posts/_post_focus_search.html.erb +37 -3
  21. data/base/app/views/posts/_post_global_search.html.erb +2 -0
  22. data/base/app/views/profiles/_contact.html.erb +1 -1
  23. data/base/app/views/search/index.js.erb +2 -0
  24. data/base/app/views/toolbar/_home.html.erb +4 -0
  25. data/base/config/locales/en.yml +26 -0
  26. data/base/config/locales/es.yml +26 -0
  27. data/base/lib/mailboxer/notification_decoder.rb +8 -6
  28. data/base/lib/social_stream-base.rb +1 -1
  29. data/base/lib/social_stream/base/version.rb +1 -1
  30. data/base/lib/social_stream/migrations/components.rb +1 -1
  31. data/base/lib/social_stream/toolbar_config/base.rb +12 -1
  32. data/base/social_stream-base.gemspec +1 -1
  33. data/base/spec/controllers/contacts_controller_spec.rb +4 -4
  34. data/events/app/assets/javascripts/social_stream-events.js +2 -2
  35. data/events/app/assets/stylesheets/social_stream-events.css +3 -0
  36. data/events/{app → vendor}/assets/javascripts/jquery.ad-gallery.js +0 -0
  37. data/events/{app → vendor}/assets/javascripts/jquery.ad-gallery.pack.js +0 -0
  38. data/events/{app → vendor}/assets/stylesheets/ad_next.png +0 -0
  39. data/events/{app → vendor}/assets/stylesheets/ad_prev.png +0 -0
  40. data/events/{app → vendor}/assets/stylesheets/ad_scroll_back.png +0 -0
  41. data/events/{app → vendor}/assets/stylesheets/ad_scroll_forward.png +0 -0
  42. data/events/{app → vendor}/assets/stylesheets/fullcalendar.css +0 -0
  43. data/events/{app → vendor}/assets/stylesheets/fullcalendar.print.css +0 -0
  44. data/events/{app → vendor}/assets/stylesheets/jquery.ad-gallery.css +0 -0
  45. data/events/{app → vendor}/assets/stylesheets/loader.gif +0 -0
  46. data/events/vendor/assets/stylesheets/social_stream-events.css +273 -0
  47. data/lib/social_stream.rb +0 -4
  48. data/lib/social_stream/version.rb +1 -1
  49. data/presence/.gitignore +4 -0
  50. data/presence/Gemfile +4 -0
  51. data/presence/Rakefile +1 -0
  52. data/presence/app/assets/audio/chat/onMessageAudio.mp3 +0 -0
  53. data/presence/app/assets/audio/chat/onMessageAudio.wav +0 -0
  54. data/presence/app/assets/images/arrow.png +0 -0
  55. data/presence/app/assets/images/black_arrow3.png +0 -0
  56. data/presence/app/assets/images/status/available.png +0 -0
  57. data/presence/app/assets/images/status/away.png +0 -0
  58. data/presence/app/assets/images/status/dnd.png +0 -0
  59. data/presence/app/assets/javascripts/jquery-ui-1.8.14.custom.min.js +789 -0
  60. data/presence/app/assets/javascripts/jquery.tools.min.js +17 -0
  61. data/presence/app/assets/javascripts/jquery.tools.tooltip.js +11 -0
  62. data/presence/app/assets/javascripts/jquery.ui.chatbox.js +260 -0
  63. data/presence/app/assets/javascripts/social_stream-presence.js +2 -0
  64. data/presence/app/assets/javascripts/store.js +27 -0
  65. data/presence/app/assets/javascripts/strophe.js +3612 -0
  66. data/presence/app/assets/javascripts/xmpp_client.js +498 -0
  67. data/presence/app/assets/stylesheets/chat.css +231 -0
  68. data/presence/app/assets/stylesheets/jquery.ui.chatbox.css +54 -0
  69. data/presence/app/assets/stylesheets/social_stream-presence.css +3 -0
  70. data/presence/app/controllers/xmpp_controller.rb +190 -0
  71. data/presence/app/helpers/xmpp_helper.rb +33 -0
  72. data/presence/app/views/xmpp/_chat.html.erb +59 -0
  73. data/presence/app/views/xmpp/_chat_connecting.html.erb +8 -0
  74. data/presence/app/views/xmpp/_chat_contacts.html.erb +46 -0
  75. data/presence/app/views/xmpp/_chat_off.html.erb +35 -0
  76. data/presence/app/views/xmpp/active_users.html.erb +33 -0
  77. data/presence/app/views/xmpp/chat.html.erb +13 -0
  78. data/presence/app/views/xmpp/index.html +19 -0
  79. data/presence/app/views/xmpp/test.html.erb +11 -0
  80. data/presence/config/routes.rb +15 -0
  81. data/presence/db/migrate/20110711111408_add_connected_column_to_user.rb +9 -0
  82. data/presence/db/migrate/20110928135031_add_status_column_to_user.rb +9 -0
  83. data/presence/ejabberd/conf/ejabberd.cfg +625 -0
  84. data/presence/ejabberd/conf/ejabberdctl.cfg +154 -0
  85. data/presence/ejabberd/conf/inetrc +3 -0
  86. data/presence/ejabberd/conf/server.pem +37 -0
  87. data/presence/ejabberd/conf/ssconfig.cfg +29 -0
  88. data/presence/ejabberd/ejabberd_scripts/authentication_script +117 -0
  89. data/presence/ejabberd/ejabberd_scripts/authentication_script_org +114 -0
  90. data/presence/ejabberd/ejabberd_scripts/compile_module +34 -0
  91. data/presence/ejabberd/ejabberd_scripts/generate_random_password +18 -0
  92. data/presence/ejabberd/ejabberd_scripts/kill_authentication_script.sh +13 -0
  93. data/presence/ejabberd/ejabberd_scripts/reset_connection_script +55 -0
  94. data/presence/ejabberd/ejabberd_scripts/reset_logs.sh +23 -0
  95. data/presence/ejabberd/ejabberd_scripts/set_connection_script +48 -0
  96. data/presence/ejabberd/ejabberd_scripts/set_presence_script +48 -0
  97. data/presence/ejabberd/ejabberd_scripts/show_config.sh +30 -0
  98. data/presence/ejabberd/ejabberd_scripts/start_ejabberd.sh +68 -0
  99. data/presence/ejabberd/ejabberd_scripts/stop_ejabberd.sh +12 -0
  100. data/presence/ejabberd/ejabberd_scripts/synchronize_presence_script +57 -0
  101. data/presence/ejabberd/ejabberd_scripts/unset_connection_script +48 -0
  102. data/presence/ejabberd/mod_admin_extra/mod_admin_extra.beam +0 -0
  103. data/presence/ejabberd/mod_admin_extra/mod_admin_extra.erl +1560 -0
  104. data/presence/ejabberd/mod_sspresence/mod_sspresence.erl +230 -0
  105. data/presence/lib/social_stream-presence.rb +13 -0
  106. data/presence/lib/social_stream/migrations/presence.rb +9 -0
  107. data/presence/lib/social_stream/presence/config.rb +9 -0
  108. data/presence/lib/social_stream/presence/engine.rb +49 -0
  109. data/presence/lib/social_stream/presence/models/buddy_manager.rb +67 -0
  110. data/presence/social_stream-presence.gemspec +28 -0
  111. data/presence/spec/demo/.gitignore +5 -0
  112. data/presence/spec/demo/.rspec +1 -0
  113. data/presence/spec/demo/README +261 -0
  114. data/presence/spec/demo/Rakefile +7 -0
  115. data/presence/spec/demo/app/assets/images/rails.png +0 -0
  116. data/presence/spec/demo/app/assets/javascripts/application.js +9 -0
  117. data/presence/spec/demo/app/assets/stylesheets/application.css +7 -0
  118. data/presence/spec/demo/app/controllers/application_controller.rb +3 -0
  119. data/presence/spec/demo/app/helpers/application_helper.rb +2 -0
  120. data/presence/spec/demo/app/mailers/.gitkeep +0 -0
  121. data/presence/spec/demo/app/models/.gitkeep +0 -0
  122. data/presence/spec/demo/app/views/layouts/application.html.erb +14 -0
  123. data/presence/spec/demo/autotest/discover.rb +2 -0
  124. data/presence/spec/demo/config.ru +4 -0
  125. data/presence/spec/demo/config/application.rb +41 -0
  126. data/presence/spec/demo/config/boot.rb +6 -0
  127. data/presence/spec/demo/config/database.yml +25 -0
  128. data/presence/spec/demo/config/environment.rb +5 -0
  129. data/presence/spec/demo/config/environments/development.rb +27 -0
  130. data/presence/spec/demo/config/environments/production.rb +54 -0
  131. data/presence/spec/demo/config/environments/test.rb +39 -0
  132. data/presence/spec/demo/config/initializers/backtrace_silencers.rb +7 -0
  133. data/presence/spec/demo/config/initializers/inflections.rb +10 -0
  134. data/presence/spec/demo/config/initializers/mime_types.rb +5 -0
  135. data/presence/spec/demo/config/initializers/secret_token.rb +7 -0
  136. data/presence/spec/demo/config/initializers/session_store.rb +8 -0
  137. data/presence/spec/demo/config/initializers/wrap_parameters.rb +12 -0
  138. data/presence/spec/demo/config/locales/en.yml +5 -0
  139. data/presence/spec/demo/config/routes.rb +58 -0
  140. data/presence/spec/demo/db/seeds.rb +7 -0
  141. data/presence/spec/demo/doc/README_FOR_APP +2 -0
  142. data/presence/spec/demo/lib/tasks/.gitkeep +0 -0
  143. data/presence/spec/demo/log/.gitkeep +0 -0
  144. data/presence/spec/demo/public/404.html +26 -0
  145. data/presence/spec/demo/public/422.html +26 -0
  146. data/presence/spec/demo/public/500.html +26 -0
  147. data/presence/spec/demo/public/favicon.ico +0 -0
  148. data/presence/spec/demo/public/index.html +241 -0
  149. data/presence/spec/demo/public/robots.txt +5 -0
  150. data/presence/spec/demo/script/rails +6 -0
  151. data/presence/spec/demo/spec/spec_helper.rb +27 -0
  152. data/presence/spec/demo/test/fixtures/.gitkeep +0 -0
  153. data/presence/spec/demo/test/functional/.gitkeep +0 -0
  154. data/presence/spec/demo/test/integration/.gitkeep +0 -0
  155. data/presence/spec/demo/test/performance/browsing_test.rb +12 -0
  156. data/presence/spec/demo/test/test_helper.rb +13 -0
  157. data/presence/spec/demo/test/unit/.gitkeep +0 -0
  158. data/presence/spec/demo/vendor/assets/stylesheets/.gitkeep +0 -0
  159. data/presence/spec/demo/vendor/plugins/.gitkeep +0 -0
  160. data/presence/spec/discover.rb +2 -0
  161. data/presence/spec/spec_helper.rb +27 -0
  162. data/social_stream.gemspec +9 -2
  163. data/spec/dummy/config/environments/{test_pg.rb → test_mysql.rb} +6 -2
  164. data/spec/dummy/config/environments/test_postgres.rb +39 -0
  165. data/spec/spec_helper.rb +1 -4
  166. metadata +135 -21
  167. data/base/app/views/groups/_new_activity.html.erb +0 -1
  168. data/base/app/views/groups/_new_activity_fields.html.erb +0 -7
@@ -0,0 +1,33 @@
1
+ module XmppHelper
2
+ def getChatContacts
3
+ connected_users = []
4
+ contacts = getBidirectionalContacts
5
+ contacts.each do |contact|
6
+ if current_user.name != contact.receiver.name && contact.receiver.subject_type == "User" && contact.receiver.user.connected
7
+ connected_users << contact.receiver
8
+ end
9
+ end
10
+
11
+ return connected_users
12
+ end
13
+
14
+ def getBidirectionalContacts
15
+ #Code for new SS Version
16
+ # return current_user.contact_actors(:direction => :both)
17
+
18
+ contacts = []
19
+ csenders = current_user.sent_contacts
20
+ creceivers = current_user.received_contacts
21
+
22
+ csenders.each do |csender|
23
+ creceivers.each do |creceiver|
24
+ if ((csender.sender.name == creceiver.receiver.name) && (csender.receiver.name == creceiver.sender.name))
25
+ contacts << csender
26
+ break
27
+ end
28
+ end
29
+ end
30
+ return contacts
31
+ end
32
+
33
+ end
@@ -0,0 +1,59 @@
1
+ <% content_for :headers do %>
2
+ <%= stylesheet_link_tag "chat.css", :media => "screen, projection" %>
3
+ <%= javascript_include_tag 'jquery-ui-1.8.14.custom.min'%>
4
+ <%= javascript_include_tag 'jquery.ui.chatbox'%>
5
+ <%= javascript_include_tag 'jquery.tools.min'%>
6
+ <%= javascript_include_tag 'strophe'%>
7
+ <%= javascript_include_tag 'xmpp_client'%>
8
+ <%= javascript_include_tag 'store'%>
9
+ <% end %>
10
+
11
+
12
+ <script type="text/javascript">
13
+
14
+ //Global variables
15
+ var BOSH_SERVICE = '<%=Socialstream::Presence::BOSH_SERVICE%>';
16
+ var domain = '<%=Socialstream::Presence::DOMAIN%>';
17
+ var user_name = '<%=current_user.name%>';
18
+ var user_slug = '<%=current_user.slug%>';
19
+ var user_jid = '<%=current_user.slug%>'+"@"+domain;
20
+ var sound_path = "/assets/audio/chat/onMessage"
21
+
22
+ function connectToServer(chatPassword){
23
+ <%unless current_user.nil? %>
24
+
25
+ //Get Password
26
+ if ((chatPassword!=null)&&(chatPassword!="")){
27
+ var password = chatPassword;
28
+ } else if ((window.sessionStorage)&&(sessionStorage.getItem("ss_user_pass") != null)) {
29
+ var password = sessionStorage.getItem("ss_user_pass");
30
+ } else {
31
+ return false;
32
+ }
33
+
34
+ try {
35
+ //Connect actual user to the chat
36
+ connection = new Strophe.Connection(BOSH_SERVICE);
37
+ connection.connect(user_jid, password, onConnect);
38
+ } catch (err) {
39
+ //"Handle errors"
40
+ return false;
41
+ }
42
+
43
+ return true;
44
+ <%end%>
45
+ }
46
+
47
+ $(document).ready(function () {
48
+ if (connectToServer(null)==false){
49
+ refreshChatWindow();
50
+ }
51
+ });
52
+
53
+ </script>
54
+
55
+ <div id="chat_partial">
56
+ <%= render :partial => 'xmpp/chat_connecting' %>
57
+ <!-- <%= render :partial => 'xmpp/chat_connecting' %> -->
58
+ <!-- <%= render :partial => 'xmpp/chat_contacts' %> -->
59
+ </div>
@@ -0,0 +1,8 @@
1
+ <div class="block">
2
+ <div class="header">
3
+ <%=image_tag("btn/btn_friend.png", :class => "header_icon")%>
4
+ <div class="header_text">
5
+ Chat Connecting
6
+ </div>
7
+ </div>
8
+ </div>
@@ -0,0 +1,46 @@
1
+ <div>
2
+
3
+ <div class="block">
4
+ <div class="header">
5
+ <%=image_tag("btn/btn_friend.png", :class => "header_icon")%>
6
+ <div class="header_text">
7
+ Chat
8
+ </div>
9
+ </div>
10
+
11
+ <div id="status" class="dropdown">
12
+ <dt><a href=""><span>Establecer estado</span></a></dt>
13
+ <dd>
14
+ <ul>
15
+ <li><a href="#" class="option"><img class="flag" src="assets/status/available.png" alt=""/> Disponible <span class="value">chat</span></a></li>
16
+ <li><a href="#" class="option"><img class="flag" src="assets/status/away.png" alt=""/> Ausente <span class="value">away</span></a></li>
17
+ <li><a href="#" class="option"><img class="flag" src="assets/status/dnd.png" alt=""/> No molestar <span class="value">dnd</span></a></li>
18
+ </ul>
19
+ </dd>
20
+ </div>
21
+
22
+ </div>
23
+
24
+ <% @contacts = getChatContacts %>
25
+
26
+ <div class="users_connected">
27
+ <% unless @contacts.empty? %>
28
+ <%@contacts.each do |contact| %>
29
+ <div class="user_presence" name='<%=contact.name%>' slug='<%=contact.slug%>'>
30
+ <a title='<%=contact.name%>' class="presence_user_link" width="28">
31
+ <%=image_tag(contact.logo.url, :alt => contact.name , :title => contact.name, :size => "28x28")%>
32
+ <% if contact.user.status %>
33
+ <%=image_tag("status/" + contact.user.status + ".png", :class => "presence_status") %></a>
34
+ <% end %>
35
+ </a>
36
+ </div>
37
+ <%end%>
38
+ <% end %>
39
+ </div>
40
+
41
+ </div>
42
+
43
+ <div id="chat_divs">
44
+ <div id="chat_div">
45
+ </div>
46
+ </div>
@@ -0,0 +1,35 @@
1
+ <script type="text/javascript">
2
+ $(document).ready(function () {
3
+ if ((window.sessionStorage) && (sessionStorage.getItem("ss_user_pass") != null)) {
4
+ $("#passwordFormChat").hide();
5
+ } else {
6
+ $("#passwordFormChat").show();
7
+ }
8
+
9
+ $('.connectChatButton').bind('click', function () {
10
+ connectToServer($('#user_password').val());
11
+ });
12
+
13
+ $('.storePass').bind('click', function () {
14
+ storePassword();
15
+ });
16
+
17
+ });
18
+ </script>
19
+
20
+ <div class="block">
21
+ <div class="header">
22
+ <%=image_tag("btn/btn_friend.png", :class => "header_icon")%>
23
+ <div class="header_text">
24
+ Chat Disconnected
25
+ </div>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="chat_off">
30
+ <div id="passwordFormChat">
31
+ <label for="user_password" class="chatPasswordTitle">Password</label>
32
+ <input id="user_password" class="chat_password" type="password"></input>
33
+ </div>
34
+ <input class="other_blue connectChatButton storePass" value="Connect">
35
+ </div>
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Demo2</title>
5
+ </head>
6
+ <body>
7
+
8
+
9
+ <p> Usuarios conectados Social Stream </p>
10
+
11
+ <p>&nbsp;</p>
12
+ <ul>
13
+ <%@users.each do |user| %>
14
+ <li><b><%=user.name%></b></li>
15
+ <%end%>
16
+ </ul>
17
+ <p>&nbsp;</p>
18
+
19
+
20
+ <p> Usuarios Social Stream </p>
21
+
22
+ <p>&nbsp;</p>
23
+ <ul>
24
+ <%@all_users.each do |user| %>
25
+ <li><b><%=user.slug%></b> with email: <%=user.email%></li>
26
+ <%end%>
27
+ </ul>
28
+ <p>&nbsp;</p>
29
+
30
+ <p> <a href="/test">Volver</a></p>
31
+
32
+ </body>
33
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>Chat</title>
5
+ </head>
6
+ <body>
7
+ <script type="text/javascript">
8
+ sessionStorage.setItem("ss_user_pass","demonstration")
9
+ </script>
10
+ <%= render :partial => 'xmpp/chat' %>
11
+ <p> <a href="/test">Volver</a></p>
12
+ </body>
13
+ </html>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Ruby on Rails: Welcome aboard</title>
5
+ <script type="text/javascript">
6
+
7
+ </script>
8
+ </head>
9
+ <body>
10
+ <div id="page">
11
+ <p> Hello World </p>
12
+
13
+ <p> <a href="/xmpp4r_test">Test</a></p>
14
+ <p> <a href="/active_users">Usuarios conectados al servidor XMPP</a></p>
15
+ <p> <a href="/chat">Chat</a></p>
16
+
17
+ </div>
18
+ </body>
19
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Demo2</title>
5
+ </head>
6
+ <body>
7
+
8
+ <p> <a href="/test">Volver</a></p>
9
+
10
+ </body>
11
+ </html>
@@ -0,0 +1,15 @@
1
+ Rails.application.routes.draw do
2
+ match "/test" => "Xmpp#index"
3
+ match "/xmpp4r_test" => "Xmpp#test"
4
+ match "/active_users" => "Xmpp#active_users"
5
+ match '/chat' => "Xmpp#chat"
6
+
7
+ match '/xmpp/resetConnection' => "Xmpp#resetConnection"
8
+ match '/xmpp/setConnection' => "Xmpp#setConnection"
9
+ match '/xmpp/unsetConnection' => "Xmpp#unsetConecction"
10
+ match '/xmpp/synchronizePresence' => "Xmpp#synchronizePresence"
11
+ match '/xmpp/setPresence' => "Xmpp#setPresence"
12
+ match '/xmpp/unsetPresence' => "Xmpp#unsetPresence"
13
+ match '/chatWindow'=> "Xmpp#chatWindow"
14
+
15
+ end
@@ -0,0 +1,9 @@
1
+ class AddConnectedColumnToUser < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :connected, :boolean, :default => false
4
+ end
5
+
6
+ def self.down
7
+ remove_column :users, :connected
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddStatusColumnToUser < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :status, :string, :default => "chat"
4
+ end
5
+
6
+ def self.down
7
+ remove_column :users, :status
8
+ end
9
+ end
@@ -0,0 +1,625 @@
1
+ %%%
2
+ %%% ejabberd configuration file
3
+ %%%
4
+ %%%'
5
+
6
+ %%% The parameters used in this configuration file are explained in more detail
7
+ %%% in the ejabberd Installation and Operation Guide.
8
+ %%% Please consult the Guide in case of doubts, it is included with
9
+ %%% your copy of ejabberd, and is also available online at
10
+ %%% http://www.process-one.net/en/ejabberd/docs/
11
+
12
+ %%% This configuration file contains Erlang terms.
13
+ %%% In case you want to understand the syntax, here are the concepts:
14
+ %%%
15
+ %%% - The character to comment a line is %
16
+ %%%
17
+ %%% - Each term ends in a dot, for example:
18
+ %%% override_global.
19
+ %%%
20
+ %%% - A tuple has a fixed definition, its elements are
21
+ %%% enclosed in {}, and separated with commas:
22
+ %%% {loglevel, 4}.
23
+ %%%
24
+ %%% - A list can have as many elements as you want,
25
+ %%% and is enclosed in [], for example:
26
+ %%% [http_poll, web_admin, tls]
27
+ %%%
28
+ %%% - A keyword of ejabberd is a word in lowercase.
29
+ %%% Strings are enclosed in "" and can contain spaces, dots, ...
30
+ %%% {language, "en"}.
31
+ %%% {ldap_rootdn, "dc=example,dc=com"}.
32
+ %%%
33
+ %%% - This term includes a tuple, a keyword, a list, and two strings:
34
+ %%% {hosts, ["jabber.example.net", "im.example.com"]}.
35
+ %%%
36
+
37
+
38
+ %%%. =======================
39
+ %%%' OVERRIDE STORED OPTIONS
40
+
41
+ %%
42
+ %% Override the old values stored in the database.
43
+ %%
44
+
45
+ %%
46
+ %% Override global options (shared by all ejabberd nodes in a cluster).
47
+ %%
48
+ %%override_global.
49
+
50
+ %%
51
+ %% Override local options (specific for this particular ejabberd node).
52
+ %%
53
+ %%override_local.
54
+
55
+ %%
56
+ %% Remove the Access Control Lists before new ones are added.
57
+ %%
58
+ %%override_acls.
59
+
60
+
61
+ %%%. =========
62
+ %%%' DEBUGGING
63
+
64
+ %%
65
+ %% loglevel: Verbosity of log files generated by ejabberd.
66
+ %% 0: No ejabberd log at all (not recommended)
67
+ %% 1: Critical
68
+ %% 2: Error
69
+ %% 3: Warning
70
+ %% 4: Info
71
+ %% 5: Debug
72
+ %%
73
+ {loglevel, 4}.
74
+
75
+ %%
76
+ %% watchdog_admins: Only useful for developers: if an ejabberd process
77
+ %% consumes a lot of memory, send live notifications to these XMPP
78
+ %% accounts.
79
+ %%
80
+ %%{watchdog_admins, ["bob@example.com"]}.
81
+
82
+
83
+ %%%. ================
84
+ %%%' SERVED HOSTNAMES
85
+
86
+ %%
87
+ %% hosts: Domains served by ejabberd.
88
+ %% You can define one or several, for example:
89
+ %% {hosts, ["example.net", "example.com", "example.org"]}.
90
+ %%
91
+ {hosts, ["trapo"]}.
92
+
93
+ %%
94
+ %% route_subdomains: Delegate subdomains to other XMPP servers.
95
+ %% For example, if this ejabberd serves example.org and you want
96
+ %% to allow communication with an XMPP server called im.example.org.
97
+ %%
98
+ %%{route_subdomains, s2s}.
99
+
100
+
101
+ %%%. ===============
102
+ %%%' LISTENING PORTS
103
+
104
+ %%
105
+ %% listen: The ports ejabberd will listen on, which service each is handled
106
+ %% by and what options to start it with.
107
+ %%
108
+ {listen,
109
+ [
110
+
111
+ {5222, ejabberd_c2s, [
112
+
113
+ %%
114
+ %% If TLS is compiled in and you installed a SSL
115
+ %% certificate, specify the full path to the
116
+ %% file and uncomment this line:
117
+ %%
118
+ %%{certfile, "/path/to/ssl.pem"}, starttls,
119
+ {certfile, "/etc/ejabberd/server.pem"}, starttls,
120
+
121
+ {access, c2s},
122
+ {shaper, c2s_shaper},
123
+ {max_stanza_size, 65536}
124
+ ]},
125
+
126
+ %%
127
+ %% To enable the old SSL connection method on port 5223:
128
+ %%
129
+ %%{5223, ejabberd_c2s, [
130
+ %% {access, c2s},
131
+ %% {shaper, c2s_shaper},
132
+ %% {certfile, "/path/to/ssl.pem"}, tls,
133
+ %% {max_stanza_size, 65536}
134
+ %% ]},
135
+
136
+ {5269, ejabberd_s2s_in, [
137
+ {shaper, s2s_shaper},
138
+ {max_stanza_size, 131072}
139
+ ]},
140
+
141
+ %%
142
+ %% ejabberd_service: Interact with external components (transports, ...)
143
+ %%
144
+ %%{8888, ejabberd_service, [
145
+ %% {access, all},
146
+ %% {shaper_rule, fast},
147
+ %% {ip, {127, 0, 0, 1}},
148
+ %% {hosts, ["icq.example.org", "sms.example.org"],
149
+ %% [{password, "secret"}]
150
+ %% }
151
+ %% ]},
152
+
153
+ %% {8888, ejabberd_service, [
154
+ %% {access, all},
155
+ %% {shaper_rule, fast},
156
+ %% {ip, {127, 0, 0, 1}},
157
+ %% {hosts, ["parser.localhost", "parser.example.org"],
158
+ %% [{password, "sabran1w0d0"}]
159
+ %% }
160
+ %% ]},
161
+
162
+ %%
163
+ %% ejabberd_stun: Handles STUN Binding requests
164
+ %%
165
+ %%{{3478, udp}, ejabberd_stun, []},
166
+
167
+ {5280, ejabberd_http, [
168
+ %%{request_handlers,
169
+ %% [
170
+ %% {["pub", "archive"], mod_http_fileserver}
171
+ %% ]},
172
+ captcha,
173
+ http_bind,
174
+ http_poll,
175
+ %%register,
176
+ web_admin
177
+ ]}
178
+
179
+ ]}.
180
+
181
+ %%
182
+ %% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
183
+ %% Allowed values are: false optional required required_trusted
184
+ %% You must specify a certificate file.
185
+ %%
186
+ %%{s2s_use_starttls, optional}.
187
+
188
+ %%
189
+ %% s2s_certfile: Specify a certificate file.
190
+ %%
191
+ %%{s2s_certfile, "/path/to/ssl.pem"}.
192
+
193
+ %%
194
+ %% domain_certfile: Specify a different certificate for each served hostname.
195
+ %%
196
+ %%{domain_certfile, "example.org", "/path/to/example_org.pem"}.
197
+ %%{domain_certfile, "example.com", "/path/to/example_com.pem"}.
198
+
199
+ %%
200
+ %% S2S whitelist or blacklist
201
+ %%
202
+ %% Default s2s policy for undefined hosts.
203
+ %%
204
+ %%{s2s_default_policy, allow}.
205
+
206
+ %%
207
+ %% Allow or deny communication with specific servers.
208
+ %%
209
+ %%{{s2s_host, "goodhost.org"}, allow}.
210
+ %%{{s2s_host, "badhost.org"}, deny}.
211
+
212
+ %%
213
+ %% Outgoing S2S options
214
+ %%
215
+ %% Preferred address families (which to try first) and connect timeout
216
+ %% in milliseconds.
217
+ %%
218
+ %%{outgoing_s2s_options, [ipv4, ipv6], 10000}.
219
+
220
+
221
+ %%%. ==============
222
+ %%%' AUTHENTICATION
223
+
224
+ %%
225
+ %% auth_method: Method used to authenticate the users.
226
+ %% The default method is the internal.
227
+ %% If you want to use a different method,
228
+ %% comment this line and enable the correct ones.
229
+ %%
230
+ %%{auth_method, internal}.
231
+
232
+ %%
233
+ %% Authentication using external script
234
+ %% Make sure the script is executable by ejabberd.
235
+ %% Exauth Response Timeout is a extauth module constant and its value is 60 seconds.
236
+ %%
237
+ {auth_method, external}.
238
+ {extauth_program, "/home/aldo/ejabberd-2.1.8_scripts/authentication_script"}.
239
+ {extauth_instances, 3}.
240
+
241
+
242
+ %%{auth_method, external}.
243
+ %%{extauth_program, "/home/aldo/ejabberd-2.1.8_scripts/authentication_script"}.
244
+
245
+ %%
246
+ %% Authentication using ODBC
247
+ %% Remember to setup a database in the next section.
248
+ %%
249
+ %%{auth_method, odbc}.
250
+
251
+ %%
252
+ %% Authentication using PAM
253
+ %%
254
+ %%{auth_method, pam}.
255
+ %%{pam_service, "pamservicename"}.
256
+
257
+ %%
258
+ %% Authentication using LDAP
259
+ %%
260
+ %%{auth_method, ldap}.
261
+ %%
262
+ %% List of LDAP servers:
263
+ %%{ldap_servers, ["localhost"]}.
264
+ %%
265
+ %% Encryption of connection to LDAP servers:
266
+ %%{ldap_encrypt, none}.
267
+ %%{ldap_encrypt, tls}.
268
+ %%
269
+ %% Port to connect to on LDAP servers:
270
+ %%{ldap_port, 389}.
271
+ %%{ldap_port, 636}.
272
+ %%
273
+ %% LDAP manager:
274
+ %%{ldap_rootdn, "dc=example,dc=com"}.
275
+ %%
276
+ %% Password of LDAP manager:
277
+ %%{ldap_password, "******"}.
278
+ %%
279
+ %% Search base of LDAP directory:
280
+ %%{ldap_base, "dc=example,dc=com"}.
281
+ %%
282
+ %% LDAP attribute that holds user ID:
283
+ %%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
284
+ %%
285
+ %% LDAP filter:
286
+ %%{ldap_filter, "(objectClass=shadowAccount)"}.
287
+
288
+ %%
289
+ %% Anonymous login support:
290
+ %% auth_method: anonymous
291
+ %% anonymous_protocol: sasl_anon | login_anon | both
292
+ %% allow_multiple_connections: true | false
293
+ %%
294
+ %%{host_config, "public.example.org", [{auth_method, anonymous},
295
+ %% {allow_multiple_connections, false},
296
+ %% {anonymous_protocol, sasl_anon}]}.
297
+ %%
298
+ %% To use both anonymous and internal authentication:
299
+ %%
300
+ %%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
301
+
302
+
303
+ %%%. ==============
304
+ %%%' DATABASE SETUP
305
+
306
+ %% ejabberd by default uses the internal Mnesia database,
307
+ %% so you do not necessarily need this section.
308
+ %% This section provides configuration examples in case
309
+ %% you want to use other database backends.
310
+ %% Please consult the ejabberd Guide for details on database creation.
311
+
312
+ %%
313
+ %% MySQL server:
314
+ %%
315
+ %%{odbc_server, {mysql, "server", "database", "username", "password"}}.
316
+ %%
317
+ %% If you want to specify the port:
318
+ %%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
319
+
320
+ %%
321
+ %% PostgreSQL server:
322
+ %%
323
+ %%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
324
+ %%
325
+ %% If you want to specify the port:
326
+ %%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
327
+ %%
328
+ %% If you use PostgreSQL, have a large database, and need a
329
+ %% faster but inexact replacement for "select count(*) from users"
330
+ %%
331
+ %%{pgsql_users_number_estimate, true}.
332
+
333
+ %%
334
+ %% ODBC compatible or MSSQL server:
335
+ %%
336
+ %%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
337
+
338
+ %%
339
+ %% Number of connections to open to the database for each virtual host
340
+ %%
341
+ %%{odbc_pool_size, 10}.
342
+
343
+ %%
344
+ %% Interval to make a dummy SQL request to keep the connections to the
345
+ %% database alive. Specify in seconds: for example 28800 means 8 hours
346
+ %%
347
+ %%{odbc_keepalive_interval, undefined}.
348
+
349
+
350
+ %%%. ===============
351
+ %%%' TRAFFIC SHAPERS
352
+
353
+ %%
354
+ %% The "normal" shaper limits traffic speed to 1000 B/s
355
+ %%
356
+ {shaper, normal, {maxrate, 1000}}.
357
+
358
+ %%
359
+ %% The "fast" shaper limits traffic speed to 50000 B/s
360
+ %%
361
+ {shaper, fast, {maxrate, 50000}}.
362
+
363
+ %%
364
+ %% This option specifies the maximum number of elements in the queue
365
+ %% of the FSM. Refer to the documentation for details.
366
+ %%
367
+ {max_fsm_queue, 1000}.
368
+
369
+
370
+ %%%. ====================
371
+ %%%' ACCESS CONTROL LISTS
372
+
373
+ %%
374
+ %% The 'admin' ACL grants administrative privileges to XMPP accounts.
375
+ %% You can put here as many accounts as you want.
376
+ %%
377
+ %%{acl, admin, {user, "aleksey", "localhost"}}.
378
+ %%{acl, admin, {user, "ermine", "example.org"}}.
379
+ {acl, admin, {user, "admin", "trapo"}}.
380
+
381
+ %%
382
+ %% Blocked users
383
+ %%
384
+ %%{acl, blocked, {user, "baduser", "example.org"}}.
385
+ %%{acl, blocked, {user, "test"}}.
386
+
387
+ %%
388
+ %% Local users: don't modify this line.
389
+ %%
390
+ {acl, local, {user_regexp, ""}}.
391
+
392
+ %%
393
+ %% More examples of ACLs
394
+ %%
395
+ %%{acl, jabberorg, {server, "jabber.org"}}.
396
+ %%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
397
+ %%{acl, test, {user_regexp, "^test"}}.
398
+ %%{acl, test, {user_glob, "test*"}}.
399
+
400
+ %%
401
+ %% Define specific ACLs in a virtual host.
402
+ %%
403
+ %%{host_config, "localhost",
404
+ %% [
405
+ %% {acl, admin, {user, "bob-local", "localhost"}}
406
+ %% ]
407
+ %%}.
408
+
409
+
410
+ %%%. ============
411
+ %%%' ACCESS RULES
412
+
413
+ %% Maximum number of simultaneous sessions allowed for a single user:
414
+ {access, max_user_sessions, [{10, all}]}.
415
+
416
+ %% Maximum number of offline messages that users can have:
417
+ {access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
418
+
419
+ %% This rule allows access only for local users:
420
+ {access, local, [{allow, local}]}.
421
+
422
+ %% Only non-blocked users can use c2s connections:
423
+ {access, c2s, [{deny, blocked},
424
+ {allow, all}]}.
425
+
426
+ %% For C2S connections, all users except admins use the "normal" shaper
427
+ {access, c2s_shaper, [{none, admin},
428
+ {normal, all}]}.
429
+
430
+ %% All S2S connections use the "fast" shaper
431
+ {access, s2s_shaper, [{fast, all}]}.
432
+
433
+ %% Only admins can send announcement messages:
434
+ {access, announce, [{allow, admin}]}.
435
+
436
+ %% Only admins can use the configuration interface:
437
+ {access, configure, [{allow, admin}]}.
438
+
439
+ %% Admins of this server are also admins of the MUC service:
440
+ {access, muc_admin, [{allow, admin}]}.
441
+
442
+ %% Only accounts of the local ejabberd server can create rooms:
443
+ {access, muc_create, [{allow, local}]}.
444
+
445
+ %% All users are allowed to use the MUC service:
446
+ {access, muc, [{allow, all}]}.
447
+
448
+ %% Only accounts on the local ejabberd server can create Pubsub nodes:
449
+ {access, pubsub_createnode, [{allow, local}]}.
450
+
451
+ %% In-band registration allows registration of any possible username.
452
+ %% To disable in-band registration, replace 'allow' with 'deny'.
453
+ {access, register, [{allow, all}]}.
454
+
455
+ %% By default the frequency of account registrations from the same IP
456
+ %% is limited to 1 account every 10 minutes. To disable, specify: infinity
457
+ %%{registration_timeout, 600}.
458
+ {registration_timeout, infinity}.
459
+
460
+ %%
461
+ %% Define specific Access Rules in a virtual host.
462
+ %%
463
+ %%{host_config, "localhost",
464
+ %% [
465
+ %% {access, c2s, [{allow, admin}, {deny, all}]},
466
+ %% {access, register, [{deny, all}]}
467
+ %% ]
468
+ %%}.
469
+
470
+
471
+ %%%. ================
472
+ %%%' DEFAULT LANGUAGE
473
+
474
+ %%
475
+ %% language: Default language used for server messages.
476
+ %%
477
+ {language, "en"}.
478
+
479
+ %%
480
+ %% Set a different default language in a virtual host.
481
+ %%
482
+ %%{host_config, "localhost",
483
+ %% [{language, "ru"}]
484
+ %%}.
485
+
486
+
487
+ %%%. =======
488
+ %%%' CAPTCHA
489
+
490
+ %%
491
+ %% Full path to a script that generates the image.
492
+ %%
493
+ %%{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
494
+
495
+ %%
496
+ %% Host for the URL and port where ejabberd listens for CAPTCHA requests.
497
+ %%
498
+ %%{captcha_host, "example.org:5280"}.
499
+
500
+ %%
501
+ %% Limit CAPTCHA calls per minute for JID/IP to avoid DoS.
502
+ %%
503
+ %%{captcha_limit, 5}.
504
+
505
+ %%%. =======
506
+ %%%' MODULES
507
+
508
+ %%
509
+ %% Modules enabled in all ejabberd virtual hosts.
510
+ %%
511
+ {modules,
512
+ [
513
+ {mod_adhoc, []},
514
+ {mod_announce, [{access, announce}]}, % recommends mod_adhoc
515
+ {mod_blocking,[]}, % requires mod_privacy
516
+ {mod_caps, []},
517
+ {mod_configure,[]}, % requires mod_adhoc
518
+ {mod_disco, []},
519
+ %%{mod_echo, [{host, "echo.localhost"}]},
520
+ {mod_irc, []},
521
+ {mod_http_bind, []},
522
+ %%{mod_http_fileserver, [
523
+ %% {docroot, "/var/www"},
524
+ %% {accesslog, "/var/log/ejabberd/access.log"}
525
+ %% ]},
526
+ {mod_last, []},
527
+ {mod_muc, [
528
+ %%{host, "conference.@HOST@"},
529
+ {access, muc},
530
+ {access_create, muc_create},
531
+ {access_persistent, muc_create},
532
+ {access_admin, muc_admin}
533
+ ]},
534
+ %%{mod_muc_log,[]},
535
+ {mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
536
+ {mod_ping, []},
537
+ %%{mod_pres_counter,[{count, 5}, {interval, 60}]},
538
+ {mod_privacy, []},
539
+ {mod_private, []},
540
+ %%{mod_proxy65,[]},
541
+ {mod_pubsub, [
542
+ {access_createnode, pubsub_createnode},
543
+ {ignore_pep_from_offline, true}, % reduces resource comsumption, but XEP incompliant
544
+ %%{ignore_pep_from_offline, false}, % XEP compliant, but increases resource comsumption
545
+ {last_item_cache, false},
546
+ {plugins, ["flat", "hometree", "pep"]} % pep requires mod_caps
547
+ ]},
548
+ {mod_register, [
549
+ %%
550
+ %% Protect In-Band account registrations with CAPTCHA.
551
+ %%
552
+ %%{captcha_protected, true},
553
+
554
+ %%
555
+ %% Set the minimum informational entropy for passwords.
556
+ %%
557
+ %%{password_strength, 32},
558
+
559
+ %%
560
+ %% After successful registration, the user receives
561
+ %% a message with this subject and body.
562
+ %%
563
+ {welcome_message, {"Welcome!",
564
+ "Hi.\nWelcome to this XMPP server."}},
565
+
566
+ %%
567
+ %% When a user registers, send a notification to
568
+ %% these XMPP accounts.
569
+ %%
570
+ %%{registration_watchers, ["admin1@example.org"]},
571
+
572
+ %%
573
+ %% Only clients in the server machine can register accounts
574
+ %%
575
+ {ip_access, [{allow, "127.0.0.0/8"},
576
+ {deny, "0.0.0.0/0"}]},
577
+
578
+ %%
579
+ %% Local c2s or remote s2s users cannot register accounts
580
+ %%
581
+ %%{access_from, deny},
582
+
583
+ {access, register}
584
+ ]},
585
+ %%{mod_register_web, [
586
+ %%
587
+ %% When a user registers, send a notification to
588
+ %% these XMPP accounts.
589
+ %%
590
+ %%{registration_watchers, ["admin1@example.org"]}
591
+ %% ]},
592
+ {mod_roster, []},
593
+ %%{mod_service_log,[]},
594
+ {mod_shared_roster,[]},
595
+ {mod_stats, []},
596
+ {mod_time, []},
597
+ {mod_vcard, []},
598
+ {mod_sspresence, []},
599
+ {mod_admin_extra, []},
600
+ {mod_version, []}
601
+ ]}.
602
+
603
+
604
+
605
+ %%
606
+ %% Enable modules with custom options in a specific virtual host
607
+ %%
608
+ %%{host_config, "localhost",
609
+ %% [{{add, modules},
610
+ %% [
611
+ %% {mod_echo, [{host, "mirror.localhost"}]}
612
+ %% ]
613
+ %% }
614
+ %% ]}.
615
+
616
+
617
+ %%%.
618
+ %%%'
619
+
620
+ %%% $Id$
621
+
622
+ %%% Local Variables:
623
+ %%% mode: erlang
624
+ %%% End:
625
+ %%% vim: set filetype=erlang tabstop=8 foldmarker=%%%',%%%. foldmethod=marker: