sr-scripts 0.1.16 → 0.1.17
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/bin/sr-check-slave +2 -2
- data/changes.txt +90 -0
- data/lib/sr-scripts/version.rb +1 -1
- data/test.rb +14 -0
- metadata +5 -3
data/bin/sr-check-slave
CHANGED
@@ -23,10 +23,10 @@ end
|
|
23
23
|
|
24
24
|
optparse.parse!
|
25
25
|
|
26
|
-
connection = SrScripts::Compute.get
|
27
|
-
|
28
26
|
current_instance_id = `curl -s http://169.254.169.254/latest/meta-data/instance-id`
|
29
27
|
|
28
|
+
connection = SrScripts::Compute.find_connection(current_instance_id)
|
29
|
+
|
30
30
|
server = connection.servers.get(current_instance_id)
|
31
31
|
|
32
32
|
exit unless server.tags["master_status"] == "slave"
|
data/changes.txt
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
diff --git a/class.Cache.php b/class.Cache.php
|
2
|
+
index 652e7be..8d6de13 100644
|
3
|
+
--- a/class.Cache.php
|
4
|
+
+++ b/class.Cache.php
|
5
|
+
@@ -1,5 +1,6 @@
|
6
|
+
<?php
|
7
|
+
|
8
|
+
+
|
9
|
+
class Cache {
|
10
|
+
|
11
|
+
private static $instance;
|
12
|
+
@@ -24,6 +25,7 @@ class Cache {
|
13
|
+
$this->memcache = new Memcache();
|
14
|
+
foreach($array as $value) {
|
15
|
+
$this->memcache->addServer($value['host'], $value['port']);
|
16
|
+
+ error_log("ADDING " . $value['host']);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
diff --git a/conf/configuration.php b/conf/configuration.php
|
21
|
+
index 6ea808c..b55cf05 100644
|
22
|
+
--- a/conf/configuration.php
|
23
|
+
+++ b/conf/configuration.php
|
24
|
+
@@ -1,6 +1,6 @@
|
25
|
+
<?php
|
26
|
+
|
27
|
+
-require_once dirname(__FILE__).'/game_vars.php';
|
28
|
+
+require_once 'game_vars.php';
|
29
|
+
require_once dirname(__FILE__).'/../helpers.php';
|
30
|
+
|
31
|
+
//api key variables for Facebook
|
32
|
+
@@ -15,21 +15,25 @@ $developers = array(520056095, 66504409, 520412027);
|
33
|
+
//$appsecret = 'e1bcdd0d303b6c8dbe12672e73264c65';
|
34
|
+
|
35
|
+
//database settings
|
36
|
+
-$dbhost = '10.16.78.18';
|
37
|
+
+$dbhost = 'db5.spicerackapps.com';
|
38
|
+
$dbuser = 'dorkapps_apprw';
|
39
|
+
$dbpass = 'd0tn3tsuX0rs';
|
40
|
+
$dbname = 'dorkapps_bingo';
|
41
|
+
|
42
|
+
+ini_set('memcache.hash_strategy', 'consistent');
|
43
|
+
+ini_set('session.save_handler', "memcache");
|
44
|
+
+ini_set('session.save_path', "tcp://bingo.vc0auv.0001.usw2.cache.amazonaws.com:11211, tcp://bingo.vc0auv.0002.usw2.cache.amazonaws.com:11211");
|
45
|
+
+
|
46
|
+
//memcache settings
|
47
|
+
$memcache_ip = 'localhost';
|
48
|
+
$memcache_port = 11211;
|
49
|
+
|
50
|
+
//server settings
|
51
|
+
-$server_root = "http://dev-fb-bingo.spicerackapps.com/";
|
52
|
+
+$server_root = "http://staging-bingo.spicerackapps.com/";
|
53
|
+
$canvas_root = "http://apps.facebook.com/playbingodev/";
|
54
|
+
-$external_root = "http://dev-bingo.spicerackapps.com/";
|
55
|
+
+$external_root = "http://bingo.spicerackapps.com/";
|
56
|
+
$static_root = is_https() ? "https://static.spicerackapps.com/bingo/" : "http://static.spicerackapps.com/bingo/";
|
57
|
+
-$payments_root = "http://dev-fb-bingo.spicerackapps.com/"; //THIS SHOULD BE A DNS NAME FOR PRODUCTION
|
58
|
+
+$payments_root = $server_root; //THIS SHOULD BE A DNS NAME ON PROD
|
59
|
+
|
60
|
+
|
61
|
+
?>
|
62
|
+
diff --git a/db.php b/db.php
|
63
|
+
index 32e0c58..ff69d78 100644
|
64
|
+
--- a/db.php
|
65
|
+
+++ b/db.php
|
66
|
+
@@ -8,7 +8,10 @@ require_once dirname(__FILE__).'/class.User.php';
|
67
|
+
require_once dirname(__FILE__).'/class.Cache.php';
|
68
|
+
require_once dirname(__FILE__).'/StoreController.php';
|
69
|
+
|
70
|
+
-Cache::instance()->setup(array(array("host" => $memcache_ip, "port" => $memcache_port)));
|
71
|
+
+Cache::instance()->setup(array(
|
72
|
+
+ array("host" => 'bingo.vc0auv.0001.usw2.cache.amazonaws.com', "port" => $memcache_port),
|
73
|
+
+ array("host" => 'bingo.vc0auv.0002.usw2.cache.amazonaws.com', "port" => $memcache_port)
|
74
|
+
+));
|
75
|
+
//Cache::instance()->setDebug(true);
|
76
|
+
Cache::instance()->setNamespace("fbbingo.");
|
77
|
+
|
78
|
+
diff --git a/helpers.php b/helpers.php
|
79
|
+
index 877fec5..e6e3961 100644
|
80
|
+
--- a/helpers.php
|
81
|
+
+++ b/helpers.php
|
82
|
+
@@ -7,7 +7,7 @@ function is_external_site() {
|
83
|
+
}
|
84
|
+
|
85
|
+
function is_https() {
|
86
|
+
- return $_SERVER['SERVER_PORT'] == 443;
|
87
|
+
+ return $_SERVER['SERVER_PORT'] == 443 || $_SERVER['HTTP_X_FORWARDED_PORT'] == 443;
|
88
|
+
}
|
89
|
+
|
90
|
+
function startsWith($haystack, $needle)
|
data/lib/sr-scripts/version.rb
CHANGED
data/test.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
$:.unshift(File.join(File.dirname(__FILE__), "lib"))
|
3
|
+
require 'lib/sr-scripts.rb'
|
4
|
+
|
5
|
+
conn = SrScripts::Compute.find_connection('i-88f8dbb8')
|
6
|
+
|
7
|
+
conn2 = SrScripts::Compute.get('us-east-1')
|
8
|
+
|
9
|
+
p conn2
|
10
|
+
|
11
|
+
p conn.servers.get('i-5a84ad6a')
|
12
|
+
|
13
|
+
|
14
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 17
|
9
|
+
version: 0.1.17
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Davy Campano
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-03
|
17
|
+
date: 2012-04-03 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -61,10 +61,12 @@ files:
|
|
61
61
|
- bin/sr-start-slave
|
62
62
|
- bin/sr-update-dns
|
63
63
|
- bin/sr-update-hosts-file
|
64
|
+
- changes.txt
|
64
65
|
- lib/sr-scripts.rb
|
65
66
|
- lib/sr-scripts/HostsManager.rb
|
66
67
|
- lib/sr-scripts/version.rb
|
67
68
|
- sr-scripts.gemspec
|
69
|
+
- test.rb
|
68
70
|
has_rdoc: true
|
69
71
|
homepage: ""
|
70
72
|
licenses: []
|