Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F13503003
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Authored By
Unknown
Size
37 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/Gemfile b/Gemfile
index 8e02186..0dcff71 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,77 +1,79 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.1.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
-gem 'rails', '~> 5.2.3'
+gem 'rails', '~> 7.0'
+gem "sprockets-rails"
+
# 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'
# 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 0c18093..9c6750c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,314 +1,354 @@
GEM
remote: https://rails-assets.org/
specs:
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)
+ actioncable (7.0.3.1)
+ actionpack (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailer (5.2.8.1)
- actionpack (= 5.2.8.1)
- actionview (= 5.2.8.1)
- activejob (= 5.2.8.1)
+ actionmailbox (7.0.3.1)
+ actionpack (= 7.0.3.1)
+ activejob (= 7.0.3.1)
+ activerecord (= 7.0.3.1)
+ activestorage (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
+ mail (>= 2.7.1)
+ net-imap
+ net-pop
+ net-smtp
+ actionmailer (7.0.3.1)
+ actionpack (= 7.0.3.1)
+ actionview (= 7.0.3.1)
+ activejob (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
mail (~> 2.5, >= 2.5.4)
+ net-imap
+ net-pop
+ net-smtp
rails-dom-testing (~> 2.0)
- actionpack (5.2.8.1)
- actionview (= 5.2.8.1)
- activesupport (= 5.2.8.1)
- rack (~> 2.0, >= 2.0.8)
+ actionpack (7.0.3.1)
+ actionview (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
+ rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
+ actiontext (7.0.3.1)
+ actionpack (= 7.0.3.1)
+ activerecord (= 7.0.3.1)
+ activestorage (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
+ globalid (>= 0.6.0)
+ nokogiri (>= 1.8.5)
+ actionview (7.0.3.1)
+ activesupport (= 7.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
+ activejob (7.0.3.1)
+ activesupport (= 7.0.3.1)
globalid (>= 0.3.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.8.1)
- actionpack (= 5.2.8.1)
- activerecord (= 5.2.8.1)
- marcel (~> 1.0.0)
- activesupport (5.2.8.1)
+ activemodel (7.0.3.1)
+ activesupport (= 7.0.3.1)
+ activerecord (7.0.3.1)
+ activemodel (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
+ activestorage (7.0.3.1)
+ actionpack (= 7.0.3.1)
+ activejob (= 7.0.3.1)
+ activerecord (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
+ marcel (~> 1.0)
+ mini_mime (>= 1.1.0)
+ activesupport (7.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
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.12.0)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.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.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.10)
connection_pool (2.2.5)
crass (1.0.6)
+ digest (3.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.7)
tzinfo
execjs (2.8.1)
faraday (2.3.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.0.3)
ffi (1.15.5)
fugit (1.5.3)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
globalid (1.0.0)
activesupport (>= 5.0)
groupdate (6.1.0)
activesupport (>= 5.2)
httpclient (2.8.3)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
io-like (0.3.1)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
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.2)
minitest (5.16.2)
msgpack (1.5.3)
+ net-imap (0.2.3)
+ digest
+ net-protocol
+ strscan
+ net-pop (0.1.1)
+ digest
+ net-protocol
+ timeout
+ net-protocol (0.1.3)
+ timeout
net-scp (1.2.1)
net-ssh (>= 2.6.5)
+ net-smtp (0.3.1)
+ digest
+ net-protocol
+ timeout
net-ssh (7.0.1)
nio4r (2.5.8)
nokogiri (1.13.7-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.13.7-x86_64-linux)
- racc (~> 1.4)
pg (1.4.1)
public_suffix (4.0.7)
puma (5.6.4)
nio4r (~> 2.0)
raabro (1.4.0)
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.8.1)
- sprockets-rails (>= 2.0.0)
+ rails (7.0.3.1)
+ actioncable (= 7.0.3.1)
+ actionmailbox (= 7.0.3.1)
+ actionmailer (= 7.0.3.1)
+ actionpack (= 7.0.3.1)
+ actiontext (= 7.0.3.1)
+ actionview (= 7.0.3.1)
+ activejob (= 7.0.3.1)
+ activemodel (= 7.0.3.1)
+ activerecord (= 7.0.3.1)
+ activestorage (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
+ bundler (>= 1.15.0)
+ railties (= 7.0.3.1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
- railties (5.2.8.1)
- actionpack (= 5.2.8.1)
- activesupport (= 5.2.8.1)
+ railties (7.0.3.1)
+ actionpack (= 7.0.3.1)
+ activesupport (= 7.0.3.1)
method_source
- rake (>= 0.8.7)
- thor (>= 0.19.0, < 2.0)
+ rake (>= 12.2)
+ thor (~> 1.0)
+ zeitwerk (~> 2.5)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.7.1)
regexp_parser (2.5.0)
rexml (3.2.5)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
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 (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.5.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sidekiq-scheduler (4.0.2)
redis (>= 4.2.0)
rufus-scheduler (~> 3.2)
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.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
+ strscan (3.0.3)
telegram-bot (0.15.6)
actionpack (>= 4.0, < 7.1)
activesupport (>= 4.0, < 7.1)
httpclient (~> 2.7)
thor (1.2.1)
- thread_safe (0.3.6)
tilt (2.0.10)
+ timeout (0.3.0)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
- tzinfo (1.2.9)
- thread_safe (~> 0.1)
+ tzinfo (2.0.4)
+ concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
- web-console (3.7.0)
- actionview (>= 5.0)
- activemodel (>= 5.0)
+ web-console (4.2.0)
+ actionview (>= 6.0.0)
+ activemodel (>= 6.0.0)
bindex (>= 0.4.0)
- railties (>= 5.0)
+ railties (>= 6.0.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)
+ zeitwerk (2.6.0)
PLATFORMS
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
- rails (~> 5.2.3)
+ rails (~> 7.0)
rails-assets-sweetalert2 (~> 5.1.1)!
sass-rails (~> 5.0)
selenium-webdriver
sentry-raven
sidekiq
sidekiq-scheduler
spring
spring-watcher-listen (~> 2.0.0)
+ sprockets-rails
telegram-bot
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
RUBY VERSION
ruby 3.1.2p20
BUNDLED WITH
2.3.15
diff --git a/bin/rails b/bin/rails
index 5badb2f..efc0377 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
-begin
- load File.expand_path('../spring', __FILE__)
-rescue LoadError => e
- raise unless e.message.include?('spring')
-end
-APP_PATH = File.expand_path('../config/application', __dir__)
-require_relative '../config/boot'
-require 'rails/commands'
+APP_PATH = File.expand_path("../config/application", __dir__)
+require_relative "../config/boot"
+require "rails/commands"
diff --git a/bin/rake b/bin/rake
index d87d5f5..4fbf10b 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
-begin
- load File.expand_path('../spring', __FILE__)
-rescue LoadError => e
- raise unless e.message.include?('spring')
-end
-require_relative '../config/boot'
-require 'rake'
+require_relative "../config/boot"
+require "rake"
Rake.application.run
diff --git a/bin/setup b/bin/setup
index 94fd4d7..ec47b79 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,36 +1,33 @@
#!/usr/bin/env ruby
-require 'fileutils'
-include FileUtils
+require "fileutils"
# path to your application root.
-APP_ROOT = File.expand_path('..', __dir__)
+APP_ROOT = File.expand_path("..", __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
-chdir APP_ROOT do
- # This script is a starting point to setup your application.
+FileUtils.chdir APP_ROOT do
+ # This script is a way to set up or update your development environment automatically.
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
- puts '== Installing dependencies =='
- system! 'gem install bundler --conservative'
- system('bundle check') || system!('bundle install')
-
- # Install JavaScript dependencies if using Yarn
- # system('bin/yarn')
+ puts "== Installing dependencies =="
+ system! "gem install bundler --conservative"
+ system("bundle check") || system!("bundle install")
# puts "\n== Copying sample files =="
- # unless File.exist?('config/database.yml')
- # cp 'config/database.yml.sample', 'config/database.yml'
+ # unless File.exist?("config/database.yml")
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
puts "\n== Preparing database =="
- system! 'bin/rails db:setup'
+ system! "bin/rails db:prepare"
puts "\n== Removing old logs and tempfiles =="
- system! 'bin/rails log:clear tmp:clear'
+ system! "bin/rails log:clear tmp:clear"
puts "\n== Restarting application server =="
- system! 'bin/rails restart'
+ system! "bin/rails restart"
end
diff --git a/config/boot.rb b/config/boot.rb
index b9e460c..988a5dd 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,4 +1,4 @@
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
-require 'bundler/setup' # Set up gems listed in the Gemfile.
-require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
+require "bundler/setup" # Set up gems listed in the Gemfile.
+require "bootsnap/setup" # Speed up boot time by caching expensive operations.
diff --git a/config/deploy.rb b/config/deploy.rb
index 4be41db..0da6bb8 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -1,96 +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/asdbot.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 :branch, "master"
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/environment.rb b/config/environment.rb
index 426333b..cac5315 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,5 +1,5 @@
# Load the Rails application.
-require_relative 'application'
+require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
index d3bcaa5..54f47cf 100644
--- a/config/initializers/content_security_policy.rb
+++ b/config/initializers/content_security_policy.rb
@@ -1,25 +1,25 @@
# Be sure to restart your server when you modify this file.
-# Define an application-wide content security policy
-# For further information see the following documentation
-# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
+# Define an application-wide content security policy.
+# See the Securing Rails Applications Guide for more information:
+# https://guides.rubyonrails.org/security.html#content-security-policy-header
-# Rails.application.config.content_security_policy do |policy|
-# policy.default_src :self, :https
-# policy.font_src :self, :https, :data
-# policy.img_src :self, :https, :data
-# policy.object_src :none
-# policy.script_src :self, :https
-# policy.style_src :self, :https
-
-# # Specify URI for violation reports
-# # policy.report_uri "/csp-violation-report-endpoint"
+# Rails.application.configure do
+# config.content_security_policy do |policy|
+# policy.default_src :self, :https
+# policy.font_src :self, :https, :data
+# policy.img_src :self, :https, :data
+# policy.object_src :none
+# policy.script_src :self, :https
+# policy.style_src :self, :https
+# # Specify URI for violation reports
+# # policy.report_uri "/csp-violation-report-endpoint"
+# end
+#
+# # Generate session nonces for permitted importmap and inline scripts
+# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
+# config.content_security_policy_nonce_directives = %w(script-src)
+#
+# # Report violations without enforcing the policy.
+# # config.content_security_policy_report_only = true
# end
-
-# If you are using UJS then enable automatic nonce generation
-# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
-
-# Report CSP violations to a specified URI
-# For further information see the following documentation:
-# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
-# Rails.application.config.content_security_policy_report_only = true
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index 4a994e1..adc6568 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -1,4 +1,8 @@
# Be sure to restart your server when you modify this file.
-# Configure sensitive parameters which will be filtered from the log file.
-Rails.application.config.filter_parameters += [:password]
+# Configure parameters to be filtered from the log file. Use this to limit dissemination of
+# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
+# notations and behaviors.
+Rails.application.config.filter_parameters += [
+ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
+]
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index ac033bf..3860f65 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -1,16 +1,16 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
+# inflect.plural /^(ox)$/i, "\\1en"
+# inflect.singular /^(ox)en/i, "\\1"
+# inflect.irregular "person", "people"
# inflect.uncountable %w( fish sheep )
# end
# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
-# inflect.acronym 'RESTful'
+# inflect.acronym "RESTful"
# end
diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb
new file mode 100644
index 0000000..a579326
--- /dev/null
+++ b/config/initializers/new_framework_defaults_7_0.rb
@@ -0,0 +1,117 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file eases your Rails 7.0 framework defaults upgrade.
+#
+# Uncomment each configuration one by one to switch to the new default.
+# Once your application is ready to run with all new defaults, you can remove
+# this file and set the `config.load_defaults` to `7.0`.
+#
+# Read the Guide for Upgrading Ruby on Rails for more info on each option.
+# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
+
+# `button_to` view helper will render `<button>` element, regardless of whether
+# or not the content is passed as the first argument or as a block.
+# Rails.application.config.action_view.button_to_generates_button_tag = true
+
+# `stylesheet_link_tag` view helper will not render the media attribute by default.
+# Rails.application.config.action_view.apply_stylesheet_media_default = false
+
+# Change the digest class for the key generators to `OpenSSL::Digest::SHA256`.
+# Changing this default means invalidate all encrypted messages generated by
+# your application and, all the encrypted cookies. Only change this after you
+# rotated all the messages using the key rotator.
+#
+# See upgrading guide for more information on how to build a rotator.
+# https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html
+# Rails.application.config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA256
+
+# Change the digest class for ActiveSupport::Digest.
+# Changing this default means that for example Etags change and
+# various cache keys leading to cache invalidation.
+# Rails.application.config.active_support.hash_digest_class = OpenSSL::Digest::SHA256
+
+# Don't override ActiveSupport::TimeWithZone.name and use the default Ruby
+# implementation.
+# Rails.application.config.active_support.remove_deprecated_time_with_zone_name = true
+
+# Change the format of the cache entry.
+# Changing this default means that all new cache entries added to the cache
+# will have a different format that is not supported by Rails 6.1 applications.
+# Only change this value after your application is fully deployed to Rails 7.0
+# and you have no plans to rollback.
+# Rails.application.config.active_support.cache_format_version = 7.0
+
+# Calls `Rails.application.executor.wrap` around test cases.
+# This makes test cases behave closer to an actual request or job.
+# Several features that are normally disabled in test, such as Active Record query cache
+# and asynchronous queries will then be enabled.
+# Rails.application.config.active_support.executor_around_test_case = true
+
+# Define the isolation level of most of Rails internal state.
+# If you use a fiber based server or job processor, you should set it to `:fiber`.
+# Otherwise the default of `:thread` if preferable.
+# Rails.application.config.active_support.isolation_level = :thread
+
+# Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method.
+# Rails.application.config.action_mailer.smtp_timeout = 5
+
+# The ActiveStorage video previewer will now use scene change detection to generate
+# better preview images (rather than the previous default of using the first frame
+# of the video).
+# Rails.application.config.active_storage.video_preview_arguments =
+# "-vf 'select=eq(n\\,0)+eq(key\\,1)+gt(scene\\,0.015),loop=loop=-1:size=2,trim=start_frame=1' -frames:v 1 -f image2"
+
+# Automatically infer `inverse_of` for associations with a scope.
+# Rails.application.config.active_record.automatic_scope_inversing = true
+
+# Raise when running tests if fixtures contained foreign key violations
+# Rails.application.config.active_record.verify_foreign_keys_for_fixtures = true
+
+# Disable partial inserts.
+# This default means that all columns will be referenced in INSERT queries
+# regardless of whether they have a default or not.
+# Rails.application.config.active_record.partial_inserts = false
+#
+# Protect from open redirect attacks in `redirect_back_or_to` and `redirect_to`.
+# Rails.application.config.action_controller.raise_on_open_redirects = true
+
+# Change the variant processor for Active Storage.
+# Changing this default means updating all places in your code that
+# generate variants to use image processing macros and ruby-vips
+# operations. See the upgrading guide for detail on the changes required.
+# The `:mini_magick` option is not deprecated; it's fine to keep using it.
+# Rails.application.config.active_storage.variant_processor = :vips
+
+# If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
+# was `:marshal`. Convert all cookies to JSON, using the `:hybrid` formatter.
+#
+# If you're confident all your cookies are JSON formatted, you can switch to the `:json` formatter.
+#
+# Continue to use `:marshal` for backward-compatibility with old cookies.
+#
+# If you have configured the serializer elsewhere, you can remove this.
+#
+# See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
+# Rails.application.config.action_dispatch.cookies_serializer = :hybrid
+
+# Enable parameter wrapping for JSON.
+# Previously this was set in an initializer. It's fine to keep using that initializer if you've customized it.
+# To disable parameter wrapping entirely, set this config to `false`.
+# Rails.application.config.action_controller.wrap_parameters_by_default = true
+
+# Specifies whether generated namespaced UUIDs follow the RFC 4122 standard for namespace IDs provided as a
+# `String` to `Digest::UUID.uuid_v3` or `Digest::UUID.uuid_v5` method calls.
+#
+# See https://guides.rubyonrails.org/configuring.html#config-active-support-use-rfc4122-namespaced-uuids for
+# more information.
+# Rails.application.config.active_support.use_rfc4122_namespaced_uuids = true
+
+# Change the default headers to disable browsers' flawed legacy XSS protection.
+# Rails.application.config.action_dispatch.default_headers = {
+# "X-Frame-Options" => "SAMEORIGIN",
+# "X-XSS-Protection" => "0",
+# "X-Content-Type-Options" => "nosniff",
+# "X-Download-Options" => "noopen",
+# "X-Permitted-Cross-Domain-Policies" => "none",
+# "Referrer-Policy" => "strict-origin-when-cross-origin"
+# }
diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb
new file mode 100644
index 0000000..00f64d7
--- /dev/null
+++ b/config/initializers/permissions_policy.rb
@@ -0,0 +1,11 @@
+# Define an application-wide HTTP permissions policy. For further
+# information see https://developers.google.com/web/updates/2018/06/feature-policy
+#
+# Rails.application.config.permissions_policy do |f|
+# f.camera :none
+# f.gyroscope :none
+# f.microphone :none
+# f.usb :none
+# f.fullscreen :self
+# f.payment :self, "https://secure.example.com"
+# end
diff --git a/db/migrate/20220719101139_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20220719101139_add_service_name_to_active_storage_blobs.active_storage.rb
new file mode 100644
index 0000000..a15c6ce
--- /dev/null
+++ b/db/migrate/20220719101139_add_service_name_to_active_storage_blobs.active_storage.rb
@@ -0,0 +1,22 @@
+# This migration comes from active_storage (originally 20190112182829)
+class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
+ def up
+ return unless table_exists?(:active_storage_blobs)
+
+ unless column_exists?(:active_storage_blobs, :service_name)
+ add_column :active_storage_blobs, :service_name, :string
+
+ if configured_service = ActiveStorage::Blob.service.name
+ ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
+ end
+
+ change_column :active_storage_blobs, :service_name, :string, null: false
+ end
+ end
+
+ def down
+ return unless table_exists?(:active_storage_blobs)
+
+ remove_column :active_storage_blobs, :service_name
+ end
+end
diff --git a/db/migrate/20220719101140_create_active_storage_variant_records.active_storage.rb b/db/migrate/20220719101140_create_active_storage_variant_records.active_storage.rb
new file mode 100644
index 0000000..94ac83a
--- /dev/null
+++ b/db/migrate/20220719101140_create_active_storage_variant_records.active_storage.rb
@@ -0,0 +1,27 @@
+# This migration comes from active_storage (originally 20191206030411)
+class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
+ def change
+ return unless table_exists?(:active_storage_blobs)
+
+ # Use Active Record's configured type for primary key
+ create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
+ t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
+ t.string :variation_digest, null: false
+
+ t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
+ t.foreign_key :active_storage_blobs, column: :blob_id
+ end
+ end
+
+ private
+ def primary_key_type
+ config = Rails.configuration.generators
+ config.options[config.orm][:primary_key_type] || :primary_key
+ end
+
+ def blobs_primary_key_type
+ pkey_name = connection.primary_key(:active_storage_blobs)
+ pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name }
+ pkey_column.bigint? ? :bigint : pkey_column.type
+ end
+end
diff --git a/db/migrate/20220719101141_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb b/db/migrate/20220719101141_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
new file mode 100644
index 0000000..93c8b85
--- /dev/null
+++ b/db/migrate/20220719101141_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
@@ -0,0 +1,8 @@
+# This migration comes from active_storage (originally 20211119233751)
+class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
+ def change
+ return unless table_exists?(:active_storage_blobs)
+
+ change_column_null(:active_storage_blobs, :checksum, true)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index f9f3fac..a1226a9 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,79 +1,79 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_12_30_130749) do
+ActiveRecord::Schema[6.1].define(version: 2021_12_30_130749) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "asds", force: :cascade do |t|
t.bigint "group_id"
t.bigint "sender_id"
t.bigint "update_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "text"
t.boolean "nightsend"
t.integer "multiple_times"
t.index ["group_id"], name: "index_asds_on_group_id"
t.index ["sender_id"], name: "index_asds_on_sender_id"
end
create_table "crono_jobs", force: :cascade do |t|
t.string "job_id", null: false
t.text "log"
t.datetime "last_performed_at"
t.boolean "healthy"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["job_id"], name: "index_crono_jobs_on_job_id", unique: true
end
create_table "groups", force: :cascade do |t|
t.bigint "chat_id"
t.string "username"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "welcomesent", default: false
t.boolean "nightsend"
t.string "title"
t.boolean "classifica", default: true
t.boolean "silent", default: false
t.boolean "admin"
t.boolean "deletenotasd"
t.boolean "eliminazione", default: false
end
create_table "senders", force: :cascade do |t|
t.bigint "chat_id"
t.string "username"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
t.boolean "classifica", default: true
end
create_table "special_events", force: :cascade do |t|
t.bigint "group_id"
t.string "text"
t.bigint "asd_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["asd_id"], name: "index_special_events_on_asd_id"
t.index ["group_id"], name: "index_special_events_on_group_id"
end
add_foreign_key "asds", "groups"
add_foreign_key "asds", "senders"
add_foreign_key "special_events", "asds"
add_foreign_key "special_events", "groups"
end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Jun 24, 21:50 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1975698
Default Alt Text
(37 KB)
Attached To
Mode
R36 asd bot
Attached
Detach File
Event Timeline