rhoconnect 3.0.0.beta3 → 3.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +7 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +40 -44
- data/doc/client.txt +16 -0
- data/doc/install.txt +2 -2
- data/examples/simple/dump.rdb +0 -0
- data/install.sh +49 -57
- data/installer/unix-like/post_install.sh +4 -0
- data/installer/unix-like/post_uninstall.sh +9 -0
- data/installer/unix-like/pre_install.sh +9 -0
- data/installer/unix-like/pre_uninstall.sh +23 -0
- data/installer/unix-like/rho_connect_install_checkers.rb +1 -4
- data/installer/unix-like/rho_connect_install_constants.rb +1 -1
- data/installer/unix-like/rho_connect_install_debian.rb +2 -2
- data/installer/unix-like/rho_connect_install_dnd.rb +7 -9
- data/installer/unix-like/rho_connect_install_get_params.rb +0 -2
- data/installer/unix-like/rho_connect_install_installers.rb +37 -37
- data/installer/unix-like/rho_connect_install_utilities.rb +7 -41
- data/installer/unix-like/rhoinstaller.rb +1 -5
- data/installer/utils/create_texts.rb +26 -9
- data/installer/utils/install_test.rb +24 -12
- data/installer/windows/rhosync.nsi +5 -5
- data/lib/rhoconnect/console/app/public/home.css +3 -10
- data/lib/rhoconnect/console/app/public/images/foot_logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/public/images/logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/routes/docs.rb +1 -1
- data/lib/rhoconnect/console/app/routes/home.rb +1 -1
- data/lib/rhoconnect/console/app/routes/user.rb +1 -1
- data/lib/rhoconnect/console/app/views/index.erb +1 -1
- data/lib/rhoconnect/console/app/views/layout.erb +4 -16
- data/lib/rhoconnect/db_adapter.rb +5 -7
- data/lib/rhoconnect/tasks.rb +31 -4
- data/lib/rhoconnect/version.rb +1 -1
- data/tasks/redis.rake +2 -2
- metadata +10 -21
- data/bin/rhoconnect-setup +0 -84
- data/installer/deb-scripts/LICENSE +0 -75
- data/installer/deb-scripts/install.sh +0 -300
- data/installer/deb-scripts/scripts/rho_connect_install_constants.rb +0 -32
- data/installer/deb-scripts/scripts/rho_connect_install_installers.rb +0 -103
- data/installer/deb-scripts/scripts/rho_connect_install_utilities.rb +0 -110
- data/installer/deb-scripts/scripts/rhoinstaller.rb +0 -55
- data/installer/deb-scripts/utils/README +0 -67
- data/installer/deb-scripts/utils/create_texts.rb +0 -76
- data/installer/deb-scripts/utils/redis_init_script +0 -124
- data/installer/deb-scripts/utils/redis_log_rotate +0 -8
- data/installer/unix-like/install.sh +0 -361
- data/installer/unix-like/post-install.sh +0 -8
- data/installer/unix-like/pre-install.sh +0 -8
- data/lib/rhoconnect/console/app/public/images/rhomobile_rhohub_logo.png +0 -0
@@ -4,22 +4,22 @@ require 'rho_connect_install_checkers'
|
|
4
4
|
include Checkers
|
5
5
|
|
6
6
|
module Installers
|
7
|
-
extend self
|
8
7
|
@options=''
|
9
8
|
|
10
9
|
# configure_passenger
|
11
10
|
# This method installs items that were retrieved via wget as well as passenger
|
12
11
|
def configure_passenger(options)
|
13
12
|
@options=options
|
14
|
-
print_header "Configuring
|
13
|
+
print_header "Configuring passenger ..."
|
15
14
|
if @options[:web_server] && !check_web_server_running
|
16
15
|
if @options[:web_server] == "apache2"
|
17
|
-
print_header "Configuring
|
16
|
+
print_header "Configuring apache2 to work with passenger ..."
|
18
17
|
cmd "yes | #{@options[:prefix]}/bin/passenger-install-#{ @options[:web_server] }-module"
|
19
18
|
elsif @options[:web_server] == "nginx"
|
20
|
-
print_header "Configuring and Compiling Nginx to work with Passenger"
|
21
19
|
nginx_version = Constants::Nginx
|
22
|
-
|
20
|
+
print_header "Downloading http://nginx.org/download/#{nginx_version}.tar.gz ..."
|
21
|
+
cmd "cd #{@options[:prefix]}; wget http://nginx.org/download/#{nginx_version}.tar.gz -o /dev/null; tar -xzvf #{nginx_version}.tar.gz"
|
22
|
+
print_header "Configuring and compiling Nginx to work with passenger ..."
|
23
23
|
cmd "#{@options[:prefix]}/bin/passenger-install-nginx-module --auto --prefix=/opt/nginx \
|
24
24
|
--nginx-source-dir=#{@options[:prefix]}/#{nginx_version} \
|
25
25
|
--extra-configure-flags='--with-http_ssl_module --with-http_gzip_static_module --user=nginx --group=nginx'"
|
@@ -41,24 +41,24 @@ module Installers
|
|
41
41
|
# install_all_packages
|
42
42
|
# This method installs all packages listed in the PACKAGES list defined
|
43
43
|
# in the Constants file.
|
44
|
-
def install_all_packages(pkg_mgr)
|
45
|
-
print_header "Installing packages"
|
46
|
-
Constants::PACKAGES.each do |pkg|
|
47
|
-
install_package pkg, pkg_mgr unless check_package pkg == true
|
48
|
-
end #do
|
49
|
-
packages_not_found = check_all_packages
|
50
|
-
if packages_not_found && !packages_not_found.empty?
|
51
|
-
log_print packages_not_found
|
52
|
-
else
|
53
|
-
log_print "All packages installed correctly"
|
54
|
-
end #if
|
55
|
-
end #install_all_packages
|
44
|
+
# def install_all_packages(pkg_mgr)
|
45
|
+
# print_header "Installing packages ..."
|
46
|
+
# Constants::PACKAGES.each do |pkg|
|
47
|
+
# install_package pkg, pkg_mgr unless check_package pkg == true
|
48
|
+
# end #do
|
49
|
+
# packages_not_found = check_all_packages
|
50
|
+
# if packages_not_found && !packages_not_found.empty?
|
51
|
+
# log_print packages_not_found
|
52
|
+
# else
|
53
|
+
# log_print "All packages installed correctly"
|
54
|
+
# end #if
|
55
|
+
# end #install_all_packages
|
56
56
|
|
57
57
|
# install_package
|
58
58
|
# This method installs the package passed with the determined get_cmd
|
59
|
-
def install_package(pkg, pkg_mgr)
|
60
|
-
cmd "#{ pkg_mgr } install #{ pkg }" unless check_package pkg
|
61
|
-
end #install_package
|
59
|
+
# def install_package(pkg, pkg_mgr)
|
60
|
+
# cmd "#{ pkg_mgr } install #{ pkg }" unless check_package pkg
|
61
|
+
# end #install_package
|
62
62
|
|
63
63
|
# install_all_gems
|
64
64
|
# This method installs all gems specified in the GEMS list defined in the
|
@@ -73,13 +73,13 @@ module Installers
|
|
73
73
|
# install_gem
|
74
74
|
# This method installs the given gem unless it is already installed
|
75
75
|
def install_gem(gem)
|
76
|
-
cmd "#{@gem_path} install #{ gem } --no-ri --no-rdoc"
|
76
|
+
cmd "#{@gem_path} install #{ gem } --no-ri --no-rdoc" unless check_gem(gem, @gem_path)
|
77
77
|
end #install_gem
|
78
78
|
|
79
79
|
# install_rubygems
|
80
80
|
# This method installs rubygems which was downloaded and untarred earlier
|
81
81
|
def install_rubygems
|
82
|
-
print_header "Installing
|
82
|
+
print_header "Installing rubygems ..."
|
83
83
|
Dir.chdir("#{@options[:prefix]}/#{Constants::RUBYGEMS}")
|
84
84
|
cmd "#{@options[:prefix]}/bin/ruby setup.rb --prefix=#{@options[:prefix]}/#{Constants::RUBYGEMS}"
|
85
85
|
@gem_path = "#{@options[:prefix]}/bin/gem"
|
@@ -89,9 +89,10 @@ module Installers
|
|
89
89
|
# install_redis
|
90
90
|
# This method installs redis
|
91
91
|
def install_redis
|
92
|
+
print_header "Installing redis ..."
|
92
93
|
Dir.chdir("#{@options[:prefix]}/#{Constants::REDIS}/src")
|
93
|
-
cmd "make; make PREFIX=#{@options[:prefix]} install"
|
94
|
-
|
94
|
+
cmd "make 2>&1; make PREFIX=#{@options[:prefix]} install"
|
95
|
+
`mkdir #{@options[:prefix]}/etc` unless File.exist? "#{@options[:prefix]}/etc"
|
95
96
|
|
96
97
|
#cmd "cp ../redis.conf #{@options[:prefix]}etc"
|
97
98
|
redis_conf_file = File.new("#{@options[:prefix]}/etc/redis.conf", 'w')
|
@@ -112,32 +113,31 @@ module Installers
|
|
112
113
|
# install_sqlite
|
113
114
|
# This method instaqll sqlite
|
114
115
|
def install_sqlite
|
116
|
+
print_header "Installing sqlite3 libs ..."
|
115
117
|
Dir.chdir("#{@options[:prefix]}/#{Constants::SQLITE3}")
|
116
118
|
cmd "./configure --prefix=#{@options[:prefix]}"
|
117
|
-
cmd "make; make install"
|
119
|
+
cmd "make 2>&1; make install"
|
118
120
|
end #install_sqlite
|
119
121
|
|
120
122
|
# install_rhoconnect
|
121
123
|
# This method installs rhoconnect
|
122
124
|
def install_rhoconnect
|
123
|
-
|
124
|
-
# store current gem_path
|
125
|
-
# orig_gem_path = `which gem`
|
126
|
-
print_header "Installing Rhoconnect"
|
127
|
-
path_to_rc_gem = "/tmp/installdir/rhoconnect-#{@options[:version]}/rhoconnect-#{@options[:version]}.gem"
|
128
|
-
|
125
|
+
print_header "Installing rhoconnect ..."
|
129
126
|
Dir.chdir(@options[:start_dir])
|
130
|
-
|
131
|
-
|
127
|
+
|
128
|
+
cmd "#{@options[:prefix]}/bin/bundle config build.sqlite3 " +
|
129
|
+
"--with-sqlite3-include=#{@options[:prefix]}/include " +
|
130
|
+
"--with-sqlite3-lib=#{@options[:prefix]}/lib" if @options[:pkg_mgr] =~ /yum/ # CentOS
|
131
|
+
|
132
|
+
gem_name = (Dir.glob "rhoconnect-*.gem")[0]
|
133
|
+
if gem_name && File.exists?(gem_name)
|
134
|
+
install_gem gem_name
|
132
135
|
else
|
133
|
-
cmd "#{@options[:prefix]}/bin/bundle config build.sqlite3 " +
|
134
|
-
"--with-sqlite3-include=#{@options[:prefix]}/include " +
|
135
|
-
"--with-sqlite3-lib=#{@options[:prefix]}/lib" if @options[:pkg_mgr] =~ /yum/ # CentOS
|
136
136
|
cmd "#{@options[:prefix]}/bin/bundle install --system --binstubs=/opt/rhoconnect/bin --without=test development"
|
137
137
|
# PATH=/opt/rhoconnect/bin:$PATH rake build
|
138
138
|
cmd "PATH=#{@options[:prefix]}/bin:$PATH rake build"
|
139
139
|
cmd "#{@gem_path} install pkg/rhoconnect-*.gem --no-ri --no-rdoc"
|
140
|
-
|
140
|
+
#`rm -f pkg/rhoconnect-*.gem`
|
141
141
|
end #if
|
142
142
|
end #install_rhoconnect
|
143
143
|
end #Installers
|
@@ -11,33 +11,10 @@ include Checkers
|
|
11
11
|
include DownloadAndDocompress
|
12
12
|
|
13
13
|
module Utilities
|
14
|
-
extend self
|
15
|
-
|
16
|
-
# get_elapsed_time
|
17
|
-
# This method returns the time since the given initial_time
|
18
|
-
def get_elapsed_time(initial_time)
|
19
|
-
#get time difference
|
20
|
-
elapsed_time = Time.now - initial_time
|
21
|
-
#determine if time is displayed in hours, minutes, or seconds
|
22
|
-
if elapsed_time >= 3600
|
23
|
-
elapsed_time /= 60
|
24
|
-
time_units = "hours"
|
25
|
-
elsif elapsed_time >= 60 && elapsed_time < 3600
|
26
|
-
elapsed_time /= 60
|
27
|
-
time_units = "minutes"
|
28
|
-
else
|
29
|
-
time_units = "seconds"
|
30
|
-
end #if
|
31
|
-
|
32
|
-
#round elapsed_time to 3 decimal values
|
33
|
-
elapsed_time = (elapsed_time * 10**3).round.to_f / 10**3
|
34
|
-
elapsed_time.to_s << " " + time_units
|
35
|
-
end #get_elapsed_time
|
36
|
-
|
37
14
|
# log_print
|
38
15
|
# This method displays, in minutes, how long the installation process took
|
39
16
|
def log_print(string)
|
40
|
-
puts string
|
17
|
+
puts string
|
41
18
|
@log.info {string} unless @log == nil
|
42
19
|
end #log_print
|
43
20
|
|
@@ -46,8 +23,9 @@ module Utilities
|
|
46
23
|
# cmd
|
47
24
|
# This method issues the given system command and calls log_print for output
|
48
25
|
def cmd(cmd)
|
49
|
-
|
50
|
-
|
26
|
+
@log.info cmd unless @log == nil
|
27
|
+
res = `#{cmd} 2>&1`
|
28
|
+
@log.info res unless @log == nil
|
51
29
|
end #cmd
|
52
30
|
|
53
31
|
#set_log_file
|
@@ -55,29 +33,17 @@ module Utilities
|
|
55
33
|
@log = log
|
56
34
|
end #set_log_file
|
57
35
|
|
58
|
-
# print_header
|
59
|
-
# This method displays a header surrounded by '=' characters consisting of
|
60
|
-
# the given string
|
61
36
|
def print_header(string)
|
62
|
-
|
63
|
-
border = "===="
|
64
|
-
string.each_char { border << "=" }
|
65
|
-
header << border + "\n"
|
66
|
-
header << "= " + string + " =\n"
|
67
|
-
header << border +"\n"
|
68
|
-
log_print header
|
37
|
+
log_print string
|
69
38
|
end #print_header
|
70
39
|
|
71
40
|
# cleanup
|
72
41
|
# This method moves all compressed files from the installation directory
|
73
42
|
# that were downloaded by this installation process
|
74
43
|
def cleanup(prefix)
|
75
|
-
print_header "Cleaning up"
|
44
|
+
print_header "Cleaning up ..."
|
76
45
|
Constants::SOFTWARE.each do |sw|
|
77
|
-
if File.exist? "#{prefix}/#{sw}.tar.gz"
|
78
|
-
cmd "rm #{prefix}/#{sw}.tar.gz"
|
79
|
-
cmd "rm -rf #{prefix}/#{sw}"
|
80
|
-
end
|
46
|
+
cmd "rm #{prefix}/#{sw}.tar.gz; rm -rf #{prefix}/#{sw}" if File.exist? "#{prefix}/#{sw}.tar.gz"
|
81
47
|
end
|
82
48
|
end #cleanup
|
83
49
|
|
@@ -55,11 +55,6 @@ optparse = OptionParser.new do|opts|
|
|
55
55
|
options[:silent] = true
|
56
56
|
end #do
|
57
57
|
|
58
|
-
options[:version] = nil
|
59
|
-
opts.on( '-v', '--version VERSION', 'Specify VERSION as the rhoconect version' ) do |ver|
|
60
|
-
options[:version] = ver
|
61
|
-
end #do
|
62
|
-
|
63
58
|
options[:web_server] = "nginx"
|
64
59
|
opts.on( '-w', '--web-server SERVER', 'Specify apache2 or nginx. Default is Nginx.' ) do |server|
|
65
60
|
options[:web_server] = server
|
@@ -74,6 +69,7 @@ end #do
|
|
74
69
|
options[:start_dir] = `pwd`.strip
|
75
70
|
|
76
71
|
optparse.parse!
|
72
|
+
|
77
73
|
log = Logger.new(IO.readlines("#{options[:prefix]}/info.dat").last.strip)
|
78
74
|
log.datetime_format = "%Y-%m-%d %H:%M:%S" # simplify time output
|
79
75
|
options[:log] = log
|
@@ -88,6 +88,9 @@ user="${user:-root}"
|
|
88
88
|
#config="${config:-/etc/redis/redis.conf}"
|
89
89
|
#user="${user:-redis}"
|
90
90
|
|
91
|
+
# If the redis-cli file is not found, terminate the script.
|
92
|
+
test -x $redis_cli || exit 0
|
93
|
+
|
91
94
|
#
|
92
95
|
# Set the running $pid value based on $pidfile.
|
93
96
|
#
|
@@ -350,7 +353,7 @@ _NGINX_CONF_
|
|
350
353
|
rho_vhost_conf = <<'_VHOST_CONF_'
|
351
354
|
server {
|
352
355
|
listen 80;
|
353
|
-
server_name www.yourhost.com; # <-- your server domain name!
|
356
|
+
# server_name www.yourhost.com; # <-- your server domain name!
|
354
357
|
root /opt/nginx/html/rhoapp/public; # <--- be sure to point to 'public' folder of your application!
|
355
358
|
passenger_enabled on;
|
356
359
|
}
|
@@ -535,6 +538,18 @@ _NGINX_README_
|
|
535
538
|
readme
|
536
539
|
end
|
537
540
|
|
541
|
+
def generate_rhoapp(rho_path)
|
542
|
+
puts "Generating rhoconnect application: /opt/nginx/html/rhoapp ..."
|
543
|
+
Dir.chdir "/opt/nginx/html"
|
544
|
+
unless File.directory? "/opt/nginx/html/rhoapp"
|
545
|
+
`#{rho_path}/bin/rhoconnect app rhoapp`
|
546
|
+
Dir.chdir "rhoapp"
|
547
|
+
`#{rho_path}/bin/bundle install --without=test development`
|
548
|
+
Dir.chdir "../"
|
549
|
+
`chown nginx:nginx rhoapp/`
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
538
553
|
def create_texts
|
539
554
|
if @redis
|
540
555
|
create_redis_init
|
@@ -545,6 +560,7 @@ def create_texts
|
|
545
560
|
create_nginx_init
|
546
561
|
create_nginx_logrotate
|
547
562
|
create_nginx_conf_files
|
563
|
+
generate_rhoapp @prefix
|
548
564
|
distro_info = nginx_readme
|
549
565
|
else
|
550
566
|
create_passenger_load
|
@@ -570,16 +586,17 @@ _IT_SHOULD_BE_DONE_
|
|
570
586
|
|
571
587
|
puts afterwords +
|
572
588
|
if @server == 'nginx'
|
573
|
-
|
574
|
-
2)
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
589
|
+
server_todo_list = <<_NGINX_TO_DO_
|
590
|
+
2) Try rhoconnect 'rhoapp' application, created in /opt/nginx/html directory
|
591
|
+
A) As root user start redis and nginx servers:
|
592
|
+
/etc/init.d/redis start
|
593
|
+
/etc/init.d/nginx start
|
594
|
+
B) Open RhoConnect application web console in your browser:
|
595
|
+
http://localhost/console/
|
579
596
|
|
580
597
|
_NGINX_TO_DO_
|
581
598
|
else
|
582
|
-
|
599
|
+
server_todo_list = <<_APACHE2_TO_DO_
|
583
600
|
2) Complete setup of Apache2 web server
|
584
601
|
A) Configure virtual host for your rhoconnect application:
|
585
602
|
Edit the file /etc/httpd/conf.d/rhoconnect.conf so that it reflects your specifications.
|
@@ -587,7 +604,7 @@ _NGINX_TO_DO_
|
|
587
604
|
/sbin/service httpd start
|
588
605
|
|
589
606
|
_APACHE2_TO_DO_
|
590
|
-
end + "For more details see #{@prefix}/README
|
607
|
+
end + "For more details see #{@prefix}/README and #{@prefix}/logs/ files."
|
591
608
|
|
592
609
|
end #create_texts
|
593
610
|
|
@@ -1,23 +1,33 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'rhoconnect/version'
|
3
4
|
require 'rubygems'
|
4
5
|
require 'fog'
|
5
6
|
require 'readline'
|
6
7
|
require 'optparse'
|
7
8
|
|
9
|
+
# CONSTANTS
|
10
|
+
|
8
11
|
REGION = 'us-west-1'
|
9
12
|
SLEEP = 45
|
10
|
-
|
11
|
-
|
13
|
+
SSH_KEY = '/home/mike/.ssh/alexdevkey.pem'
|
14
|
+
SCP_KEY = '/home/mike/.scp/alexdevkey.pem'
|
12
15
|
ACCESS_KEY_FILE = '/Users/rhomobile/.ec2'
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
LOCAL_FILE = ''
|
17
|
+
REMOTE_FILE = "/home/#{USER}/rhoconnect"
|
18
|
+
UBUNTU_STACK = { :image_id => 'ami-3d491a78',
|
19
|
+
:flavor_id => 'm1.small',
|
20
|
+
:key_name => 'alexdevkey',
|
21
|
+
:groups => 'load-test',
|
22
|
+
:user => 'ubuntu' }
|
23
|
+
CENTOS_STACK = { :image_id => 'ami-13346656',
|
24
|
+
:flavor_id => 'm1.small',
|
25
|
+
:key_name => 'alexdevkey',
|
26
|
+
:groups => 'load-test',
|
27
|
+
:user => 'root' }
|
28
|
+
STACKS = [ UBUNTU_STACK, CENTOS_STACK ]
|
29
|
+
|
30
|
+
# METHODS
|
21
31
|
|
22
32
|
# cmd
|
23
33
|
# easily issue system commands in a clear way
|
@@ -55,10 +65,10 @@ end #make_fog
|
|
55
65
|
|
56
66
|
# start_new_instance
|
57
67
|
# Creates a new ec2 instance as per the given stack.
|
58
|
-
def start_new_instance
|
68
|
+
def start_new_instance(stack)
|
59
69
|
puts "Creating new instance..."
|
60
70
|
|
61
|
-
@server = @fog.servers.create(
|
71
|
+
@server = @fog.servers.create(stack)
|
62
72
|
@server.wait_for { print "."; STDOUT.flush; ready? }
|
63
73
|
puts
|
64
74
|
if @server.ready?
|
@@ -129,6 +139,8 @@ def destroy_ec2_instance
|
|
129
139
|
puts "Instance Terminated."
|
130
140
|
end #destroy_ec2_instance
|
131
141
|
|
142
|
+
# SCRIPT
|
143
|
+
|
132
144
|
create_ec2_instance
|
133
145
|
|
134
146
|
# Establish connections
|
@@ -99,7 +99,7 @@ section "uninstall"
|
|
99
99
|
Push "PATH"
|
100
100
|
Push "R"
|
101
101
|
Push "HKLM"
|
102
|
-
Push "$INSTDIR\redis-2.2.
|
102
|
+
Push "$INSTDIR\redis-2.2.14"
|
103
103
|
Call un.EnvVarUpdate
|
104
104
|
Pop $R0
|
105
105
|
|
@@ -170,25 +170,25 @@ Section "Redis" redisSection
|
|
170
170
|
|
171
171
|
SetOutPath $INSTDIR
|
172
172
|
|
173
|
-
File /r "redis-2.2.
|
173
|
+
File /r "redis-2.2.14"
|
174
174
|
|
175
175
|
;add to path here
|
176
176
|
|
177
177
|
Push "PATH"
|
178
178
|
Push "P"
|
179
179
|
Push "HKLM"
|
180
|
-
Push "$INSTDIR\redis-2.2.
|
180
|
+
Push "$INSTDIR\redis-2.2.14"
|
181
181
|
Call EnvVarUpdate
|
182
182
|
Pop $R0
|
183
183
|
|
184
184
|
Push "REDIS_HOME"
|
185
185
|
Push "P"
|
186
186
|
Push "HKLM"
|
187
|
-
Push "$INSTDIR\redis-2.2.
|
187
|
+
Push "$INSTDIR\redis-2.2.14"
|
188
188
|
Call EnvVarUpdate
|
189
189
|
Pop $R0
|
190
190
|
|
191
|
-
ExecWait '$INSTDIR\redis-2.2.
|
191
|
+
ExecWait '$INSTDIR\redis-2.2.14\redis-service.exe install' $0
|
192
192
|
StrCmp $0 "0" continue wrong
|
193
193
|
|
194
194
|
wrong:
|
@@ -74,19 +74,12 @@ body{
|
|
74
74
|
position:absolute;
|
75
75
|
top:9px;
|
76
76
|
}
|
77
|
-
.header .logos a.
|
78
|
-
background:url("images/logo_rhoconnect.png") no-repeat scroll -56px 0 transparent;
|
79
|
-
float:left;
|
80
|
-
height:38px;
|
81
|
-
text-indent:-3000px;
|
82
|
-
width:175px;
|
83
|
-
}
|
84
|
-
.header .logos a.logo_rhomobile{
|
77
|
+
.header .logos a.logo_rhoconnect{
|
85
78
|
background:url("images/logo_rhoconnect.png") no-repeat scroll 0 0 transparent;
|
79
|
+
float:left;
|
86
80
|
height:38px;
|
87
81
|
text-indent:-3000px;
|
88
|
-
|
89
|
-
width:56px;
|
82
|
+
width:400px;
|
90
83
|
}
|
91
84
|
.header .logo a{
|
92
85
|
display:block;
|
Binary file
|
Binary file
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>
|
6
|
+
<title>RhoConnect Console</title>
|
7
7
|
<!--<link rel="stylesheet" href="<%=url_path('main.css')%>" type="text/css" media="screen" /> -->
|
8
8
|
<link rel="stylesheet" href="<%=url_path('reset.css')%>" type="text/css" media="screen" />
|
9
9
|
<link rel="stylesheet" href="<%=url_path('home.css')%>" type="text/css" media="screen" />
|
@@ -105,8 +105,7 @@
|
|
105
105
|
<div class="header">
|
106
106
|
<div class="logos">
|
107
107
|
<% unless RhoconnectConsole::Server::HEROKU_NAV %>
|
108
|
-
<a href="" class="
|
109
|
-
<a href="" class="logo_rhohub">RhoHub</a>
|
108
|
+
<a href="" class="logo_rhoconnect">RhoHub</a>
|
110
109
|
<% end %>
|
111
110
|
</div>
|
112
111
|
<div id="menu">
|
@@ -144,19 +143,8 @@
|
|
144
143
|
<%="<li>Licensed to #{license['licensee']}</li><li>|</li><li> #{license['available']}/#{license['seats']} devices available</li>"%>
|
145
144
|
<%end%>
|
146
145
|
<li>|</li>
|
147
|
-
<li>
|
148
|
-
|
149
|
-
<li>|</li>
|
150
|
-
<li><a href="http://app.rhohub.com/how_to_use">How to Use</a></li>
|
151
|
-
<li>|</li>
|
152
|
-
<li><a href="http://app.rhohub.com/pricing">Pricing</a></li>
|
153
|
-
<li>|</li>
|
154
|
-
<li><a class="largea3" target="_blank" href="http://wiki.rhomobile.com/index.php/RhoHub">Docs</a></li>
|
155
|
-
<li>|</li>
|
156
|
-
<li><a href="http://app.rhohub.com/terms">Terms of Service</a></li>
|
157
|
-
<li>|</li>
|
158
|
-
<li><a href="http://www.twitter.com/rhohub">Status</a></li>
|
159
|
-
--> </ul>
|
146
|
+
<li>RhoConnect v<%=Rhoconnect::VERSION%></li>
|
147
|
+
</ul>
|
160
148
|
</div>
|
161
149
|
<br class="clear">
|
162
150
|
</div>
|
@@ -1,10 +1,3 @@
|
|
1
|
-
unless defined?(JRUBY_VERSION)
|
2
|
-
require 'sqlite3'
|
3
|
-
else
|
4
|
-
require 'dbi'
|
5
|
-
require 'dbd/Jdbc'
|
6
|
-
require 'jdbc/sqlite3'
|
7
|
-
end
|
8
1
|
require 'singleton'
|
9
2
|
|
10
3
|
class DBAdapter
|
@@ -15,6 +8,10 @@ class DBAdapter
|
|
15
8
|
# and redefined 'transaction' method (to manage DBI auto-commit behavior)
|
16
9
|
def get_connection(dbfile)
|
17
10
|
if defined?(JRUBY_VERSION) # JRuby
|
11
|
+
require 'dbi'
|
12
|
+
require 'dbd/Jdbc'
|
13
|
+
require 'jdbc/sqlite3'
|
14
|
+
|
18
15
|
db = DBI.connect("DBI:Jdbc:SQLite:#{dbfile}", nil, nil, 'driver' => 'org.sqlite.JDBC')
|
19
16
|
class << db
|
20
17
|
# jdbc/sqlite3 has no Database#execute_batch method
|
@@ -38,6 +35,7 @@ class DBAdapter
|
|
38
35
|
end
|
39
36
|
end
|
40
37
|
else # Ruby 1.8/1.9
|
38
|
+
require 'sqlite3'
|
41
39
|
db = SQLite3::Database.new(dbfile)
|
42
40
|
end
|
43
41
|
|
data/lib/rhoconnect/tasks.rb
CHANGED
@@ -40,11 +40,16 @@ module Rhoconnect
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def rhoconnect_socket
|
43
|
-
|
43
|
+
'/tmp/rhoconnect.dtach'
|
44
44
|
end
|
45
45
|
|
46
46
|
def rhoconnect_pid
|
47
|
-
|
47
|
+
if windows?
|
48
|
+
Dir.mkdir 'C:/TMP' unless File.directory? 'C:/TMP'
|
49
|
+
'C:/TMP/rhoconnect.pid'
|
50
|
+
else
|
51
|
+
'/tmp/rhoconnect.pid'
|
52
|
+
end
|
48
53
|
end
|
49
54
|
|
50
55
|
def windows?
|
@@ -254,7 +259,7 @@ namespace :rhoconnect do
|
|
254
259
|
cmd = (jruby?) ? trinidad? : (thin? || mongrel? || report_missing_server)
|
255
260
|
if windows?
|
256
261
|
puts 'Starting rhoconnect...'
|
257
|
-
system("#{cmd} config.ru")
|
262
|
+
system("#{cmd} config.ru -P #{rhoconnect_pid}")
|
258
263
|
elsif jruby?
|
259
264
|
puts 'Starting rhoconnect in jruby environment...'
|
260
265
|
system("#{cmd}")
|
@@ -265,6 +270,24 @@ namespace :rhoconnect do
|
|
265
270
|
end
|
266
271
|
end
|
267
272
|
|
273
|
+
desc "Start rhoconnect server in bg mode (Rhostudio)"
|
274
|
+
task :startbg do
|
275
|
+
cmd = (jruby?) ? trinidad? : (thin? || mongrel? || report_missing_server)
|
276
|
+
Thread.new {
|
277
|
+
if windows?
|
278
|
+
puts 'Starting rhoconnect...'
|
279
|
+
system("#{cmd} config.ru -P #{rhoconnect_pid}")
|
280
|
+
elsif jruby?
|
281
|
+
puts 'Starting rhoconnect in jruby environment...'
|
282
|
+
system("#{cmd}")
|
283
|
+
else
|
284
|
+
system("#{cmd} config.ru -P #{rhoconnect_pid}")
|
285
|
+
end
|
286
|
+
}
|
287
|
+
|
288
|
+
exit
|
289
|
+
end
|
290
|
+
|
268
291
|
desc "run rhoconnect console"
|
269
292
|
task :console, :environment do |t, args|
|
270
293
|
if RedisRunner.running?
|
@@ -278,7 +301,11 @@ namespace :rhoconnect do
|
|
278
301
|
|
279
302
|
desc "Stop rhoconnect server"
|
280
303
|
task :stop => :dtach_installed do
|
281
|
-
|
304
|
+
if windows?
|
305
|
+
File.delete "#{rhoconnect_pid}" if system("FOR /F %A in (#{rhoconnect_pid}) do taskkill /F /PID %A")
|
306
|
+
else
|
307
|
+
sh "cat #{rhoconnect_pid} | xargs kill -3"
|
308
|
+
end
|
282
309
|
end
|
283
310
|
|
284
311
|
desc "Attach to rhoconnect console"
|
data/lib/rhoconnect/version.rb
CHANGED
data/tasks/redis.rake
CHANGED
@@ -7,7 +7,7 @@ def windows?
|
|
7
7
|
end
|
8
8
|
|
9
9
|
if windows?
|
10
|
-
$redis_ver = "redis-2.2.
|
10
|
+
$redis_ver = "redis-2.2.14"
|
11
11
|
$redis_zip = "C:/#{$redis_ver}.zip"
|
12
12
|
$redis_dest = "C:/"
|
13
13
|
end
|
@@ -164,7 +164,7 @@ namespace :redis do
|
|
164
164
|
else
|
165
165
|
sh 'rm -rf /tmp/redis/' if File.exists?("#{RedisRunner.redisdir}")
|
166
166
|
sh 'git clone git://github.com/antirez/redis.git /tmp/redis -n'
|
167
|
-
sh "cd #{RedisRunner.redisdir} && git reset --hard && git checkout 2.2.
|
167
|
+
sh "cd #{RedisRunner.redisdir} && git reset --hard && git checkout 2.2.14"
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|