rhoconnect 3.0.0.beta3 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,110 +0,0 @@
|
|
1
|
-
#!/opt/rhoconnect/bin/ruby
|
2
|
-
|
3
|
-
require 'rho_connect_install_constants'
|
4
|
-
require 'rho_connect_install_installers'
|
5
|
-
|
6
|
-
include Installers
|
7
|
-
|
8
|
-
module Utilities
|
9
|
-
extend self
|
10
|
-
|
11
|
-
# log_print
|
12
|
-
# This method displays, in minutes, how long the installation process took
|
13
|
-
def log_print(string)
|
14
|
-
puts string
|
15
|
-
@log.info {string} unless @log == nil
|
16
|
-
end #log_print
|
17
|
-
|
18
|
-
# cmd
|
19
|
-
# This method issues the given system command and calls log_print for output
|
20
|
-
def cmd(cmd)
|
21
|
-
log_print cmd
|
22
|
-
log_print `#{ cmd }`
|
23
|
-
end #cmd
|
24
|
-
|
25
|
-
#set_log_file
|
26
|
-
def set_log_file(log)
|
27
|
-
@log = log
|
28
|
-
end #set_log_file
|
29
|
-
|
30
|
-
# print_header
|
31
|
-
# This method displays a header surrounded by '=' characters consisting of
|
32
|
-
# the given string
|
33
|
-
def print_header(string)
|
34
|
-
header = "\n"
|
35
|
-
border = "===="
|
36
|
-
string.each_char { border << "=" }
|
37
|
-
header << border + "\n"
|
38
|
-
header << "= " + string + " =\n"
|
39
|
-
header << border +"\n"
|
40
|
-
log_print header
|
41
|
-
end #print_header
|
42
|
-
|
43
|
-
# download_and_decompress
|
44
|
-
# Delegates the download and decompression duties
|
45
|
-
def download_and_decompress(prefix)
|
46
|
-
print_header "Downloading and Decompressing"
|
47
|
-
downloads = 0
|
48
|
-
Constants::URLS.each do |url|
|
49
|
-
if !File.exists?("#{ get_tarball_name url }") ||
|
50
|
-
!File.exists?("#{ get_version url }")
|
51
|
-
wget_download prefix, url
|
52
|
-
decompress prefix, url
|
53
|
-
downloads += 1
|
54
|
-
end #if
|
55
|
-
end #do
|
56
|
-
end #download_and_decompress
|
57
|
-
|
58
|
-
# wget_download
|
59
|
-
# Takes a URL and the name of a tarball and issues a wget command on said
|
60
|
-
# URL unless the tarball or directory already exists
|
61
|
-
def wget_download(prefix, url)
|
62
|
-
if !File.exists?("#{ prefix }/#{ get_tarball_name url }") &&
|
63
|
-
!File.directory?("#{ prefix }/#{ get_version url }")
|
64
|
-
cmd "wget -P #{ prefix } #{ url }"
|
65
|
-
end #if
|
66
|
-
end #wget_download
|
67
|
-
|
68
|
-
# decompress
|
69
|
-
# Decompress downloaded files unless already decompressed directory
|
70
|
-
# exists
|
71
|
-
def decompress(prefix, url)
|
72
|
-
tarball = get_tarball_name(url)
|
73
|
-
dir = get_version(url)
|
74
|
-
cmd "tar -xzf #{ prefix }/#{ tarball } -C #{ prefix }" unless
|
75
|
-
File.directory? "#{ prefix }/#{ dir }"
|
76
|
-
end #decompress
|
77
|
-
|
78
|
-
# get_version
|
79
|
-
# This method extracts the untarballed name of files retrieved via wget
|
80
|
-
# from their URL
|
81
|
-
def get_version(url)
|
82
|
-
url =~ /.*\/(.*)\.t.*\Z/
|
83
|
-
$1
|
84
|
-
end #get_version
|
85
|
-
|
86
|
-
# get_tarball_name
|
87
|
-
# This method extracts the name of files retrieved via wget from their URL
|
88
|
-
def get_tarball_name(url)
|
89
|
-
url =~ /.*\/(.*\.t.*)/
|
90
|
-
$1
|
91
|
-
end #get_tarball_name
|
92
|
-
|
93
|
-
# cleanup
|
94
|
-
# This method moves all compressed files from the installation directory
|
95
|
-
# that were downloaded by this installation process
|
96
|
-
def cleanup(options)
|
97
|
-
prefix = options[:prefix]
|
98
|
-
|
99
|
-
print_header "Cleaning up"
|
100
|
-
|
101
|
-
Dir.mkdir("#{prefix}/downloads") unless File.directory?("#{prefix}/downloads")
|
102
|
-
Constants::URLS.each do |url|
|
103
|
-
file = get_version url
|
104
|
-
if File.exists?("#{prefix}/#{file}")
|
105
|
-
cmd "rm -rf #{prefix}/downloads/#{file}"
|
106
|
-
cmd "mv #{prefix}/#{file}* #{prefix}/downloads"
|
107
|
-
end #if
|
108
|
-
end # do
|
109
|
-
end #cleanup
|
110
|
-
end #Utilities
|
@@ -1,55 +0,0 @@
|
|
1
|
-
#!/opt/rhoconnect/bin/ruby
|
2
|
-
|
3
|
-
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), "..", "scripts"))
|
4
|
-
|
5
|
-
require 'logger'
|
6
|
-
require 'time'
|
7
|
-
require 'rho_connect_install_constants'
|
8
|
-
require 'rho_connect_install_utilities'
|
9
|
-
|
10
|
-
include Utilities
|
11
|
-
|
12
|
-
# Simplify logger output format: [timestamp] message
|
13
|
-
class Logger
|
14
|
-
class Formatter
|
15
|
-
#Format = "[%s] %s\n"
|
16
|
-
def call(severity, time, progname, msg)
|
17
|
-
"[%s] %s\n" % [format_datetime(time), msg]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# set necessary variables
|
23
|
-
@options = {:prefix => Constants::DEFAULT_INSTALL_DIR,
|
24
|
-
:dist => "debian",
|
25
|
-
:pkg_mgr => 'apt-get -y',
|
26
|
-
:pkg_chkr => 'dpkg -l',
|
27
|
-
:start_dir => `pwd`.strip,
|
28
|
-
:web_server => Constants::WEB_SERVER}
|
29
|
-
|
30
|
-
log = Logger.new(IO.readlines("#{@options[:prefix]}/info.dat").last.strip)
|
31
|
-
log.datetime_format = "%Y-%m-%d %H:%M:%S" # simplify time output
|
32
|
-
|
33
|
-
# execute_installation
|
34
|
-
# This method orchestrates the actual installation process
|
35
|
-
def execute_installation
|
36
|
-
install_sqlite @options
|
37
|
-
|
38
|
-
# Start installing
|
39
|
-
install_all_gems @options
|
40
|
-
configure_passenger @options
|
41
|
-
|
42
|
-
# Install Redis
|
43
|
-
install_redis @options
|
44
|
-
|
45
|
-
# Install rhoconnect
|
46
|
-
install_rhoconnect @options
|
47
|
-
|
48
|
-
# Remove downloaded tarballs and extracted directories
|
49
|
-
cleanup @options
|
50
|
-
end #execute_installation
|
51
|
-
|
52
|
-
# Start installation process
|
53
|
-
download_and_decompress @options[:prefix]
|
54
|
-
|
55
|
-
execute_installation
|
@@ -1,67 +0,0 @@
|
|
1
|
-
Thank you for choosing Rhomobile for your cross-platform app needs!
|
2
|
-
To finish this setup, please complete the following...
|
3
|
-
|
4
|
-
1) Add necessary bins to the path(s) of the users who will
|
5
|
-
be using this software. You may also wish to add these items
|
6
|
-
to ~/.profile to automatically add them upon login.
|
7
|
-
Ex:
|
8
|
-
|
9
|
-
A) All bins in the main bin deposit:
|
10
|
-
export PATH=/opt/rhoconnect/bin:$PATH
|
11
|
-
|
12
|
-
B) Bins specifically placed in the ruby/bin directory
|
13
|
-
export PATH=/opt/rhoconnect/ruby/1.8/bin:$PATH
|
14
|
-
|
15
|
-
Or if you had other versions of ruby installed previously to running
|
16
|
-
this installation, you may instead wish to simply create an alias
|
17
|
-
for the newly installed ruby.
|
18
|
-
|
19
|
-
Ex:
|
20
|
-
alias rubyee=/opt/rhoconnect/bin/ruby
|
21
|
-
|
22
|
-
B) Add the export line to ~/.profile:
|
23
|
-
export PATH=/opt/rhoconnect/bin:opt/rhoconnect/ruby/bin:$PATH
|
24
|
-
|
25
|
-
2) Rhoconnect installer configured redis server with the following settings:
|
26
|
-
|
27
|
-
A) redis.conf file is located in /opt/rhoconnect/etc/ directory with properties:
|
28
|
-
daemonize yes
|
29
|
-
pidfile /var/run/redis.pid
|
30
|
-
logfile /var/log/redis.log
|
31
|
-
|
32
|
-
B) Redis logrotate settings for /var/log/redis.log files defined in '/etc/logrotate.d/redis':
|
33
|
-
|
34
|
-
/var/log/redis.log {
|
35
|
-
rotate 3
|
36
|
-
missingok
|
37
|
-
notifempty
|
38
|
-
size 250k
|
39
|
-
create 0644 root root
|
40
|
-
compress
|
41
|
-
}
|
42
|
-
|
43
|
-
C) Redis start-up script '/etc/init.d/redis'.
|
44
|
-
You can start/stop redis server by running the following commands:
|
45
|
-
/etc/init.d/redis {start|stop}
|
46
|
-
|
47
|
-
3) Setup rhoconnect application directory
|
48
|
-
|
49
|
-
A) Put your application code in a directory called /var/www/rhoconnect
|
50
|
-
(make sure this is the root of your applictaion directory, i.e. /var/www/rhoconnect/config.ru should exist).
|
51
|
-
|
52
|
-
B) Make an empty public folder in the directory
|
53
|
-
$ mkdir /var/www/rhoconnect/public
|
54
|
-
|
55
|
-
4) Configure Apache2
|
56
|
-
A) Configure virtual host for rhoconnect application:
|
57
|
-
Edit the file /etc/apache2/sites-available/rhoconnect so that it
|
58
|
-
reflects your specifications.
|
59
|
-
|
60
|
-
B) Enable the virtual host:
|
61
|
-
$ sudo a2ensite rhoconnect
|
62
|
-
|
63
|
-
C) Load the passenger.load module
|
64
|
-
$ sudo a2enmod passenger
|
65
|
-
|
66
|
-
D) Restart apache to pick up the changes:
|
67
|
-
$ sudo /etc/init.d/apache2 restart
|
@@ -1,76 +0,0 @@
|
|
1
|
-
#!/opt/rhoconnect/bin/ruby
|
2
|
-
|
3
|
-
$:.unshift File.expand_path(File.join(File.dirname(__FILE__),'..','scripts'))
|
4
|
-
|
5
|
-
require 'rho_connect_install_constants'
|
6
|
-
|
7
|
-
@prefix = '/opt/rhoconnect'
|
8
|
-
@dist = 'debian'
|
9
|
-
@redis = ''
|
10
|
-
@ruby_version = 'rubyee'
|
11
|
-
@profile = '~/.profile'
|
12
|
-
|
13
|
-
# place_redis_init
|
14
|
-
# Places the redis initialization file into the correct directory
|
15
|
-
def place_redis_init
|
16
|
-
redis_init="/etc/init.d/redis"
|
17
|
-
|
18
|
-
# Move the script into the appropriate directory
|
19
|
-
`mv redis_init_script #{redis_init}`
|
20
|
-
# Make the init script executable
|
21
|
-
`chmod +x #{redis_init}`
|
22
|
-
|
23
|
-
# Set run levels
|
24
|
-
`update-rc.d -f redis defaults`
|
25
|
-
end #place_redis_init
|
26
|
-
|
27
|
-
def place_redis_logrotate
|
28
|
-
log_rotate = '/etc/logrotate.d/redis'
|
29
|
-
|
30
|
-
# Move the file to the appropriate directory
|
31
|
-
`mv redis_log_rotate #{log_rotate}`
|
32
|
-
end
|
33
|
-
|
34
|
-
# place_readme
|
35
|
-
# Places the readme file in the appropriate directory
|
36
|
-
def place_readme
|
37
|
-
readme_dir = "#{prefix}/README"
|
38
|
-
|
39
|
-
# Move the readme into the appropriate folder
|
40
|
-
`mv README #{readme_dir}`
|
41
|
-
end #create_readme
|
42
|
-
|
43
|
-
def create_passenger_load
|
44
|
-
passenger_load_file = '/etc/apache2/mods-available/passenger.load'
|
45
|
-
|
46
|
-
passenger_load = <<_PASSENGER_LOAD_
|
47
|
-
LoadModule passenger_module /opt/rhoconnect/lib/ruby/gems/1.8/gems/#{Constants::PASSENGER_VERSION}/ext/apache2/mod_passenger.so
|
48
|
-
PassengerRoot /opt/rhoconnect/lib/ruby/gems/1.8/gems/#{Constants::PASSENGER_VERSION}
|
49
|
-
PassengerRuby /opt/rhoconnect/bin/ruby
|
50
|
-
_PASSENGER_LOAD_
|
51
|
-
|
52
|
-
File.open( passenger_load_file, 'w' ) { |f| f << passenger_load }
|
53
|
-
end #create_passenger_load
|
54
|
-
|
55
|
-
def create_nginx_vhost
|
56
|
-
vhost_file = ''
|
57
|
-
|
58
|
-
File.open( vhost_file, 'w' ) { |f| f << vhost }
|
59
|
-
end #create_apache_vhost
|
60
|
-
|
61
|
-
def create_texts
|
62
|
-
if @redis
|
63
|
-
place_redis_init
|
64
|
-
place_redis_logrotate
|
65
|
-
end
|
66
|
-
|
67
|
-
readme = create_readme
|
68
|
-
|
69
|
-
create_passenger_load
|
70
|
-
create_apache_vhost
|
71
|
-
|
72
|
-
puts readme
|
73
|
-
|
74
|
-
end #create_texts
|
75
|
-
|
76
|
-
create_texts
|
@@ -1,124 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
### BEGIN INIT INFO
|
3
|
-
# Provides: redis-server
|
4
|
-
# Required-Start: $syslog
|
5
|
-
# Required-Stop: $syslog
|
6
|
-
# Should-Start: $local_fs
|
7
|
-
# Should-Stop: $local_fs
|
8
|
-
# Default-Start: 2 3 4 5
|
9
|
-
# Default-Stop: 0 1 6
|
10
|
-
# Short-Description: redis-server - Persistent key-value db
|
11
|
-
# Description: redis-server - Persistent key-value db
|
12
|
-
### END INIT INFO
|
13
|
-
#
|
14
|
-
# Author: Wayne E. Seguin <wayneeseguin@gmail.com>
|
15
|
-
# License: The same licence as Redis, New BSD
|
16
|
-
# http://www.opensource.org/licenses/bsd-license.php
|
17
|
-
#
|
18
|
-
|
19
|
-
# Source the system config file, if it exists.
|
20
|
-
if [[ -s /etc/conf.d/redis ]] ; then
|
21
|
-
source /etc/conf.d/redis
|
22
|
-
fi
|
23
|
-
|
24
|
-
# Default config variables that have not been set.
|
25
|
-
port="${port:-6379}"
|
26
|
-
prefix="${prefix:-/opt/rhoconnect}"
|
27
|
-
redis="${prefix}/bin/redis-server"
|
28
|
-
redis_cli="${prefix}/bin/redis-cli"
|
29
|
-
pidfile="${pidfile:-/var/run/redis.pid}"
|
30
|
-
config="${config:-/opt/rhoconnect/etc/redis.conf}"
|
31
|
-
user="${user:-root}"
|
32
|
-
#prefix="${prefix:-/usr/local}"
|
33
|
-
#config="${config:-/usr/local/etc/redis.conf}"
|
34
|
-
#pidfile="${pidfile:-/var/run/redis/redis.pid}"
|
35
|
-
#config="${config:-/etc/redis/redis.conf}"
|
36
|
-
#user="${user:-redis}"
|
37
|
-
|
38
|
-
#
|
39
|
-
# Set the running $pid value based on $pidfile.
|
40
|
-
#
|
41
|
-
if [[ -s "$pidfile" ]] ; then
|
42
|
-
pid=$(cat $pidfile)
|
43
|
-
else
|
44
|
-
rm -f $pidfile
|
45
|
-
fi
|
46
|
-
|
47
|
-
# In case there was pidfile corruption...
|
48
|
-
if [[ "Linux" = "$(uname)" ]] ; then
|
49
|
-
# /proc does not exist on say, Darwin
|
50
|
-
if [[ ! -z "${pid}" ]] && [[ ! -x "/proc/${pid}" ]] ;then
|
51
|
-
pid="$(ps auxww | grep [r]edis | grep "$config" | grep -v 'grep' | awk '{print $2}')"
|
52
|
-
elif [[ -z "${pid}" ]] ; then
|
53
|
-
pid="$(ps auxww | grep [r]edis | grep "$config" | grep -v 'grep' | awk '{print $2}')"
|
54
|
-
fi
|
55
|
-
else
|
56
|
-
if [[ -z "${pid}" ]] ; then
|
57
|
-
pid="$(ps auxww | grep [r]edis | grep "$config" | grep -v 'grep' | awk '{print $2}')"
|
58
|
-
fi
|
59
|
-
fi
|
60
|
-
|
61
|
-
#
|
62
|
-
# Start redis using redis-server as user 'redis'.
|
63
|
-
#
|
64
|
-
redis_start() {
|
65
|
-
if [[ -f $pidfile ]] ; then
|
66
|
-
echo "$pidfile exists, redis-server is either already running or crashed."
|
67
|
-
exit 1
|
68
|
-
elif [[ ! -z "$pid" ]] ; then
|
69
|
-
echo -e "\nRedis is already running with configuration '$config'."
|
70
|
-
echo "$pid" > $pidfile # Ensure pidfile exists with the pid.
|
71
|
-
else
|
72
|
-
echo "Starting Redis server..."
|
73
|
-
su $user -c "$redis $config"
|
74
|
-
exit 0
|
75
|
-
fi
|
76
|
-
}
|
77
|
-
|
78
|
-
#
|
79
|
-
# Stop redis using redis-cli SHUTDOWN.
|
80
|
-
#
|
81
|
-
redis_stop() {
|
82
|
-
echo -n "Stopping redis server on port ${port} ... "
|
83
|
-
"$redis_cli" -p ${port} SHUTDOWN
|
84
|
-
|
85
|
-
# Keep user informed while server shuts down.
|
86
|
-
echo "Waiting for the redis server to shutdown "
|
87
|
-
|
88
|
-
if [[ "Linux" = "$(uname)" ]] ; then
|
89
|
-
if [[ "${pid}" = "" ]] ; then
|
90
|
-
echo "redis server is not running."
|
91
|
-
# Clear out the old pidfile if available
|
92
|
-
rm -f $pidfile
|
93
|
-
exit 1
|
94
|
-
fi
|
95
|
-
while [[ -x /proc/${pid} ]] ; do
|
96
|
-
echo -n '.' ; sleep 1
|
97
|
-
done
|
98
|
-
else # Darwin, etc...
|
99
|
-
while [[ ! -z "$(ps auxww | grep [r]edis | grep "$config" | awk '{print $2}')" ]] ; do
|
100
|
-
echo -n '.' ; sleep 1
|
101
|
-
done
|
102
|
-
fi
|
103
|
-
|
104
|
-
# Clear out the old pidfile.
|
105
|
-
rm -f $pidfile
|
106
|
-
|
107
|
-
# Notify user of successful completion.
|
108
|
-
echo -e "redis server stopped."
|
109
|
-
exit 0
|
110
|
-
}
|
111
|
-
|
112
|
-
redis_usage() {
|
113
|
-
echo -e "Usage: $0 {start,stop}"
|
114
|
-
exit 1
|
115
|
-
}
|
116
|
-
|
117
|
-
#
|
118
|
-
# CLI logic.
|
119
|
-
#
|
120
|
-
case "$1" in
|
121
|
-
start) redis_start ;;
|
122
|
-
stop) redis_stop ;;
|
123
|
-
*) redis_usage ;;
|
124
|
-
esac
|