From fa19f1ec9641417a9157329de69f1492d58c82bc Mon Sep 17 00:00:00 2001 From: f Date: Sat, 4 Apr 2020 15:52:29 -0300 Subject: [PATCH 1/8] =?UTF-8?q?actualizaci=C3=B3n=20de=20seguridad=20a=20r?= =?UTF-8?q?uby=202.6.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ruby-version | 2 +- Dockerfile | 5 +++-- Gemfile | 2 +- Gemfile.lock | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.ruby-version b/.ruby-version index 57cf282e..338a5b5d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +2.6.6 diff --git a/Dockerfile b/Dockerfile index 634c264a..8a5978b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,6 @@ MAINTAINER "f " ARG RAILS_MASTER_KEY # Un entorno base -ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=1 ENV SECRET_KEY_BASE solo_es_necesaria_para_correr_rake ENV RAILS_ENV production ENV RAILS_MASTER_KEY=$RAILS_MASTER_KEY @@ -17,6 +16,8 @@ ENV RAILS_MASTER_KEY=$RAILS_MASTER_KEY RUN apk add --no-cache libxslt libxml2 tzdata ruby ruby-bundler ruby-json ruby-bigdecimal ruby-rake RUN apk add --no-cache postgresql-libs git yarn brotli libssh2 python +RUN test "2.6.6" = `ruby -e 'puts RUBY_VERSION'` + # https://github.com/rubygems/rubygems/issues/2918 # https://gitlab.alpinelinux.org/alpine/aports/issues/10808 COPY ./rubygems-platform-musl.patch /tmp/ @@ -78,7 +79,7 @@ RUN apk add --no-cache libxslt libxml2 tzdata ruby ruby-bundler ruby-json ruby-b RUN apk add --no-cache postgresql-libs libssh2 file rsync git jpegoptim vips # Chequear que la versión de ruby sea la correcta -RUN test "2.6.5" = `ruby -e 'puts RUBY_VERSION'` +RUN test "2.6.6" = `ruby -e 'puts RUBY_VERSION'` # https://github.com/rubygems/rubygems/issues/2918 # https://gitlab.alpinelinux.org/alpine/aports/issues/10808 diff --git a/Gemfile b/Gemfile index fbde9705..c70e7574 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ git_source(:github) do |repo_name| end # Cambiar en Dockerfile también -ruby '2.6.5' +ruby '2.6.6' gem 'dotenv-rails', require: 'dotenv/rails-now' diff --git a/Gemfile.lock b/Gemfile.lock index 5e41526d..39917b51 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -266,7 +266,7 @@ GEM pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) - public_suffix (4.0.3) + public_suffix (4.0.4) puma (4.3.3) nio4r (~> 2.0) pundit (2.1.0) @@ -500,7 +500,7 @@ DEPENDENCIES yaml_db! RUBY VERSION - ruby 2.6.5p114 + ruby 2.6.6p146 BUNDLED WITH 2.1.4 From fd4d302e3bf297db9aaef44844963de8103a522d Mon Sep 17 00:00:00 2001 From: f Date: Mon, 6 Apr 2020 19:03:49 -0300 Subject: [PATCH 2/8] typo --- app/jobs/deploy_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/deploy_job.rb b/app/jobs/deploy_job.rb index a115720a..7f42e306 100644 --- a/app/jobs/deploy_job.rb +++ b/app/jobs/deploy_job.rb @@ -45,7 +45,7 @@ class DeployJob < ApplicationJob end def notify_usuaries - @site.roles.where(rol: 'usuarie', temporal: false).pluck(:usuaries_id).each do |usuarie| + @site.roles.where(rol: 'usuarie', temporal: false).pluck(:usuarie_id).each do |usuarie| DeployMailer.with(usuarie: usuarie, site: @site.id) .deployed(@deployed) .deliver_now From 84dff2537b78d386087430d5109bcf57f32c7dac Mon Sep 17 00:00:00 2001 From: f Date: Mon, 6 Apr 2020 19:21:14 -0300 Subject: [PATCH 3/8] traer el layout del post no de los parametros --- app/views/posts/_form.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 573389fb..27d1953d 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -19,7 +19,7 @@ -# Botones de guardado = render 'posts/submit', site: site, post: post - = hidden_field_tag 'post[layout]', params[:layout] || 'post' + = hidden_field_tag 'post[layout]', post.layout.name -# Dibuja cada atributo - post.attributes.each do |attribute| From 7f8cfeaa5644e0e02b8d9ec123e9db5cabcfd31d Mon Sep 17 00:00:00 2001 From: f Date: Tue, 7 Apr 2020 18:17:21 -0300 Subject: [PATCH 4/8] Actualizar sutty-jekyll-theme --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 39917b51..744f0232 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -388,7 +388,7 @@ GEM sqlite3 (1.4.2) sucker_punch (2.1.2) concurrent-ruby (~> 1.0) - sutty-jekyll-theme (0.1.0) + sutty-jekyll-theme (0.1.1) jekyll (~> 4.0) jekyll-feed (~> 0.9) jekyll-images (~> 0.2) From b692693c435224ba4fdb0af99bab32a4fd4b0b23 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 9 Apr 2020 18:58:15 -0300 Subject: [PATCH 5/8] =?UTF-8?q?actualizaci=C3=B3n=20de=20sutty-jekyll-them?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 744f0232..57b09870 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -388,7 +388,7 @@ GEM sqlite3 (1.4.2) sucker_punch (2.1.2) concurrent-ruby (~> 1.0) - sutty-jekyll-theme (0.1.1) + sutty-jekyll-theme (0.1.2) jekyll (~> 4.0) jekyll-feed (~> 0.9) jekyll-images (~> 0.2) From 6db0f3b97b02ffab9ffc651c31c09e3c83670e7b Mon Sep 17 00:00:00 2001 From: f Date: Mon, 13 Apr 2020 18:01:45 -0300 Subject: [PATCH 6/8] traducir layout en la tabla de articulos tambien --- app/views/posts/index.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index ee8355a6..5242a340 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -52,7 +52,7 @@ value: @posts.length - i, class: 'reorder' %td %small - = link_to post.layout.name.to_s.humanize, + = link_to @site.i18n.dig('layouts', layout.to_s) || layout.to_s.humanize, site_posts_path(@site, layout: post.layout.name) %br/ = link_to post.title.value, From 2e3640e58bf9fca968d4bc9ef6fde2ff19b8fd9c Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Apr 2020 14:48:12 -0300 Subject: [PATCH 7/8] mostrar los layouts de verdad --- app/views/posts/index.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 5242a340..534805a8 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -52,7 +52,7 @@ value: @posts.length - i, class: 'reorder' %td %small - = link_to @site.i18n.dig('layouts', layout.to_s) || layout.to_s.humanize, + = link_to @site.i18n.dig('layouts', post.layout.name.to_s) || post.layout.name.to_s.humanize, site_posts_path(@site, layout: post.layout.name) %br/ = link_to post.title.value, From 0312466db96534d7b9b93286f9ce054580a9b0ec Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Apr 2020 19:07:46 -0300 Subject: [PATCH 8/8] eliminar rbnacl e instalar benchmarks --- Gemfile | 7 ++----- Gemfile.lock | 25 ++++++++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index c70e7574..f3d40206 100644 --- a/Gemfile +++ b/Gemfile @@ -77,23 +77,20 @@ group :themes do end group :development, :test do + gem 'derailed_benchmarks' gem 'pry' # Adds support for Capybara system testing and selenium driver gem 'capybara', '~> 2.13' gem 'selenium-webdriver' gem 'sqlite3' + gem 'stackprof' end group :development do - # Access an IRB console on exception pages or by using <%= console %> - # anywhere in the code. - gem 'bcrypt_pbkdf' gem 'brakeman' - gem 'ed25519' gem 'haml-lint', require: false gem 'letter_opener' gem 'listen', '>= 3.0.5', '< 3.2' - gem 'rbnacl', '< 5.0' gem 'rubocop-rails' gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 57b09870..fa6041a0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,7 +77,7 @@ GEM autoprefixer-rails (9.7.4) execjs bcrypt (3.1.13) - bcrypt_pbkdf (1.0.1) + benchmark-ips (2.7.2) bindex (0.8.1) blazer (2.2.1) activerecord (>= 5) @@ -106,6 +106,15 @@ GEM concurrent-ruby (1.1.6) crass (1.0.6) database_cleaner (1.8.3) + derailed_benchmarks (1.6.0) + benchmark-ips (~> 2) + get_process_mem (~> 0) + heapy (~> 0) + memory_profiler (~> 0) + rack (>= 1) + rake (> 10, < 14) + ruby-statistics (>= 2.1) + thor (>= 0.19, < 2) devise (4.7.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -121,7 +130,6 @@ GEM dotenv-rails (2.7.5) dotenv (= 2.7.5) railties (>= 3.2, < 6.1) - ed25519 (1.2.4) editorial-autogestiva-jekyll-theme (0.2.2) jekyll (~> 4.0) jekyll-data (~> 1.1) @@ -153,6 +161,8 @@ GEM forwardable-extended (2.6.0) friendly_id (5.3.0) activerecord (>= 4.0.0) + get_process_mem (0.2.5) + ffi (~> 1.0) globalid (0.4.2) activesupport (>= 4.2.0) haml (5.1.2) @@ -174,6 +184,7 @@ GEM activesupport (>= 4.0.1) hamlit (>= 1.2.0) railties (>= 4.0.1) + heapy (0.1.4) hiredis (0.6.3) http_parser.rb (0.6.0) i18n (1.8.2) @@ -237,6 +248,7 @@ GEM mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) + memory_profiler (0.9.14) mercenary (0.3.6) method_source (0.9.2) mimemagic (0.3.4) @@ -312,8 +324,6 @@ GEM rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) - rbnacl (4.0.2) - ffi redis (4.1.3) redis-actionpack (5.2.0) actionpack (>= 5, < 7) @@ -353,6 +363,7 @@ GEM i18n ruby-filemagic (0.7.2) ruby-progressbar (1.10.1) + ruby-statistics (2.1.2) ruby-vips (2.0.17) ffi (~> 1.9) ruby_dep (1.5.0) @@ -386,6 +397,7 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.4.2) + stackprof (0.2.15) sucker_punch (2.1.2) concurrent-ruby (~> 1.0) sutty-jekyll-theme (0.1.2) @@ -440,18 +452,17 @@ PLATFORMS DEPENDENCIES bcrypt (~> 3.1.7) - bcrypt_pbkdf blazer bootstrap (~> 4) brakeman capybara (~> 2.13) commonmarker database_cleaner + derailed_benchmarks devise devise-i18n devise_invitable dotenv-rails - ed25519 editorial-autogestiva-jekyll-theme email_address exception_notification @@ -477,7 +488,6 @@ DEPENDENCIES rails (~> 6) rails-i18n rails_warden - rbnacl (< 5.0) redis redis-rails rubocop-rails @@ -488,6 +498,7 @@ DEPENDENCIES spring spring-watcher-listen (~> 2.0.0) sqlite3 + stackprof sucker_punch sutty-jekyll-theme terminal-table