ezii-postgres 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +7 -0
  2. data/ezii-postgres.gemspec +13 -0
  3. data/natural-backend/Capfile +50 -0
  4. data/natural-backend/Gemfile +63 -0
  5. data/natural-backend/Gemfile.lock +233 -0
  6. data/natural-backend/LICENSE +21 -0
  7. data/natural-backend/Procfile +2 -0
  8. data/natural-backend/README.md +51 -0
  9. data/natural-backend/Rakefile +6 -0
  10. data/natural-backend/app.json +28 -0
  11. data/natural-backend/app/channels/application_cable/channel.rb +4 -0
  12. data/natural-backend/app/channels/application_cable/connection.rb +4 -0
  13. data/natural-backend/app/commands/base_command.rb +31 -0
  14. data/natural-backend/app/commands/create_new_or_authenticate_user.rb +60 -0
  15. data/natural-backend/app/commands/create_project_authentication_token_command.rb +25 -0
  16. data/natural-backend/app/commands/decode_authentication_command.rb +50 -0
  17. data/natural-backend/app/commands/decode_project_authentication_token_command.rb +51 -0
  18. data/natural-backend/app/controllers/application_controller.rb +3 -0
  19. data/natural-backend/app/controllers/authentication_controller.rb +17 -0
  20. data/natural-backend/app/controllers/columns_controller.rb +51 -0
  21. data/natural-backend/app/controllers/concerns/token_authenticatable.rb +26 -0
  22. data/natural-backend/app/controllers/databases_controller.rb +51 -0
  23. data/natural-backend/app/controllers/ember_controller.rb +6 -0
  24. data/natural-backend/app/controllers/projects_controller.rb +51 -0
  25. data/natural-backend/app/controllers/queries_controller.rb +59 -0
  26. data/natural-backend/app/controllers/row_values_controller.rb +51 -0
  27. data/natural-backend/app/controllers/rows_controller.rb +56 -0
  28. data/natural-backend/app/controllers/tables_controller.rb +55 -0
  29. data/natural-backend/app/jobs/application_job.rb +2 -0
  30. data/natural-backend/app/jobs/create_column_job.rb +10 -0
  31. data/natural-backend/app/jobs/create_database_job.rb +11 -0
  32. data/natural-backend/app/jobs/create_database_user_job.rb +8 -0
  33. data/natural-backend/app/jobs/create_table_job.rb +21 -0
  34. data/natural-backend/app/jobs/delete_row_job.rb +12 -0
  35. data/natural-backend/app/jobs/delete_value_job.rb +10 -0
  36. data/natural-backend/app/jobs/destroy_column_job.rb +10 -0
  37. data/natural-backend/app/jobs/destroy_database_job.rb +8 -0
  38. data/natural-backend/app/jobs/destroy_database_user_job.rb +8 -0
  39. data/natural-backend/app/jobs/destroy_table_job.rb +9 -0
  40. data/natural-backend/app/jobs/insert_value_job.rb +11 -0
  41. data/natural-backend/app/jobs/run_query_job.rb +35 -0
  42. data/natural-backend/app/jobs/sync_db_job.rb +80 -0
  43. data/natural-backend/app/jobs/update_column_type_job.rb +10 -0
  44. data/natural-backend/app/jobs/update_value_job.rb +10 -0
  45. data/natural-backend/app/mailers/application_mailer.rb +4 -0
  46. data/natural-backend/app/models/application_record.rb +3 -0
  47. data/natural-backend/app/models/column.rb +43 -0
  48. data/natural-backend/app/models/database.rb +37 -0
  49. data/natural-backend/app/models/project.rb +31 -0
  50. data/natural-backend/app/models/query.rb +20 -0
  51. data/natural-backend/app/models/row.rb +15 -0
  52. data/natural-backend/app/models/row_value.rb +30 -0
  53. data/natural-backend/app/models/table.rb +32 -0
  54. data/natural-backend/app/models/user.rb +10 -0
  55. data/natural-backend/app/serializers/column_serializer.rb +5 -0
  56. data/natural-backend/app/serializers/database_serializer.rb +6 -0
  57. data/natural-backend/app/serializers/project_serializer.rb +4 -0
  58. data/natural-backend/app/serializers/query_serializer.rb +3 -0
  59. data/natural-backend/app/serializers/row_serializer.rb +5 -0
  60. data/natural-backend/app/serializers/row_value_serializer.rb +5 -0
  61. data/natural-backend/app/serializers/table_serializer.rb +8 -0
  62. data/natural-backend/app/services/jwt_service.rb +17 -0
  63. data/natural-backend/app/views/layouts/mailer.html.erb +13 -0
  64. data/natural-backend/app/views/layouts/mailer.text.erb +1 -0
  65. data/natural-backend/bin/bundle +3 -0
  66. data/natural-backend/bin/rails +9 -0
  67. data/natural-backend/bin/rake +9 -0
  68. data/natural-backend/bin/run_migrations.sh +3 -0
  69. data/natural-backend/bin/setup +35 -0
  70. data/natural-backend/bin/spring +17 -0
  71. data/natural-backend/bin/update +29 -0
  72. data/natural-backend/config.ru +5 -0
  73. data/natural-backend/config/application.rb +33 -0
  74. data/natural-backend/config/boot.rb +3 -0
  75. data/natural-backend/config/cable.yml +10 -0
  76. data/natural-backend/config/database.yml +21 -0
  77. data/natural-backend/config/deploy.rb +36 -0
  78. data/natural-backend/config/deploy/production.rb +61 -0
  79. data/natural-backend/config/deploy/staging.rb +61 -0
  80. data/natural-backend/config/environment.rb +5 -0
  81. data/natural-backend/config/environments/development.rb +47 -0
  82. data/natural-backend/config/environments/production.rb +83 -0
  83. data/natural-backend/config/environments/test.rb +42 -0
  84. data/natural-backend/config/initializers/application_controller_renderer.rb +8 -0
  85. data/natural-backend/config/initializers/backtrace_silencers.rb +7 -0
  86. data/natural-backend/config/initializers/bugsnag.rb +3 -0
  87. data/natural-backend/config/initializers/cors.rb +16 -0
  88. data/natural-backend/config/initializers/filter_parameter_logging.rb +4 -0
  89. data/natural-backend/config/initializers/inflections.rb +16 -0
  90. data/natural-backend/config/initializers/json_api.rb +5 -0
  91. data/natural-backend/config/initializers/load_commands.rb +4 -0
  92. data/natural-backend/config/initializers/load_lib.rb +6 -0
  93. data/natural-backend/config/initializers/mime_types.rb +4 -0
  94. data/natural-backend/config/initializers/redis_classy.rb +1 -0
  95. data/natural-backend/config/initializers/sidekiq.rb +1 -0
  96. data/natural-backend/config/initializers/wrap_parameters.rb +14 -0
  97. data/natural-backend/config/locales/en.yml +33 -0
  98. data/natural-backend/config/puma.rb +56 -0
  99. data/natural-backend/config/routes.rb +14 -0
  100. data/natural-backend/config/schedule.rb +18 -0
  101. data/natural-backend/config/secrets.yml +32 -0
  102. data/natural-backend/config/spring.rb +6 -0
  103. data/natural-backend/db/migrate/20180408155000_create_projects.rb +9 -0
  104. data/natural-backend/db/migrate/20180408155011_create_databases.rb +10 -0
  105. data/natural-backend/db/migrate/20180409174859_create_tables.rb +9 -0
  106. data/natural-backend/db/migrate/20180409174916_create_columns.rb +11 -0
  107. data/natural-backend/db/migrate/20180409175800_create_rows.rb +9 -0
  108. data/natural-backend/db/migrate/20180409214650_create_row_values.rb +11 -0
  109. data/natural-backend/db/migrate/20180411110745_add_db_username_to_projects.rb +5 -0
  110. data/natural-backend/db/migrate/20180411145722_add_dbpw_to_projects.rb +5 -0
  111. data/natural-backend/db/migrate/20180411185924_add_database_identifier_to_databases.rb +6 -0
  112. data/natural-backend/db/migrate/20180412002908_add_dbid_to_rows.rb +5 -0
  113. data/natural-backend/db/migrate/20180412012433_create_queries.rb +11 -0
  114. data/natural-backend/db/migrate/20180429151758_create_users.rb +10 -0
  115. data/natural-backend/db/migrate/20180430094604_add_user_ref_to_projects.rb +5 -0
  116. data/natural-backend/db/migrate/20180430102945_add_user_ref_to_databases.rb +5 -0
  117. data/natural-backend/db/migrate/20180430102955_add_user_ref_to_tables.rb +5 -0
  118. data/natural-backend/db/migrate/20180430103004_add_user_ref_to_rows.rb +5 -0
  119. data/natural-backend/db/migrate/20180430103015_add_user_ref_to_columns.rb +5 -0
  120. data/natural-backend/db/migrate/20180430103024_add_user_ref_to_row_values.rb +5 -0
  121. data/natural-backend/db/migrate/20180430141537_add_api_token_projects.rb +5 -0
  122. data/natural-backend/db/schema.rb +112 -0
  123. data/natural-backend/db/seeds.rb +7 -0
  124. data/natural-backend/lib/database_manager/database_manager.rb +59 -0
  125. data/natural-backend/lib/database_manager/lib/connection.rb +49 -0
  126. data/natural-backend/lib/database_manager/lib/database.rb +65 -0
  127. data/natural-backend/lib/database_manager/lib/database_user.rb +46 -0
  128. data/natural-backend/lib/database_manager/lib/table.rb +129 -0
  129. data/natural-backend/public/assets/natural-frontend-598145a86019fc7faa2e0386ec6cb276.css +6 -0
  130. data/natural-backend/public/assets/natural-frontend-8e453ff9db7fc3a47e6d9e3de45aa19e.js +31 -0
  131. data/natural-backend/public/assets/vendor-7ffaee0528b64f886e9d1860fc719b5a.js +7359 -0
  132. data/natural-backend/public/assets/vendor-8bd8fa913b4f7f8b27f086c7bfd98b7f.css +1 -0
  133. data/natural-backend/public/index.html +26 -0
  134. data/natural-backend/public/robots.txt +3 -0
  135. data/natural-backend/roadmap.md +25 -0
  136. data/natural-backend/test/controllers/authentication_controller_test.rb +7 -0
  137. data/natural-backend/test/controllers/columns_controller_test.rb +38 -0
  138. data/natural-backend/test/controllers/databases_controller_test.rb +38 -0
  139. data/natural-backend/test/controllers/ember_controller_test.rb +7 -0
  140. data/natural-backend/test/controllers/projects_controller_test.rb +38 -0
  141. data/natural-backend/test/controllers/queries_controller_test.rb +38 -0
  142. data/natural-backend/test/controllers/row_values_controller_test.rb +38 -0
  143. data/natural-backend/test/controllers/rows_controller_test.rb +38 -0
  144. data/natural-backend/test/controllers/tables_controller_test.rb +38 -0
  145. data/natural-backend/test/fixtures/columns.yml +11 -0
  146. data/natural-backend/test/fixtures/databases.yml +9 -0
  147. data/natural-backend/test/fixtures/projects.yml +7 -0
  148. data/natural-backend/test/fixtures/queries.yml +9 -0
  149. data/natural-backend/test/fixtures/row_values.yml +11 -0
  150. data/natural-backend/test/fixtures/rows.yml +7 -0
  151. data/natural-backend/test/fixtures/tables.yml +7 -0
  152. data/natural-backend/test/fixtures/users.yml +9 -0
  153. data/natural-backend/test/jobs/add_column_job_test.rb +7 -0
  154. data/natural-backend/test/jobs/create_database_job_test.rb +7 -0
  155. data/natural-backend/test/jobs/create_database_user_job_test.rb +7 -0
  156. data/natural-backend/test/jobs/create_table_job_test.rb +7 -0
  157. data/natural-backend/test/jobs/delete_row_job_test.rb +7 -0
  158. data/natural-backend/test/jobs/delete_value_job_test.rb +7 -0
  159. data/natural-backend/test/jobs/destroy_database_job_test.rb +7 -0
  160. data/natural-backend/test/jobs/destroy_database_user_job_test.rb +7 -0
  161. data/natural-backend/test/jobs/destroy_table_job_test.rb +7 -0
  162. data/natural-backend/test/jobs/insert_value_job_test.rb +7 -0
  163. data/natural-backend/test/jobs/run_query_job_test.rb +7 -0
  164. data/natural-backend/test/jobs/sync_db_job_test.rb +7 -0
  165. data/natural-backend/test/jobs/update_value_job_test.rb +7 -0
  166. data/natural-backend/test/lib/database_manager/database_manager_test.rb +21 -0
  167. data/natural-backend/test/lib/database_manager/lib/database_test.rb +28 -0
  168. data/natural-backend/test/lib/database_manager/lib/database_user_test.rb +43 -0
  169. data/natural-backend/test/lib/database_manager/lib/table_test.rb +46 -0
  170. data/natural-backend/test/models/column_test.rb +7 -0
  171. data/natural-backend/test/models/database_test.rb +7 -0
  172. data/natural-backend/test/models/project_test.rb +7 -0
  173. data/natural-backend/test/models/query_test.rb +7 -0
  174. data/natural-backend/test/models/row_test.rb +7 -0
  175. data/natural-backend/test/models/row_value_test.rb +7 -0
  176. data/natural-backend/test/models/table_test.rb +7 -0
  177. data/natural-backend/test/models/user_test.rb +7 -0
  178. data/natural-backend/test/test_helper.rb +10 -0
  179. data/natural-frontend/LICENSE +21 -0
  180. data/natural-frontend/README.md +3 -0
  181. data/natural-frontend/app/adapters/application.js +33 -0
  182. data/natural-frontend/app/app.js +18 -0
  183. data/natural-frontend/app/components/column-editor.js +41 -0
  184. data/natural-frontend/app/components/row-editor.js +21 -0
  185. data/natural-frontend/app/components/row-value-editor.js +49 -0
  186. data/natural-frontend/app/controllers/application.js +11 -0
  187. data/natural-frontend/app/controllers/authenticate.js +16 -0
  188. data/natural-frontend/app/controllers/databases.js +22 -0
  189. data/natural-frontend/app/controllers/projects.js +18 -0
  190. data/natural-frontend/app/controllers/table.js +12 -0
  191. data/natural-frontend/app/controllers/table/rows.js +23 -0
  192. data/natural-frontend/app/controllers/tables.js +22 -0
  193. data/natural-frontend/app/helpers/plus-one.js +8 -0
  194. data/natural-frontend/app/index.html +25 -0
  195. data/natural-frontend/app/mixins/application-route-auth-mixin.js +8 -0
  196. data/natural-frontend/app/mixins/authenticated-route-mixin.js +10 -0
  197. data/natural-frontend/app/models/column.js +9 -0
  198. data/natural-frontend/app/models/database.js +9 -0
  199. data/natural-frontend/app/models/project.js +8 -0
  200. data/natural-frontend/app/models/row-value.js +8 -0
  201. data/natural-frontend/app/models/row.js +8 -0
  202. data/natural-frontend/app/models/table.js +9 -0
  203. data/natural-frontend/app/resolver.js +4 -0
  204. data/natural-frontend/app/router.js +22 -0
  205. data/natural-frontend/app/routes/application.js +5 -0
  206. data/natural-frontend/app/routes/authenticate.js +4 -0
  207. data/natural-frontend/app/routes/databases.js +15 -0
  208. data/natural-frontend/app/routes/function.js +20 -0
  209. data/natural-frontend/app/routes/functions.js +22 -0
  210. data/natural-frontend/app/routes/index.js +9 -0
  211. data/natural-frontend/app/routes/projects.js +8 -0
  212. data/natural-frontend/app/routes/table.js +17 -0
  213. data/natural-frontend/app/routes/table/rows.js +19 -0
  214. data/natural-frontend/app/routes/tables.js +16 -0
  215. data/natural-frontend/app/serializers/application.js +10 -0
  216. data/natural-frontend/app/services/authentication.js +38 -0
  217. data/natural-frontend/app/styles/app.scss +58 -0
  218. data/natural-frontend/app/templates/application.hbs +32 -0
  219. data/natural-frontend/app/templates/authenticate.hbs +7 -0
  220. data/natural-frontend/app/templates/components/api-usage-documentation.hbs +36 -0
  221. data/natural-frontend/app/templates/components/column-editor.hbs +37 -0
  222. data/natural-frontend/app/templates/components/row-editor.hbs +21 -0
  223. data/natural-frontend/app/templates/components/row-value-editor.hbs +1 -0
  224. data/natural-frontend/app/templates/databases.hbs +37 -0
  225. data/natural-frontend/app/templates/function.hbs +9 -0
  226. data/natural-frontend/app/templates/functions.hbs +30 -0
  227. data/natural-frontend/app/templates/index.hbs +15 -0
  228. data/natural-frontend/app/templates/projects.hbs +37 -0
  229. data/natural-frontend/app/templates/table.hbs +10 -0
  230. data/natural-frontend/app/templates/table/rows.hbs +23 -0
  231. data/natural-frontend/app/templates/tables.hbs +32 -0
  232. data/natural-frontend/config/environment.js +61 -0
  233. data/natural-frontend/config/targets.js +19 -0
  234. data/natural-frontend/deploy_rails_public.sh +6 -0
  235. data/natural-frontend/ember-cli-build.js +42 -0
  236. data/natural-frontend/package-lock.json +13288 -0
  237. data/natural-frontend/package.json +59 -0
  238. data/natural-frontend/public/robots.txt +3 -0
  239. data/natural-frontend/testem.js +20 -0
  240. data/natural-frontend/tests/index.html +33 -0
  241. data/natural-frontend/tests/integration/components/column-editor-test.js +27 -0
  242. data/natural-frontend/tests/integration/components/row-editor-test.js +27 -0
  243. data/natural-frontend/tests/integration/components/row-value-editor-test.js +27 -0
  244. data/natural-frontend/tests/integration/helpers/humanization-test.js +18 -0
  245. data/natural-frontend/tests/test-helper.js +9 -0
  246. data/natural-frontend/tests/unit/controllers/databases-test.js +13 -0
  247. data/natural-frontend/tests/unit/controllers/projects-test.js +13 -0
  248. data/natural-frontend/tests/unit/controllers/table-test.js +13 -0
  249. data/natural-frontend/tests/unit/controllers/table/rows-test.js +12 -0
  250. data/natural-frontend/tests/unit/controllers/tables-test.js +13 -0
  251. data/natural-frontend/tests/unit/models/column-test.js +15 -0
  252. data/natural-frontend/tests/unit/models/database-test.js +15 -0
  253. data/natural-frontend/tests/unit/models/project-test.js +15 -0
  254. data/natural-frontend/tests/unit/models/row-test.js +15 -0
  255. data/natural-frontend/tests/unit/models/rwo-value-test.js +15 -0
  256. data/natural-frontend/tests/unit/models/table-test.js +15 -0
  257. data/natural-frontend/tests/unit/routes/authenticate-test.js +11 -0
  258. data/natural-frontend/tests/unit/routes/databases-test.js +12 -0
  259. data/natural-frontend/tests/unit/routes/projects-test.js +12 -0
  260. data/natural-frontend/tests/unit/routes/table-test.js +12 -0
  261. data/natural-frontend/tests/unit/routes/table/rows-test.js +11 -0
  262. data/natural-frontend/tests/unit/routes/tables-test.js +12 -0
  263. metadata +303 -0
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ puts "\n== Updating database =="
22
+ system! 'bin/rails db:migrate'
23
+
24
+ puts "\n== Removing old logs and tempfiles =="
25
+ system! 'bin/rails log:clear tmp:clear'
26
+
27
+ puts "\n== Restarting application server =="
28
+ system! 'bin/rails restart'
29
+ end
@@ -0,0 +1,5 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
@@ -0,0 +1,33 @@
1
+ require_relative 'boot'
2
+
3
+ require "rails"
4
+ # Pick the frameworks you want:
5
+ require "active_model/railtie"
6
+ require "active_job/railtie"
7
+ require "active_record/railtie"
8
+ require "action_controller/railtie"
9
+ require "action_mailer/railtie"
10
+ require "action_view/railtie"
11
+ require "action_cable/engine"
12
+ # require "sprockets/railtie"
13
+ require "rails/test_unit/railtie"
14
+
15
+ # Require the gems listed in Gemfile, including any gems
16
+ # you've limited to :test, :development, or :production.
17
+ Bundler.require(*Rails.groups)
18
+
19
+ module NaturalBackend
20
+ class Application < Rails::Application
21
+ # Initialize configuration defaults for originally generated Rails version.
22
+ config.load_defaults 5.1
23
+
24
+ # Settings in config/environments/* take precedence over those specified here.
25
+ # Application configuration should go into files in config/initializers
26
+ # -- all .rb files in that directory are automatically loaded.
27
+
28
+ # Only loads a smaller set of middleware suitable for API only apps.
29
+ # Middleware like session, flash, cookies can be added back manually.
30
+ # Skip views, helpers and assets when generating a new resource.
31
+ config.api_only = true
32
+ end
33
+ end
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
10
+ channel_prefix: natural-backend_production
@@ -0,0 +1,21 @@
1
+ development:
2
+ adapter: postgresql
3
+ encoding: unicode
4
+ database: natural
5
+ pool: 40
6
+ username: natural
7
+ password: natural
8
+ test:
9
+ adapter: postgresql
10
+ encoding: unicode
11
+ database: natural_test
12
+ pool: 40
13
+ username: natural
14
+ password: natural
15
+ production:
16
+ adapter: postgresql
17
+ encoding: unicode
18
+ database: natural_production
19
+ pool: 40
20
+ username: natural
21
+ password: natural
@@ -0,0 +1,36 @@
1
+ # config valid for current version and patch releases of Capistrano
2
+ lock "~> 3.11.0"
3
+
4
+ set :application, "natural-api"
5
+ set :repo_url, "git@github.com:MangoSmoothie101010/natural-backend.git"
6
+
7
+ # Default branch is :master
8
+ # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
9
+
10
+ # Default deploy_to directory is /var/www/my_app_name
11
+ set :deploy_to, '/home/deploy/natural-api'
12
+
13
+ # Default value for :format is :airbrussh.
14
+ # set :format, :airbrussh
15
+
16
+ # You can configure the Airbrussh format using :format_options.
17
+ # These are the defaults.
18
+ # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
19
+
20
+ # Default value for :pty is false
21
+ set :pty, false
22
+
23
+ append :linked_files, "config/database.yml", "config/secrets.yml"
24
+ append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle", "public/system", "public/uploads"
25
+
26
+ # Default value for default_env is {}
27
+ # set :default_env, { path: "/opt/ruby/bin:$PATH" }
28
+
29
+ # Default value for local_user is ENV['USER']
30
+ # set :local_user, -> { `git config user.name`.chomp }
31
+
32
+ # Default value for keep_releases is 5
33
+ # set :keep_releases, 5
34
+
35
+ # Uncomment the following to require manually verifying the host key before first deploy.
36
+ # set :ssh_options, verify_host_key: :secure
@@ -0,0 +1,61 @@
1
+ # server-based syntax
2
+ # ======================
3
+ # Defines a single server with a list of roles and multiple properties.
4
+ # You can define all roles on a single server, or split them:
5
+
6
+ server "195.201.43.71", user: "deploy", roles: %w{app db web}
7
+ # server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value
8
+ # server "db.example.com", user: "deploy", roles: %w{db}
9
+
10
+
11
+
12
+ # role-based syntax
13
+ # ==================
14
+
15
+ # Defines a role with one or multiple servers. The primary server in each
16
+ # group is considered to be the first unless any hosts have the primary
17
+ # property set. Specify the username and a domain or IP for the server.
18
+ # Don't use `:all`, it's a meta role.
19
+
20
+ # role :app, %w{deploy@example.com}, my_property: :my_value
21
+ # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
22
+ # role :db, %w{deploy@example.com}
23
+
24
+
25
+
26
+ # Configuration
27
+ # =============
28
+ # You can set any configuration variable like in config/deploy.rb
29
+ # These variables are then only loaded and set in this stage.
30
+ # For available Capistrano configuration variables see the documentation page.
31
+ # http://capistranorb.com/documentation/getting-started/configuration/
32
+ # Feel free to add new variables to customise your setup.
33
+
34
+
35
+
36
+ # Custom SSH Options
37
+ # ==================
38
+ # You may pass any option but keep in mind that net/ssh understands a
39
+ # limited set of options, consult the Net::SSH documentation.
40
+ # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
41
+ #
42
+ # Global options
43
+ # --------------
44
+ set :ssh_options, {
45
+ keys: %w(/home/manuel/.ssh/id_rsa),
46
+ forward_agent: true,
47
+ auth_methods: %w(publickey)
48
+ }
49
+ #
50
+ # The server-based syntax can be used to override options:
51
+ # ------------------------------------
52
+ # server "example.com",
53
+ # user: "user_name",
54
+ # roles: %w{web app},
55
+ # ssh_options: {
56
+ # user: "user_name", # overrides user setting above
57
+ # keys: %w(/home/user_name/.ssh/id_rsa),
58
+ # forward_agent: false,
59
+ # auth_methods: %w(publickey password)
60
+ # # password: "please use keys"
61
+ # }
@@ -0,0 +1,61 @@
1
+ # server-based syntax
2
+ # ======================
3
+ # Defines a single server with a list of roles and multiple properties.
4
+ # You can define all roles on a single server, or split them:
5
+
6
+ # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value
7
+ # server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value
8
+ # server "db.example.com", user: "deploy", roles: %w{db}
9
+
10
+
11
+
12
+ # role-based syntax
13
+ # ==================
14
+
15
+ # Defines a role with one or multiple servers. The primary server in each
16
+ # group is considered to be the first unless any hosts have the primary
17
+ # property set. Specify the username and a domain or IP for the server.
18
+ # Don't use `:all`, it's a meta role.
19
+
20
+ # role :app, %w{deploy@example.com}, my_property: :my_value
21
+ # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
22
+ # role :db, %w{deploy@example.com}
23
+
24
+
25
+
26
+ # Configuration
27
+ # =============
28
+ # You can set any configuration variable like in config/deploy.rb
29
+ # These variables are then only loaded and set in this stage.
30
+ # For available Capistrano configuration variables see the documentation page.
31
+ # http://capistranorb.com/documentation/getting-started/configuration/
32
+ # Feel free to add new variables to customise your setup.
33
+
34
+
35
+
36
+ # Custom SSH Options
37
+ # ==================
38
+ # You may pass any option but keep in mind that net/ssh understands a
39
+ # limited set of options, consult the Net::SSH documentation.
40
+ # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
41
+ #
42
+ # Global options
43
+ # --------------
44
+ # set :ssh_options, {
45
+ # keys: %w(/home/rlisowski/.ssh/id_rsa),
46
+ # forward_agent: false,
47
+ # auth_methods: %w(password)
48
+ # }
49
+ #
50
+ # The server-based syntax can be used to override options:
51
+ # ------------------------------------
52
+ # server "example.com",
53
+ # user: "user_name",
54
+ # roles: %w{web app},
55
+ # ssh_options: {
56
+ # user: "user_name", # overrides user setting above
57
+ # keys: %w(/home/user_name/.ssh/id_rsa),
58
+ # forward_agent: false,
59
+ # auth_methods: %w(publickey password)
60
+ # # password: "please use keys"
61
+ # }
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,47 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable/disable caching. By default caching is disabled.
16
+ if Rails.root.join('tmp/caching-dev.txt').exist?
17
+ config.action_controller.perform_caching = true
18
+
19
+ config.cache_store = :memory_store
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
22
+ }
23
+ else
24
+ config.action_controller.perform_caching = false
25
+
26
+ config.cache_store = :null_store
27
+ end
28
+
29
+ # Don't care if the mailer can't send.
30
+ config.action_mailer.raise_delivery_errors = false
31
+
32
+ config.action_mailer.perform_caching = false
33
+
34
+ # Print deprecation notices to the Rails logger.
35
+ config.active_support.deprecation = :log
36
+
37
+ # Raise an error on page load if there are pending migrations.
38
+ config.active_record.migration_error = :page_load
39
+
40
+
41
+ # Raises error for missing translations
42
+ # config.action_view.raise_on_missing_translations = true
43
+
44
+ # Use an evented file watcher to asynchronously detect changes in source code,
45
+ # routes, locales, etc. This feature depends on the listen gem.
46
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
47
+ end
@@ -0,0 +1,83 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Attempt to read encrypted secrets from `config/secrets.yml.enc`.
18
+ # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
19
+ # `config/secrets.yml.key`.
20
+ config.read_encrypted_secrets = true
21
+
22
+ # Disable serving static files from the `/public` folder by default since
23
+ # Apache or NGINX already handles this.
24
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
25
+
26
+
27
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
28
+ # config.action_controller.asset_host = 'http://assets.example.com'
29
+
30
+ # Specifies the header that your server uses for sending files.
31
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
32
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
33
+
34
+ # Mount Action Cable outside main process or domain
35
+ # config.action_cable.mount_path = nil
36
+ # config.action_cable.url = 'wss://example.com/cable'
37
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
38
+
39
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
40
+ # config.force_ssl = true
41
+
42
+ # Use the lowest log level to ensure availability of diagnostic information
43
+ # when problems arise.
44
+ config.log_level = :debug
45
+
46
+ # Prepend all log lines with the following tags.
47
+ config.log_tags = [ :request_id ]
48
+
49
+ # Use a different cache store in production.
50
+ # config.cache_store = :mem_cache_store
51
+
52
+ # Use a real queuing backend for Active Job (and separate queues per environment)
53
+ # config.active_job.queue_adapter = :resque
54
+ # config.active_job.queue_name_prefix = "natural-backend_#{Rails.env}"
55
+ config.action_mailer.perform_caching = false
56
+
57
+ # Ignore bad email addresses and do not raise email delivery errors.
58
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
59
+ # config.action_mailer.raise_delivery_errors = false
60
+
61
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
62
+ # the I18n.default_locale when a translation cannot be found).
63
+ config.i18n.fallbacks = true
64
+
65
+ # Send deprecation notices to registered listeners.
66
+ config.active_support.deprecation = :notify
67
+
68
+ # Use default logging formatter so that PID and timestamp are not suppressed.
69
+ config.log_formatter = ::Logger::Formatter.new
70
+
71
+ # Use a different logger for distributed setups.
72
+ # require 'syslog/logger'
73
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
74
+
75
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
76
+ logger = ActiveSupport::Logger.new(STDOUT)
77
+ logger.formatter = config.log_formatter
78
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
79
+ end
80
+
81
+ # Do not dump schema after migrations.
82
+ config.active_record.dump_schema_after_migration = false
83
+ end
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = true
14
+
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
19
+ }
20
+
21
+ # Show full error reports and disable caching.
22
+ config.consider_all_requests_local = true
23
+ config.action_controller.perform_caching = false
24
+
25
+ # Raise exceptions instead of rendering exception templates.
26
+ config.action_dispatch.show_exceptions = false
27
+
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+ config.action_mailer.perform_caching = false
31
+
32
+ # Tell Action Mailer not to deliver emails to the real world.
33
+ # The :test delivery method accumulates sent emails in the
34
+ # ActionMailer::Base.deliveries array.
35
+ config.action_mailer.delivery_method = :test
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end