milia 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -4
- data/app/controllers/sessions_controller.rb +3 -6
- data/doc/sample.sh +47 -0
- data/lib/milia/version.rb +1 -1
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b71b49e31631befa25024acdb042e14b7fecd82
|
4
|
+
data.tar.gz: f1dc1e95c35498437ff078e891077f11fad242ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ed0849673efa710d2ef2feb3d703ced0a40cce297e41ed75c03ad88bef99941103792329c3310189f6c172fa9c63f8cc71c77f0b6ade96c57f7e2bd0321d3fc
|
7
|
+
data.tar.gz: 0be4c74efdca4c1ab2b561342d1f5c1c9d35d2d76e3649abe027809fcc785a4c6cb5cdb3d8c4e9de161304f52a1c160bfb7192c2943695103335f6b96594e624
|
data/README.md
CHANGED
@@ -37,13 +37,14 @@ by invitation. New tenants are not created for every new user.
|
|
37
37
|
|
38
38
|
## Version
|
39
39
|
|
40
|
-
milia v1.0.
|
40
|
+
milia v1.0.1 is the release version for Rails 4.0.x and is now available for usage.
|
41
41
|
|
42
42
|
The last previous release version for Rails 3.2.x can be found in the git branch 'v0.3', but
|
43
43
|
it is essentially obsolete. Go with v1.0.x
|
44
44
|
|
45
45
|
## What's changed?
|
46
46
|
|
47
|
+
* fixes Issue #42: Redirect loop (sign up & activate with email1; trying to sign up again with email1 fails but immediately signing in with email1 caused a redirect loop).
|
47
48
|
* Rails 4.0.x adapted (changes to terms, strong_parameters, default_scope, etc)
|
48
49
|
* Devise 3.2.x adapted
|
49
50
|
* All the changes which version 0.3.x advised to be inserted in applications_controller.rb are now automatically loaded into ActionController by milia.
|
@@ -59,8 +60,15 @@ it is essentially obsolete. Go with v1.0.x
|
|
59
60
|
|
60
61
|
There were numerous requests for me to provide a complete sample web application
|
61
62
|
which uses milia and devise. I have done this. This README will have a brief section
|
62
|
-
on creating and installing the sample application.
|
63
|
-
|
63
|
+
on creating and installing the sample application.
|
64
|
+
|
65
|
+
This sample app is now running on heroku and you may test it out here:
|
66
|
+
http://sample-milia.herokuapp.com
|
67
|
+
Instructions for deploying to heroku can be found in doc/sample.sh STEP 6
|
68
|
+
within the milia gem.
|
69
|
+
|
70
|
+
|
71
|
+
Further details about this process can be found via the sources listed below:
|
64
72
|
|
65
73
|
* see doc/sample.sh for easy generator usage for setting up and creating a working app.
|
66
74
|
Although all the same information is here in this README, it's perhaps clearer, and
|
@@ -149,7 +157,7 @@ Kibali is primarily oriented for functioning as a before_action role authenticat
|
|
149
157
|
* necessary migrations: user, tenant, tenants_users (join table)
|
150
158
|
|
151
159
|
You must understand which of your apps models will be tenanted ( <i>acts_as_tenant</i> )
|
152
|
-
and which will be universal ( <i>
|
160
|
+
and which will be universal ( <i>acts_as_universal</i>). Universal data NEVER has critical user/company
|
153
161
|
information in the table. It is usually only for system-wide constants. For example, if you've put
|
154
162
|
too much user information in the users table, you'll need to seperate it out. by definition, the devise
|
155
163
|
user table MUST be universal and should only contain email, encrypted password, and devise-required data.
|
@@ -1,13 +1,10 @@
|
|
1
1
|
module Milia
|
2
2
|
|
3
3
|
class SessionsController < Devise::SessionsController
|
4
|
-
|
4
|
+
# skip need for authentication
|
5
5
|
skip_before_action :authenticate_tenant!, :only => [:new, :create, :destroy]
|
6
|
-
|
7
|
-
|
8
|
-
__milia_reset_tenant! # clear tenanting
|
9
|
-
super
|
10
|
-
end
|
6
|
+
# clear tenanting
|
7
|
+
before_action :__milia_reset_tenant!, :only => [:create, :destroy]
|
11
8
|
|
12
9
|
end # class
|
13
10
|
end # module
|
data/doc/sample.sh
CHANGED
@@ -225,5 +225,52 @@ export RECAPTCHA_PRIVATE_KEY=6LeBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBgQBv
|
|
225
225
|
# stop/restart foreman
|
226
226
|
# ^c stops foreman; foreman start restarts it; F5 refreshes the browser page
|
227
227
|
#
|
228
|
+
# *********************************************************************
|
229
|
+
# STEP 5 - DEPLOYING SAMPLE-MILIA-APP TO HEROKU
|
230
|
+
# *********************************************************************
|
231
|
+
|
232
|
+
# Make sure that you've installed the heroku toolbelt, as shown in STEP 0.
|
233
|
+
# Make sure that you've setup git repository for you app, as shown in STEP 1.
|
234
|
+
# Open a terminal window and make sure you've cd to your project within the projectspace.
|
235
|
+
# Make sure that you've setup your heroku credentials on your machine using
|
236
|
+
$ heroku login
|
237
|
+
|
238
|
+
# Create your project (we'll call it "sample-milia" in the examples here).
|
239
|
+
$ heroku create sample-milia
|
240
|
+
|
241
|
+
# Now setup the various add-ons we'll need:
|
242
|
+
$ heroku addons:add sendgrid
|
243
|
+
|
244
|
+
# Now setup any needed configurations variables
|
245
|
+
$ heroku config:add BUNDLE_WITHOUT="development:test:linux:mac"
|
246
|
+
$ heroku config:add RECAPTCHA_PUBLIC_KEY='<your public key>'
|
247
|
+
$ heroku config:add RECAPTCHA_PRIVATE_KEY='<your private key>'
|
248
|
+
|
249
|
+
# edit config/initializers/secret_token.rb
|
250
|
+
# duplicate the secret_key_base line and rename it to secret_token
|
251
|
+
|
252
|
+
# edit config/environments/production.rb line 4
|
253
|
+
# put in the correct path for the hostname, and remove the https protocol if not needed
|
254
|
+
|
255
|
+
# edit Gemfile and replace the sqlite3 line with the following:
|
256
|
+
# Use sqlite3 as the dev/test database for Active Record
|
257
|
+
gem 'sqlite3', :group => [:development, :test]
|
258
|
+
|
259
|
+
# Use pg as the production database for heroku
|
260
|
+
gem 'pg', :group => :production
|
261
|
+
|
262
|
+
# then run bundle install, and commit to the repository
|
263
|
+
$ bundle install
|
264
|
+
$ git commit -am 'ready for heroku deploy'; git push origin master
|
265
|
+
|
266
|
+
# now deploy to heroku
|
267
|
+
$ git push heroku master
|
268
|
+
|
269
|
+
# now migrate the database
|
270
|
+
$ heroku run rake db:migrate
|
271
|
+
$ heroku restart
|
272
|
+
|
273
|
+
# go to browser and put in the correct address for your app on heroku:
|
228
274
|
|
275
|
+
http://sample-milia.herokuapp.com
|
229
276
|
|
data/lib/milia/version.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: milia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- daudi amani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: devise
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sqlite3
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: shoulda
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: turn
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: Multi-tenanting gem for hosted Rails/Ruby/devise applications
|
@@ -115,12 +115,12 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- .document
|
119
|
-
- .gitignore
|
120
|
-
- .project
|
121
|
-
- .ruby-gemset
|
122
|
-
- .ruby-version
|
123
|
-
- .slugignore
|
118
|
+
- ".document"
|
119
|
+
- ".gitignore"
|
120
|
+
- ".project"
|
121
|
+
- ".ruby-gemset"
|
122
|
+
- ".ruby-version"
|
123
|
+
- ".slugignore"
|
124
124
|
- Gemfile
|
125
125
|
- LICENSE.txt
|
126
126
|
- README.md
|
@@ -227,17 +227,17 @@ require_paths:
|
|
227
227
|
- lib
|
228
228
|
required_ruby_version: !ruby/object:Gem::Requirement
|
229
229
|
requirements:
|
230
|
-
- -
|
230
|
+
- - ">="
|
231
231
|
- !ruby/object:Gem::Version
|
232
232
|
version: '0'
|
233
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
234
|
requirements:
|
235
|
-
- -
|
235
|
+
- - ">="
|
236
236
|
- !ruby/object:Gem::Version
|
237
237
|
version: '0'
|
238
238
|
requirements: []
|
239
239
|
rubyforge_project:
|
240
|
-
rubygems_version: 2.
|
240
|
+
rubygems_version: 2.2.2
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: Transparent multi-tenanting for hosted rails/ruby/devise web applications
|