From 6aa4eb7778c7667ff1b37ab05c246d9c1b3ab824 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 12 Mar 2020 23:54:17 +0100 Subject: [PATCH] Bump Decidim to 0.20.0 + install imagick --- lxc-apps/decidim/install/adminpwd.rb | 3 +- .../decidim_conf/environments/production.rb | 204 +++++++------- .../decidim_conf/initializers/decidim.rb | 250 +++++++++--------- lxc-apps/decidim/lxc/srv/decidim-app/Gemfile | 10 +- lxc-apps/decidim/lxcfile | 5 +- lxc-apps/decidim/meta | 4 +- 6 files changed, 237 insertions(+), 239 deletions(-) diff --git a/lxc-apps/decidim/install/adminpwd.rb b/lxc-apps/decidim/install/adminpwd.rb index 6975985..05ae434 100644 --- a/lxc-apps/decidim/install/adminpwd.rb +++ b/lxc-apps/decidim/install/adminpwd.rb @@ -1,3 +1,2 @@ -user = Decidim::System::Admin.new(email: "${DECIDIM_ADMIN_EMAIL}", password: "${DECIDIM_ADMIN_PWD}", password_confirmation: "${DECIDIM_ADMIN_PWD}") -user.save! +Decidim::System::Admin.create!(email: "${DECIDIM_ADMIN_EMAIL}", password: "${DECIDIM_ADMIN_PWD}", password_confirmation: "${DECIDIM_ADMIN_PWD}") quit diff --git a/lxc-apps/decidim/install/decidim_conf/environments/production.rb b/lxc-apps/decidim/install/decidim_conf/environments/production.rb index f380efd..8ae8b70 100644 --- a/lxc-apps/decidim/install/decidim_conf/environments/production.rb +++ b/lxc-apps/decidim/install/decidim_conf/environments/production.rb @@ -1,104 +1,104 @@ Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Compress JavaScripts and CSS. - config.assets.js_compressor = Uglifier.new(:harmony => true) - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - - # Store uploaded files on the local file system (see config/storage.yml for options) - config.active_storage.service = :local - - # Mount Action Cable outside main process or domain - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = true - - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. - config.log_level = :info - - # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment) - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "decidim-app_#{Rails.env}" - - config.action_mailer.perform_caching = false - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - config.action_mailer.smtp_settings = { - :address => Rails.application.secrets.smtp_address, - :port => Rails.application.secrets.smtp_port, - :authentication => Rails.application.secrets.smtp_authentication, - :user_name => Rails.application.secrets.smtp_username, - :password => Rails.application.secrets.smtp_password, - :domain => Rails.application.secrets.smtp_domain, - :enable_starttls_auto => Rails.application.secrets.smtp_starttls_auto, - :openssl_verify_mode => 'none' - } - - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = Uglifier.new(:harmony => true) + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options) + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :info + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "decidim-app_#{Rails.env}" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + config.action_mailer.smtp_settings = { + :address => Rails.application.secrets.smtp_address, + :port => Rails.application.secrets.smtp_port, + :authentication => Rails.application.secrets.smtp_authentication, + :user_name => Rails.application.secrets.smtp_username, + :password => Rails.application.secrets.smtp_password, + :domain => Rails.application.secrets.smtp_domain, + :enable_starttls_auto => Rails.application.secrets.smtp_starttls_auto, + :openssl_verify_mode => 'none' + } + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/lxc-apps/decidim/install/decidim_conf/initializers/decidim.rb b/lxc-apps/decidim/install/decidim_conf/initializers/decidim.rb index 178c78b..9debe4e 100644 --- a/lxc-apps/decidim/install/decidim_conf/initializers/decidim.rb +++ b/lxc-apps/decidim/install/decidim_conf/initializers/decidim.rb @@ -1,128 +1,128 @@ # frozen_string_literal: true Decidim.configure do |config| - config.application_name = "Decidim" - config.mailer_sender = "admin@example.com" - - # Change these lines to set your preferred locales - config.default_locale = :cs - config.available_locales = [:cs, :sk, :en, :de, :fr, :es] - - # Geocoder configuration - # config.geocoder = { - # static_map_url: "https://image.maps.cit.api.here.com/mia/1.6/mapview", - # here_app_id: Rails.application.secrets.geocoder[:here_app_id], - # here_app_code: Rails.application.secrets.geocoder[:here_app_code] - # } - - # Custom resource reference generator method - # config.reference_generator = lambda do |resource, component| - # # Implement your custom method to generate resources references - # "1234-#{resource.id}" - # end - - # Currency unit - # config.currency_unit = "€" - - # The number of reports which an object can receive before hiding it - # config.max_reports_before_hiding = 3 - - # Custom HTML Header snippets - # - # The most common use is to integrate third-party services that require some - # extra JavaScript or CSS. Also, you can use it to add extra meta tags to the - # HTML. Note that this will only be rendered in public pages, not in the admin - # section. - # - # Before enabling this you should ensure that any tracking that might be done - # is in accordance with the rules and regulations that apply to your - # environment and usage scenarios. This component also comes with the risk - # that an organization's administrator injects malicious scripts to spy on or - # take over user accounts. - # - config.enable_html_header_snippets = false - - # SMS gateway configuration - # - # If you want to verify your users by sending a verification code via - # SMS you need to provide a SMS gateway service class. - # - # An example class would be something like: - # - # class MySMSGatewayService - # attr_reader :mobile_phone_number, :code - # - # def initialize(mobile_phone_number, code) - # @mobile_phone_number = mobile_phone_number - # @code = code - # end - # - # def deliver_code - # # Actual code to deliver the code - # true - # end - # end - # - # config.sms_gateway_service = "MySMSGatewayService" - - # Timestamp service configuration - # - # Provide a class to generate a timestamp for a document. The instances of - # this class are initialized with a hash containing the :document key with - # the document to be timestamped as value. The istances respond to a - # timestamp public method with the timestamp - # - # An example class would be something like: - # - # class MyTimestampService - # attr_accessor :document - # - # def initialize(args = {}) - # @document = args.fetch(:document) - # end - # - # def timestamp - # # Code to generate timestamp - # "My timestamp" - # end - # end - # - # config.timestamp_service = "MyTimestampService" - - # PDF signature service configuration - # - # Provide a class to process a pdf and return the document including a - # digital signature. The instances of this class are initialized with a hash - # containing the :pdf key with the pdf file content as value. The instances - # respond to a signed_pdf method containing the pdf with the signature - # - # An example class would be something like: - # - # class MyPDFSignatureService - # attr_accessor :pdf - # - # def initialize(args = {}) - # @pdf = args.fetch(:pdf) - # end - # - # def signed_pdf - # # Code to return the pdf signed - # end - # end - # - # config.pdf_signature_service = "MyPDFSignatureService" - - # Etherpad configuration - # - # Only needed if you want to have Etherpad integration with Decidim. See - # Decidim docs at docs/services/etherpad.md in order to set it up. - # - # config.etherpad = { - # server: Rails.application.secrets.etherpad[:server], - # api_key: Rails.application.secrets.etherpad[:api_key], - # api_version: Rails.application.secrets.etherpad[:api_version] - # } - end - - Rails.application.config.i18n.available_locales = Decidim.available_locales - Rails.application.config.i18n.default_locale = Decidim.default_locale + config.application_name = "Decidim" + config.mailer_sender = "admin@example.com" + + # Change these lines to set your preferred locales + config.default_locale = :cs + config.available_locales = [:cs, :sk, :en, :de, :fr, :es] + + # Geocoder configuration + # config.geocoder = { + # static_map_url: "https://image.maps.cit.api.here.com/mia/1.6/mapview", + # here_app_id: Rails.application.secrets.geocoder[:here_app_id], + # here_app_code: Rails.application.secrets.geocoder[:here_app_code] + # } + + # Custom resource reference generator method + # config.reference_generator = lambda do |resource, component| + # # Implement your custom method to generate resources references + # "1234-#{resource.id}" + # end + + # Currency unit + # config.currency_unit = "€" + + # The number of reports which an object can receive before hiding it + # config.max_reports_before_hiding = 3 + + # Custom HTML Header snippets + # + # The most common use is to integrate third-party services that require some + # extra JavaScript or CSS. Also, you can use it to add extra meta tags to the + # HTML. Note that this will only be rendered in public pages, not in the admin + # section. + # + # Before enabling this you should ensure that any tracking that might be done + # is in accordance with the rules and regulations that apply to your + # environment and usage scenarios. This component also comes with the risk + # that an organization's administrator injects malicious scripts to spy on or + # take over user accounts. + # + config.enable_html_header_snippets = false + + # SMS gateway configuration + # + # If you want to verify your users by sending a verification code via + # SMS you need to provide a SMS gateway service class. + # + # An example class would be something like: + # + # class MySMSGatewayService + # attr_reader :mobile_phone_number, :code + # + # def initialize(mobile_phone_number, code) + # @mobile_phone_number = mobile_phone_number + # @code = code + # end + # + # def deliver_code + # # Actual code to deliver the code + # true + # end + # end + # + # config.sms_gateway_service = "MySMSGatewayService" + + # Timestamp service configuration + # + # Provide a class to generate a timestamp for a document. The instances of + # this class are initialized with a hash containing the :document key with + # the document to be timestamped as value. The istances respond to a + # timestamp public method with the timestamp + # + # An example class would be something like: + # + # class MyTimestampService + # attr_accessor :document + # + # def initialize(args = {}) + # @document = args.fetch(:document) + # end + # + # def timestamp + # # Code to generate timestamp + # "My timestamp" + # end + # end + # + # config.timestamp_service = "MyTimestampService" + + # PDF signature service configuration + # + # Provide a class to process a pdf and return the document including a + # digital signature. The instances of this class are initialized with a hash + # containing the :pdf key with the pdf file content as value. The instances + # respond to a signed_pdf method containing the pdf with the signature + # + # An example class would be something like: + # + # class MyPDFSignatureService + # attr_accessor :pdf + # + # def initialize(args = {}) + # @pdf = args.fetch(:pdf) + # end + # + # def signed_pdf + # # Code to return the pdf signed + # end + # end + # + # config.pdf_signature_service = "MyPDFSignatureService" + + # Etherpad configuration + # + # Only needed if you want to have Etherpad integration with Decidim. See + # Decidim docs at docs/services/etherpad.md in order to set it up. + # + # config.etherpad = { + # server: Rails.application.secrets.etherpad[:server], + # api_key: Rails.application.secrets.etherpad[:api_key], + # api_version: Rails.application.secrets.etherpad[:api_version] + # } +end + +Rails.application.config.i18n.available_locales = Decidim.available_locales +Rails.application.config.i18n.default_locale = Decidim.default_locale diff --git a/lxc-apps/decidim/lxc/srv/decidim-app/Gemfile b/lxc-apps/decidim/lxc/srv/decidim-app/Gemfile index 226430c..911bec8 100644 --- a/lxc-apps/decidim/lxc/srv/decidim-app/Gemfile +++ b/lxc-apps/decidim/lxc/srv/decidim-app/Gemfile @@ -4,13 +4,13 @@ source "https://rubygems.org" ruby RUBY_VERSION -gem "decidim", "0.19.0" -# gem "decidim-consultations", "0.19.0" -# gem "decidim-initiatives", "0.19.0" +gem "decidim", "0.20.0" +# gem "decidim-consultations", "0.20.0" +# gem "decidim-initiatives", "0.20.0" gem "bootsnap", "~> 1.3" -gem "puma", "~> 3.12" +gem "puma", "~> 3.12.2" gem "uglifier", "~> 4.1" gem "faker", "~> 1.9" @@ -18,7 +18,7 @@ gem "faker", "~> 1.9" group :development, :test do gem "byebug", "~> 11.0", platform: :mri - gem "decidim-dev", "0.19.0" + gem "decidim-dev", "0.20.0" end group :development do diff --git a/lxc-apps/decidim/lxcfile b/lxc-apps/decidim/lxcfile index f92a743..3c312d7 100644 --- a/lxc-apps/decidim/lxcfile +++ b/lxc-apps/decidim/lxcfile @@ -1,4 +1,4 @@ -IMAGE decidim_0.0.1-191113 +IMAGE decidim_0.20.0-191113 FROM alpine3.9-ruby2.6_2.6.3-190620 # https://github.com/Platoniq/decidim-install/blob/master/decidim-bionic.md @@ -8,7 +8,7 @@ ENV RAILS_ENV production RUN EOF # Install runtime dependencies - apk --no-cache add curl libpq nodejs pcre procps tzdata + apk --no-cache add curl imagemagick libpq nodejs pcre procps tzdata # Install build dependencies apk --no-cache add --virtual .deps build-base curl-dev icu-dev libxml2-dev libxslt-dev linux-headers pcre-dev postgresql-dev zlib-dev @@ -49,7 +49,6 @@ RUN EOF rm -f /etc/nginx/*.default # Install Decidim - gem install bundler:1.17.3 bundle config build.nokogiri --use-system-libraries gem install decidim cd /srv diff --git a/lxc-apps/decidim/meta b/lxc-apps/decidim/meta index c544bc9..41d7ed6 100644 --- a/lxc-apps/decidim/meta +++ b/lxc-apps/decidim/meta @@ -1,5 +1,5 @@ { - "version": "0.0.1-191113", + "version": "0.20.0-191113", "meta": { "title": "Decidim", "desc-cs": "Platforma pro účast občanů", @@ -8,7 +8,7 @@ }, "containers": { "decidim": { - "image": "decidim_0.0.1-191113", + "image": "decidim_0.20.0-191113", "depends": [ "decidim-postgres" ],