Commit 2504170343404e7633df3764338d7bd355389279
1 parent
926d2074
Exists in
master
and in
1 other branch
trying to fix websocket error
Showing
4 changed files
with
3 additions
and
192 deletions
Show diff stats
app/assets/javascripts/v_libras/videos/index.js.erb
config/deploy.rb.1
... | ... | @@ -1,106 +0,0 @@ |
1 | -# -*- encoding : utf-8 -*- | |
2 | -# config valid only for Capistrano 3.1 | |
3 | -lock '3.2.1' | |
4 | - | |
5 | -server '150.165.204.80', port: 22, password: 'l1br4s-l1v3', roles: [:web, :app, :db], primary: true | |
6 | - | |
7 | -set :application, 'vlibras-web2' | |
8 | -set :repo_url, 'git@git.lavid.ufpb.br:vlibras-web2.git' | |
9 | -set :application, 'vlibras-web2' | |
10 | -set :user, 'deployer' | |
11 | - | |
12 | -# Default branch is :master | |
13 | -ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call | |
14 | - | |
15 | -set :puma_threads, [4, 16] | |
16 | -set :puma_workers, 0 | |
17 | - | |
18 | -# Default deploy_to directory is /var/www/my_app | |
19 | -set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}" | |
20 | -set :deploy_via, :remote_cache | |
21 | -set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" | |
22 | -set :puma_state, "#{shared_path}/tmp/pids/puma.state" | |
23 | -set :puma_pid, "#{shared_path}/tmp/pids/puma.pid" | |
24 | -set :puma_access_log, "#{release_path}/log/puma.error.log" | |
25 | -set :puma_error_log, "#{release_path}/log/puma.access.log" | |
26 | -set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) } | |
27 | -set :puma_preload_app, true | |
28 | -set :puma_worker_timeout, nil | |
29 | -set :puma_init_active_record, true # Change to false when not using ActiveRecord | |
30 | - | |
31 | -set :rails_env, 'production' | |
32 | - | |
33 | -set :use_sudo, false | |
34 | - | |
35 | -# Default value for :scm is :git | |
36 | -# set :scm, :git | |
37 | - | |
38 | -# Default value for :format is :pretty | |
39 | -# set :format, :pretty | |
40 | - | |
41 | -# Default value for :log_level is :debug | |
42 | -# set :log_level, :debug | |
43 | - | |
44 | -# Default value for :pty is false | |
45 | -set :pty, true | |
46 | - | |
47 | -# Default value for :linked_files is [] | |
48 | -set :linked_files, %w{config/database.yml .env} | |
49 | - | |
50 | -# Default value for linked_dirs is [] | |
51 | -set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} | |
52 | - | |
53 | -# Default value for default_env is {} | |
54 | -# set :default_env, { path: "/opt/ruby/bin:$PATH" } | |
55 | - | |
56 | -# Default value for keep_releases is 5 | |
57 | -set :keep_releases, 3 | |
58 | - | |
59 | -namespace :puma do | |
60 | - desc 'Create Directories for Puma Pids and Socket' | |
61 | - task :make_dirs do | |
62 | - on roles(:app) do | |
63 | - execute "mkdir #{shared_path}/tmp/sockets -p" | |
64 | - execute "mkdir #{shared_path}/tmp/pids -p" | |
65 | - end | |
66 | - end | |
67 | - | |
68 | - before :start, :make_dirs | |
69 | -end | |
70 | - | |
71 | -namespace :deploy do | |
72 | - desc "Make sure local git is in sync with remote." | |
73 | - task :check_revision do | |
74 | - on roles(:app) do | |
75 | - unless `git rev-parse HEAD` == `git rev-parse origin/master` | |
76 | - puts "WARNING: HEAD is not the same as origin/master" | |
77 | - puts "Run `git push` to sync changes." | |
78 | - exit | |
79 | - end | |
80 | - end | |
81 | - end | |
82 | - | |
83 | - desc 'Initial Deploy' | |
84 | - task :initial do | |
85 | - on roles(:app) do | |
86 | - before 'deploy:restart', 'puma:start' | |
87 | - invoke 'deploy' | |
88 | - end | |
89 | - end | |
90 | - | |
91 | - desc 'Restart application' | |
92 | - task :restart do | |
93 | - on roles(:app), in: :sequence, wait: 5 do | |
94 | - invoke 'puma:restart' | |
95 | - end | |
96 | - end | |
97 | - | |
98 | - before :starting, :check_revision | |
99 | - after :finishing, :compile_assets | |
100 | - after :finishing, :cleanup | |
101 | - after :finishing, :restart | |
102 | -end | |
103 | - | |
104 | -# ps aux | grep puma # Get puma pid | |
105 | -# kill -s SIGUSR2 pid # Restart puma | |
106 | -# kill -s SIGTERM pid # Stop puma |
config/deploy.rb.2
... | ... | @@ -1,84 +0,0 @@ |
1 | -# Change these | |
2 | -server '150.165.204.80', port: 22, password: 'l1br4s-l1v3', roles: [:web, :app, :db], primary: true | |
3 | - | |
4 | -set :repo_url, 'git@git.lavid.ufpb.br:vlibras-web2.git' | |
5 | -set :application, 'vlibras-web2' | |
6 | -set :user, 'deployer' | |
7 | -set :puma_threads, [4, 16] | |
8 | -set :puma_workers, 0 | |
9 | - | |
10 | -# Don't change these unless you know what you're doing | |
11 | -set :pty, true | |
12 | -set :use_sudo, false | |
13 | -set :stage, :production | |
14 | -set :deploy_via, :remote_cache | |
15 | -set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}" | |
16 | -set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" | |
17 | -set :puma_state, "#{shared_path}/tmp/pids/puma.state" | |
18 | -set :puma_pid, "#{shared_path}/tmp/pids/puma.pid" | |
19 | -set :puma_access_log, "#{release_path}/log/puma.error.log" | |
20 | -set :puma_error_log, "#{release_path}/log/puma.access.log" | |
21 | -set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) } | |
22 | -set :puma_preload_app, true | |
23 | -set :puma_worker_timeout, nil | |
24 | -set :puma_init_active_record, true # Change to false when not using ActiveRecord | |
25 | - | |
26 | -## Defaults: | |
27 | -# set :scm, :git | |
28 | -# set :branch, :master | |
29 | -# set :format, :pretty | |
30 | -# set :log_level, :debug | |
31 | -# set :keep_releases, 5 | |
32 | - | |
33 | -## Linked Files & Directories (Default None): | |
34 | -# set :linked_files, %w{config/database.yml} | |
35 | -# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} | |
36 | - | |
37 | -namespace :puma do | |
38 | - desc 'Create Directories for Puma Pids and Socket' | |
39 | - task :make_dirs do | |
40 | - on roles(:app) do | |
41 | - execute "mkdir #{shared_path}/tmp/sockets -p" | |
42 | - execute "mkdir #{shared_path}/tmp/pids -p" | |
43 | - end | |
44 | - end | |
45 | - | |
46 | - before :start, :make_dirs | |
47 | -end | |
48 | - | |
49 | -namespace :deploy do | |
50 | - desc "Make sure local git is in sync with remote." | |
51 | - task :check_revision do | |
52 | - on roles(:app) do | |
53 | - unless `git rev-parse HEAD` == `git rev-parse origin/master` | |
54 | - puts "WARNING: HEAD is not the same as origin/master" | |
55 | - puts "Run `git push` to sync changes." | |
56 | - exit | |
57 | - end | |
58 | - end | |
59 | - end | |
60 | - | |
61 | - desc 'Initial Deploy' | |
62 | - task :initial do | |
63 | - on roles(:app) do | |
64 | - before 'deploy:restart', 'puma:start' | |
65 | - invoke 'deploy' | |
66 | - end | |
67 | - end | |
68 | - | |
69 | - desc 'Restart application' | |
70 | - task :restart do | |
71 | - on roles(:app), in: :sequence, wait: 5 do | |
72 | - invoke 'puma:restart' | |
73 | - end | |
74 | - end | |
75 | - | |
76 | - before :starting, :check_revision | |
77 | - after :finishing, :compile_assets | |
78 | - after :finishing, :cleanup | |
79 | - after :finishing, :restart | |
80 | -end | |
81 | - | |
82 | -# ps aux | grep puma # Get puma pid | |
83 | -# kill -s SIGUSR2 pid # Restart puma | |
84 | -# kill -s SIGTERM pid # Stop puma |
config/initializers/websocket_rails.rb
... | ... | @@ -16,7 +16,8 @@ WebsocketRails.setup do |config| |
16 | 16 | # Change to true to enable standalone server mode |
17 | 17 | # Start the standalone server with rake websocket_rails:start_server |
18 | 18 | # * Requires Redis |
19 | - config.standalone = false | |
19 | + config.standalone = true | |
20 | + config.standalone_port = 110 | |
20 | 21 | |
21 | 22 | # Change to true to enable channel synchronization between |
22 | 23 | # multiple server instances. | ... | ... |