digital_heroes_startkit 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +37 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/config/digital_heroes_startkit_manifest.js +0 -0
  6. data/app/assets/javascripts/authorization.coffee +79 -0
  7. data/app/assets/javascripts/avatar.coffee +16 -0
  8. data/app/assets/javascripts/datepicker.js +2 -0
  9. data/app/assets/javascripts/digital_heroes_startkit/cable.js +13 -0
  10. data/app/assets/javascripts/digital_heroes_startkit/channels/pills.coffee +23 -0
  11. data/app/assets/javascripts/digital_heroes_startkit/input.coffee +5 -0
  12. data/app/assets/javascripts/digital_heroes_startkit/pills.coffee +2 -0
  13. data/app/assets/javascripts/digital_heroes_startkit/snap.svg-min.js +21 -0
  14. data/app/assets/javascripts/digital_heroes_startkit.js +26 -0
  15. data/app/assets/javascripts/profile.coffee +53 -0
  16. data/app/assets/javascripts/profile_geodata.coffee +68 -0
  17. data/app/assets/javascripts/reg_fields_checkup.coffee +96 -0
  18. data/app/assets/javascripts/registration.coffee +35 -0
  19. data/app/assets/javascripts/resurrection.coffee +20 -0
  20. data/app/channels/application_cable/channel.rb +4 -0
  21. data/app/channels/application_cable/connection.rb +4 -0
  22. data/app/channels/pills_channel.rb +10 -0
  23. data/app/controllers/avatars_controller.rb +11 -0
  24. data/app/controllers/clients_controller.rb +62 -0
  25. data/app/controllers/email_access_cards_controller.rb +28 -0
  26. data/app/controllers/geodata_controller.rb +84 -0
  27. data/app/controllers/nickname_access_cards_controller.rb +30 -0
  28. data/app/controllers/oauth_controller.rb +178 -0
  29. data/app/controllers/openid_controller.rb +124 -0
  30. data/app/controllers/phone_access_cards_controller.rb +28 -0
  31. data/app/controllers/profile_controller.rb +114 -0
  32. data/app/controllers/response_controller.rb +17 -0
  33. data/app/controllers/start_kit_controller.rb +86 -0
  34. data/app/controllers/user_cards_controller.rb +305 -0
  35. data/app/jobs/log_analyzer_job.rb +50 -0
  36. data/app/jobs/password_resurrection_kill_job.rb +9 -0
  37. data/app/mailers/admin_mailer.rb +9 -0
  38. data/app/mailers/client_mailer.rb +3 -0
  39. data/app/mailers/kreator_mailer.rb +9 -0
  40. data/app/mailers/manager_mailer.rb +9 -0
  41. data/app/mailers/prometeus_mailer.rb +16 -0
  42. data/app/mailers/user_cards_mailer.rb +9 -0
  43. data/app/models/admin.rb +3 -0
  44. data/app/models/avatar.rb +23 -0
  45. data/app/models/city.rb +7 -0
  46. data/app/models/client.rb +31 -0
  47. data/app/models/country.rb +7 -0
  48. data/app/models/delayed_job.rb +20 -0
  49. data/app/models/email_access_card.rb +30 -0
  50. data/app/models/kreator.rb +3 -0
  51. data/app/models/log_error.rb +56 -0
  52. data/app/models/log_error_type.rb +3 -0
  53. data/app/models/manager.rb +3 -0
  54. data/app/models/nickname_access_card.rb +18 -0
  55. data/app/models/oauth_access_card.rb +38 -0
  56. data/app/models/phone_access_card.rb +19 -0
  57. data/app/models/prometeus.rb +50 -0
  58. data/app/models/user_card.rb +158 -0
  59. data/app/views/admin_mailer/greetings_email.html.erb +191 -0
  60. data/app/views/client_mailer/greetings_email.html.erb +191 -0
  61. data/app/views/kreator_mailer/greetings_email.html.erb +191 -0
  62. data/app/views/manager_mailer/greetings_email.html.erb +191 -0
  63. data/app/views/oauth/verify.slim +1 -0
  64. data/app/views/profile/_add_avatar.slim +12 -0
  65. data/app/views/profile/_user_profile.slim +95 -0
  66. data/app/views/profile/index.slim +12 -0
  67. data/app/views/user_cards/authorization.slim +72 -0
  68. data/app/views/user_cards/confirmation_but_access_code.slim +7 -0
  69. data/app/views/user_cards/confirmation_complete.slim +7 -0
  70. data/app/views/user_cards/registration.slim +86 -0
  71. data/app/views/user_cards/resurrection.slim +19 -0
  72. data/app/views/user_cards/resurrection_but_access_code.slim +7 -0
  73. data/app/views/user_cards/resurrection_no_access_code.slim +7 -0
  74. data/app/views/user_cards_mailer/email.html.erb +191 -0
  75. data/app/views/user_cards_mailer/resurrection.html.erb +191 -0
  76. data/config/initializers/session_manager.rb +2 -0
  77. data/config/routes.rb +53 -0
  78. data/lib/access_control.rb +3 -0
  79. data/lib/digital_heroes_startkit/engine.rb +25 -0
  80. data/lib/digital_heroes_startkit/version.rb +3 -0
  81. data/lib/digital_heroes_startkit.rb +5 -0
  82. data/lib/generators/digital_heroes_startkit/install_generator.rb +61 -0
  83. data/lib/generators/project/Capfile +36 -0
  84. data/lib/generators/project/Procfile +3 -0
  85. data/lib/generators/project/app/assets/stylesheets/application.scss +16 -0
  86. data/lib/generators/project/app/assets/stylesheets/base/_auth.scss +37 -0
  87. data/lib/generators/project/app/assets/stylesheets/base/_buttons.scss +62 -0
  88. data/lib/generators/project/app/assets/stylesheets/base/_checkbox.scss +71 -0
  89. data/lib/generators/project/app/assets/stylesheets/base/_datepicker.scss +620 -0
  90. data/lib/generators/project/app/assets/stylesheets/base/_form.scss +81 -0
  91. data/lib/generators/project/app/assets/stylesheets/base/_notice.scss +14 -0
  92. data/lib/generators/project/app/assets/stylesheets/base/_pills.scss +39 -0
  93. data/lib/generators/project/app/assets/stylesheets/base/_profile.scss +67 -0
  94. data/lib/generators/project/app/assets/stylesheets/base/_reset.scss +49 -0
  95. data/lib/generators/project/app/assets/stylesheets/base/_social.scss +52 -0
  96. data/lib/generators/project/app/assets/stylesheets/base/_user.scss +0 -0
  97. data/lib/generators/project/app/assets/stylesheets/base/_user_avatar.scss +18 -0
  98. data/lib/generators/project/app/assets/stylesheets/base/styles.scss.txt +35 -0
  99. data/lib/generators/project/app/assets/stylesheets/plugins/sumoselect.scss +296 -0
  100. data/lib/generators/project/app/controllers/application_controller.rb +3 -0
  101. data/lib/generators/project/app/views/layouts/_counts.html.erb +29 -0
  102. data/lib/generators/project/app/views/layouts/_footer.slim +6 -0
  103. data/lib/generators/project/app/views/layouts/_head.slim +7 -0
  104. data/lib/generators/project/app/views/layouts/_header.slim +47 -0
  105. data/lib/generators/project/app/views/layouts/_mobile_menu.slim +11 -0
  106. data/lib/generators/project/app/views/layouts/application.slim +26 -0
  107. data/lib/generators/project/app/views/layouts/mailer.html.erb +13 -0
  108. data/lib/generators/project/app/views/layouts/mailer.text.erb +1 -0
  109. data/lib/generators/project/config/application.access.yml +66 -0
  110. data/lib/generators/project/config/application.db.yml +5 -0
  111. data/lib/generators/project/config/application.google.yml +3 -0
  112. data/lib/generators/project/config/application.oauth.yml +135 -0
  113. data/lib/generators/project/config/application.robokassa.yml +10 -0
  114. data/lib/generators/project/config/application.sendgrid.yml +3 -0
  115. data/lib/generators/project/config/application.telegram.yml +22 -0
  116. data/lib/generators/project/config/application.yml +28 -0
  117. data/lib/generators/project/config/cable.yml +6 -0
  118. data/lib/generators/project/config/capistrano.yml +78 -0
  119. data/lib/generators/project/config/database.yml +52 -0
  120. data/lib/generators/project/config/deploy/application.secrets.yml +4 -0
  121. data/lib/generators/project/config/deploy/domain.crt +92 -0
  122. data/lib/generators/project/config/deploy/domain.key +51 -0
  123. data/lib/generators/project/config/deploy/nginx.conf +50 -0
  124. data/lib/generators/project/config/deploy/production.rb +67 -0
  125. data/lib/generators/project/config/deploy/secrets.yml +32 -0
  126. data/lib/generators/project/config/deploy/secrets.yml.enc +1 -0
  127. data/lib/generators/project/config/deploy/secrets.yml.key +1 -0
  128. data/lib/generators/project/config/deploy/staging.rb +61 -0
  129. data/lib/generators/project/config/deploy/virgin_conf/database.yml +42 -0
  130. data/lib/generators/project/config/deploy/virgin_conf/nginx_site.conf +47 -0
  131. data/lib/generators/project/config/deploy/virgin_conf/nginx_site_ssl.conf +57 -0
  132. data/lib/generators/project/config/deploy/virgin_conf/postfix.cf +685 -0
  133. data/lib/generators/project/config/deploy/virgin_conf/production.rb +67 -0
  134. data/lib/generators/project/config/deploy/virgin_conf/puma.rb +66 -0
  135. data/lib/generators/project/config/deploy/virgin_sh/capistrano.sh +18 -0
  136. data/lib/generators/project/config/deploy/virgin_sh/foreman.sh +19 -0
  137. data/lib/generators/project/config/deploy/virgin_sh/rvm_install.sh +10 -0
  138. data/lib/generators/project/config/deploy.rb +377 -0
  139. data/lib/generators/project/config/environments/development.rb +91 -0
  140. data/lib/generators/project/config/environments/production.rb +142 -0
  141. data/lib/generators/project/config/initializers/session_store.rb +3 -0
  142. data/lib/generators/project/config/locales/ru.yml +444 -0
  143. data/lib/generators/project/db/migrate/10_create_user_cards.rb +19 -0
  144. data/lib/generators/project/db/migrate/12_create_email_access_cards.rb +15 -0
  145. data/lib/generators/project/db/migrate/13_create_nickname_access_cards.rb +15 -0
  146. data/lib/generators/project/db/migrate/14_create_phone_access_cards.rb +16 -0
  147. data/lib/generators/project/db/migrate/15_create_oauth_access_cards.rb +19 -0
  148. data/lib/generators/project/db/migrate/1_create_kreators.rb +9 -0
  149. data/lib/generators/project/db/migrate/21_create_avatars.rb +12 -0
  150. data/lib/generators/project/db/migrate/30_create_countries.rb +12 -0
  151. data/lib/generators/project/db/migrate/32_create_cities.rb +12 -0
  152. data/lib/generators/project/db/migrate/3_create_admins.rb +9 -0
  153. data/lib/generators/project/db/migrate/44_add_sessions_table.rb +12 -0
  154. data/lib/generators/project/db/migrate/4_create_managers.rb +10 -0
  155. data/lib/generators/project/db/migrate/5_create_clients.rb +17 -0
  156. data/lib/generators/project/db/migrate/60_create_log_error_types.rb +9 -0
  157. data/lib/generators/project/db/migrate/61_create_log_errors.rb +12 -0
  158. data/lib/generators/project/db/migrate/78_create_delayed_jobs.rb +22 -0
  159. data/lib/generators/project/db/seeds.rb +27 -0
  160. data/lib/generators/project/geodata/cities.csv +25305 -0
  161. data/lib/generators/project/geodata/countries.csv +250 -0
  162. data/lib/generators/project/public/401.html +75 -0
  163. data/lib/generators/project/public/404.html +67 -0
  164. data/lib/generators/project/public/422.html +67 -0
  165. data/lib/generators/project/public/500.html +66 -0
  166. data/lib/generators/project/public/_receiver.html +10 -0
  167. data/lib/generators/project/public/apple-touch-icon-precomposed.png +0 -0
  168. data/lib/generators/project/public/apple-touch-icon.png +0 -0
  169. data/lib/generators/project/public/favicon.ico +0 -0
  170. data/lib/generators/project/public/robots.txt +1 -0
  171. data/lib/happy_birthday.rb +5 -0
  172. data/lib/link.rb +16 -0
  173. data/lib/oauth/oauth.rb +72 -0
  174. data/lib/oauth/oauth_fb.rb +48 -0
  175. data/lib/oauth/oauth_gg.rb +50 -0
  176. data/lib/oauth/oauth_im.rb +51 -0
  177. data/lib/oauth/oauth_mr.rb +53 -0
  178. data/lib/oauth/oauth_vk.rb +3 -0
  179. data/lib/oauth/oauth_yx.rb +51 -0
  180. data/lib/openid/openid.rb +46 -0
  181. data/lib/openid/openid_st.rb +2 -0
  182. data/lib/phone_cutter.rb +9 -0
  183. data/lib/response.rb +51 -0
  184. data/lib/session_manager.rb +47 -0
  185. data/lib/sms_lib.rb +30 -0
  186. data/lib/social_networks.rb +328 -0
  187. data/lib/tasks/digital_heroes_startkit_tasks.rake +83 -0
  188. data/lib/telegram.rb +33 -0
  189. metadata +497 -0
@@ -0,0 +1,67 @@
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{root@cap_server}
21
+ role :web, %w{root@cap_server}
22
+ role :db, %w{root@cap_server}
23
+
24
+ # role :app, %w{deploy@example.com}, my_property: :my_value
25
+ # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
26
+ # role :db, %w{deploy@example.com}
27
+
28
+
29
+
30
+ # Configuration
31
+ # =============
32
+ # You can set any configuration variable like in config/deploy.rb
33
+ # These variables are then only loaded and set in this stage.
34
+ # For available Capistrano configuration variables see the documentation page.
35
+ # http://capistranorb.com/documentation/getting-started/configuration/
36
+ # Feel free to add new variables to customise your setup.
37
+
38
+
39
+
40
+ # Custom SSH Options
41
+ # ==================
42
+ # You may pass any option but keep in mind that net/ssh understands a
43
+ # limited set of options, consult the Net::SSH documentation.
44
+ # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
45
+ #
46
+ # Global options
47
+ # --------------
48
+ # set :ssh_options, {
49
+ # user: 'root',
50
+ # keys: %w(~/.ssh/id_rsa),
51
+ # forward_agent: true,
52
+ # auth_methods: %w(publickey),
53
+ # passphrase: 'pussy'
54
+ # }
55
+ #
56
+ # The server-based syntax can be used to override options:
57
+ # ------------------------------------
58
+ server 'cap_server',
59
+ user: 'root',
60
+ roles: %w{web app},
61
+ ssh_options: {
62
+ keys: %w(~/.ssh/id_rsa),
63
+ forward_agent: true,
64
+ auth_methods: %w(publickey),
65
+ passphrase: 'cap_passphrase'
66
+ }
67
+
@@ -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: 7ff3b76410a4c14ad8838e6346fe9db0b70870c620fa29010f1651c07bf98a7859e0960392d23830a59e958bb319010a916a91575c72cb8ee00553c14df66d4d
22
+
23
+ test:
24
+ secret_key_base: c9efcdd85fbe9746a2e7c312e6d20bc1e6ed3b736ac3ad6e6365d62e5b54c96f97246198c7ff5f8a8b93228c09de0dcb0ccd65b9401e6fd7a137630fbf3cc7ad
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: c9efcdd85fbe9746a2e7c312e6d20bc1e6ed3b736ac3ad6e6365d62e5b54c96f97246198c7ff5f8a8b93228c09de0dcb0ccd65b9401e6fd7a137630fbf3cc7ad
@@ -0,0 +1 @@
1
+ MPKpTQBQxrvDUNb5sp3F0BhbkBMh/inAqPYsgmvPcdZSazGEYtZUaVbGxz4B06gB0MbhSfs3HWDb+OXK6cwURAzMmEfqWKhhRJiLuPjR+UjvSKAeykL1prWSFwad7+flVglgKJTH/XSqUdc0HY0feZvUUIlPamidJyfJ30CsbQE0h3RGmt9CnqrAyZ+fzP6lKHdQSpg=--HgeBlbKi/YsUTBia--P2ZlSAWAQgIps/iwdL08Tw==
@@ -0,0 +1 @@
1
+ b47e679d3adc2cafdc65515a486a5a36
@@ -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,42 @@
1
+ # MySQL. Versions 5.0 and up are supported.
2
+ #
3
+ # Install the MySQL driver
4
+ # gem install mysql2
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem 'mysql2'
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # http://dev.mysql.com/doc/refman/5.7/en/old-client.html
11
+ #
12
+ default: &default
13
+ adapter: mysql2
14
+ encoding: utf8
15
+ pool: 50
16
+ username: cap_db_user
17
+ password: cap_db_password
18
+ # socket: /tmp/mysql.sock
19
+ socket: /var/run/mysqld/mysqld.sock
20
+
21
+ # As with config/secrets.yml, you never want to store sensitive information,
22
+ # like your database password, in your source code. If your source code is
23
+ # ever seen by anyone, they now have access to your database.
24
+ #
25
+ # Instead, provide the password as a unix environment variable when you boot
26
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
27
+ # for a full rundown on how to provide these environment variables in a
28
+ # production deployment.
29
+ #
30
+ # On Heroku and other platform providers, you may have a full connection URL
31
+ # available as an environment variable. For example:
32
+ #
33
+ # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
34
+ #
35
+ # You can use this database configuration with:
36
+ #
37
+ # production:
38
+ # url: <%= ENV['DATABASE_URL'] %>
39
+ #
40
+ production:
41
+ <<: *default
42
+ database: cap_application
@@ -0,0 +1,47 @@
1
+ upstream cap_application {
2
+ # Path to Puma SOCK file, as defined previously
3
+ server unix:/cap_shared_path/sockets/puma.sock fail_timeout=0;
4
+ }
5
+
6
+ server {
7
+ listen 443;
8
+
9
+ if ( $scheme = 'https' ) {
10
+ rewrite ^/(.*) http://$host/$1;
11
+ }
12
+ }
13
+
14
+
15
+ server {
16
+
17
+ listen 80;
18
+ server_name cap_application;
19
+
20
+ root cap_current_path/public;
21
+
22
+ try_files $uri/index.html $uri @cap_application;
23
+
24
+ location @cap_application {
25
+ proxy_pass http://cap_application;
26
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
27
+ proxy_set_header Host $http_host;
28
+ proxy_redirect off;
29
+ }
30
+
31
+ location /cable {
32
+ proxy_pass http://cap_application;
33
+ proxy_http_version 1.1;
34
+ proxy_set_header Upgrade $http_upgrade;
35
+ proxy_set_header Connection "Upgrade";
36
+
37
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38
+ proxy_set_header Host $http_host;
39
+ proxy_set_header X-Real-IP $remote_addr;
40
+ proxy_set_header X-Forwarded-Proto https;
41
+ proxy_redirect off;
42
+ }
43
+
44
+ error_page 500 502 503 504 /500.html;
45
+ client_max_body_size 1G;
46
+ keepalive_timeout 10;
47
+ }
@@ -0,0 +1,57 @@
1
+ upstream cap_application {
2
+ # Path to Puma SOCK file, as defined previously
3
+ server unix://cap_shared_path/sockets/puma.sock fail_timeout=0;
4
+ }
5
+
6
+ server {
7
+ listen 80;
8
+
9
+ if ( $scheme = 'http' ) {
10
+ rewrite ^/(.*) https://$host/$1;
11
+ }
12
+ }
13
+
14
+ server {
15
+ listen 443;
16
+ ssl on;
17
+ ssl_certificate /etc/ssl/cap_application.crt;
18
+ ssl_certificate_key /etc/ssl/cap_application.key;
19
+ server_name cap_domain;
20
+ ssl_ciphers ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP;
21
+ ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
22
+
23
+ root cap_current_path/public;
24
+
25
+ try_files $uri/index.html $uri @cap_application;
26
+
27
+
28
+ location @cap_application {
29
+ proxy_pass http://cap_application;
30
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
31
+ proxy_set_header Host $http_host;
32
+ proxy_set_header X-Real-IP $remote_addr;
33
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34
+ proxy_set_header X-Forwarded-Host $host:443;
35
+ proxy_set_header X-Forwarded-Server $host;
36
+ proxy_set_header X-Forwarded-Port 443;
37
+ proxy_set_header X-Forwarded-Proto https;
38
+ proxy_redirect off;
39
+ }
40
+
41
+ location /cable {
42
+ proxy_pass http://cap_application;
43
+ proxy_http_version 1.1;
44
+ proxy_set_header Upgrade $http_upgrade;
45
+ proxy_set_header Connection "Upgrade";
46
+
47
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
48
+ proxy_set_header Host $http_host;
49
+ proxy_set_header X-Real-IP $remote_addr;
50
+ proxy_set_header X-Forwarded-Proto https;
51
+ proxy_redirect off;
52
+ }
53
+
54
+ error_page 500 502 503 504 /500.html;
55
+ client_max_body_size 1G;
56
+ keepalive_timeout 10;
57
+ }