social_stream 0.11.8 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/base/app/assets/images/btn/download.png +0 -0
  2. data/base/app/assets/javascripts/activities.js.erb +1 -1
  3. data/base/app/assets/javascripts/social_stream-base.js +2 -0
  4. data/base/app/assets/stylesheets/social_stream-base.css +2 -0
  5. data/base/app/views/avatars/index.html.erb +0 -13
  6. data/base/app/views/comments/create.js.erb +3 -0
  7. data/base/app/views/toolbar/_home.html.erb +1 -1
  8. data/base/config/locales/en.yml +1 -0
  9. data/base/config/locales/es.yml +1 -0
  10. data/base/lib/social_stream/base/version.rb +1 -1
  11. data/base/lib/social_stream/controllers/helpers.rb +6 -0
  12. data/base/lib/social_stream/migrations/base.rb +12 -9
  13. data/base/lib/social_stream/migrations/components.rb +1 -1
  14. data/base/social_stream-base.gemspec +1 -1
  15. data/documents/Rakefile +3 -13
  16. data/documents/app/assets/javascripts/documents.js.erb +21 -32
  17. data/documents/app/assets/javascripts/social_stream-documents.js +2 -1
  18. data/documents/app/assets/stylesheets/{documents.css → documents.css.scss} +32 -6
  19. data/documents/app/assets/stylesheets/show.css.scss +75 -0
  20. data/documents/app/assets/stylesheets/social_stream-documents.css +2 -1
  21. data/documents/app/controllers/audios_controller.rb +0 -14
  22. data/documents/app/controllers/common_documents_controller.rb +6 -3
  23. data/documents/app/controllers/documents_controller.rb +9 -3
  24. data/documents/app/controllers/pictures_controller.rb +0 -1
  25. data/documents/app/controllers/videos_controller.rb +0 -15
  26. data/documents/app/helpers/documents_helper.rb +11 -7
  27. data/documents/app/models/audio.rb +1 -1
  28. data/documents/app/models/document.rb +9 -5
  29. data/documents/app/models/picture.rb +1 -1
  30. data/documents/app/models/video.rb +8 -6
  31. data/documents/app/views/audios/_audio.html.erb +2 -2
  32. data/documents/app/views/audios/_audio_processed.html.erb +4 -4
  33. data/documents/app/views/audios/_audio_show.html.erb +62 -0
  34. data/documents/app/views/audios/index.html.erb +1 -1
  35. data/documents/app/views/audios/show.html.erb +2 -2
  36. data/documents/app/views/common_documents/_document_info.html.erb +34 -0
  37. data/documents/app/views/common_documents/_index.html.erb +49 -0
  38. data/documents/app/views/common_documents/_show.html.erb +36 -0
  39. data/documents/app/views/documents/_document.html.erb +2 -6
  40. data/documents/app/views/documents/_document_show.html.erb +7 -0
  41. data/documents/app/views/documents/index.html.erb +1 -1
  42. data/documents/app/views/documents/show.html.erb +2 -2
  43. data/documents/app/views/pictures/_picture.html.erb +13 -12
  44. data/documents/app/views/pictures/_picture_show.html.erb +26 -0
  45. data/documents/app/views/pictures/index.html.erb +1 -1
  46. data/documents/app/views/pictures/show.html.erb +2 -2
  47. data/documents/app/views/videos/_video.html.erb +2 -2
  48. data/documents/app/views/videos/_video_processed.html.erb +4 -3
  49. data/documents/app/views/videos/_video_show.html.erb +64 -0
  50. data/documents/app/views/videos/index.html.erb +1 -1
  51. data/documents/app/views/videos/show.html.erb +2 -2
  52. data/documents/config/locales/en.yml +19 -1
  53. data/documents/config/locales/es.yml +18 -0
  54. data/documents/lib/social_stream/documents/engine.rb +2 -0
  55. data/documents/lib/social_stream/documents/version.rb +1 -1
  56. data/documents/social_stream-documents.gemspec +1 -1
  57. data/documents/spec/controllers/documents_controller_spec.rb +40 -2
  58. data/documents/spec/controllers/pictures_controller_spec.rb +4 -4
  59. data/documents/spec/dummy/config/environments/development.rb +0 -1
  60. data/documents/spec/dummy/config/environments/test.rb +2 -0
  61. data/lib/social_stream/release.rb +26 -4
  62. data/lib/social_stream/version.rb +1 -1
  63. data/presence/app/assets/javascripts/xmpp_client.js +0 -6
  64. data/presence/app/controllers/xmpp_controller.rb +46 -102
  65. data/presence/app/views/xmpp/_chat.html.erb +1 -2
  66. data/presence/ejabberd/conf/{ejabberd.cfg → ejabberd_example.cfg} +3 -7
  67. data/presence/ejabberd/conf/ssconfig_example.cfg +32 -0
  68. data/presence/ejabberd/ejabberd_scripts/authentication_script +7 -3
  69. data/presence/ejabberd/ejabberd_scripts/{compile_module → development_scripts/compile_module} +0 -0
  70. data/presence/ejabberd/ejabberd_scripts/{generate_random_password → development_scripts/generate_random_password} +0 -0
  71. data/presence/ejabberd/ejabberd_scripts/{kill_authentication_script.sh → development_scripts/kill_authentication_script.sh} +0 -0
  72. data/presence/ejabberd/ejabberd_scripts/{reset_logs.sh → development_scripts/reset_logs.sh} +0 -2
  73. data/presence/ejabberd/ejabberd_scripts/{show_config.sh → development_scripts/show_config.sh} +3 -0
  74. data/presence/ejabberd/ejabberd_scripts/{start_ejabberd.sh → development_scripts/start_ejabberd.sh} +0 -0
  75. data/presence/ejabberd/ejabberd_scripts/{stop_ejabberd.sh → development_scripts/stop_ejabberd.sh} +0 -0
  76. data/presence/ejabberd/ejabberd_scripts/emanagement +18 -14
  77. data/presence/ejabberd/mod_sspresence/mod_sspresence.beam +0 -0
  78. data/presence/ejabberd/mod_sspresence/mod_sspresence.erl +11 -7
  79. data/presence/lib/generators/social_stream/presence/templates/initializer.rb +14 -4
  80. data/presence/lib/social_stream/migrations/presence.rb +0 -1
  81. data/presence/lib/social_stream/presence/engine.rb +1 -48
  82. data/presence/lib/social_stream/presence/models/buddy_manager.rb +17 -44
  83. data/presence/lib/social_stream/presence/version.rb +1 -1
  84. data/presence/lib/social_stream/presence/xmpp_server_order.rb +181 -0
  85. data/presence/lib/social_stream-presence.rb +12 -2
  86. data/presence/lib/tasks/presence/synchronize.rake +6 -47
  87. data/social_stream.gemspec +2 -2
  88. metadata +32 -28
  89. data/base/lib/social_stream/migrations/finder.rb +0 -20
  90. data/documents/app/views/common-documents/_index.html.erb +0 -45
  91. data/documents/app/views/toolbar/_uploads_menu.html.erb +0 -21
  92. data/presence/ejabberd/conf/ejabberdctl.cfg +0 -154
  93. data/presence/ejabberd/conf/inetrc +0 -3
  94. data/presence/ejabberd/conf/ssconfig.cfg +0 -32
  95. data/presence/ejabberd/ejabberd_scripts/authentication_script_org +0 -114
@@ -1,154 +0,0 @@
1
- #
2
- # In this file you can configure options that are passed by ejabberdctl
3
- # to the erlang runtime system when starting ejabberd
4
- #
5
-
6
- #' POLL: Kernel polling ([true|false])
7
- #
8
- # The kernel polling option requires support in the kernel.
9
- # Additionally, you need to enable this feature while compiling Erlang.
10
- #
11
- # Default: true
12
- #
13
- #POLL=true
14
-
15
- #.
16
- #' SMP: SMP support ([enable|auto|disable])
17
- #
18
- # Explanation in Erlang/OTP documentation:
19
- # enable: starts the Erlang runtime system with SMP support enabled.
20
- # This may fail if no runtime system with SMP support is available.
21
- # auto: starts the Erlang runtime system with SMP support enabled if it
22
- # is available and more than one logical processor are detected.
23
- # disable: starts a runtime system without SMP support.
24
- #
25
- # Default: auto
26
- #
27
- #SMP=auto
28
-
29
- #.
30
- #' ERL_MAX_PORTS: Maximum number of simultaneously open Erlang ports
31
- #
32
- # ejabberd consumes two or three ports for every connection, either
33
- # from a client or from another Jabber server. So take this into
34
- # account when setting this limit.
35
- #
36
- # Default: 32000
37
- # Maximum: 268435456
38
- #
39
- #ERL_MAX_PORTS=32000
40
-
41
- #.
42
- #' FIREWALL_WINDOW: Range of allowed ports to pass through a firewall
43
- #
44
- # If Ejabberd is configured to run in cluster, and a firewall is blocking ports,
45
- # it's possible to make Erlang use a defined range of port (instead of dynamic
46
- # ports) for node communication.
47
- #
48
- # Default: not defined
49
- # Example: 4200-4210
50
- #
51
- #FIREWALL_WINDOW=
52
-
53
- #.
54
- #' INET_DIST_INTERFACE: IP address where this Erlang node listens other nodes
55
- #
56
- # This communication is used by ejabberdctl command line tool,
57
- # and in a cluster of several ejabberd nodes.
58
- # Notice that the IP address must be specified in the Erlang syntax.
59
- #
60
- # Default: {127,0,0,1}
61
- #
62
- INET_DIST_INTERFACE={127,0,0,1}
63
-
64
- #.
65
- #' ERL_EPMD_ADDRESS: IP addresses where epmd listens for connections
66
- #
67
- # IMPORTANT: This option works only in Erlang/OTP R14B03 and newer.
68
- #
69
- # This environment variable may be set to a comma-separated
70
- # list of IP addresses, in which case the epmd daemon
71
- # will listen only on the specified address(es) and on the
72
- # loopback address (which is implicitly added to the list if it
73
- # has not been specified). The default behaviour is to listen on
74
- # all available IP addresses.
75
- #
76
- # Default: 0.0.0.0
77
- #
78
- #ERL_EPMD_ADDRESS=127.0.0.1
79
-
80
- #.
81
- #' ERL_PROCESSES: Maximum number of Erlang processes
82
- #
83
- # Erlang consumes a lot of lightweight processes. If there is a lot of activity
84
- # on ejabberd so that the maximum number of processes is reached, people will
85
- # experience greater latency times. As these processes are implemented in
86
- # Erlang, and therefore not related to the operating system processes, you do
87
- # not have to worry about allowing a huge number of them.
88
- #
89
- # Default: 250000
90
- # Maximum: 268435456
91
- #
92
- #ERL_PROCESSES=250000
93
-
94
- #.
95
- #' ERL_MAX_ETS_TABLES: Maximum number of ETS and Mnesia tables
96
- #
97
- # The number of concurrent ETS and Mnesia tables is limited. When the limit is
98
- # reached, errors will appear in the logs:
99
- # ** Too many db tables **
100
- # You can safely increase this limit when starting ejabberd. It impacts memory
101
- # consumption but the difference will be quite small.
102
- #
103
- # Default: 1400
104
- #
105
- #ERL_MAX_ETS_TABLES=1400
106
-
107
- #.
108
- #' ERL_OPTIONS: Additional Erlang options
109
- #
110
- # The next variable allows to specify additional options passed to erlang while
111
- # starting ejabberd. Some useful options are -noshell, -detached, -heart. When
112
- # ejabberd is started from an init.d script options -noshell and -detached are
113
- # added implicitly. See erl(1) for more info.
114
- #
115
- # It might be useful to add "-pa /usr/local/lib/ejabberd/ebin" if you
116
- # want to add local modules in this path.
117
- #
118
- # Default: ""
119
- #
120
- #ERL_OPTIONS=""
121
-
122
- #.
123
- #' ERLANG_NODE: Erlang node name
124
- #
125
- # The next variable allows to explicitly specify erlang node for ejabberd
126
- # It can be given in different formats:
127
- # ERLANG_NODE=ejabberd
128
- # Lets erlang add hostname to the node (ejabberd uses short name in this case)
129
- # ERLANG_NODE=ejabberd@hostname
130
- # Erlang uses node name as is (so make sure that hostname is a real
131
- # machine hostname or you'll not be able to control ejabberd)
132
- # ERLANG_NODE=ejabberd@hostname.domainname
133
- # The same as previous, but erlang will use long hostname
134
- # (see erl (1) manual for details)
135
- #
136
- # Default: ejabberd
137
- #
138
- #ERLANG_NODE=ejabberd
139
-
140
- #.
141
- #' EJABBERD_PID_PATH: ejabberd PID file
142
- #
143
- # Indicate the full path to the ejabberd Process identifier (PID) file.
144
- # If this variable is defined, ejabberd writes the PID file when starts,
145
- # and deletes it when stops.
146
- # Remember to create the directory and grant write permission to ejabberd.
147
- #
148
- # Default: don't write PID file
149
- #
150
- #EJABBERD_PID_PATH=/var/run/ejabberd/ejabberd.pid
151
-
152
- #.
153
- #'
154
- # vim: foldmarker=#',#. foldmethod=marker:
@@ -1,3 +0,0 @@
1
- {lookup,["file","native"]}.
2
- {host,{127,0,0,1}, ["localhost","hostalias"]}.
3
- {file, resolv, "/etc/resolv.conf"}.
@@ -1,32 +0,0 @@
1
- #Social Stream Presence: ejabberd config
2
-
3
- #Ejabberd node server domain
4
- server_domain=localhost
5
-
6
- #Scripts Path
7
- scripts_path=/home/aldo/ejabberd-2.1.8_scripts
8
-
9
- #Source path: uncomment to compile ejabberd social stream module
10
- source_path=/home/aldo/ejabberd-2.1.8_source/src
11
-
12
- #It is also necessary to modify the file: /etc/ejabberd/ejabberd.cfg
13
- #%%{auth_method, external}.
14
- #%%{extauth_program, "scripts_path/authentication_script"}.
15
-
16
- #API REST
17
- auth_api=http://0.0.0.0:3000/users/sign_in
18
- set_connection_api=http://0.0.0.0:3000/xmpp/setConnection
19
- unset_connection_api=http://0.0.0.0:3000/xmpp/unsetConnection
20
- reset_connection_api=http://0.0.0.0:3000/xmpp/resetConnection
21
- synchronize_presence_api=http://0.0.0.0:3000/xmpp/synchronizePresence
22
- set_presence_api=http://0.0.0.0:3000/xmpp/setPresence
23
- unset_presence_api=http://0.0.0.0:3000/xmpp/unsetPresence
24
-
25
- #Social Stream Login
26
- ss_login=social_stream-presence
27
-
28
- #Social Stream PASSWORD
29
- ss_password=DnVCB8G|R$VGmZ@2?5=CYS8z)NrL@LuQ&LTCUh^9B(DF4gC&sQpfbCMbaNKEdNrGYkT4L5zxM0wNWs5q3?ww(b&0d5fK87z^BmgJMMF2SKXT9pEk^UEcch!GX!Avf5GT9)j@FpHe)4RH)BK7J98u!sUmJHUN(Je6aBmn!FtZ4Ab5h8$|nsvUt3Jkq?21HOH$r0sDyJZZvGOCgFS2EKw@0wXsJRHYVRPBe&Eb!1X55e55bQ^h2AW&^R70TK0m)Fu8
30
-
31
- #Ejabberd Server Password
32
- ejabberd_password=G&s6GBnO)anw2Ene%K12Cb=0quj@uDmA
@@ -1,114 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'logger'
4
- require 'rest_client'
5
-
6
- $stdout.sync = true
7
- $stdin.sync = true
8
-
9
- path = "/var/log/ejabberd/auth.log"
10
- file = File.open(path, File::WRONLY | File::APPEND | File::CREAT)
11
- file.sync = true
12
- $logger = Logger.new(file)
13
- $logger.level = Logger::DEBUG
14
-
15
- $logger.info "#{Process.pid}: Starting ejabberd authentication service"
16
-
17
-
18
- def getOption(option)
19
- File.open('/etc/ejabberd/ssconfig.cfg', 'r') do |f1|
20
- while line = f1.gets
21
- line = line.gsub(/\n/,'')
22
- if line.match(/^#/)
23
- #Comments
24
- elsif line.match(/^#{option}/)
25
- return line.gsub(/#{option}/,'')
26
- end
27
- end
28
- end
29
- return "Undefined"
30
- end
31
-
32
- $accessUrl = getOption("auth_api=")
33
- $sslogin = getOption("ss_login=")
34
- $sspass = getOption("ss_password=")
35
-
36
-
37
- def auth(username, password)
38
-
39
- #[TEST] Admin password
40
- if username == "admin" and password == "pass"
41
- return true
42
- end
43
-
44
- #Social Stream password
45
- if username == $sslogin and password == $sspass
46
- return true
47
- end
48
-
49
- begin
50
- response = RestClient.post $accessUrl, :user => { :email => username , :password => password }
51
-
52
- if response.code == 201
53
- return true
54
- else
55
- return false
56
- end
57
-
58
- rescue => e
59
-
60
- unless e.class.name == "RestClient::Unauthorized" and e.message == "401 Unauthorized"
61
- $logger.error "#{Process.pid}: Exception in auth(username, password)"
62
- $logger.error "#{Process.pid}: #{e.class.name}: #{e.message}"
63
- end
64
-
65
- return false
66
- end
67
-
68
- end
69
-
70
-
71
- loop do
72
- begin
73
- $stdin.eof? # wait for input
74
- start = Time.now
75
-
76
- msg = $stdin.read(2)
77
- length = msg.unpack('n').first
78
-
79
- msg = $stdin.read(length)
80
- cmd, *data = msg.split(":")
81
-
82
- $logger.info "#{Process.pid}: Incoming Request: '#{cmd}'"
83
- success = case cmd
84
-
85
- when "auth"
86
- $logger.info "#{Process.pid}: Authenticating #{data[0]}@#{data[1]}"
87
- $logger.info "#{Process.pid}: With password #{data[2]}"
88
- #password = data[2]
89
-
90
- #Authorization condition for LOGIN
91
- auth(data[0], data[2])
92
-
93
-
94
- when "isuser"
95
-
96
- $logger.info "#{Process.pid}: Isuser #{data[0]}@#{data[1]}"
97
-
98
- #Authorization condition for ISUSER (Add buddys)
99
- true
100
-
101
- else
102
- false
103
- end
104
-
105
- bool = success ? 1 : 0
106
- $stdout.write [2, bool].pack("nn")
107
- $logger.info "#{Process.pid}: Response: #{success ? "success" : "failure"}"
108
- rescue => e
109
- $logger.error "#{Process.pid}: #{e.class.name}: #{e.message}"
110
- $logger.error "#{Process.pid}: " + e.backtrace.join("\n\t")
111
- $logger.error "#{Process.pid}: Finish process"
112
- break
113
- end
114
- end