trogdir_api 0.5.0 → 0.5.1
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.
- checksums.yaml +4 -4
- data/README.md +0 -9
- data/config/mongoid.yml +9 -7
- data/config/mongoid.yml.example +10 -8
- data/config/settings.local.yml +3 -0
- data/config/settings.local.yml.example +2 -0
- data/config/settings.yml +2 -0
- data/lib/trogdir/versions/v1/addresses_api.rb +1 -1
- data/lib/trogdir/versions/v1/api.rb +5 -0
- data/lib/trogdir_api.rb +14 -1
- data/lib/trogdir_api/newrelic.rb +1 -1
- data/lib/trogdir_api/version.rb +1 -1
- metadata +19 -4
- data/config/blazing.rb +0 -6
- data/config/blazing.rb.example +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa354b0a9be8229e46f22496967be07d4fa106f9
|
4
|
+
data.tar.gz: 9ec3fc1078b827dd3987ac01df784e6bc7d979c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce6b94b61bb78cb579d5aedfb725055674fde6d53bc0c479914f7aa7730e4c6307cec61f3bebafcf5eb06325b6b88b49a4642a504b816e93b7eb102606529d09
|
7
|
+
data.tar.gz: 276f15973b60ab55e4f28dd9b838777165f4647bb7bdc4b97aa2df4e1f84423be7e52829f1e0d5764d7803a9311dcff0a477d06e87cd8c9b0022aed53768a2ec
|
data/README.md
CHANGED
@@ -15,23 +15,14 @@ git clone git@github.com:biola/trogdir-api.git
|
|
15
15
|
cd trogdir-api
|
16
16
|
bundle install
|
17
17
|
cp config/mongoid.yml.example config/mongoid.yml
|
18
|
-
cp config/blazing.rb.example config/blazing.rb
|
19
18
|
cp config/newrelic.yml.example config/newrelic.yml
|
20
19
|
```
|
21
20
|
|
22
21
|
Configuration
|
23
22
|
-------------
|
24
23
|
- Edit `config/mongoid.yml` accordingly.
|
25
|
-
- Edit `config/blazing.rb` accordingly.
|
26
24
|
- Edit `config/newrelic.yml` accordingly.
|
27
25
|
|
28
|
-
Deployment
|
29
|
-
----------
|
30
|
-
```bash
|
31
|
-
blazing setup [target name in blazing.rb]
|
32
|
-
git push [target name in blazing.rb]
|
33
|
-
```
|
34
|
-
|
35
26
|
Console
|
36
27
|
-------
|
37
28
|
To launch a console, `cd` into the app directory and run `irb -r ./config/environment.rb`
|
data/config/mongoid.yml
CHANGED
@@ -1,35 +1,37 @@
|
|
1
1
|
development:
|
2
|
-
|
2
|
+
clients:
|
3
3
|
default:
|
4
4
|
database: trogdir_development
|
5
5
|
hosts:
|
6
6
|
- localhost:27017
|
7
7
|
|
8
8
|
test:
|
9
|
-
|
9
|
+
clients:
|
10
10
|
default:
|
11
11
|
database: trogdir_test
|
12
12
|
hosts:
|
13
13
|
- localhost:27017
|
14
14
|
|
15
15
|
staging:
|
16
|
-
|
16
|
+
clients:
|
17
17
|
default:
|
18
18
|
database: trogdir
|
19
19
|
hosts:
|
20
20
|
- mongo1.staging.biola.edu:27017
|
21
21
|
- mongo2.staging.biola.edu:27017
|
22
22
|
- mongo3.staging.biola.edu:27017
|
23
|
-
|
23
|
+
options:
|
24
|
+
user: trogdir
|
24
25
|
password: "*************"
|
25
26
|
|
26
27
|
production:
|
27
|
-
|
28
|
+
clients:
|
28
29
|
default:
|
29
30
|
database: trogdir
|
30
31
|
hosts:
|
31
32
|
- mongo1.prod.biola.edu:27017
|
32
33
|
- mongo2.prod.biola.edu:27017
|
33
34
|
- mongo3.prod.biola.edu:27017
|
34
|
-
|
35
|
-
|
35
|
+
options:
|
36
|
+
user: trogdir
|
37
|
+
password: "*************"
|
data/config/mongoid.yml.example
CHANGED
@@ -1,35 +1,37 @@
|
|
1
1
|
development:
|
2
|
-
|
2
|
+
clients:
|
3
3
|
default:
|
4
4
|
database: trogdir_development
|
5
5
|
hosts:
|
6
6
|
- localhost:27017
|
7
7
|
|
8
8
|
test:
|
9
|
-
|
9
|
+
clients:
|
10
10
|
default:
|
11
11
|
database: trogdir_test
|
12
12
|
hosts:
|
13
13
|
- localhost:27017
|
14
14
|
|
15
15
|
staging:
|
16
|
-
|
16
|
+
clients:
|
17
17
|
default:
|
18
18
|
database: trogdir
|
19
19
|
hosts:
|
20
20
|
- mongo1.staging.biola.edu:27017
|
21
21
|
- mongo2.staging.biola.edu:27017
|
22
22
|
- mongo3.staging.biola.edu:27017
|
23
|
-
|
24
|
-
|
23
|
+
options:
|
24
|
+
user: trogdir
|
25
|
+
password: "*************"
|
25
26
|
|
26
27
|
production:
|
27
|
-
|
28
|
+
clients:
|
28
29
|
default:
|
29
30
|
database: trogdir
|
30
31
|
hosts:
|
31
32
|
- mongo1.prod.biola.edu:27017
|
32
33
|
- mongo2.prod.biola.edu:27017
|
33
34
|
- mongo3.prod.biola.edu:27017
|
34
|
-
|
35
|
-
|
35
|
+
options:
|
36
|
+
user: trogdir
|
37
|
+
password: "*************"
|
data/config/settings.yml
ADDED
@@ -9,7 +9,12 @@ module Trogdir
|
|
9
9
|
helpers AuthenticationHelpers
|
10
10
|
|
11
11
|
before do
|
12
|
+
# Verify HMAC signiture for the given request
|
12
13
|
authenticate!
|
14
|
+
|
15
|
+
# Mongoid::Userstamp::User gets mixed into the Syncinator class
|
16
|
+
# which provides methods for setting the current syncinator for
|
17
|
+
# the each request
|
13
18
|
Syncinator.current = current_syncinator
|
14
19
|
end
|
15
20
|
|
data/lib/trogdir_api.rb
CHANGED
@@ -3,12 +3,19 @@ require 'grape-entity'
|
|
3
3
|
require 'hashie-forbidden_attributes'
|
4
4
|
require 'oj'
|
5
5
|
require 'api_auth'
|
6
|
+
require 'config'
|
6
7
|
require 'trogdir_models'
|
7
8
|
require 'turnout'
|
8
9
|
|
9
10
|
module TrogdirAPI
|
11
|
+
def self.environment
|
12
|
+
(ENV['RACK_ENV'] || ENV['RAILS_ENV'] || :development).to_sym
|
13
|
+
end
|
14
|
+
|
10
15
|
def self.initialize!
|
11
|
-
ENV['RACK_ENV'] ||=
|
16
|
+
ENV['RACK_ENV'] ||= environment.to_s
|
17
|
+
|
18
|
+
Config.load_and_set_settings('./config/settings.yml', "./config/settings.#{environment}.yml", './config/settings.local.yml')
|
12
19
|
|
13
20
|
MultiJson.use :oj
|
14
21
|
|
@@ -16,6 +23,12 @@ module TrogdirAPI
|
|
16
23
|
mongoid_yml_path = "#{mongoid_yml_path}.example" if !File.exists? mongoid_yml_path
|
17
24
|
Mongoid.load! mongoid_yml_path
|
18
25
|
|
26
|
+
if defined? Raven
|
27
|
+
Raven.configure do |config|
|
28
|
+
config.dsn = Settings.sentry.url
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
19
32
|
Turnout.configure do |config|
|
20
33
|
config.named_maintenance_file_paths.merge! server: '/tmp/turnout.yml'
|
21
34
|
config.default_maintenance_page = Turnout::MaintenancePage::JSON
|
data/lib/trogdir_api/newrelic.rb
CHANGED
data/lib/trogdir_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trogdir_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api-auth
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: config
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: grape
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,12 +159,13 @@ files:
|
|
145
159
|
- MIT-LICENSE
|
146
160
|
- README.md
|
147
161
|
- config.ru
|
148
|
-
- config/blazing.rb
|
149
|
-
- config/blazing.rb.example
|
150
162
|
- config/environment.rb
|
151
163
|
- config/mongoid.yml
|
152
164
|
- config/mongoid.yml.example
|
153
165
|
- config/newrelic.yml.example
|
166
|
+
- config/settings.local.yml
|
167
|
+
- config/settings.local.yml.example
|
168
|
+
- config/settings.yml
|
154
169
|
- lib/trogdir/api.rb
|
155
170
|
- lib/trogdir/helpers/authentication_helpers.rb
|
156
171
|
- lib/trogdir/helpers/request_helpers.rb
|
data/config/blazing.rb
DELETED
data/config/blazing.rb.example
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
target :'ruby2.staging', 'johnd0@ruby2.staging.biola.edu:/srv/rack/trogdir-api', rails_env: 'staging'
|
2
|
-
target :'ruby3a.prod', 'johnd0@ruby3a.prod.biola.edu:/srv/rack/trogdir-api', rails_env: 'production'
|
3
|
-
target :'ruby3b.prod', 'johnd0@ruby3b.prod.biola.edu:/srv/rack/trogdir-api', rails_env: 'production'
|
4
|
-
|
5
|
-
env_script '/etc/profile'
|
6
|
-
|
7
|
-
rake :post_deploy
|