cyclid-ui 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cyclid_ui.rb +21 -7
- data/app/cyclid_ui/controllers/health.rb +5 -0
- data/app/cyclid_ui/templates/layout.mustache +4 -0
- data/app/cyclid_ui/templates/user.mustache +3 -0
- data/app/cyclid_ui/views/layout.rb +4 -0
- data/lib/cyclid_ui/version.rb +1 -1
- data/public/vendor/bootstrap/css/custom.css +3 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca86e931e0eb566c2bf638de74c388e675222437
|
4
|
+
data.tar.gz: 26afc5f71cf7f4ade5ae25cc6c57b9babe9dab80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 106ad7cb054099d963434b127d7dda2cfbedbe9dc66f4fcbc8147456b063534d7d7ea3dc9e56a36bb8dfa446f4a0870bdf267ce500817c8d12e61c33975175c0
|
7
|
+
data.tar.gz: b56757b82268f45d2774c3e0390798b17ef6f190c34c636e94143ce014fef7686b64bc748501a77bb9d944b6969a0a1a3e7aea45a6ccecde771f586ff350de62
|
data/app/cyclid_ui.rb
CHANGED
@@ -17,6 +17,7 @@ require 'require_all'
|
|
17
17
|
require 'logger'
|
18
18
|
require 'warden'
|
19
19
|
require 'memcached'
|
20
|
+
require 'sinatra/cross_origin'
|
20
21
|
require 'sinatra/flash'
|
21
22
|
require 'rack/csrf'
|
22
23
|
|
@@ -53,13 +54,6 @@ module Cyclid
|
|
53
54
|
module UI
|
54
55
|
# Sinatra application
|
55
56
|
class App < Sinatra::Application
|
56
|
-
configure do
|
57
|
-
set sessions: true,
|
58
|
-
secure: production?,
|
59
|
-
expire_after: 31_557_600,
|
60
|
-
secret: ENV['SESSION_SECRET']
|
61
|
-
end
|
62
|
-
|
63
57
|
use Rack::Deflater
|
64
58
|
use Rack::Session::Cookie
|
65
59
|
use Rack::Csrf, raise: true,
|
@@ -70,6 +64,26 @@ module Cyclid
|
|
70
64
|
|
71
65
|
register Sinatra::Flash
|
72
66
|
|
67
|
+
configure do
|
68
|
+
set sessions: true,
|
69
|
+
secure: production?,
|
70
|
+
expire_after: 31_557_600,
|
71
|
+
secret: ENV['SESSION_SECRET']
|
72
|
+
set allow_origin: :any,
|
73
|
+
allow_methods: [:get, :put, :post, :options],
|
74
|
+
allow_credentials: true,
|
75
|
+
max_age: '1728000',
|
76
|
+
expose_headers: ['Content-Type']
|
77
|
+
disable :show_exceptions
|
78
|
+
end
|
79
|
+
|
80
|
+
options '*' do
|
81
|
+
response.headers['Allow'] = 'HEAD,GET,PUT,POST,DELETE,OPTIONS'
|
82
|
+
response.headers['Access-Control-Allow-Headers'] =
|
83
|
+
'Content-Type, Cache-Control, Accept, Authorization'
|
84
|
+
200
|
85
|
+
end
|
86
|
+
|
73
87
|
# Configure Warden to authenticate
|
74
88
|
use Warden::Manager do |config|
|
75
89
|
config.serialize_into_session(&:username)
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
13
|
# See the License for the specific language governing permissions and
|
14
14
|
# limitations under the License.
|
15
|
+
require 'sinatra/cross_origin'
|
15
16
|
require 'sinatra-health-check'
|
16
17
|
require 'memcached'
|
17
18
|
|
@@ -21,6 +22,8 @@ module Cyclid
|
|
21
22
|
module Controllers
|
22
23
|
# Controller for all Health related API endpoints
|
23
24
|
class Health < Base
|
25
|
+
register Sinatra::CrossOrigin
|
26
|
+
|
24
27
|
def initialize(_app)
|
25
28
|
super
|
26
29
|
@checker = SinatraHealthCheck::Checker.new(logger: Cyclid.logger,
|
@@ -35,6 +38,7 @@ module Cyclid
|
|
35
38
|
# the healthchecks. This is intended to be used by things like load
|
36
39
|
# balancers and active monitors.
|
37
40
|
get '/health/status' do
|
41
|
+
cross_origin
|
38
42
|
@checker.healthy? ? 200 : 503
|
39
43
|
end
|
40
44
|
|
@@ -43,6 +47,7 @@ module Cyclid
|
|
43
47
|
# not suitable for general health checks unless the caller intends to
|
44
48
|
# parse the message body for the health status.
|
45
49
|
get '/health/info' do
|
50
|
+
cross_origin
|
46
51
|
@checker.status.to_json
|
47
52
|
end
|
48
53
|
end
|
@@ -47,6 +47,10 @@
|
|
47
47
|
{{#organizations}}
|
48
48
|
<li><a href="/{{.}}">{{.}}</a></li>
|
49
49
|
{{/organizations}}
|
50
|
+
{{#signup}}
|
51
|
+
<li role="separator" class="divider"></li>
|
52
|
+
<li><a href="{{signup}}/organization" target="_blank">Create a new Organization</a></li>
|
53
|
+
{{/signup}}
|
50
54
|
</ul>
|
51
55
|
</li>
|
52
56
|
</ul>
|
@@ -23,6 +23,9 @@
|
|
23
23
|
<div class="dl-horizontal text-muted pad-20">
|
24
24
|
<dt>Email</dt><dd id="user_email"></dd>
|
25
25
|
<dt>Organizations</dt><dd id="user_org_list"></dd>
|
26
|
+
{{#signup}}
|
27
|
+
<dd><a href="{{signup}}/organization" target="_blank">Create a new Organization</a></dd>
|
28
|
+
{{/signup}}
|
26
29
|
</div>
|
27
30
|
</div>
|
28
31
|
|
data/lib/cyclid_ui/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyclid-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristian Van Der Vliet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require_all
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sinatra-cross_origin
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.3'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.3'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rack_csrf
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|