meroku 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +2 -0
  3. data/Guardfile +7 -18
  4. data/README.md +78 -4
  5. data/bin/meroku +1 -1
  6. data/frontend/.gitignore +23 -0
  7. data/frontend/.ruby-version +2 -0
  8. data/frontend/Gemfile +58 -0
  9. data/frontend/Gemfile.lock +233 -0
  10. data/frontend/README.md +24 -0
  11. data/frontend/Rakefile +6 -0
  12. data/frontend/app/assets/config/manifest.js +3 -0
  13. data/frontend/app/assets/images/.keep +0 -0
  14. data/frontend/app/assets/javascripts/application.js +15 -0
  15. data/frontend/app/assets/javascripts/apps.coffee +3 -0
  16. data/frontend/app/assets/javascripts/cable.js +13 -0
  17. data/frontend/app/assets/javascripts/channels/.keep +0 -0
  18. data/frontend/app/assets/javascripts/pages.coffee +3 -0
  19. data/frontend/app/assets/javascripts/publickeys.coffee +3 -0
  20. data/frontend/app/assets/stylesheets/application.css +15 -0
  21. data/frontend/app/assets/stylesheets/apps.scss +3 -0
  22. data/frontend/app/assets/stylesheets/pages.scss +3 -0
  23. data/frontend/app/assets/stylesheets/publickeys.scss +3 -0
  24. data/frontend/app/assets/stylesheets/scaffolds.scss +84 -0
  25. data/frontend/app/channels/application_cable/channel.rb +4 -0
  26. data/frontend/app/channels/application_cable/connection.rb +4 -0
  27. data/frontend/app/controllers/application_controller.rb +3 -0
  28. data/frontend/app/controllers/apps_controller.rb +85 -0
  29. data/frontend/app/controllers/concerns/.keep +0 -0
  30. data/frontend/app/controllers/pages_controller.rb +4 -0
  31. data/frontend/app/controllers/publickeys_controller.rb +76 -0
  32. data/frontend/app/controllers/users/confirmations_controller.rb +28 -0
  33. data/frontend/app/controllers/users/omniauth_callbacks_controller.rb +28 -0
  34. data/frontend/app/controllers/users/passwords_controller.rb +32 -0
  35. data/frontend/app/controllers/users/registrations_controller.rb +89 -0
  36. data/frontend/app/controllers/users/sessions_controller.rb +25 -0
  37. data/frontend/app/controllers/users/unlocks_controller.rb +28 -0
  38. data/frontend/app/helpers/application_helper.rb +2 -0
  39. data/frontend/app/helpers/apps_helper.rb +2 -0
  40. data/frontend/app/helpers/pages_helper.rb +2 -0
  41. data/frontend/app/helpers/publickeys_helper.rb +2 -0
  42. data/frontend/app/jobs/application_job.rb +2 -0
  43. data/frontend/app/mailers/application_mailer.rb +4 -0
  44. data/frontend/app/models/app.rb +3 -0
  45. data/frontend/app/models/application_record.rb +3 -0
  46. data/frontend/app/models/concerns/.keep +0 -0
  47. data/frontend/app/models/publickey.rb +3 -0
  48. data/frontend/app/models/user.rb +12 -0
  49. data/frontend/app/serializable/serializable_app.rb +6 -0
  50. data/frontend/app/serializable/serializable_publickey.rb +7 -0
  51. data/frontend/app/serializable/serializable_user.rb +7 -0
  52. data/frontend/app/serializers/app_serializer.rb +3 -0
  53. data/frontend/app/serializers/publickey_serializer.rb +4 -0
  54. data/frontend/app/views/apps/_app.json.jbuilder +2 -0
  55. data/frontend/app/views/apps/_form.html.erb +22 -0
  56. data/frontend/app/views/apps/edit.html.erb +6 -0
  57. data/frontend/app/views/apps/index.html.erb +27 -0
  58. data/frontend/app/views/apps/index.json.jbuilder +1 -0
  59. data/frontend/app/views/apps/new.html.erb +5 -0
  60. data/frontend/app/views/apps/show.html.erb +9 -0
  61. data/frontend/app/views/apps/show.json.jbuilder +1 -0
  62. data/frontend/app/views/devise/confirmations/new.html.erb +16 -0
  63. data/frontend/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  64. data/frontend/app/views/devise/mailer/email_changed.html.erb +7 -0
  65. data/frontend/app/views/devise/mailer/password_change.html.erb +3 -0
  66. data/frontend/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  67. data/frontend/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  68. data/frontend/app/views/devise/passwords/edit.html.erb +25 -0
  69. data/frontend/app/views/devise/passwords/new.html.erb +16 -0
  70. data/frontend/app/views/devise/registrations/edit.html.erb +43 -0
  71. data/frontend/app/views/devise/registrations/new.html.erb +29 -0
  72. data/frontend/app/views/devise/sessions/new.html.erb +26 -0
  73. data/frontend/app/views/devise/shared/_links.html.erb +25 -0
  74. data/frontend/app/views/devise/unlocks/new.html.erb +16 -0
  75. data/frontend/app/views/layouts/application.html.erb +16 -0
  76. data/frontend/app/views/layouts/mailer.html.erb +13 -0
  77. data/frontend/app/views/layouts/mailer.text.erb +1 -0
  78. data/frontend/app/views/pages/landing.html.erb +2 -0
  79. data/frontend/app/views/publickeys/_form.html.erb +32 -0
  80. data/frontend/app/views/publickeys/_publickey.json.jbuilder +2 -0
  81. data/frontend/app/views/publickeys/edit.html.erb +6 -0
  82. data/frontend/app/views/publickeys/index.html.erb +31 -0
  83. data/frontend/app/views/publickeys/index.json.jbuilder +1 -0
  84. data/frontend/app/views/publickeys/new.html.erb +5 -0
  85. data/frontend/app/views/publickeys/show.html.erb +19 -0
  86. data/frontend/app/views/publickeys/show.json.jbuilder +1 -0
  87. data/frontend/bin/bundle +3 -0
  88. data/frontend/bin/rails +9 -0
  89. data/frontend/bin/rake +9 -0
  90. data/frontend/bin/setup +38 -0
  91. data/frontend/bin/spring +17 -0
  92. data/frontend/bin/update +29 -0
  93. data/frontend/bin/yarn +11 -0
  94. data/frontend/config.ru +5 -0
  95. data/frontend/config/application.rb +18 -0
  96. data/frontend/config/boot.rb +3 -0
  97. data/frontend/config/cable.yml +10 -0
  98. data/frontend/config/database.yml +25 -0
  99. data/frontend/config/environment.rb +5 -0
  100. data/frontend/config/environments/development.rb +56 -0
  101. data/frontend/config/environments/production.rb +97 -0
  102. data/frontend/config/environments/test.rb +42 -0
  103. data/frontend/config/initializers/ams.rb +3 -0
  104. data/frontend/config/initializers/application_controller_renderer.rb +8 -0
  105. data/frontend/config/initializers/assets.rb +14 -0
  106. data/frontend/config/initializers/backtrace_silencers.rb +7 -0
  107. data/frontend/config/initializers/cookies_serializer.rb +5 -0
  108. data/frontend/config/initializers/devise.rb +277 -0
  109. data/frontend/config/initializers/filter_parameter_logging.rb +4 -0
  110. data/frontend/config/initializers/inflections.rb +16 -0
  111. data/frontend/config/initializers/mime_types.rb +4 -0
  112. data/frontend/config/initializers/wrap_parameters.rb +14 -0
  113. data/frontend/config/locales/devise.en.yml +64 -0
  114. data/frontend/config/locales/en.yml +33 -0
  115. data/frontend/config/puma.rb +66 -0
  116. data/frontend/config/routes.rb +19 -0
  117. data/frontend/config/secrets.yml +32 -0
  118. data/frontend/config/spring.rb +6 -0
  119. data/frontend/db/migrate/20171023223732_devise_create_users.rb +42 -0
  120. data/frontend/db/migrate/20171025193627_add_token_to_users.rb +5 -0
  121. data/frontend/db/migrate/20171025203706_create_apps.rb +9 -0
  122. data/frontend/db/migrate/20171025223804_add_user_to_apps.rb +5 -0
  123. data/frontend/db/migrate/20171026071440_create_publickeys.rb +11 -0
  124. data/frontend/db/schema.rb +32 -0
  125. data/frontend/db/seeds.rb +7 -0
  126. data/frontend/etc_nginx_sites-available_default +29 -0
  127. data/frontend/lib/assets/.keep +0 -0
  128. data/frontend/lib/tasks/.keep +0 -0
  129. data/frontend/log/.keep +0 -0
  130. data/frontend/package.json +5 -0
  131. data/frontend/public/404.html +67 -0
  132. data/frontend/public/422.html +67 -0
  133. data/frontend/public/500.html +66 -0
  134. data/frontend/public/apple-touch-icon-precomposed.png +0 -0
  135. data/frontend/public/apple-touch-icon.png +0 -0
  136. data/frontend/public/favicon.ico +0 -0
  137. data/frontend/public/robots.txt +1 -0
  138. data/frontend/test/application_system_test_case.rb +5 -0
  139. data/frontend/test/controllers/.keep +0 -0
  140. data/frontend/test/controllers/apps_controller_test.rb +48 -0
  141. data/frontend/test/controllers/pages_controller_test.rb +9 -0
  142. data/frontend/test/controllers/publickeys_controller_test.rb +48 -0
  143. data/frontend/test/fixtures/.keep +0 -0
  144. data/frontend/test/fixtures/apps.yml +7 -0
  145. data/frontend/test/fixtures/files/.keep +0 -0
  146. data/frontend/test/fixtures/publickeys.yml +11 -0
  147. data/frontend/test/fixtures/users.yml +11 -0
  148. data/frontend/test/helpers/.keep +0 -0
  149. data/frontend/test/integration/.keep +0 -0
  150. data/frontend/test/mailers/.keep +0 -0
  151. data/frontend/test/models/.keep +0 -0
  152. data/frontend/test/models/app_test.rb +7 -0
  153. data/frontend/test/models/publickey_test.rb +7 -0
  154. data/frontend/test/models/user_test.rb +7 -0
  155. data/frontend/test/system/.keep +0 -0
  156. data/frontend/test/system/apps_test.rb +9 -0
  157. data/frontend/test/system/publickeys_test.rb +9 -0
  158. data/frontend/test/test_helper.rb +9 -0
  159. data/frontend/tmp/.keep +0 -0
  160. data/frontend/vendor/.keep +0 -0
  161. data/lib/meroku.rb +11 -24
  162. data/lib/meroku/aws.rb +32 -0
  163. data/lib/meroku/cli.rb +131 -0
  164. data/lib/meroku/infrastructure.rb +10 -17
  165. data/lib/meroku/infrastructure/node.rb +68 -0
  166. data/lib/meroku/tunnel.rb +50 -0
  167. data/lib/meroku/version.rb +1 -1
  168. data/meroku.gemspec +7 -3
  169. data/modified-cedar-14.sh +175 -0
  170. metadata +222 -19
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,64 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ email_changed:
27
+ subject: "Email Changed"
28
+ password_change:
29
+ subject: "Password Changed"
30
+ omniauth_callbacks:
31
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32
+ success: "Successfully authenticated from %{kind} account."
33
+ passwords:
34
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
35
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
37
+ updated: "Your password has been changed successfully. You are now signed in."
38
+ updated_not_active: "Your password has been changed successfully."
39
+ registrations:
40
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41
+ signed_up: "Welcome! You have signed up successfully."
42
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
45
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
46
+ updated: "Your account has been updated successfully."
47
+ sessions:
48
+ signed_in: "Signed in successfully."
49
+ signed_out: "Signed out successfully."
50
+ already_signed_out: "Signed out successfully."
51
+ unlocks:
52
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
53
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
54
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
55
+ errors:
56
+ messages:
57
+ already_confirmed: "was already confirmed, please try signing in"
58
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
59
+ expired: "has expired, please request a new one"
60
+ not_found: "not found"
61
+ not_locked: "was not locked"
62
+ not_saved:
63
+ one: "1 error prohibited this %{resource} from being saved:"
64
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at http://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,66 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ threads threads_count, threads_count
9
+
10
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11
+ #
12
+ port ENV.fetch("PORT") { 3000 }
13
+
14
+ # Specifies the `environment` that Puma will run in.
15
+ #
16
+ #environment ENV.fetch("RAILS_ENV") { "development" }
17
+
18
+ # Specifies the number of `workers` to boot in clustered mode.
19
+ # Workers are forked webserver processes. If using threads and workers together
20
+ # the concurrency of the application would be max `threads` * `workers`.
21
+ # Workers do not work on JRuby or Windows (both of which do not support
22
+ # processes).
23
+ #
24
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
+
26
+ # Use the `preload_app!` method when specifying a `workers` number.
27
+ # This directive tells Puma to first boot the application and load code
28
+ # before forking the application. This takes advantage of Copy On Write
29
+ # process behavior so workers use less memory. If you use this option
30
+ # you need to make sure to reconnect any threads in the `on_worker_boot`
31
+ # block.
32
+ #
33
+ # preload_app!
34
+
35
+ # If you are preloading your application and using Active Record, it's
36
+ # recommended that you close any connections to the database before workers
37
+ # are forked to prevent connection leakage.
38
+ #
39
+ # before_fork do
40
+ # ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
41
+ # end
42
+
43
+ # The code in the `on_worker_boot` will be called if you are using
44
+ # clustered mode by specifying a number of `workers`. After each worker
45
+ # process is booted, this block will be run. If you are using the `preload_app!`
46
+ # option, you will want to use this block to reconnect to any threads
47
+ # or connections that may have been created at application boot, as Ruby
48
+ # cannot share connections between processes.
49
+ #
50
+ # on_worker_boot do
51
+ # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
52
+ # end
53
+ #
54
+
55
+ # Allow puma to be restarted by `rails restart` command.
56
+ plugin :tmp_restart
57
+
58
+
59
+ # Default to production
60
+ rails_env = ENV['RAILS_ENV'] || "production"
61
+ environment rails_env
62
+
63
+
64
+ #bind "unix://tmp/puma.sock"
65
+ stdout_redirect Dir.home+"/meroku/frontend/log/puma.stdout.log", Dir.home+"/meroku/frontend/log/puma.stderr.log", true
66
+ pidfile "/tmp/puma.pid"
@@ -0,0 +1,19 @@
1
+ Rails.application.routes.draw do
2
+
3
+ resources :publickeys
4
+ resources :apps
5
+ Rails.application.routes.draw do
6
+ resources :publickeys
7
+ resources :apps
8
+ devise_for :users, controllers: {
9
+ sessions: 'users/sessions',
10
+ registrations: 'users/registrations'
11
+ }
12
+ end
13
+
14
+ get 'pages/landing'
15
+
16
+ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
17
+
18
+ root 'pages#landing'
19
+ end
@@ -0,0 +1,32 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ # Shared secrets are available across all environments.
14
+
15
+ # shared:
16
+ # api_key: a1B2c3D4e5F6
17
+
18
+ # Environmental secrets are only available for that specific environment.
19
+
20
+ development:
21
+ secret_key_base: d5c61a80d7e96c6787a53c4dd3ca8290b4e359fd67d077e36b7e68d3b7b8ac2849a32c9da752e11b74c6cf5a990bd34dddc9c590432268eecaf631c9cea8493e
22
+
23
+ test:
24
+ secret_key_base: 19fdad5c3f28f38aeddc7026acb0a909de86b9daa36fd5f66b5230b7b389f136515013d24d5501437dabbf7b149b70b45744ba60f47151bd6edac898ef3fc8fa
25
+
26
+ # Do not keep production secrets in the unencrypted secrets file.
27
+ # Instead, either read values from the environment.
28
+ # Or, use `bin/rails secrets:setup` to configure encrypted secrets
29
+ # and move the `production:` environment over there.
30
+
31
+ production:
32
+ secret_key_base: d5c61a80d7e96c6787a53c4dd3ca8290b4e359fd67d077e36b7e68d3b7b8ac2849a32c9da752e11b74c6cf5a990bd34dddc9c590432268eecaf631c9cea8493a
@@ -0,0 +1,6 @@
1
+ %w(
2
+ .ruby-version
3
+ .rbenv-vars
4
+ tmp/restart.txt
5
+ tmp/caching-dev.txt
6
+ ).each { |path| Spring.watch(path) }
@@ -0,0 +1,42 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :users do |t|
4
+ ## Database authenticatable
5
+ t.string :email, null: false, default: ""
6
+ t.string :encrypted_password, null: false, default: ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, default: 0, null: false
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+
34
+ t.timestamps null: false
35
+ end
36
+
37
+ add_index :users, :email, unique: true
38
+ add_index :users, :reset_password_token, unique: true
39
+ # add_index :users, :confirmation_token, unique: true
40
+ # add_index :users, :unlock_token, unique: true
41
+ end
42
+ end
@@ -0,0 +1,5 @@
1
+ class AddTokenToUsers < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :users, :token, :string
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class CreateApps < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :apps do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddUserToApps < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :apps, :user, foreign_key: true
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class CreatePublickeys < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :publickeys do |t|
4
+ t.string :name
5
+ t.text :data
6
+ t.references :user, foreign_key: true
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,32 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 20171023223732) do
14
+
15
+ create_table "users", force: :cascade do |t|
16
+ t.string "email", default: "", null: false
17
+ t.string "encrypted_password", default: "", null: false
18
+ t.string "reset_password_token"
19
+ t.datetime "reset_password_sent_at"
20
+ t.datetime "remember_created_at"
21
+ t.integer "sign_in_count", default: 0, null: false
22
+ t.datetime "current_sign_in_at"
23
+ t.datetime "last_sign_in_at"
24
+ t.string "current_sign_in_ip"
25
+ t.string "last_sign_in_ip"
26
+ t.datetime "created_at", null: false
27
+ t.datetime "updated_at", null: false
28
+ t.index ["email"], name: "index_users_on_email", unique: true
29
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
30
+ end
31
+
32
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
+ # Character.create(name: 'Luke', movie: movies.first)
@@ -0,0 +1,29 @@
1
+ upstream app {
2
+ # Path to Puma SOCK file, as defined previously
3
+ #server unix:/tmp/sockets/puma.sock fail_timeout=0;
4
+ server 127.0.0.1:3000;
5
+ }
6
+
7
+ server {
8
+ listen 443 ssl;
9
+ server_name www.meroku.com;
10
+ ssl on;
11
+
12
+ ssl_certificate /home/ubuntu/.meroku/letsencrypt_fullchain.pem;
13
+ ssl_certificate_key /home/ubuntu/.meroku/letsencrypt_privkey.pem;
14
+
15
+ root /home/ubuntu/meroku/frontend/public;
16
+
17
+ try_files $uri/index.html $uri @app;
18
+
19
+ location @app {
20
+ proxy_pass http://app;
21
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
22
+ proxy_set_header Host $http_host;
23
+ proxy_redirect off;
24
+ }
25
+
26
+ error_page 500 502 503 504 /500.html;
27
+ client_max_body_size 4G;
28
+ keepalive_timeout 10;
29
+ }
File without changes
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "frontend",
3
+ "private": true,
4
+ "dependencies": {}
5
+ }