diff --git a/.gitignore b/.gitignore index 791326f..e3664b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,29 @@ # See https://help.github.com/articles/ignoring-files for more about ignoring files. # # If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' # Ignore bundler config. /.bundle # Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal # Ignore all logfiles and tempfiles. /log/* /tmp/* !/log/.keep !/tmp/.keep # Ignore uploaded files in development /storage/* !/storage/.keep .byebug_history # Ignore master key for decrypting credentials and more. /config/master.key + +.env \ No newline at end of file diff --git a/.ruby-version b/.ruby-version index 2eb2fe9..7bde84d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.2 +ruby-3.1.2 diff --git a/Capfile b/Capfile new file mode 100644 index 0000000..dc2ab7a --- /dev/null +++ b/Capfile @@ -0,0 +1,80 @@ +# Load DSL and set up stages +require "capistrano/setup" + +# Include default deployment tasks +require "capistrano/deploy" + +# cap install +# bundle lock --add-platform x86_64-linux + +# Load the SCM plugin appropriate to your project: +# +# require "capistrano/scm/hg" +# install_plugin Capistrano::SCM::Hg +# or +# require "capistrano/scm/svn" +# install_plugin Capistrano::SCM::Svn +# or +require "capistrano/scm/git" +install_plugin Capistrano::SCM::Git + +require "capistrano/bundler" +require "capistrano/rails" +require 'capistrano/rails/assets' +require 'capistrano/rails/migrations' + +require "capistrano/rvm" +require 'capistrano/puma' +install_plugin Capistrano::Puma +# cap production puma:config +install_plugin Capistrano::Puma::Systemd +# cap production puma:systemd:config puma:systemd:enable +install_plugin Capistrano::Puma::Nginx +# cap production puma:nginx_config +# mkdir apps/mysite/shared/tmp/sockets + +require 'capistrano/yarn' +require 'capistrano/lets-encrypt' + +require 'capistrano/sidekiq' +install_plugin Capistrano::Sidekiq # Default sidekiq tasks +# Then select your service manager +install_plugin Capistrano::Sidekiq::Systemd + +# cap production sidekiq:install + +# su postgres +# cd +#createdb mysite_production +# psql +# create user rails with password 'mypassword'; +# grant all privileges on database mysite_production to rails; +# exit # exit psql shell +# exit # back to root user + +# cap lets_encrypt:register # Register a Let's encrypt account +# cap lets_encrypt:check_certificate # Check for validity of certificates +# cap lets_encrypt:authorize # Authorize a domain using ACME protocol +# cap lets_encrypt:cert # Create certificates and private keys + +# Include tasks from other gems included in your Gemfile +# +# For documentation on these, see for example: +# +# https://github.com/capistrano/rvm +# https://github.com/capistrano/rbenv +# https://github.com/capistrano/chruby +# https://github.com/capistrano/bundler +# https://github.com/capistrano/rails +# https://github.com/capistrano/passenger +# +# require "capistrano/rvm" +# require "capistrano/rbenv" +# require "capistrano/chruby" +# require "capistrano/bundler" +# require "capistrano/rails/assets" +# require "capistrano/rails/migrations" +# require "capistrano/passenger" + +# Load custom tasks from `lib/capistrano/tasks` if you have any defined +Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r } diff --git a/Gemfile b/Gemfile index 6851546..8e02186 100644 --- a/Gemfile +++ b/Gemfile @@ -1,68 +1,77 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '2.7.2' +ruby '3.1.2' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.3' # Use sqlite3 as the database for Active Record gem 'pg' +gem 'dotenv-rails', require: 'dotenv/rails-now' # Use Puma as the app server -gem 'puma', '~> 4.3' +gem 'puma' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby gem "chartkick" gem 'groupdate' gem "sentry-raven" gem 'telegram-bot' gem 'sidekiq' gem 'sidekiq-scheduler' gem 'rails-assets-sweetalert2', '~> 5.1.1', source: 'https://rails-assets.org' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use ActiveStorage variant # gem 'mini_magick', '~> 4.8' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' + + gem 'capistrano', require: false + gem 'capistrano-yarn', require: false + gem 'capistrano-rvm', require: false + gem 'capistrano-rails', require: false + gem 'capistrano-bundler', require: false + gem 'capistrano3-puma', require: false + gem 'capistrano-sidekiq', require: false end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock index 3d679e7..0c18093 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,283 +1,314 @@ GEM - remote: https://rubygems.org/ remote: https://rails-assets.org/ specs: - actioncable (5.2.6) - actionpack (= 5.2.6) + rails-assets-es6-promise (4.2.4) + rails-assets-sweetalert2 (5.1.1) + rails-assets-es6-promise + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.8.1) + actionpack (= 5.2.8.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.6) - actionpack (= 5.2.6) - actionview (= 5.2.6) - activejob (= 5.2.6) + actionmailer (5.2.8.1) + actionpack (= 5.2.8.1) + actionview (= 5.2.8.1) + activejob (= 5.2.8.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.6) - actionview (= 5.2.6) - activesupport (= 5.2.6) + actionpack (5.2.8.1) + actionview (= 5.2.8.1) + activesupport (= 5.2.8.1) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.6) - activesupport (= 5.2.6) + actionview (5.2.8.1) + activesupport (= 5.2.8.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.6) - activesupport (= 5.2.6) + activejob (5.2.8.1) + activesupport (= 5.2.8.1) globalid (>= 0.3.6) - activemodel (5.2.6) - activesupport (= 5.2.6) - activerecord (5.2.6) - activemodel (= 5.2.6) - activesupport (= 5.2.6) + activemodel (5.2.8.1) + activesupport (= 5.2.8.1) + activerecord (5.2.8.1) + activemodel (= 5.2.8.1) + activesupport (= 5.2.8.1) arel (>= 9.0) - activestorage (5.2.6) - actionpack (= 5.2.6) - activerecord (= 5.2.6) + activestorage (5.2.8.1) + actionpack (= 5.2.8.1) + activerecord (= 5.2.8.1) marcel (~> 1.0.0) - activesupport (5.2.6) + activesupport (5.2.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) + airbrussh (1.4.0) + sshkit (>= 1.6.1, != 1.7.0) archive-zip (0.12.0) io-like (~> 0.3.0) arel (9.0.0) bindex (0.8.1) - bootsnap (1.9.1) - msgpack (~> 1.0) + bootsnap (1.12.0) + msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) - capybara (3.35.3) + capistrano (3.17.0) + airbrussh (>= 1.0.0) + i18n + rake (>= 10.0.0) + sshkit (>= 1.9.0) + capistrano-bundler (2.1.0) + capistrano (~> 3.1) + capistrano-rails (1.6.2) + capistrano (~> 3.1) + capistrano-bundler (>= 1.1, < 3) + capistrano-rvm (0.1.2) + capistrano (~> 3.0) + sshkit (~> 1.2) + capistrano-sidekiq (2.3.0) + capistrano (>= 3.9.0) + capistrano-bundler + sidekiq (>= 6.0) + capistrano-yarn (2.0.2) + capistrano (~> 3.0) + capistrano3-puma (5.2.0) + capistrano (~> 3.7) + capistrano-bundler + puma (>= 4.0, < 6.0) + capybara (3.37.1) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - chartkick (4.0.5) - childprocess (3.0.0) + chartkick (4.2.0) + childprocess (4.1.0) chromedriver-helper (2.1.1) archive-zip (~> 0.10) nokogiri (~> 1.8) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) connection_pool (2.2.5) crass (1.0.6) - e2mmap (0.1.0) + dotenv (2.7.6) + dotenv-rails (2.7.6) + dotenv (= 2.7.6) + railties (>= 3.2) erubi (1.10.0) - et-orbi (1.2.5) + et-orbi (1.2.7) tzinfo execjs (2.8.1) - faraday (1.8.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) + faraday (2.3.0) + faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - ffi (1.15.4) - fugit (1.5.2) - et-orbi (~> 1.1, >= 1.1.8) + faraday-net_http (2.0.3) + ffi (1.15.5) + fugit (1.5.3) + et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) - globalid (0.5.2) + globalid (1.0.0) activesupport (>= 5.0) - groupdate (5.2.2) - activesupport (>= 5) + groupdate (6.1.0) + activesupport (>= 5.2) httpclient (2.8.3) - i18n (1.8.10) + i18n (1.12.0) concurrent-ruby (~> 1.0) io-like (0.3.1) - jbuilder (2.11.2) + jbuilder (2.11.5) + actionview (>= 5.0.0) activesupport (>= 5.0.0) - listen (3.1.5) + listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - loofah (2.12.0) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.2) + matrix (0.4.2) method_source (1.0.0) - mini_mime (1.1.1) - mini_portile2 (2.6.1) - minitest (5.14.4) - msgpack (1.4.2) - multipart-post (2.1.1) + mini_mime (1.1.2) + minitest (5.16.2) + msgpack (1.5.3) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (7.0.1) nio4r (2.5.8) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.13.7-x86_64-linux) racc (~> 1.4) - pg (1.2.3) - public_suffix (4.0.6) - puma (4.3.8) + pg (1.4.1) + public_suffix (4.0.7) + puma (5.6.4) nio4r (~> 2.0) raabro (1.4.0) - racc (1.5.2) - rack (2.2.3) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.6) - actioncable (= 5.2.6) - actionmailer (= 5.2.6) - actionpack (= 5.2.6) - actionview (= 5.2.6) - activejob (= 5.2.6) - activemodel (= 5.2.6) - activerecord (= 5.2.6) - activestorage (= 5.2.6) - activesupport (= 5.2.6) + racc (1.6.0) + rack (2.2.4) + rack-test (2.0.2) + rack (>= 1.3) + rails (5.2.8.1) + actioncable (= 5.2.8.1) + actionmailer (= 5.2.8.1) + actionpack (= 5.2.8.1) + actionview (= 5.2.8.1) + activejob (= 5.2.8.1) + activemodel (= 5.2.8.1) + activerecord (= 5.2.8.1) + activestorage (= 5.2.8.1) + activesupport (= 5.2.8.1) bundler (>= 1.3.0) - railties (= 5.2.6) + railties (= 5.2.8.1) sprockets-rails (>= 2.0.0) - rails-assets-es6-promise (4.2.4) - rails-assets-sweetalert2 (5.1.1) - rails-assets-es6-promise rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) + rails-html-sanitizer (1.4.3) loofah (~> 2.3) - railties (5.2.6) - actionpack (= 5.2.6) - activesupport (= 5.2.6) + railties (5.2.8.1) + actionpack (= 5.2.8.1) + activesupport (= 5.2.8.1) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rake (13.0.6) - rb-fsevent (0.11.0) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) - redis (4.4.0) - regexp_parser (2.1.1) + redis (4.7.1) + regexp_parser (2.5.0) + rexml (3.2.5) ruby2_keywords (0.0.5) - ruby_dep (1.5.0) rubyzip (2.3.2) - rufus-scheduler (3.8.0) + rufus-scheduler (3.8.2) fugit (~> 1.1, >= 1.1.6) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.1.0) railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - selenium-webdriver (3.142.7) - childprocess (>= 0.5, < 4.0) - rubyzip (>= 1.2.2) + selenium-webdriver (4.3.0) + childprocess (>= 0.5, < 5.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) sentry-raven (3.1.2) faraday (>= 1.0) - sidekiq (6.2.2) + sidekiq (6.5.1) connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) - sidekiq-scheduler (3.1.0) - e2mmap - redis (>= 3, < 5) + sidekiq-scheduler (4.0.2) + redis (>= 4.2.0) rufus-scheduler (~> 3.2) - sidekiq (>= 3) - thwait + sidekiq (>= 4) tilt (>= 1.4.0) spring (2.1.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) - telegram-bot (0.15.4) - actionpack (>= 4.0, < 6.2) - activesupport (>= 4.0, < 6.2) + sshkit (1.21.2) + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) + telegram-bot (0.15.6) + actionpack (>= 4.0, < 7.1) + activesupport (>= 4.0, < 7.1) httpclient (~> 2.7) - thor (1.1.0) + thor (1.2.1) thread_safe (0.3.6) - thwait (0.2.0) - e2mmap tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (1.2.9) thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) + websocket (1.2.9) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS - ruby + arm64-darwin-21 + x86_64-linux DEPENDENCIES bootsnap (>= 1.1.0) byebug + capistrano + capistrano-bundler + capistrano-rails + capistrano-rvm + capistrano-sidekiq + capistrano-yarn + capistrano3-puma capybara (>= 2.15) chartkick chromedriver-helper coffee-rails (~> 4.2) + dotenv-rails groupdate jbuilder (~> 2.5) listen (>= 3.0.5, < 3.2) pg - puma (~> 4.3) + puma rails (~> 5.2.3) rails-assets-sweetalert2 (~> 5.1.1)! sass-rails (~> 5.0) selenium-webdriver sentry-raven sidekiq sidekiq-scheduler spring spring-watcher-listen (~> 2.0.0) telegram-bot turbolinks (~> 5) tzinfo-data uglifier (>= 1.3.0) web-console (>= 3.3.0) RUBY VERSION - ruby 2.7.2p137 + ruby 3.1.2p20 BUNDLED WITH - 2.2.9 + 2.3.15 diff --git a/config/database.yml b/config/database.yml index bdd57ee..798f64d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,16 +1,19 @@ development: adapter: postgresql database: my_database_development pool: 5 timeout: 5000 test: adapter: postgresql database: my_database_test pool: 5 timeout: 5000 production: adapter: postgresql - database: my_database_production + host: localhost + database: asdbot_production + username: asdbot + password: <%= ENV["DATABASE_PASSWORD"] %> pool: 5 timeout: 5000 diff --git a/config/deploy.rb b/config/deploy.rb new file mode 100644 index 0000000..fe50cbf --- /dev/null +++ b/config/deploy.rb @@ -0,0 +1,96 @@ +# config valid for current version and patch releases of Capistrano +lock "~> 3.17.0" + +set :application, "asdbot" + +server 'c.ferdi.cc', port: 22, roles: [:web, :app, :db], primary: true +set :repo_url, "git@github.com:ferdi2005/monumenti_backend.git" +set :sidekiq_service_unit_name, "#{fetch(:application)}-sidekiq" + +set :user, 'deploy' +set :puma_threads, [4, 16] +set :puma_workers, 0 +set :branch, "main" + +set :pty, true +set :use_sudo, false +set :stage, :production +set :deploy_via, :remote_cache +set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}" +set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" +set :puma_state, "#{shared_path}/tmp/pids/puma.state" +set :puma_pid, "#{shared_path}/tmp/pids/puma.pid" +set :puma_access_log, "#{release_path}/log/puma.access.log" +set :puma_error_log, "#{release_path}/log/puma.error.log" +set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) } +set :puma_preload_app, true +set :puma_worker_timeout, nil +set :puma_phased_restart, true +set :puma_init_active_record, true # Change to false when not using ActiveRecord +set :default_env, {"LD_PRELOAD" => "/usr/lib/x86_64-linux-gnu/libjemalloc.so.2"} +set :sidekiq_user, fetch(:user) +set :sidekiq_service_unit_user, :system + +append :linked_files, ".env" +append :linked_dirs, "log", "tmp/pids", "tmp/sockets", "tmp/cache", "public/uploads", "storage" + +namespace :rails do + desc 'Open a rails console `cap [staging] rails:console [server_index default: 0]`' + task :console do + server = roles(:app)[ARGV[2].to_i] + + puts "Opening a console on: #{server.hostname}...." + + cmd = "ssh #{fetch(:user)}@#{server.hostname} -t 'cd #{fetch(:deploy_to)}/current && RAILS_ENV=#{fetch(:rails_env)} bundle exec rails console'" + + puts cmd + + exec cmd + end +end + +namespace :deploy do + namespace :check do + before :linked_files, :set_master_key do + on roles(:app), in: :sequence, wait: 10 do + puts "Uploading .env file..." + upload! '.env', "#{shared_path}/.env" + end + end + end +end + + +# Default branch is :master +# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp + +# Default deploy_to directory is /var/www/my_app_name +# set :deploy_to, "/var/www/my_app_name" + +# Default value for :format is :airbrussh. +# set :format, :airbrussh + +# You can configure the Airbrussh format using :format_options. +# These are the defaults. +# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto + +# Default value for :pty is false +# set :pty, true + +# Default value for :linked_files is [] +# append :linked_files, "config/database.yml", 'config/master.key' + +# Default value for linked_dirs is [] +# append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "tmp/webpacker", "public/system", "vendor", "storage" + +# Default value for default_env is {} +# set :default_env, { path: "/opt/ruby/bin:$PATH" } + +# Default value for local_user is ENV['USER'] +# set :local_user, -> { `git config user.name`.chomp } + +# Default value for keep_releases is 5 +# set :keep_releases, 5 + +# Uncomment the following to require manually verifying the host key before first deploy. +# set :ssh_options, verify_host_key: :secure diff --git a/config/deploy/production.rb b/config/deploy/production.rb new file mode 100644 index 0000000..0a3f086 --- /dev/null +++ b/config/deploy/production.rb @@ -0,0 +1,61 @@ +# server-based syntax +# ====================== +# Defines a single server with a list of roles and multiple properties. +# You can define all roles on a single server, or split them: + +# server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value +# server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value +# server "db.example.com", user: "deploy", roles: %w{db} + + + +# role-based syntax +# ================== + +# Defines a role with one or multiple servers. The primary server in each +# group is considered to be the first unless any hosts have the primary +# property set. Specify the username and a domain or IP for the server. +# Don't use `:all`, it's a meta role. + +# role :app, %w{deploy@example.com}, my_property: :my_value +# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value +# role :db, %w{deploy@example.com} + + + +# Configuration +# ============= +# You can set any configuration variable like in config/deploy.rb +# These variables are then only loaded and set in this stage. +# For available Capistrano configuration variables see the documentation page. +# http://capistranorb.com/documentation/getting-started/configuration/ +# Feel free to add new variables to customise your setup. + + + +# Custom SSH Options +# ================== +# You may pass any option but keep in mind that net/ssh understands a +# limited set of options, consult the Net::SSH documentation. +# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start +# +# Global options +# -------------- +# set :ssh_options, { +# keys: %w(/home/user_name/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(password) +# } +# +# The server-based syntax can be used to override options: +# ------------------------------------ +# server "example.com", +# user: "user_name", +# roles: %w{web app}, +# ssh_options: { +# user: "user_name", # overrides user setting above +# keys: %w(/home/user_name/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(publickey password) +# # password: "please use keys" +# } diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb new file mode 100644 index 0000000..0a3f086 --- /dev/null +++ b/config/deploy/staging.rb @@ -0,0 +1,61 @@ +# server-based syntax +# ====================== +# Defines a single server with a list of roles and multiple properties. +# You can define all roles on a single server, or split them: + +# server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value +# server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value +# server "db.example.com", user: "deploy", roles: %w{db} + + + +# role-based syntax +# ================== + +# Defines a role with one or multiple servers. The primary server in each +# group is considered to be the first unless any hosts have the primary +# property set. Specify the username and a domain or IP for the server. +# Don't use `:all`, it's a meta role. + +# role :app, %w{deploy@example.com}, my_property: :my_value +# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value +# role :db, %w{deploy@example.com} + + + +# Configuration +# ============= +# You can set any configuration variable like in config/deploy.rb +# These variables are then only loaded and set in this stage. +# For available Capistrano configuration variables see the documentation page. +# http://capistranorb.com/documentation/getting-started/configuration/ +# Feel free to add new variables to customise your setup. + + + +# Custom SSH Options +# ================== +# You may pass any option but keep in mind that net/ssh understands a +# limited set of options, consult the Net::SSH documentation. +# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start +# +# Global options +# -------------- +# set :ssh_options, { +# keys: %w(/home/user_name/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(password) +# } +# +# The server-based syntax can be used to override options: +# ------------------------------------ +# server "example.com", +# user: "user_name", +# roles: %w{web app}, +# ssh_options: { +# user: "user_name", # overrides user setting above +# keys: %w(/home/user_name/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(publickey password) +# # password: "please use keys" +# }