Skip to content

Instantly share code, notes, and snippets.

@takahashim
Last active August 21, 2023 16:38
Show Gist options
  • Save takahashim/efec065b9e7e4ea7bea69e9d5f7ce1d4 to your computer and use it in GitHub Desktop.
Save takahashim/efec065b9e7e4ea7bea69e9d5f7ce1d4 to your computer and use it in GitHub Desktop.
diff -uwbNr decidim-cfj/config/application.rb decidim/development_app/config/application.rb
--- decidim-cfj/config/application.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/application.rb 2023-08-21 23:24:55
@@ -1,37 +1,22 @@
-# frozen_string_literal: true
-
require_relative "boot"
-require "decidim/rails"
-# Add the frameworks used by your app that are not loaded by Decidim.
-# require "action_cable/engine"
-# require "action_mailbox/engine"
-# require "action_text/engine"
-require "zip"
+require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
-module DecidimApp
+module DecidimDevelopmentApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 5.2
+ config.load_defaults 6.1
- config.generators do |g|
- # remove some specs
- g.test_framework :rspec,
- fixtures: true,
- view_specs: false,
- helper_specs: false,
- routing_specs: false
-
- g.fixture_replacement :factory_bot, dir: "spec/factories"
- end
-
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration can go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded after loading
- # the framework and any gems in your application.
+ # Configuration for the application, engines, and railties goes here.
+ #
+ # These settings can be overridden in specific environments using the files
+ # in config/environments, which are processed later.
+ #
+ # config.time_zone = "Central Time (US & Canada)"
+ # config.eager_load_paths << Rails.root.join("extras")
end
end
diff -uwbNr decidim-cfj/config/assets.rb decidim/development_app/config/assets.rb
--- decidim-cfj/config/assets.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/assets.rb 1970-01-01 09:00:00
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-# This file is located at `config/assets.rb` of your module.
-
-# Define the base path of your module. Please note that `Rails.root` may not be
-# used because we are not inside the Rails environment when this file is loaded.
-# base_path = File.expand_path("..", __dir__)
-
-# If you want to import some extra SCSS files in the Decidim main SCSS file
-# without adding any extra stylesheet inclusion tags, you can use the following
-# method to register the stylesheet import for the main application. This would
-# include an SCSS file at `app/packs/stylesheets/your_app_extensions.scss` into
-# the Decidim's main SCSS file.
-# Decidim::Webpacker.register_stylesheet_import("stylesheets/your_app_extensions")
-
-# If you want to do the same but include the SCSS file for the admin panel's
-# main SCSS file, you can use the following method.
-# Decidim::Webpacker.register_stylesheet_import("stylesheets/your_app_admin_extensions", group: :admin)
diff -uwbNr decidim-cfj/config/boot.rb decidim/development_app/config/boot.rb
--- decidim-cfj/config/boot.rb 2023-08-21 23:04:55
+++ decidim/development_app/config/boot.rb 2023-08-21 23:24:56
@@ -1,16 +1,4 @@
-# frozen_string_literal: true
+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"
-
-env = ENV.fetch("RAILS_ENV", nil) || "development"
-
-Bootsnap.setup(
- cache_dir: File.expand_path(File.join("..", "tmp", "cache"), __dir__),
- development_mode: env == "development",
- load_path_cache: true,
- compile_cache_iseq: !ENV["SIMPLECOV"],
- compile_cache_yaml: true
-)
+require "bootsnap/setup" # Speed up boot time by caching expensive operations.
diff -uwbNr decidim-cfj/config/credentials.yml.enc decidim/development_app/config/credentials.yml.enc
--- decidim-cfj/config/credentials.yml.enc 2023-07-03 17:49:30
+++ decidim/development_app/config/credentials.yml.enc 2023-08-21 23:24:56
@@ -1 +1 @@
-KosfdQgf5ir2fD5BWd1/lzwmqK55Y6jtUewEbEgVwWMG5YiQP1hFSqTT/cfedUassJZeCVp+ZVQvb1OirVRd2hIyIwrZ2UAToGK0Gv8e6mYeZaEQrmcJt+MP8bkkS1dK8N7jp0kLzHw7HQ1Pb8/1sktzuSW+Z/OGETWz9Fx0L7RW6he1KpgtP8wZcPdaO7KXLzGwY4xl1+aDk2jm1A9svszDcBtBNRJn80yiVy0m46yKK53JVM1BVSbqwusFTJ9S/Bzmz3wW5Kg/etR8CBPZ1JDkIpx0Ten6VhwIrTlKnpjGlErvWYj9U9LdLZbupeiX1JOzaXUgZmayqnVpJKuoeXHgzsScCvpkfX2J2Jxr77CNJGv0QPOwHZEigniZtbec7wfvWEV/t36JVyFANbQX845ldylVJcaxNAhb--OdyYwlgE0J558NkK--HFyd6+GuWf5tZLD2j5rd0w==
\ No newline at end of file
+UFw6X+a8vsvPMDI8eOYdzVpUHJQIrViW+koKA+Ug7GevARUAaCeiTRd3uz31O9g40jJq0/XN8YmVXVkGvJKz+p6fplQGe5JaCJRq9e5LVCdsJhdbB+3+4ee5wydngsl4lnTDe3LZo0yi6dGbYu7hCdqZ3B3PeCeSOCKGfRZXMlnuAPBOKI3UIi79v7OTZnwJ+VkZ7Eve4aTY/SDowo8oFk9uio4lUJlWVkF1mtU4ZgnJXuJiI+efs7AVSjyr5jZst+zYHUMKjg71//tN7ITSk7TO+ogX/YgzVU7fAZqujDGkdzLbaQ8bQvl4Uc38ywvTknK/0YMV0luVJWs79v6d0UI3e0suLMg+oIuXeRqAOjvvEMr09u3EiEfxptwUXIpZ0vBVzBD3ZPk+tUQF0gTySK5TsOso9iZXbGxi--QkaR/8bx5KePZsxC--awi7SftDaSTTRGsvnH5SiQ==
\ No newline at end of file
diff -uwbNr decidim-cfj/config/database.yml decidim/development_app/config/database.yml
--- decidim-cfj/config/database.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/database.yml 2023-08-21 23:24:56
@@ -29,13 +29,13 @@
development:
<<: *default
- database: <%= ENV.fetch("DATABASE_DBNAME_DEV") { "decidim-app_development" } %>
+ database: decidim_development_app_development
# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# the same name as the operating system user that initialized the database.
- #username: decidim-app
+ #username: decidim_development_app
# The password associated with the postgres role (username).
#password:
@@ -63,7 +63,7 @@
# Do not set this db to the same as development or production.
test:
<<: *default
- database: <%= ENV.fetch("DATABASE_DBNAME_TEST") { "decidim-app_test" } %>
+ database: decidim_development_app_test<%= ENV.fetch('TEST_ENV_NUMBER', "") %>
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
@@ -86,10 +86,4 @@
production:
<<: *default
- adapter: postgresql
- encoding: unicode
- database: <%= ENV['RDS_DB_NAME'] %>
- username: <%= ENV['RDS_USERNAME'] %>
- password: <%= ENV['RDS_PASSWORD'] %>
- host: <%= ENV['RDS_HOSTNAME'] %>
- port: <%= ENV['RDS_PORT'] %>
+ url: <%= ENV['DATABASE_URL'] %>
diff -uwbNr decidim-cfj/config/environment.rb decidim/development_app/config/environment.rb
--- decidim-cfj/config/environment.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/environment.rb 2023-08-21 23:24:55
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# Load the Rails application.
require_relative "application"
diff -uwbNr decidim-cfj/config/environments/development.rb decidim/development_app/config/environments/development.rb
--- decidim-cfj/config/environments/development.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/environments/development.rb 2023-08-21 23:24:55
@@ -1,10 +1,10 @@
-# frozen_string_literal: true
+require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
- # In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
+ # In the development environment your application's code is reloaded any time
+ # it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
@@ -16,12 +16,13 @@
# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
- if Rails.root.join("tmp/caching-dev.txt").exist?
+ if Rails.root.join('tmp', 'caching-dev.txt').exist?
config.action_controller.perform_caching = true
+ config.action_controller.enable_fragment_cache_logging = true
config.cache_store = :memory_store
config.public_file_server.headers = {
- "Cache-Control" => "public, max-age=#{2.days.to_i}"
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false
@@ -29,7 +30,7 @@
config.cache_store = :null_store
end
- # Store uploaded files on the local file system (see config/storage.yml for options)
+ # Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# Don't care if the mailer can't send.
@@ -37,28 +38,39 @@
config.action_mailer.perform_caching = false
- # Use LetterOpener to send e-mail
- config.action_mailer.delivery_method = :letter_opener_web
- config.action_mailer.default_url_options = {
- host: "localhost",
- port: 3000
- }
-
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
+ # Raise exceptions for disallowed deprecations.
+ config.active_support.disallowed_deprecation = :raise
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
- # Raises error for missing translations
- # config.action_view.raise_on_missing_translations = true
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
+ # Suppress logger output for asset requests.
+ config.assets.quiet = true
+
+ # Raises error for missing translations.
+ # config.i18n.raise_on_missing_translations = true
+
+ # Annotate rendered view with file names.
+ # config.action_view.annotate_rendered_view_with_filenames = true
+
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
- # No precompilation on demand on first request
+ # Uncomment if you wish to allow Action Cable access from any origin.
+ # config.action_cable.disable_request_forgery_protection = true
end
diff -uwbNr decidim-cfj/config/environments/production.rb decidim/development_app/config/environments/production.rb
--- decidim-cfj/config/environments/production.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/environments/production.rb 2023-08-21 23:24:56
@@ -1,4 +1,4 @@
-# frozen_string_literal: true
+require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -22,29 +22,35 @@
# 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?
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
+ # Compress CSS using a preprocessor.
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
- # config.action_controller.asset_host = 'http://assets.example.com'
+ config.asset_host = ENV['RAILS_ASSET_HOST'] if ENV['RAILS_ASSET_HOST'].present?
# 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 = :amazon
+ # Store uploaded files on the local file system (see config/storage.yml for options).
+ config.active_storage.service = Rails.application.secrets.dig(:storage, :provider) || :local
- # Mount Action Cable outside main process or domain
+ # 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
+ # config.force_ssl = true
- # Use the lowest log level to ensure availability of diagnostic information
- # when problems arise.
- config.log_level = :info
+ # Include generic and useful information about system operation, but avoid logging too much
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
+ config.log_level = %w(debug info warn error fatal).include?(ENV['RAILS_LOG_LEVEL']) ? ENV['RAILS_LOG_LEVEL'] : :info
# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
@@ -52,9 +58,9 @@
# 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)
+ # 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.active_job.queue_name_prefix = "decidim_development_app_production"
config.action_mailer.perform_caching = false
@@ -64,36 +70,61 @@
# 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 = [:ja, :en]
+ config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
+ # Log disallowed deprecations.
+ config.active_support.disallowed_deprecation = :log
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
# 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"
+ :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'
+ # 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 = 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
- # Specify active_job sidekiq adapter
- config.active_job.queue_adapter = :sidekiq
+
+ # Inserts middleware to perform automatic connection switching.
+ # The `database_selector` hash is used to pass options to the DatabaseSelector
+ # middleware. The `delay` is used to determine how long to wait after a write
+ # to send a subsequent read to the primary.
+ #
+ # The `database_resolver` class is used by the middleware to determine which
+ # database is appropriate to use based on the time delay.
+ #
+ # The `database_resolver_context` class is used by the middleware to set
+ # timestamps for the last write to the primary. The resolver uses the context
+ # class timestamps to determine how long to wait before reading from the
+ # replica.
+ #
+ # By default Rails will store a last write timestamp in the session. The
+ # DatabaseSelector middleware is designed as such you can define your own
+ # strategy for connection switching and pass that into the middleware through
+ # these configuration options.
+ # config.active_record.database_selector = { delay: 2.seconds }
+ # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
+ # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
end
diff -uwbNr decidim-cfj/config/environments/test.rb decidim/development_app/config/environments/test.rb
--- decidim-cfj/config/environments/test.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/environments/test.rb 2023-08-21 23:24:55
@@ -1,14 +1,16 @@
-# frozen_string_literal: true
+require "active_support/core_ext/integer/time"
-Rails.application.configure do
- # Settings specified here will take precedence over those in config/application.rb.
-
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
- config.cache_classes = true
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ config.cache_classes = false
+ config.action_view.cache_template_loading = true
+
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
@@ -17,12 +19,13 @@
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
- "Cache-Control" => "public, max-age=#{1.hour.to_i}"
+ 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
}
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
+ config.cache_store = :null_store
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
@@ -30,7 +33,7 @@
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
- # Store uploaded files on the local file system in a temporary directory
+ # Store uploaded files on the local file system in a temporary directory.
config.active_storage.service = :test
config.action_mailer.perform_caching = false
@@ -43,6 +46,15 @@
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
- # Raises error for missing translations
- # config.action_view.raise_on_missing_translations = true
+ # Raise exceptions for disallowed deprecations.
+ config.active_support.disallowed_deprecation = :raise
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
+ # Raises error for missing translations.
+ # config.i18n.raise_on_missing_translations = true
+
+ # Annotate rendered view with file names.
+ # config.action_view.annotate_rendered_view_with_filenames = true
end
diff -uwbNr decidim-cfj/config/initializers/active_storage.rb decidim/development_app/config/initializers/active_storage.rb
--- decidim-cfj/config/initializers/active_storage.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/active_storage.rb 1970-01-01 09:00:00
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-Rails.application.configure do
- config.active_storage.previewers << HeicPreviewer
- config.active_storage.variable_content_types << "image/heic"
- config.active_storage.variable_content_types << "image/heif"
-end
diff -uwbNr decidim-cfj/config/initializers/application_controller_renderer.rb decidim/development_app/config/initializers/application_controller_renderer.rb
--- decidim-cfj/config/initializers/application_controller_renderer.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/application_controller_renderer.rb 2023-08-21 23:24:55
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
diff -uwbNr decidim-cfj/config/initializers/assets.rb decidim/development_app/config/initializers/assets.rb
--- decidim-cfj/config/initializers/assets.rb 1970-01-01 09:00:00
+++ decidim/development_app/config/initializers/assets.rb 2023-08-21 23:24:55
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = '1.0'
+
+# Add additional assets to the asset load path.
+# Rails.application.config.assets.paths << Emoji.images_path
+# Add Yarn node_modules folder to the asset load path.
+Rails.application.config.assets.paths << Rails.root.join('node_modules')
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in the app/assets
+# folder are already added.
+# Rails.application.config.assets.precompile += %w( admin.js admin.css )
diff -uwbNr decidim-cfj/config/initializers/aws_xray.rb decidim/development_app/config/initializers/aws_xray.rb
--- decidim-cfj/config/initializers/aws_xray.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/aws_xray.rb 1970-01-01 09:00:00
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-Rails.application.config.xray = {
- name: "decidim-cfj",
- patch: [:net_http, :aws_sdk],
- active_record: true,
- context_missing: "LOG_ERROR"
-}
diff -uwbNr decidim-cfj/config/initializers/backtrace_silencers.rb decidim/development_app/config/initializers/backtrace_silencers.rb
--- decidim-cfj/config/initializers/backtrace_silencers.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/backtrace_silencers.rb 2023-08-21 23:24:55
@@ -1,9 +1,8 @@
-# frozen_string_literal: true
-
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
-# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
+# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
+Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
diff -uwbNr decidim-cfj/config/initializers/carrierwave.rb decidim/development_app/config/initializers/carrierwave.rb
--- decidim-cfj/config/initializers/carrierwave.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/carrierwave.rb 2023-08-21 23:24:56
@@ -2,31 +2,13 @@
# Default CarrierWave setup.
#
-if Rails.application.secrets.aws_access_key_id.present?
- require "carrierwave/storage/fog"
-
- CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:].\-+]/
-
CarrierWave.configure do |config|
- config.storage = :fog
- config.fog_provider = "fog/aws"
- config.fog_public = false
- config.fog_directory = ENV.fetch("AWS_BUCKET_NAME", "cfj-decidim")
- config.asset_host = ENV.fetch("AWS_CLOUD_FRONT_END_POINT")
- config.fog_credentials = {
- provider: "AWS",
- region: "ap-northeast-1",
- use_iam_profile: true
- # host: 's3.ap-northeast-1.amazonaws.com',
- # endpoint: 'https://s3.example.com:8080'
- }
- # config.fog_public = false
- config.fog_attributes = {
- "Cache-Control" => "max-age=#{365.days.to_i}",
- "X-Content-Type-Options" => "nosniff"
- }
+ config.permissions = 0o666
+ config.directory_permissions = 0o777
+ config.storage = :file
+ config.enable_processing = !Rails.env.test?
end
-end
+
# Setup CarrierWave to use Amazon S3. Add `gem "fog-aws" to your Gemfile.
#
# CarrierWave.configure do |config|
diff -uwbNr decidim-cfj/config/initializers/content_security_policy.rb decidim/development_app/config/initializers/content_security_policy.rb
--- decidim-cfj/config/initializers/content_security_policy.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/content_security_policy.rb 2023-08-21 23:24:55
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# Be sure to restart your server when you modify this file.
# Define an application-wide content security policy
@@ -13,6 +11,8 @@
# policy.object_src :none
# policy.script_src :self, :https
# policy.style_src :self, :https
+# # If you are using webpack-dev-server then specify webpack-dev-server host
+# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
# # Specify URI for violation reports
# # policy.report_uri "/csp-violation-report-endpoint"
@@ -20,6 +20,9 @@
# If you are using UJS then enable automatic nonce generation
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
+
+# Set the nonce only to specific directives
+# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
# Report CSP violations to a specified URI
# For further information see the following documentation:
diff -uwbNr decidim-cfj/config/initializers/cookies_serializer.rb decidim/development_app/config/initializers/cookies_serializer.rb
--- decidim-cfj/config/initializers/cookies_serializer.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/cookies_serializer.rb 2023-08-21 23:24:55
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
diff -uwbNr decidim-cfj/config/initializers/decidim.rb decidim/development_app/config/initializers/decidim.rb
--- decidim-cfj/config/initializers/decidim.rb 2023-08-22 01:31:09
+++ decidim/development_app/config/initializers/decidim.rb 2023-08-21 23:24:56
@@ -2,61 +2,144 @@
Decidim.configure do |config|
# The name of the application
- config.application_name = "Code for Japan Decidim"
+ config.application_name = Rails.application.secrets.decidim[:application_name]
# The email that will be used as sender in all emails from Decidim
- config.mailer_sender = "[email protected]"
+ config.mailer_sender = Rails.application.secrets.decidim[:mailer_sender]
# Sets the list of available locales for the whole application.
#
# When an organization is created through the System area, system admins will
# be able to choose the available languages for that organization. That list
# of languages will be equal or a subset of the list in this file.
- config.available_locales = [:ja, :en]
+ # config.available_locales = Rails.application.secrets.decidim[:available_locales].presence || [:en]
+ # Or block set it up manually and prevent ENV manipulation:
+ config.available_locales = %w(en ca es)
- # Enable machine translations
- config.enable_machine_translations = false
+ # Sets the default locale for new organizations. When creating a new
+ # organization from the System area, system admins will be able to overwrite
+ # this value for that specific organization.
+ config.default_locale = Rails.application.secrets.decidim[:default_locale].presence || :en
# Restrict access to the system part with an authorized ip list.
# You can use a single ip like ("1.2.3.4"), or an ip subnet like ("1.2.3.4/24")
# You may specify multiple ip in an array ["1.2.3.4", "1.2.3.4/24"]
- # config.system_accesslist_ips = ["127.0.0.1"]
+ config.system_accesslist_ips = Rails.application.secrets.decidim[:system_accesslist_ips] if Rails.application.secrets.decidim[:system_accesslist_ips].present?
- # Sets the default locale for new organizations. When creating a new
- # organization from the System area, system admins will be able to overwrite
- # this value for that specific organization.
- config.default_locale = :ja
-
# Defines a list of custom content processors. They are used to parse and
# render specific tags inside some user-provided content. Check the docs for
# more info.
# config.content_processors = []
# Whether SSL should be enabled or not.
+ # if this var is not defined, it is decided automatically per-rails-environment
+ config.force_ssl = Rails.application.secrets.decidim[:force_ssl].present? unless Rails.application.secrets.decidim[:force_ssl] == "auto"
+ # or set it up manually and prevent any ENV manipulation:
# config.force_ssl = true
- # Geocoder configuration
+ # Enable the service worker. By default is disabled in development and enabled in the rest of environments
+ config.service_worker_enabled = Rails.application.secrets.decidim[:service_worker_enabled].present?
+
+ # Map and Geocoder configuration
+ #
+ # == HERE Maps ==
+ # config.maps = {
+ # provider: :here,
+ # api_key: Rails.application.secrets.maps[:api_key],
+ # static: { url: "https://image.maps.ls.hereapi.com/mia/1.6/mapview" }
+ # }
+ #
+ # == OpenStreetMap (OSM) services ==
+ # To use the OSM map service providers, you will need a service provider for
+ # the following map servers or host all of them yourself:
+ # - A tile server for the dynamic maps
+ # (https://wiki.openstreetmap.org/wiki/Tile_servers)
+ # - A Nominatim geocoding server for the geocoding functionality
+ # (https://wiki.openstreetmap.org/wiki/Nominatim)
+ # - A static map server for static map images
+ # (https://github.com/jperelli/osm-static-maps)
+ #
+ # When used, please read carefully the terms of service for your service
+ # provider.
+ #
+ # config.maps = {
+ # provider: :osm,
+ # api_key: Rails.application.secrets.maps[:api_key],
+ # dynamic: {
+ # tile_layer: {
+ # url: "https://tiles.example.org/{z}/{x}/{y}.png?key={apiKey}&{foo}",
+ # api_key: true,
+ # foo: "bar=baz",
+ # attribution: %(
+ # <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap</a> contributors
+ # ).strip
+ # # Translatable attribution:
+ # # attribution: -> { I18n.t("tile_layer_attribution") }
+ # }
+ # },
+ # static: { url: "https://staticmap.example.org/" },
+ # geocoding: { host: "nominatim.example.org", use_https: true }
+ # }
+ #
+ # == Combination (OpenStreetMap default + HERE Maps dynamic map tiles) ==
+ # config.maps = {
+ # provider: :osm,
+ # api_key: Rails.application.secrets.maps[:api_key],
+ # dynamic: {
+ # provider: :here,
+ # api_key: Rails.application.secrets.maps[:here_api_key]
+ # },
+ # static: { url: "https://staticmap.example.org/" },
+ # geocoding: { host: "nominatim.example.org", use_https: true }
+ # }
+
+ # Geocoder configurations if you want to customize the default geocoding
+ # settings. The maps configuration will manage which geocoding service to use,
+ # so that does not need any additional configuration here. Use this only for
+ # the global geocoder preferences.
+ # config.geocoder = {
+ # # geocoding service request timeout, in seconds (default 3):
+ # timeout: 5,
+ # # set default units to kilometers:
+ # units: :km,
+ # # caching (see https://github.com/alexreisner/geocoder#caching for details):
+ # cache: Redis.new,
+ # cache_prefix: "..."
+ # }
+ if Rails.application.secrets.maps.present? && Rails.application.secrets.maps[:static_provider].present?
+ static_provider = Rails.application.secrets.maps[:static_provider]
+ dynamic_provider = Rails.application.secrets.maps[:dynamic_provider]
+ dynamic_url = Rails.application.secrets.maps[:dynamic_url]
+ static_url = Rails.application.secrets.maps[:static_url]
+ static_url = "https://image.maps.ls.hereapi.com/mia/1.6/mapview" if static_provider == "here" && static_url.blank?
config.maps = {
- provider: :osm,
- api_key: Rails.application.secrets.maps[:api_key],
+ provider: static_provider,
+ api_key: Rails.application.secrets.maps[:static_api_key],
+ static: { url: static_url },
dynamic: {
- tile_layer: {
- url: "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
- api_key: true,
- attribution: %(
- <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap</a> contributors
- ).strip
- # Translatable attribution:
- # attribution: -> { I18n.t("tile_layer_attribution") }
+ provider: dynamic_provider,
+ api_key: Rails.application.secrets.maps[:dynamic_api_key]
}
- },
- static: {
- provider: :cfj_osm,
- url: "http://www.openstreetmap.org/"
- }, # use StaticMap::CfjOsm
- geocoding: { host: "nominatim.openstreetmap.org", use_https: true }
- # autocomplete: { url: "https://nominatim.openstreetmap.org/search" }
}
+ config.maps[:geocoding] = { host: Rails.application.secrets.maps[:geocoding_host], use_https: true } if Rails.application.secrets.maps[:geocoding_host]
+ config.maps[:dynamic][:tile_layer] = {}
+ config.maps[:dynamic][:tile_layer][:url] = dynamic_url if dynamic_url
+ config.maps[:dynamic][:tile_layer][:attribution] = Rails.application.secrets.maps[:attribution] if Rails.application.secrets.maps[:attribution]
+ if Rails.application.secrets.maps[:extra_vars].present?
+ vars = URI.decode_www_form(Rails.application.secrets.maps[:extra_vars])
+ vars.each do |key, value|
+ # perform a naive type conversion
+ config.maps[:dynamic][:tile_layer][key] = case value
+ when /^true$|^false$/i
+ value.downcase == "true"
+ when /\A[-+]?\d+\z/
+ value.to_i
+ else
+ value
+ end
+ end
+ end
+ end
# Custom resource reference generator method. Check the docs for more info.
# config.reference_generator = lambda do |resource, component|
@@ -65,20 +148,20 @@
# end
# Currency unit
- config.currency_unit = "円"
+ config.currency_unit = Rails.application.secrets.decidim[:currency_unit] if Rails.application.secrets.decidim[:currency_unit].present?
+ # Workaround to enable SVG assets cors
+ config.cors_enabled = Rails.application.secrets.decidim[:cors_enabled].present?
+
# Defines the quality of image uploads after processing. Image uploads are
# processed by Decidim, this value helps reduce the size of the files.
- # config.image_uploader_quality = 80
+ config.image_uploader_quality = Rails.application.secrets.decidim[:image_uploader_quality].to_i
- # The maximum file size of an attachment
- # config.maximum_attachment_size = 10.megabytes
+ config.maximum_attachment_size = Rails.application.secrets.decidim[:maximum_attachment_size].to_i.megabytes
+ config.maximum_avatar_size = Rails.application.secrets.decidim[:maximum_avatar_size].to_i.megabytes
- # The maximum file size for a user avatar
- # config.maximum_avatar_size = 10.megabytes
-
# The number of reports which a resource can receive before hiding it
- # config.max_reports_before_hiding = 3
+ config.max_reports_before_hiding = Rails.application.secrets.decidim[:max_reports_before_hiding].to_i
# Custom HTML Header snippets
#
@@ -93,38 +176,30 @@
# that an organization's administrator injects malicious scripts to spy on or
# take over user accounts.
#
- config.enable_html_header_snippets = true
+ config.enable_html_header_snippets = Rails.application.secrets.decidim[:enable_html_header_snippets].present?
# Allow organizations admins to track newsletter links.
- # config.track_newsletter_links = true
+ config.track_newsletter_links = Rails.application.secrets.decidim[:track_newsletter_links].present? unless Rails.application.secrets.decidim[:track_newsletter_links] == "auto"
- # Amount of time that the data portability files will be available in the server.
- # config.data_portability_expiry_time = 7.days
+ # Amount of time that the download your data files will be available in the server.
+ config.download_your_data_expiry_time = Rails.application.secrets.decidim[:download_your_data_expiry_time].to_i.days
# Max requests in a time period to prevent DoS attacks. Only applied on production.
- # config.throttling_max_requests = 100
+ config.throttling_max_requests = Rails.application.secrets.decidim[:throttling_max_requests].to_i
# Time window in which the throttling is applied.
- # config.throttling_period = 1.minute
+ config.throttling_period = Rails.application.secrets.decidim[:throttling_period].to_i.minutes
# Time window were users can access the website even if their email is not confirmed.
- # config.unconfirmed_access_for = 2.days
- config.unconfirmed_access_for = 0.days
+ config.unconfirmed_access_for = Rails.application.secrets.decidim[:unconfirmed_access_for].to_i.days
- # Etherpad configuration. Check the docs for more info.
- # config.etherpad = {
- # server: <your url>,
- # api_key: <your key>,
- # api_version: <your version>
- # }
-
# A base path for the uploads. If set, make sure it ends in a slash.
# Uploads will be set to `<base_path>/uploads/`. This can be useful if you
# want to use the same uploads place for both staging and production
# environments, but in different folders.
#
# If not set, it will be ignored.
- # config.base_uploads_path = nil
+ config.base_uploads_path = Rails.application.secrets.decidim[:base_uploads_path] if Rails.application.secrets.decidim[:base_uploads_path].present?
# SMS gateway configuration
#
@@ -147,7 +222,7 @@
# end
# end
#
- # config.sms_gateway_service = "MySMSGatewayService"
+ config.sms_gateway_service = 'Decidim::Verifications::Sms::ExampleGateway'
# Timestamp service configuration
#
@@ -171,7 +246,8 @@
# end
# end
#
- # config.timestamp_service = "MyTimestampService"
+ #
+ config.timestamp_service = "Decidim::Initiatives::DummyTimestamp"
# PDF signature service configuration
#
@@ -194,21 +270,23 @@
# end
# end
#
- # config.pdf_signature_service = "MyPDFSignatureService"
+ config.pdf_signature_service = "Decidim::Initiatives::PdfSignatureExample"
# 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.
+ # Decidim docs at https://docs.decidim.org/en/services/etherpad/ 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]
- # }
+ if Rails.application.secrets.etherpad.present? && Rails.application.secrets.etherpad[:server].present?
+ 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
# Sets Decidim::Exporters::CSV's default column separator
- config.default_csv_col_sep = ","
+ config.default_csv_col_sep = Rails.application.secrets.decidim[:default_csv_col_sep] if Rails.application.secrets.decidim[:default_csv_col_sep].present?
# The list of roles a user can have, not considering the space-specific roles.
# config.user_roles = %w(admin user_manager)
@@ -224,9 +302,19 @@
# Machine Translation Configuration
#
+ # See Decidim docs at https://docs.decidim.org/en/develop/machine_translations/
+ # for more information about how it works and how to set it up.
+ #
+ # Enable machine translations
+ config.enable_machine_translations = false
+ #
# If you want to enable machine translation you can create your own service
# to interact with third party service to translate the user content.
#
+ # If you still want to use "Decidim::Dev::DummyTranslator" as translator placeholder,
+ # add the follwing line at the beginning of this file:
+ # require "decidim/dev/dummy_translator"
+ #
# An example class would be something like:
#
# class MyTranslationService
@@ -243,24 +331,155 @@
# end
# end
#
- # config.machine_translation_service = "MyTranslationService"
+ config.machine_translation_service = 'Decidim::Dev::DummyTranslator'
+
+ # Defines the name of the cookie used to check if the user allows Decidim to
+ # set cookies.
+ config.consent_cookie_name = Rails.application.secrets.decidim[:consent_cookie_name] if Rails.application.secrets.decidim[:consent_cookie_name].present?
+
+ # Defines data consent categories and the data stored in each category.
+ # config.consent_categories = [
+ # {
+ # slug: "essential",
+ # mandatory: true,
+ # items: [
+ # {
+ # type: "cookie",
+ # name: "_session_id"
+ # },
+ # {
+ # type: "cookie",
+ # name: Decidim.consent_cookie_name
+ # }
+ # ]
+ # },
+ # {
+ # slug: "preferences",
+ # mandatory: false
+ # },
+ # {
+ # slug: "analytics",
+ # mandatory: false
+ # },
+ # {
+ # slug: "marketing",
+ # mandatory: false
+ # }
+ # ]
+
+ # Admin admin password configurations
+ Rails.application.secrets.dig(:decidim, :admin_password, :strong).tap do |strong_pw|
+ # When the strong password is not configured, default to true
+ config.admin_password_strong = strong_pw.nil? ? true : strong_pw.present?
end
+ config.admin_password_expiration_days = Rails.application.secrets.dig(:decidim, :admin_password, :expiration_days).presence || 90
+ config.admin_password_min_length = Rails.application.secrets.dig(:decidim, :admin_password, :min_length).presence || 15
+ config.admin_password_repetition_times = Rails.application.secrets.dig(:decidim, :admin_password, :repetition_times).presence || 5
-require "decidim/map/provider/static_map/cfj_osm"
+ # Additional optional configurations (see decidim-core/lib/decidim/core.rb)
+ config.cache_key_separator = Rails.application.secrets.decidim[:cache_key_separator] if Rails.application.secrets.decidim[:cache_key_separator].present?
+ config.expire_session_after = Rails.application.secrets.decidim[:expire_session_after].to_i.minutes if Rails.application.secrets.decidim[:expire_session_after].present?
+ config.enable_remember_me = Rails.application.secrets.decidim[:enable_remember_me].present? unless Rails.application.secrets.decidim[:enable_remember_me] == "auto"
+ if Rails.application.secrets.decidim[:session_timeout_interval].present?
+ config.session_timeout_interval = Rails.application.secrets.decidim[:session_timeout_interval].to_i.seconds
+ end
+ config.follow_http_x_forwarded_host = Rails.application.secrets.decidim[:follow_http_x_forwarded_host].present?
+ config.maximum_conversation_message_length = Rails.application.secrets.decidim[:maximum_conversation_message_length].to_i
+ config.password_blacklist = Rails.application.secrets.decidim[:password_blacklist] if Rails.application.secrets.decidim[:password_blacklist].present?
+ config.allow_open_redirects = Rails.application.secrets.decidim[:allow_open_redirects] if Rails.application.secrets.decidim[:allow_open_redirects].present?
+end
-Rails.application.config.i18n.available_locales = Decidim.available_locales
-Rails.application.config.i18n.default_locale = Decidim.default_locale
+if Decidim.module_installed? :api
+ Decidim::Api.configure do |config|
+ config.schema_max_per_page = Rails.application.secrets.dig(:decidim, :api, :schema_max_per_page).presence || 50
+ config.schema_max_complexity = Rails.application.secrets.dig(:decidim, :api, :schema_max_complexity).presence || 5000
+ config.schema_max_depth = Rails.application.secrets.dig(:decidim, :api, :schema_max_depth).presence || 15
+ end
+end
-## Set default comments limit. It's used in Decidim::Comments component. Default value is 100.
-Rails.application.config.default_comments_limit = ENV.fetch("DECIDIM_COMMENTS_LIMIT", 100).to_i
+if Decidim.module_installed? :proposals
+ Decidim::Proposals.configure do |config|
+ config.similarity_threshold = Rails.application.secrets.dig(:decidim, :proposals, :similarity_threshold).presence || 0.25
+ config.similarity_limit = Rails.application.secrets.dig(:decidim, :proposals, :similarity_limit).presence || 10
+ config.participatory_space_highlighted_proposals_limit = Rails.application.secrets.dig(:decidim, :proposals, :participatory_space_highlighted_proposals_limit).presence || 4
+ config.process_group_highlighted_proposals_limit = Rails.application.secrets.dig(:decidim, :proposals, :process_group_highlighted_proposals_limit).presence || 3
+ end
+end
-# Overwrite Devise.allow_unconfirmed_access_for
-Devise.allow_unconfirmed_access_for = Decidim.unconfirmed_access_for
+if Decidim.module_installed? :meetings
+ Decidim::Meetings.configure do |config|
+ config.upcoming_meeting_notification = Rails.application.secrets.dig(:decidim, :meetings, :upcoming_meeting_notification).to_i.days
+ if Rails.application.secrets.dig(:decidim, :meetings, :embeddable_services).present?
+ config.embeddable_services = Rails.application.secrets.dig(:decidim, :meetings, :embeddable_services)
+ end
+ unless Rails.application.secrets.dig(:decidim, :meetings, :enable_proposal_linking) == "auto"
+ config.enable_proposal_linking = Rails.application.secrets.dig(:decidim, :meetings, :enable_proposal_linking).present?
+ end
+ end
+end
-# Inform Decidim about the assets folder
-Decidim.register_assets_path File.expand_path("app/packs", Rails.application.root)
+if Decidim.module_installed? :budgets
+ Decidim::Budgets.configure do |config|
+ unless Rails.application.secrets.dig(:decidim, :budgets, :enable_proposal_linking) == "auto"
+ config.enable_proposal_linking = Rails.application.secrets.dig(:decidim, :budgets, :enable_proposal_linking).present?
+ end
+ end
+end
-# Set max_complexity of GraphQL::Schema
-Rails.application.config.to_prepare do
- Decidim::Api::Schema.max_complexity = 100_000
+if Decidim.module_installed? :accountability
+ Decidim::Accountability.configure do |config|
+ unless Rails.application.secrets.dig(:decidim, :accountability, :enable_proposal_linking) == "auto"
+ config.enable_proposal_linking = Rails.application.secrets.dig(:decidim, :accountability, :enable_proposal_linking).present?
end
+ end
+end
+
+if Decidim.module_installed? :consultations
+ Decidim::Consultations.configure do |config|
+ config.stats_cache_expiration_time = Rails.application.secrets.dig(:decidim, :consultations, :stats_cache_expiration_time).to_i.minutes
+ end
+end
+
+if Decidim.module_installed? :initiatives
+ Decidim::Initiatives.configure do |config|
+ unless Rails.application.secrets.dig(:decidim, :initiatives, :creation_enabled) == "auto"
+ config.creation_enabled = Rails.application.secrets.dig(:decidim, :initiatives, :creation_enabled).present?
+ end
+ config.similarity_threshold = Rails.application.secrets.dig(:decidim, :initiatives, :similarity_threshold).presence || 0.25
+ config.similarity_limit = Rails.application.secrets.dig(:decidim, :initiatives, :similarity_limit).presence || 5
+ config.minimum_committee_members = Rails.application.secrets.dig(:decidim, :initiatives, :minimum_committee_members).presence || 2
+ config.default_signature_time_period_length = Rails.application.secrets.dig(:decidim, :initiatives, :default_signature_time_period_length).presence || 120
+ config.default_components = Rails.application.secrets.dig(:decidim, :initiatives, :default_components)
+ config.first_notification_percentage = Rails.application.secrets.dig(:decidim, :initiatives, :first_notification_percentage).presence || 33
+ config.second_notification_percentage = Rails.application.secrets.dig(:decidim, :initiatives, :second_notification_percentage).presence || 66
+ config.stats_cache_expiration_time = Rails.application.secrets.dig(:decidim, :initiatives, :stats_cache_expiration_time).to_i.minutes
+ config.max_time_in_validating_state = Rails.application.secrets.dig(:decidim, :initiatives, :max_time_in_validating_state).to_i.days
+ unless Rails.application.secrets.dig(:decidim, :initiatives, :print_enabled) == "auto"
+ config.print_enabled = Rails.application.secrets.dig(:decidim, :initiatives, :print_enabled).present?
+ end
+ config.do_not_require_authorization = Rails.application.secrets.dig(:decidim, :initiatives, :do_not_require_authorization).present?
+ end
+end
+
+if Decidim.module_installed? :elections
+ Decidim::Elections.configure do |config|
+ config.setup_minimum_hours_before_start = Rails.application.secrets.dig(:elections, :setup_minimum_hours_before_start).presence || 3
+ config.start_vote_maximum_hours_before_start = Rails.application.secrets.dig(:elections, :start_vote_maximum_hours_before_start).presence || 6
+ config.voter_token_expiration_minutes = Rails.application.secrets.dig(:elections, :voter_token_expiration_minutes).presence || 120
+ end
+
+ Decidim::Votings.configure do |config|
+ config.check_census_max_requests = Rails.application.secrets.dig(:elections, :votings, :check_census_max_requests).presence || 5
+ config.throttling_period = Rails.application.secrets.dig(:elections, :votings, :throttling_period).to_i.minutes
+ end
+
+ Decidim::Votings::Census.configure do |config|
+ config.census_access_codes_export_expiry_time = Rails.application.secrets.dig(:elections, :votings, :census, :access_codes_export_expiry_time).to_i.days
+ end
+end
+
+Rails.application.config.i18n.available_locales = Decidim.available_locales
+Rails.application.config.i18n.default_locale = Decidim.default_locale
+
+# Inform Decidim about the assets folder
+Decidim.register_assets_path File.expand_path("app/packs", Rails.application.root)
diff -uwbNr decidim-cfj/config/initializers/decidim_awesome.rb decidim/development_app/config/initializers/decidim_awesome.rb
--- decidim-cfj/config/initializers/decidim_awesome.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/decidim_awesome.rb 1970-01-01 09:00:00
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-Decidim::DecidimAwesome.configure do |config|
- config.admin_accountability = []
-end
diff -uwbNr decidim-cfj/config/initializers/decidim_budgets.rb decidim/development_app/config/initializers/decidim_budgets.rb
--- decidim-cfj/config/initializers/decidim_budgets.rb 1970-01-01 09:00:00
+++ decidim/development_app/config/initializers/decidim_budgets.rb 2023-08-21 23:24:56
@@ -0,0 +1,4 @@
+# frozen_string_literal: true
+
+require "budgets_workflow_random"
+Decidim::Budgets.workflows[:random] = BudgetsWorkflowRandom
diff -uwbNr decidim-cfj/config/initializers/decidim_override.rb decidim/development_app/config/initializers/decidim_override.rb
--- decidim-cfj/config/initializers/decidim_override.rb 2023-08-21 23:04:55
+++ decidim/development_app/config/initializers/decidim_override.rb 1970-01-01 09:00:00
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-Rails.application.config.to_prepare do
- # Decidim::Proposals::ProposalWizardCreateStepForm
- #
- # minimum title length should be 8
- Decidim::Proposals::ProposalWizardCreateStepForm.validators.each do |validator|
- if validator.instance_of?(ProposalLengthValidator) && # rubocop:disable Style/Next
- validator.attributes.include?(:title)
-
- fixed_options = validator.options.dup
- fixed_options[:minimum] = 8
- validator.instance_eval do
- @options = fixed_options.freeze
- end
- end
- end
-
- # Decidim::Proposals::Admin::ProposalForm
- #
- # minimum title length should be 8
- Decidim::Proposals::Admin::ProposalForm.validators.each do |validator|
- if validator.instance_of?(ActiveModel::Validations::LengthValidator) && # rubocop:disable Style/Next
- validator.attributes.first.match?(/^title_/)
-
- fixed_options = validator.options.dup
- fixed_options[:minimum] = 8
- validator.instance_eval do
- @options = fixed_options.freeze
- end
- end
- end
-
- module Decidim
- module Map
- class DynamicMap < Map::Frontend
- class Builder < Decidim::Map::Frontend::Builder
- # Overwrite
- def map_element(html_options = {})
- opts = view_options
- opts["markers"] = opts["markers"].reject { |item| item[:latitude].nil? || item[:latitude].nan? } if opts["markers"].present?
- map_html_options = {
- "data-decidim-map" => opts.to_json,
- # The data-markers-data is kept for backwards compatibility
- "data-markers-data" => opts.fetch(:markers, []).to_json
- }.merge(html_options)
-
- content = template.capture { yield }.html_safe if block_given?
-
- template.content_tag(:div, map_html_options) do
- (content || "")
- end
- end
- end
- end
- end
- end
-end
diff -uwbNr decidim-cfj/config/initializers/decidim_verifications.rb decidim/development_app/config/initializers/decidim_verifications.rb
--- decidim-cfj/config/initializers/decidim_verifications.rb 1970-01-01 09:00:00
+++ decidim/development_app/config/initializers/decidim_verifications.rb 2023-08-21 23:24:56
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+Decidim::Verifications.register_workflow(:dummy_authorization_handler) do |workflow|
+ workflow.form = "DummyAuthorizationHandler"
+ workflow.action_authorizer = "DummyAuthorizationHandler::DummyActionAuthorizer"
+ workflow.expires_in = 1.month
+ workflow.renewable = true
+ workflow.time_between_renewals = 5.minutes
+
+ workflow.options do |options|
+ options.attribute :allowed_postal_codes, type: :string, default: "08001", required: false
+ options.attribute :allowed_scope_id, type: :scope, required: false
+ end
+end
+
+Decidim::Verifications.register_workflow(:another_dummy_authorization_handler) do |workflow|
+ workflow.form = "AnotherDummyAuthorizationHandler"
+ workflow.expires_in = 1.month
+
+ workflow.options do |options|
+ options.attribute :passport_number, type: :string, required: false
+ end
+end
diff -uwbNr decidim-cfj/config/initializers/fileutils.rb decidim/development_app/config/initializers/fileutils.rb
--- decidim-cfj/config/initializers/fileutils.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/fileutils.rb 1970-01-01 09:00:00
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../../lib/monkey_patching_fileutils"
diff -uwbNr decidim-cfj/config/initializers/filter_parameter_logging.rb decidim/development_app/config/initializers/filter_parameter_logging.rb
--- decidim-cfj/config/initializers/filter_parameter_logging.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/filter_parameter_logging.rb 2023-08-21 23:24:55
@@ -1,6 +1,6 @@
-# frozen_string_literal: true
-
# 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]
+Rails.application.config.filter_parameters += [
+ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
+]
diff -uwbNr decidim-cfj/config/initializers/inflections.rb decidim/development_app/config/initializers/inflections.rb
--- decidim-cfj/config/initializers/inflections.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/inflections.rb 2023-08-21 23:24:55
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
diff -uwbNr decidim-cfj/config/initializers/mime_types.rb decidim/development_app/config/initializers/mime_types.rb
--- decidim-cfj/config/initializers/mime_types.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/mime_types.rb 2023-08-21 23:24:55
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
diff -uwbNr decidim-cfj/config/initializers/omniauth_line.rb decidim/development_app/config/initializers/omniauth_line.rb
--- decidim-cfj/config/initializers/omniauth_line.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/omniauth_line.rb 1970-01-01 09:00:00
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-def setup_provider_proc(provider, config_mapping = {})
- lambda do |env|
- request = Rack::Request.new(env)
- organization = Decidim::Organization.find_by(host: request.host)
- provider_config = organization.enabled_omniauth_providers[provider]
-
- config_mapping.each do |option_key, config_key|
- env["omniauth.strategy"].options[option_key] = provider_config[config_key]
- end
- end
-end
-
-Rails.application.config.middleware.use OmniAuth::Builder do
- omniauth_config = Rails.application.secrets[:omniauth]
-
- if omniauth_config && omniauth_config[:line_login].present?
- require "omniauth-line_login"
- provider(
- :line_login,
- setup: setup_provider_proc(:line_login, client_id: :client_id, client_secret: :client_secret)
- )
- end
-end
diff -uwbNr decidim-cfj/config/initializers/permissions_policy.rb decidim/development_app/config/initializers/permissions_policy.rb
--- decidim-cfj/config/initializers/permissions_policy.rb 1970-01-01 09:00:00
+++ decidim/development_app/config/initializers/permissions_policy.rb 2023-08-21 23:24:55
@@ -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 -uwbNr decidim-cfj/config/initializers/redis.rb decidim/development_app/config/initializers/redis.rb
--- decidim-cfj/config/initializers/redis.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/redis.rb 1970-01-01 09:00:00
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-Redis.exists_returns_integer = true
diff -uwbNr decidim-cfj/config/initializers/slack.rb decidim/development_app/config/initializers/slack.rb
--- decidim-cfj/config/initializers/slack.rb 2023-08-21 23:04:55
+++ decidim/development_app/config/initializers/slack.rb 1970-01-01 09:00:00
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-require "slack-ruby-client"
-require_relative "../../lib/slack_chat_messenger"
-
-Slack.configure do |config|
- config.token = ENV.fetch("SLACK_API_TOKEN", nil)
- Rails.logger.error "Missing ENV[SLACK_API_TOKEN]!" unless config.token
-end
diff -uwbNr decidim-cfj/config/initializers/user_answers_serializer.rb decidim/development_app/config/initializers/user_answers_serializer.rb
--- decidim-cfj/config/initializers/user_answers_serializer.rb 2023-07-24 22:42:14
+++ decidim/development_app/config/initializers/user_answers_serializer.rb 1970-01-01 09:00:00
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../../lib/monkey_patching_user_answers_serializer"
diff -uwbNr decidim-cfj/config/initializers/wrap_parameters.rb decidim/development_app/config/initializers/wrap_parameters.rb
--- decidim-cfj/config/initializers/wrap_parameters.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/initializers/wrap_parameters.rb 2023-08-21 23:24:55
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
diff -uwbNr decidim-cfj/config/locales/budgets_workflow_random.en.yml decidim/development_app/config/locales/budgets_workflow_random.en.yml
--- decidim-cfj/config/locales/budgets_workflow_random.en.yml 1970-01-01 09:00:00
+++ decidim/development_app/config/locales/budgets_workflow_random.en.yml 2023-08-21 23:24:56
@@ -0,0 +1,8 @@
+en:
+ decidim:
+ components:
+ budgets:
+ settings:
+ global:
+ workflow_choices:
+ random: "Vote in a random component: allows participants to vote only in one budget, selected randomly."
diff -uwbNr decidim-cfj/config/locales/decidim_awesome.ja.yml decidim/development_app/config/locales/decidim_awesome.ja.yml
--- decidim-cfj/config/locales/decidim_awesome.ja.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/locales/decidim_awesome.ja.yml 1970-01-01 09:00:00
@@ -1,53 +0,0 @@
-ja:
- decidim:
- decidim_awesome:
- admin:
- admin_accountability:
- admin_roles:
- admin: スーパー管理者
- user_manager: ユーザーマネージャー
- created_at: ロールの作成日時
- currently_active: 現在アクティブ
- deleted_user: 削除されたユーザー
- email: メールアドレス
- exports:
- button: この検索結果をエクスポート
- export_as: '%{export_format} としてエクスポート'
- export_format:
- csv: CSV
- json: JSON
- xlsx: XLSX
- notice: エクスポート処理がキューに追加されました。準備ができたらメールが届きます。
- index:
- description: ここには、参加型スペースの管理に何らかの役割を持っていたすべてのユーザーが表示されます。一般の管理者は表示されません。
- global_description: ここには、この組織を管理するためにグローバルな役割を持っているすべてのユーザーが表示されます。参加型スペースの管理者は表示されません。
- see_global: グローバル管理者一覧
- see_spaces: 参加型スペース管理者一覧
- title: 管理者のアカウンタビリティ
- last_login: 最終ログイン日
- missing_info: "(不足情報)"
- missing_user: データベースにいないユーザー
- name: 名前
- never_logged: 未ログイン
- participatory_space: 参加型スペース
- removal_date: ロールの削除日時
- role: ロール
- roles:
- admin: 管理者
- collaborator: コラボレーター
- moderator: モデレーター
- valuator: 評価者
- config:
- form:
- help:
- validate_body_max_caps_percent: ゼロの場合大文字を許可しません。100の場合すべてを大文字で書くことを強制します。
- validate_body_max_marks_together: '並べて入力できる「?」と「!」の数を制限します。 すなわち、それが2の場合、「!!!」はテキストに記入できません'
- validate_body_min_length: この数字はゼロにできます。その場合、このフィールドを必須ではなくする効果があります。
- validate_title_max_caps_percent: ゼロの場合大文字を許可しません。100の場合すべてを大文字で書くことを強制します。
- validate_title_max_marks_together: '並べて入力できる「?」と「!」の数を制限します。 すなわち、それが2の場合、「!!!」はテキストに記入できません'
- validate_title_min_length: タイトルは常に必須です。この数字はゼロにはできません
- validators:
- body: '「body」フィールドのユーザー入力検証'
- title: '「タイトル」フィールドのユーザー入力検証'
- validators:
- too_much_caps: 大文字が多すぎます(テキストの %{percent}%以上)
diff -uwbNr decidim-cfj/config/locales/en.yml decidim/development_app/config/locales/en.yml
--- decidim-cfj/config/locales/en.yml 2023-07-17 20:23:01
+++ decidim/development_app/config/locales/en.yml 2023-08-21 23:24:55
@@ -1,29 +1,33 @@
----
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# The following keys must be escaped otherwise they will not be retrieved by
+# the default I18n backend:
+#
+# true, false, on, off, yes, no
+#
+# Instead, surround them with single quotes.
+#
+# en:
+# 'true': 'foo'
+#
+# To learn more, please read the Rails Internationalization guide
+# available at https://guides.rubyonrails.org/i18n.html.
+
en:
- activemodel:
- attributes:
- user_extension:
- address: Address
- birth_year: Birth year
- gender: Gender
- occupation: Occupation
- real_name: Real Name
- activerecord:
- attributes:
- decidim/proposals/proposal:
- title: Title
- body: Body
- decidim:
- debates:
- debates:
- versions:
- too_large_changeset: This changeset is too large to show.
- following:
- non_public_followings: Some of the resources followed are not public.
- enums:
- user_extension:
- gender:
- female: Female
- male: Male
- not_applicable: Not Applicable
- not_known: Not Known
+ hello: "Hello world"
diff -uwbNr decidim-cfj/config/locales/file_validators_ja.yml decidim/development_app/config/locales/file_validators_ja.yml
--- decidim-cfj/config/locales/file_validators_ja.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/locales/file_validators_ja.yml 1970-01-01 09:00:00
@@ -1,11 +0,0 @@
-ja:
- errors:
- messages:
- file_size_is_in: ! 'ファイルサイズは %{min} から %{max} の間でなければいけません'
- file_size_is_less_than: ! 'ファイルサイズは %{count} より小さくなければいけません'
- file_size_is_less_than_or_equal_to: ! 'ファイルサイズは %{count} 以下でなければいけません'
- file_size_is_greater_than: ! 'ファイルサイズは %{count} より大きくなければいけません'
- file_size_is_greater_than_or_equal_to: ! 'ファイルサイズは %{count} 以上でなければいけません'
-
- allowed_file_content_types: ! 'ファイルは %{types} のうちのどれかを使用してください'
- excluded_file_content_types: ! '%{types} のファイルは使用できません'
\ No newline at end of file
diff -uwbNr decidim-cfj/config/locales/ja.yml decidim/development_app/config/locales/ja.yml
--- decidim-cfj/config/locales/ja.yml 2023-08-21 23:04:55
+++ decidim/development_app/config/locales/ja.yml 1970-01-01 09:00:00
@@ -1,962 +0,0 @@
----
-ja:
- activemodel:
- attributes:
- config:
- validate_body_max_caps_percent: 本文内での大文字の最大許容割合
- validate_body_max_marks_together: 本文で許容される最多連続記号文字数
- validate_body_min_length: 本文に必要な最小文字数
- validate_body_start_with_caps: 本文を大文字で始めることを強制する
- validate_title_max_caps_percent: タイトル内での大文字の最大許容割合
- validate_title_max_marks_together: タイトルで許容される最多連続記号文字数
- validate_title_min_length: タイトルに必要な最小文字数
- validate_title_start_with_caps: タイトルを大文字で始めることを強制する
- debate:
- instructions: 参加方法
- decidim/user:
- name: アカウントID
- group:
- nickname: アカウントID
- question:
- origin_title: 起案者
- origin_url: 元のURL
- user:
- name: 表示名
- nickname: アカウントID
- user_extension:
- address: 住所
- birth_year: 生年(西暦)
- gender: 性別
- occupation: 職業
- real_name: 本名
- organization:
- primary_color: プライマリ
- secondary_color: セカンダリ
- minutes:
- visible: 表示する
- activerecord:
- attributes:
- decidim/proposals/proposal:
- title: タイトル
- body: 本文
- date:
- formats:
- decidim_short: "%Y/%m/%d"
- decidim_short_with_month_name_short: "%Y %b %d"
- decidim_with_day_and_month_name: "%Y %b %d %A"
- decidim_with_month_name: "%Y %B %d"
- decidim_with_month_name_short: "%b %d"
- decidim:
- admin:
- actions:
- duplicate: 複製
- admin_terms_of_use:
- actions:
- refuse: 同意しない
- dashboard:
- show:
- welcome: Decidim 管理画面へようこそ。
- filters:
- admin_accountability:
- admin_role_type:
- label: ロールの種別
- participatory_space_type_eq:
- label: 参加型スペース種別
- role:
- label: ロール
- role_type_eq:
- label: ロールの種別
- label:
- search_field_end_date: '終了日:'
- search_field_start_date: '開始日:'
- officializations:
- index:
- nickname: アカウントID
- search_placeholder:
- user_name_or_user_email_cont: ユーザー名、メールアドレスで検索する
- name_or_nickname_or_email_cont: "%{collection} をメール、表示名、アカウントIDで検索します。"
- menu:
- admin_accountability: 管理者のアカウンタビリティ
- officializations:
- show_email_modal:
- hidden: 非表示
- users_statistics:
- users_count:
- last_day: 直近24時間
- last_month: 直近1ヶ月
- last_week: 直近1週間
- authorization_handlers:
- csv_census:
- name: 組織のセンサス
- user_extension_authorization_handler:
- explanation: 'ユーザー拡張属性保持用'
- name: 'ユーザー拡張属性'
- components:
- add_comment_form:
- account_message: <a href="%{sign_in_url}">ログイン</a> または <a href="%{sign_up_url}">新規登録</a> することでコメントできます。
- comment:
- deleted_user: 退会者
- report:
- reasons:
- does_not_belong: 違法行為、個人情報、または %{organization_name} に属していないと思われる内容が含まれています。
- offensive: 差別的な内容、誹謗中傷などの不適切な内容が含まれています。
- spam: 本来の内容に関係が無い広告、詐欺や悪意のある処理などが含まれています。
- comment_order_selector:
- order:
- best_rated: 評価の高い順
- most_discussed: 議論数の多い順
- older: 古い順
- recent: 新しい順
- down_vote_button:
- text: このコメントに同意しません
- debates:
- debates:
- filters:
- activity: 参加したもの
- citizens: 一般参加者
- official: 事務局
- origin: 起案者
- versions:
- too_large_changeset: 履歴のサイズが大きすぎるため表示できません
- devise:
- registrations:
- new:
- newsletter: 関連するお知らせを受け取る
- newsletter_title: ニュースレターを受け取る
- nickname_help: 本人を識別するための任意のアルファベットを入力してください。
- nickname_notice: "※ 表示名とアカウントIDが投稿に表示されます。例)共創 歩@ayumi"
- nickname_placeholder: ayumi
- password_help: 半角英数字%{minimun_characters}文字以上で入力してください。単純すぎてはいけません(例:123456)。アカウントIDやメールアドレスと異なる必要があります。
- see_username: アカウントIDを見る
- subtitle: 参加するにはユーザ登録をしてください。
- terms: 利用規約
- username_placeholder: 共創 歩
- doorkeeper:
- authorizations:
- new:
- connect_your_account_html: "<strong>%{organization}</strong> にログインしてアカウントに接続します"
- errors:
- not_found:
- content_doesnt_exist: このアドレスは正しくないか削除されています。
- events:
- comments:
- comment_by_followed_user:
- email_subject: "%{author_name} から %{resource_title} に対して新しいコメントがあります"
- comment_by_followed_user_group:
- email_subject: "%{author_name} から %{resource_title} に対して新しいコメントがあります"
- comment_created:
- email_intro: "%{resource_title} にコメントがありました。このページでコメントを読むことができます:"
- email_outro: '"%{resource_title}" 、またはその参加者をフォローしているためこの通知を受け取りました。前のリンクからフォローを解除することができます。'
- email_subject: "%{author_name} から %{resource_title} に対して新しいコメントがあります"
- notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> から <a href="%{resource_path}">%{resource_title} に対して新しいコメントがあります</a>
- debates:
- debate_closed:
- follower:
- email_intro: '「%{resource_title}」のディベートは終了しました。そのページから結論を読むことができます。'
- email_outro: '%{resource_title} をフォローしているため、この通知を受け取りました。前のリンクから通知の受信を停止することができます。'
- email_subject: '「%{resource_title}」のディベートは終了しました'
- notification_title: <a href="%{resource_path}">%{resource_title}</a> のディベートは終了しました。
- gamification:
- badge_earned:
- email_outro: サイトでの活動によって、この通知を受け取りました。
- level_up:
- email_intro: おめでとうございます! あなたは <a href="%{resource_url}">%{badge_name} バッジ</a> のレベル %{current_level} に到達しました!
- email_outro: サイトでの活動によって、この通知を受け取りました。
- email_subject: "%{badge_name} のバッジがレベル %{current_level} に達しました!"
- notification_title: おめでとうございます! あなたは <a href="%{resource_path}">%{badge_name} バッジ</a> のレベル %{current_level} に到達しました!
- proposals:
- collaborative_draft_access_accepted:
- email_intro: '%{requester_name} は、 <a href="%{resource_path}">%{resource_title}</a> の共同草案のコントリビューターとして承認されました。'
- notification_title: <a href="%{requester_path}">%{requester_name} %{requester_nickname}</a> は、 <strong>コントリビューターとして</strong> <a href="%{resource_path}">%{resource_title}</a> 共同草案のコントリビューターとしてアクセスできるようになりました。
- collaborative_draft_access_rejected:
- email_intro: '%{requester_name} は、 <a href="%{resource_path}">%{resource_title}</a> の共同草案のコントリビューターとしてアクセスするために拒否されました。'
- email_outro: <a href="%{resource_path}">%{resource_title}</a> のコラボレーターであるため、この通知を受け取りました。
- email_subject: "%{requester_name} は、 %{resource_title} の共同草案の貢献者としてアクセスするために拒否されました。"
- notification_title: <a href="%{requester_path}">%{requester_name} %{requester_nickname}</a> は、 <a href="%{resource_path}">%{resource_title}</a> の共同草案にアクセスをリクエストしました。 <strong>リクエストを承認または拒否してください</strong>。
- collaborative_draft_access_requester_accepted:
- email_intro: <a href="%{resource_path}">%{resource_title}</a> の共同草案の投稿者としてアクセスすることを承認されました。
- notification_title: あなたは <strong></strong> <a href="%{resource_path}">%{resource_title}</a> の共同草案の貢献者としてアクセスすることを受け入れられました。
- collaborative_draft_access_requester_rejected:
- email_intro: <a href="%{resource_path}">%{resource_title}</a> の共同草案の投稿者としてアクセスが拒否されました。
- collaborative_draft_withdrawn:
- email_intro: <a href="%{author_path}">%{author_name} %{author_nickname}</a> は、 <a href="%{resource_path}">%{resource_title}</a> の共同草案を撤回しました。
- email_subject: "%{author_name} %{author_nickname} は %{resource_title} の共同草案を撤回しました。"
- verifications:
- verify_with_managed_user:
- email_intro: 参加者 <a href="%{resource_path}">%{resource_title}</a> が管理対象参加者 <a href="%{managed_user_path}">%{managed_user_name}</a>のデータで自身を検証しようとしました。
- email_outro: <a href="%{conflicts_path}">検証の競合リスト</a> を確認し、参加者に連絡して詳細を調査し、問題を解決してください。
- email_subject: 管理対象参加者に対する検証の試みに失敗しました
- notification_title: 参加者 <a href="%{resource_path}">%{resource_title}</a> が管理対象参加者 <a href="%{managed_user_path}">%{managed_user_name}</a>のデータで自身を検証しようとしました。
- filters:
- linked_classes:
- collaborative_draft: 共同草案
- fingerprint:
- check: フィンガープリントを確認
- following:
- non_public_followings: フォローしているリソースのいくつかは公開されていません。
- initiatives:
- initiatives:
- vote_cabin:
- votes_blocked: ログインが無効になっています
- forms:
- file_help:
- image:
- message_1: "テキストを含まない風景画像が適しています(推奨サイズ: 縦横どちらも3800ピクセル以下程度)"
- meetings:
- meetings:
- filters:
- origin: 起案者
- origin_values:
- citizens: 一般参加者
- official: 事務局
- user_groups: グループ
- show:
- edit_close_meeting: ミーティングレポートを編集
- join: ミーティングに参加
- messaging:
- conversation_mailer:
- comanagers_new_conversation:
- greeting: "%{recipient}さん、こんにちは。"
- outro: ''
- comanagers_new_message:
- greeting: "%{recipient}さん、こんにちは。"
- outro: ''
- new_conversation:
- greeting: "%{recipient}さん、こんにちは。"
- outro: ''
- new_group_conversation:
- greeting: "%{recipient}さん、こんにちは。"
- outro: ''
- new_group_message:
- greeting: "%{recipient}さん、こんにちは。"
- outro: ''
- new_message:
- greeting: "%{recipient}さん、こんにちは。"
- outro: ''
-
- moderations:
- actions:
- hidden: 非表示
- hide: 非表示にする
- not_hidden: 表示
- notifications_settings:
- show:
- allow_public_contact: フォローしていない人からもダイレクトメッセージを受信する
- direct_messages: ダイレクトメッセージを受信する
- email_on_notification: 通知を毎回メールで受け取る
- send_notifications_by_email: 電子メールで通知を受け取る
- pages:
- terms_and_conditions:
- accept:
- success: 利用規約に同意しました。
- refuse:
- modal_button: 同意しない
- participatory_processes:
- pages:
- home:
- highlighted_processes:
- active_processes: アクティブな参加型プロセス
- see_all_processes: 全ての参加型プロセス
- active_step: アクティブ・フェーズ
- more_information: もっと見る
- participate: 参加する
- participate_in: 参加型プロセス %{resource_name} に参加する
- processes_button_title: すべてのプロセスを表示する
- participatory_processes:
- filters:
- explanations:
- no_active_nor_upcoming_callout: アクティブな参加型プロセスも今後の参加型プロセスもありません。ここでは過去の参加型プロセスのリストを示します。
- show:
- local_area: 組織エリア
- participatory_process_groups:
- content_blocks:
- metadata:
- developer_group: 制作グループ
- proposals:
- application_helper:
- filter_origin_values:
- citizens: 一般参加者
- official: 事務局
- models:
- requests:
- access_requested:
- error: リクエストを完了できませんでした。後でもう一度お試しください。
- success: 共同草案のリクエストが正常に送信されました
- show:
- back: 戻る
- edit: 共同草案を編集
- final_proposal_help_text: この草案は終了しました。最終提案を確認してください。
- info-message: これは提案のための <strong>共同草案</strong> です。 これは、以下のコメントセクションを使用して提案を作成したり、編集するためのアクセスを要求することで、提案を改善したりすることができることを意味します。 作成者がアクセスを許可すると、この草案を変更することができます。
- withdraw: 草案を撤回する
- update:
- error: 共同草案を保存する際に問題が発生しました。
- success: 共同草案が正常に更新されました。
- create:
- success: 提案は正常に作成されました。草案として保存されました。
- proposals:
- edit:
- add_documents: 添付ファイル
- add_images: 画像
- attachment_legend: "(オプション) 添付ファイルを追加"
- back: 戻る
- delete_document: 添付ファイルの削除
- delete_image: 画像の削除
- gallery_legend: "(オプション) 提案カードに画像を追加"
- select_a_category: カテゴリーを選択
- send: 送信
- title: 提案の編集
- orders:
- label: '提案の並び順:'
- most_commented: コメントの多い順
- most_endorsed: オススメの多い順
- most_followed: フォローの多い順
- most_voted: サポートの多い順
- random: ランダム
- recent: 新しい順
- with_more_authors: 起案者の多い順
- verifications:
- authorizations:
- first_login:
- actions:
- user_extension_authorization_handler: ユーザー拡張属性対応用
- csv_census:
- admin:
- census:
- destroy_all:
- success: すべてのセンサスデータが削除されました
- destroy:
- confirm: センサスをすべて削除することはできません。続行してもよろしいですか?
- title: センサスデータをすべて削除する
- index:
- empty: センサスデータがありません。CSVファイルを使用してインポートするには、以下のフォームを使用してください。
- title: 現在のセンサスデータ
- new:
- title: 新しいセンサスをアップロード
- postal_letter:
- admin:
- pending_authorizations:
- index:
- username: アカウントID
- versions:
- resource_version:
- of_versions: / %{number}
- welcome_notification:
- default_body: <p>こんにちは {{name}} さん, {{organization}} へご参加いただきありがとうございます。</p><ul><li>もし、このサイトの使い方は、 <a href="{{help_url}}">ヘルプ</a> セクションをご参照ください。</li><li>目を通していただけると、最初のバッジを獲得できます。<a href="{{badges_url}}">全てのバッジの一覧</a> から、この {{organization}} への参加で獲得できるバッジを見ることができます。</li><li>他の人と一緒に参加し、この {{organization}} へ参加した経験をシェアしましょう。 提案を作り、コメントし、議論し、共通善への貢献の仕方について考え、議論に説得力をもたせ、主張を聞いたり読んだりしながら納得し、具体的かつ直接的な方法であなたの考えを表明し、忍耐と決断を持って対応し、 自らの考えを守り、他人の考えを取り入れて協力し合いましょう。</li></ul>
- devise:
- failure:
- already_authenticated: 既にログイン済です。
- unauthenticated: 続行する前にログインまたはユーザ登録する必要があります。
- invitations:
- edit:
- nickname_help: "%{organization} のニックネーム。"
- subtitle: |-
- 招待を受け入れたくない場合は、このメールを無視してください。<br />
- 上記のリンクにアクセスし、アカウントIDとパスワードを設定するまで、あなたのアカウントは作成されません。
- updated: パスワードは正常に設定され、ログイン完了しました。
- mailer:
- invitation_instructions:
- ignore: |-
- 招待を受け入れたくない場合は、このメールを無視してください。<br />
- 上記のリンクにアクセスし、アカウントIDとパスワードを設定するまで、あなたのアカウントは作成されません。
- someone_invited_you: "%{application}にあなたを招待しました。以下のリンクから受け入れることができます。"
- someone_invited_you_as_admin: "%{application}の管理者としてあなたを招待しました。以下のリンクから承認できます。"
- password_change:
- greeting: こんにちは、 %{recipient} さん!
- reset_password_instructions:
- greeting: こんにちは、 %{recipient} さん!
- unlock_instructions:
- greeting: こんにちは、 %{recipient} さん!
- message: あなたのアカウントはログインに規定回数以上失敗したため、ロックされています。
- passwords:
- edit:
- password_help: "%{minimun_characters} 半角英数字10文字以上で入力してください。単純すぎてはいけません(例:123456)。アカウントIDやメールアドレスと異なる必要があります。"
- shared:
- links:
- didn_t_receive_confirmation_instructions: ユーザ登録確認メールが届かない方はこちら
- didn_t_receive_unlock_instructions: ロック解除の手順を送信したい方はこちら
- errors:
- messages:
- needs_user_extension: 登録されていないユーザー属性情報が見つかりました。
- faker:
- lorem:
- punctuation:
- space: ''
- words:
- - あいさつ
- - あした
- - あたらしい
- - あたらしく
- - あたり
- - あたりまえ
- - あちこち
- - ありがたい
- - ありがとう
- - あるいは
- - あんまり
- - いくらか
- - いちばん
- - いっしょ
- - いったい
- - いっぱい
- - いつか
- - いつも
- - いまごろ
- - いよいよ
- - いらっしゃる
- - いろいろ
- - うたった
- - うつくしい
- - うつらうつら
- - うなずき
- - うまく
- - うやうやしく
- - おいおい
- - おいで
- - おじいさん
- - おばあさん
- - おもしろい
- - おもった
- - お母さん
- - お父さん
- - お礼
- - お茶
- - お話
- - かおり
- - かかって
- - かがやいて
- - かげろう
- - かたち
- - かなり
- - かぶとむし
- - からだ
- - かわるがわる
- - がたっと
- - がぶがぶ
- - きこえる
- - きもの
- - きれい
- - ください
- - くらい
- - ぐらぐら
- - ぐるぐる
- - ぐるっと
- - こういう
- - こちら
- - このごろ
- - これから
- - こんど
- - こんなに
- - こんなふうに
- - ごちそう
- - さがす
- - さまざま
- - しきりに
- - しずかに
- - しばらく
- - しょんぼり
- - しるし
- - すきとおった
- - すこし
- - すばやく
- - ずいぶん
- - ずんずん
- - ぜんたい
- - そうなると
- - そこで
- - そっくり
- - そっと
- - そのうち
- - そのまま
- - その間
- - それだけ
- - それでは
- - それでも
- - それとも
- - それなら
- - それに
- - それほど
- - そんなに
- - たいへん
- - たき火
- - たくさん
- - たしかに
- - たずねて
- - ただ
- - たった
- - たびたび
- - たまらなく
- - だいぶ
- - だから
- - だけど
- - だんだん
- - ちゃんと
- - ちゅうちょ
- - ちょうど
- - ちょっと
- - ちらちら
- - ちらっと
- - ついてる
- - つかう
- - つかえる
- - つかまえる
- - つきあたり
- - つくれる
- - つぶやき
- - つぶやく
- - ていねい
- - できるだけ
- - でしょう
- - とっぷり
- - とにかく
- - ともに
- - どういう
- - どうしても
- - どうぞ
- - どうにか
- - どっち
- - どっと
- - どんどん
- - どんなに
- - なかなか
- - なぜなら
- - なつかしい
- - なにか
- - なめらか
- - ならび
- - なるべく
- - なるほど
- - なんだか
- - なんて
- - なんにも
- - にぎやか
- - にわかに
- - ねがい
- - ねむって
- - はいって
- - はさみ
- - はじめて
- - はたらいた
- - はっきり
- - はねあがった
- - はねあがり
- - はるか
- - ぱたぱた
- - ひしゃく
- - ひっそり
- - ひとりでに
- - ひょろひょろ
- - ふくろう
- - ふりかえった
- - ふりかえり
- - ふりまわす
- - ふるえる
- - ほくほく
- - ほんとう
- - ほんの
- - ぼんやり
- - まだまだ
- - まっさきに
- - まっすぐ
- - まっ黒
- - まつり
- - まもなく
- - まもなく
- - まわって
- - まわり
- - まんなか
- - みんな
- - むかし
- - むし暑い
- - めずらしい
- - もし
- - もちろん
- - もっとも
- - もらって
- - やさしい
- - やって来る
- - やっぱり
- - やはり
- - ゆっくり
- - ようやく
- - よっぽど
- - よほど
- - よろこんで
- - よろよろ
- - ろうそく
- - わかる
- - わたし
- - われわれ
- - アカシヤ
- - アーティスト
- - イーハトーヴォ
- - オーケストラ
- - オートミール
- - カシオペア
- - カラー
- - ガラス
- - キュー
- - クラリネット
- - コップ
- - コート
- - シャツ
- - スケッチ
- - スコップ
- - スフィンクス
- - チョッキ
- - テキスト
- - テニス
- - テーブル
- - ネクタイ
- - ノック
- - ハム
- - バケツ
- - バス
- - ファイル
- - フラスコ
- - ページ
- - ホテル
- - ボール紙
- - ポケット
- - ポプラ
- - モーニング
- - モール
- - ライ麦
- - ランニング
- - ランプ
- - レコード
- - ワルツ
- - 一度
- - 一生
- - 一番
- - 一言
- - 丁寧
- - 丁度
- - 七月
- - 三つ
- - 三つ葉
- - 上げる
- - 上手
- - 上着
- - 上等
- - 不思議
- - 世界
- - 両側
- - 両手
- - 並木
- - 乗った
- - 乾杯
- - 事情
- - 二つ
- - 五月
- - 今日
- - 今晩
- - 今朝
- - 仕事
- - 仕度
- - 仕方
- - 仲間
- - 会社
- - 会計
- - 会釈
- - 伝説
- - 伴奏
- - 位置
- - 何だか
- - 何でも
- - 何もかも
- - 信号
- - 信号所
- - 停車場
- - 働いて
- - 元気
- - 充分
- - 先生
- - 入力
- - 入口
- - 全体
- - 八月
- - 公開
- - 六月
- - 内側
- - 写真
- - 凱旋
- - 出張
- - 出来事
- - 切符売場
- - 前庭
- - 力いっぱい
- - 助手
- - 勉強
- - 動物
- - 北極熊
- - 北西
- - 十月
- - 午後
- - 半分
- - 博物局
- - 厚い
- - 原稿
- - 友だち
- - 双眼鏡
- - 反響
- - 取り換えよう
- - 受け取った
- - 受付
- - 口笛
- - 右側
- - 同じ
- - 名前
- - 向き
- - 呼び出し
- - 呼んで
- - 図書館
- - 園遊会
- - 地図
- - 地平線
- - 地形
- - 地方
- - 地面
- - 坐った
- - 坐り
- - 報告
- - 場合
- - 場所
- - 夏まつり
- - 夕方
- - 大きく
- - 大丈夫
- - 大事
- - 大学
- - 大急ぎ
- - 大理石
- - 大通り
- - 姉さん
- - 始まり
- - 子ども
- - 子供
- - 学校
- - 学生
- - 安心
- - 安楽椅子
- - 宛名
- - 専門
- - 小さい
- - 小さく
- - 小屋
- - 小路
- - 届け出
- - 山猫
- - 山羊
- - 山頂
- - 岩礁
- - 工場
- - 左手
- - 帰る
- - 帽子
- - 幻燈
- - 広場
- - 建物
- - 引いた
- - 引き受ける
- - 待ち伏せ
- - 待って
- - 忘れない
- - 思う
- - 思わず
- - 急ぎ
- - 愉快
- - 戸口
- - 扇風機
- - 手伝った
- - 手首
- - 打ち明ける
- - 承知
- - 指さした
- - 挨拶
- - 振り向いて
- - 採集
- - 握って
- - 散歩
- - 数える
- - 数字
- - 整理
- - 新聞
- - 方角
- - 旅行
- - 日曜
- - 日曜日
- - 早口
- - 明るい
- - 明るく
- - 明日
- - 昔ばなし
- - 昨夜
- - 昨日
- - 時々
- - 時代
- - 時間
- - 景色
- - 書類
- - 木の下
- - 本当
- - 本当に
- - 本気
- - 果物
- - 校正
- - 椅子
- - 植木鉢
- - 植物
- - 植物園
- - 楽しい
- - 楽隊
- - 様子
- - 模型
- - 歌う
- - 歌える
- - 正面
- - 歩く
- - 残り
- - 毎日
- - 毎朝
- - 民謡
- - 気持ち
- - 汽船
- - 汽車
- - 洗い
- - 海岸
- - 海藻
- - 済む
- - 火曜日
- - 炭酸
- - 物知り
- - 玄関
- - 申し立て
- - 申し込む
- - 番号
- - 皆さん
- - 目あて
- - 相手
- - 相談
- - 真面目
- - 知り合い
- - 磁石
- - 秋まつり
- - 空白
- - 立ちあがって
- - 立ちあがり
- - 立ちどまった
- - 立ちどまり
- - 立ち入る
- - 立派な
- - 笑い声
- - 紙切れ
- - 細い
- - 細長い
- - 紳士
- - 組合
- - 結構
- - 繰り返し
- - 置いておく
- - 考える
- - 聞こえる
- - 腰かけ
- - 自分
- - 自動車
- - 若者
- - 草むら
- - 荷造り
- - 落ちた
- - 落ち着いた
- - 落ち着かせて
- - 蜂蜜
- - 行けます
- - 行ける
- - 製作所
- - 要る
- - 見える
- - 見せられる
- - 見積り
- - 試験
- - 話し合った
- - 詳しく
- - 説明
- - 読む
- - 読んだ
- - 誰か
- - 調子
- - 財産
- - 赤い
- - 赤く
- - 走り出し
- - 足もと
- - 踊って
- - 身構え
- - 農夫
- - 近く
- - 返し
- - 返事
- - 迷って
- - 追い付く
- - 途中
- - 通りかかり
- - 通り抜ける
- - 通り越し
- - 通り過ぎようと
- - 通る
- - 造り
- - 遊び
- - 運び出し
- - 道路
- - 遠い
- - 遠く
- - 郊外
- - 酔った
- - 重役
- - 野原
- - 銀河
- - 銀貨
- - 長く
- - 開け放し
- - 間違い
- - 隣りに
- - 電気
- - 青く
- - 青じろい
- - 面白い
- - 面白かった
- - 頑丈
- - 顔つき
- - 飛び込もう
- - 飛んでいる
- - 食事
- - 食卓
- - 香水
- - 馬車
- - 高い
- - 鳥打帽
- - 鳴らして
- - 鳴らす
- - 鳴り出した
- - 黄いろ
- - 黒く
- layouts:
- decidim:
- notifications_dashboard:
- mark_all_as_read: すべての通知を削除する
- time:
- formats:
- day_of_month: "%b %d"
- day_of_week: "%a"
- day_of_week_long: "%e %a"
- day_of_year: "%y.%m.%d"
- decidim_day_of_year: "%Y %B %d"
- decidim_short: "%Y/%m/%d %H:%M"
- default: "%Y %b %d (%a) %H:%M:%S %z"
- devise:
- mailer:
- invitation_instructions:
- accept_until_format: "%Y/%m/%d %I:%M %p"
- long: "%Y/%m/%d %H:%M"
- long_dashed: "%Y-%m-%d %H:%M:%S"
- short: "%Y/%m/%d %H:%M"
- time_of_day: "%H:%M"
diff -uwbNr decidim-cfj/config/locales/line_login.en.yml decidim/development_app/config/locales/line_login.en.yml
--- decidim-cfj/config/locales/line_login.en.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/locales/line_login.en.yml 1970-01-01 09:00:00
@@ -1,8 +0,0 @@
-en:
- decidim:
- system:
- organizations:
- omniauth_settings:
- line_login:
- client_id: Channel ID
- client_secret: Channel secret
diff -uwbNr decidim-cfj/config/locales/line_login.ja.yml decidim/development_app/config/locales/line_login.ja.yml
--- decidim-cfj/config/locales/line_login.ja.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/locales/line_login.ja.yml 1970-01-01 09:00:00
@@ -1,8 +0,0 @@
-ja:
- decidim:
- system:
- organizations:
- omniauth_settings:
- line_login:
- client_id: チャンネルID
- client_secret: チャンネルシークレット
diff -uwbNr decidim-cfj/config/locales/polis_ja.yml decidim/development_app/config/locales/polis_ja.yml
--- decidim-cfj/config/locales/polis_ja.yml 2023-07-17 20:23:01
+++ decidim/development_app/config/locales/polis_ja.yml 1970-01-01 09:00:00
@@ -1,69 +0,0 @@
-ja:
- activemodel:
- attributes:
- organization:
- polis_site_id: Pol.isサイトID
- polis_site_url: Pol.isサイトURL
- decidim:
- admin:
- menu:
- decidim_polis: Pol.is
- organization:
- update:
- error: エラー
- success: 成功
- polis_config:
- reminder: Pol.isの管理画面への直接リンクが機能するように、Pol.isにログインすることを忘れないでください。
- title: Pol.isの設定
- warning: これはあなたの固有のIDです。共有したり変更したりしないでください。
- components:
- polis:
- settings:
- step:
- write_enabled: 書き込みを有効する
- vote_enabled: 投票を有効にする
- global:
- title: タイトル
- description: 説明
- social_sign_in_enabled: ソーシャルログインを有効にする
- visualization_enabled: ビジュアライゼーションを有効にする
- site_id: サイトID
- site_id_help: これはあなたの固有のIDです。共有したり変更したりしないでください。
- site_url: サイトURL
- site_url_help: Pol.isの管理画面への直接リンクが機能するように、Pol.isにログインすることを忘れないでください。
- name: Pol.is ディベート
- views:
- moder: 'Moderation:'
- polis:
- admin:
- configuration:
- edit:
- update: 更新
- polis:
- show:
- data: データ
- help:
- bottom: 新しいタイプのディスカッションへようこそ
- description_1: 他人の意見に投票する
- description_2: 自分の意見を表明する
- description_3: 7人以上の投票者がいる場合、意見グループが形成されます
- description_4: 新しい視点を提供して合意形成しましょう(意見グループはリアルタイムで変化します)
- top: Pol.isの使い方
- login_instructions: あなたのアカウントでログイン
- login_title: ディベートに参加する
- moderation:
- comments: コメント
- participants: 参加者
- stats: 統計
- exports: エクスポート
- reports: 報告する
- or: または
- question_circle_alt: 質問
- layouts:
- decidim:
- admin:
- settings:
- title: タイトル
- header:
- sign_in: ログイン
- sign_up: 新規登録
diff -uwbNr decidim-cfj/config/master.key decidim/development_app/config/master.key
--- decidim-cfj/config/master.key 1970-01-01 09:00:00
+++ decidim/development_app/config/master.key 2023-08-21 23:24:56
@@ -0,0 +1 @@
+a338ec57ead6b63944c7a29b6846a23e
\ No newline at end of file
diff -uwbNr decidim-cfj/config/newrelic.yml decidim/development_app/config/newrelic.yml
--- decidim-cfj/config/newrelic.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/newrelic.yml 1970-01-01 09:00:00
@@ -1,52 +0,0 @@
-#
-# This file configures the New Relic Agent. New Relic monitors Ruby, Java,
-# .NET, PHP, Python, Node, and Go applications with deep visibility and low
-# overhead. For more information, visit www.newrelic.com.
-#
-# Generated March 12, 2021
-#
-# This configuration file is custom generated for NewRelic Administration
-#
-# For full documentation of agent configuration options, please refer to
-# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration
-
-common: &default_settings
- # Required license key associated with your New Relic account.
- license_key: <%= ENV["NEW_RELIC_LICENSE_KEY"] %>
-
- # Your application name. Renaming here affects where data displays in New
- # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
- app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
-
- distributed_tracing:
- enabled: true
-
- # To disable the agent regardless of other settings, uncomment the following:
- # agent_enabled: false
-
- # Logging level
- log_level: info
-
- log_file_path: STDOUT
-
- monitor_mode: false
-
-
-# Environment-specific settings are in this section.
-# RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment.
-# If your application has other named environments, configure them here.
-development:
- <<: *default_settings
- app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> (Development)
-
-test:
- <<: *default_settings
- # It doesn't make sense to report to New Relic from automated test runs.
-
-staging:
- <<: *default_settings
- app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> (Staging)
-
-production:
- <<: *default_settings
- monitor_mode: true
diff -uwbNr decidim-cfj/config/puma.rb decidim/development_app/config/puma.rb
--- decidim-cfj/config/puma.rb 2023-08-21 23:04:55
+++ decidim/development_app/config/puma.rb 2023-08-21 23:24:56
@@ -1,49 +1,36 @@
-# frozen_string_literal: true
-
-require_relative "../lib/slack_chat_messenger"
-
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
-threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
-threads threads_count, threads_count
+max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
+min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
+threads min_threads_count, max_threads_count
+# Specifies the `worker_timeout` threshold that Puma will use to wait before
+# terminating a worker in development environments.
+#
+worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
-port ENV.fetch("PORT", 3000)
+port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in.
#
-environment ENV.fetch("RAILS_ENV", "development")
+environment ENV.fetch("RAILS_ENV") { "development" }
# Specifies the `pidfile` that Puma will use.
-pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid")
+pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
-before_fork do
- PumaWorkerKiller.config do |config|
- config.ram = 2048
- config.frequency = 60
- config.percent_usage = 0.9
- config.rolling_restart_frequency = 24 * 60 * 60
- config.reaper_status_logs = true
- config.pre_term = lambda do |worker|
- SlackChatMessenger.notify(channel: ENV.fetch('SLACK_MESSAGE_CHANNEL', nil), message: "[#{Rails.env}] Worker #{worker.index}(#{worker.pid}) being killed") # rubocop:disable Style/StringLiterals
- puts "Worker #{worker.index}(#{worker.pid}) being killed"
- end
- end
- PumaWorkerKiller.start
-end
-
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
-workers ENV.fetch("WEB_CONCURRENCY", 2)
+# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
@@ -54,3 +41,14 @@
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
+
+# Development SSL
+if ENV["DEV_SSL"] && defined?(Bundler) && (dev_gem = Bundler.load.specs.find { |spec| spec.name == "decidim-dev" })
+ cert_dir = ENV.fetch("DEV_SSL_DIR") { "#{dev_gem.full_gem_path}/lib/decidim/dev/assets" }
+ ssl_bind(
+ "0.0.0.0",
+ ENV.fetch("DEV_SSL_PORT") { 3443 },
+ cert_pem: File.read("#{cert_dir}/ssl-cert.pem"),
+ key_pem: File.read("#{cert_dir}/ssl-key.pem")
+ )
+end
diff -uwbNr decidim-cfj/config/routes.rb decidim/development_app/config/routes.rb
--- decidim-cfj/config/routes.rb 2023-08-21 20:45:09
+++ decidim/development_app/config/routes.rb 2023-08-21 23:24:56
@@ -1,16 +1,4 @@
-# frozen_string_literal: true
-
-require "sidekiq/web"
Rails.application.routes.draw do
- # Redirect to Metadecidim Japan
- get "/", to: redirect("https://meta.diycities.jp/"), constraints: { host: "www.diycities.jp" }
- get "/search", to: redirect("/")
-
- mount Decidim::Core::Engine => "/"
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
- authenticate :user, ->(u) { u.admin? } do
- mount Sidekiq::Web => "/sidekiq"
- end
-
- mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?
+ mount Decidim::Core::Engine => '/'
+ # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
diff -uwbNr decidim-cfj/config/secrets.yml decidim/development_app/config/secrets.yml
--- decidim-cfj/config/secrets.yml 2023-08-22 01:35:12
+++ decidim/development_app/config/secrets.yml 2023-08-21 23:24:56
@@ -4,11 +4,11 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
-# no regular words or you will be exposed to dictionary attacks.
+# no regular words or you'll be exposed to dictionary attacks.
# You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
-# if you are sharing your code publicly.
+# if you're sharing your code publicly.
decidim_default: &decidim_default
application_name: <%= Decidim::Env.new("DECIDIM_APPLICATION_NAME", "My Application Name").to_json %>
@@ -38,18 +38,14 @@
enable_remember_me: <%= Decidim::Env.new("DECIDIM_ENABLE_REMEMBER_ME", "auto").default_or_present_if_exists.to_s %>
follow_http_x_forwarded_host: <%= Decidim::Env.new("DECIDIM_FOLLOW_HTTP_X_FORWARDED_HOST").to_boolean_string %>
maximum_conversation_message_length: <%= Decidim::Env.new("DECIDIM_MAXIMUM_CONVERSATION_MESSAGE_LENGTH", "1000").to_i %>
- password_similarity_length: <%= Decidim::Env.new("DECIDIM_PASSWORD_SIMILARITY_LENGTH", 4).to_i %>
- denied_passwords: <%= Decidim::Env.new("DECIDIM_DENIED_PASSWORDS").to_array(separator: ", ").to_json %>
+ password_blacklist: <%= Decidim::Env.new("DECIDIM_PASSWORD_BLACKLIST").to_array(separator: ", ").to_json %>
allow_open_redirects: <%= Decidim::Env.new("DECIDIM_ALLOW_OPEN_REDIRECTS").to_boolean_string %>
- social_share_services: <%= Decidim::Env.new("DECIDIM_SOCIAL_SHARE_SERVICES", "Twitter, Facebook, WhatsApp, Telegram").to_array.to_json %>
service_worker_enabled: <%= Decidim::Env.new("DECIDIM_SERVICE_WORKER_ENABLED", Rails.env.exclude?("development")).to_boolean_string %>
- page_blocks: <%= Decidim::Env.new("DECIDIM_PAGE_BLOCKS", "terms-of-service").to_array %>
admin_password:
expiration_days: <%= Decidim::Env.new("DECIDIM_ADMIN_PASSWORD_EXPIRATION_DAYS", 90).to_i %>
min_length: <%= Decidim::Env.new("DECIDIM_ADMIN_PASSWORD_MIN_LENGTH", 15).to_i %>
repetition_times: <%= Decidim::Env.new("DECIDIM_ADMIN_PASSWORD_REPETITION_TIMES", 5).to_i %>
strong: <%= Decidim::Env.new("DECIDIM_ADMIN_PASSWORD_STRONG", true).to_boolean_string %>
- redesign_active: <%= Decidim::Env.new("DECIDIM_REDESIGN_ACTIVE").to_boolean_string %>
api:
schema_max_per_page: <%= Decidim::Env.new("API_SCHEMA_MAX_PER_PAGE", 50).to_i %>
schema_max_complexity: <%= Decidim::Env.new("API_SCHEMA_MAX_COMPLEXITY", 5000).to_i %>
@@ -92,7 +88,6 @@
scheme_name: "dummy"
quorum: 2
number_of_trustees: 3
- setup_minimum_hours_before_start: 1
storage_default: &storage_default
provider: <%= Decidim::Env.new("STORAGE_PROVIDER", "local").to_s %>
@@ -126,29 +121,19 @@
<<: *decidim_default
omniauth:
facebook:
- # It must be a boolean. Remember ENV variables doesn't support booleans.
- enabled: false
+ enabled: <%= Decidim::Env.new("OMNIAUTH_FACEBOOK_APP_ID").to_boolean_string %>
app_id: <%= ENV["OMNIAUTH_FACEBOOK_APP_ID"] %>
app_secret: <%= ENV["OMNIAUTH_FACEBOOK_APP_SECRET"] %>
- icon: facebook-line
twitter:
- enabled: false
+ enabled: <%= Decidim::Env.new("OMNIAUTH_TWITTER_API_KEY").to_boolean_string %>
api_key: <%= ENV["OMNIAUTH_TWITTER_API_KEY"] %>
api_secret: <%= ENV["OMNIAUTH_TWITTER_API_SECRET"] %>
- icon: twitter-line
google_oauth2:
- enabled: false
+ enabled: <%= Decidim::Env.new("OMNIAUTH_GOOGLE_CLIENT_ID").to_boolean_string %>
icon_path: decidim/brands/google.svg
client_id: <%= ENV["OMNIAUTH_GOOGLE_CLIENT_ID"] %>
client_secret: <%= ENV["OMNIAUTH_GOOGLE_CLIENT_SECRET"] %>
- line_login:
- enabled: false
- client_id: <%= ENV["OMNIAUTH_LINE_LOGIN_CHANNEL_ID"] %>
- client_secret: <%= ENV["OMNIAUTH_LINE_LOGIN_CHANNEL_SECRET"] %>
- geocoder:
- here_api_key: <%= ENV["GEOCODER_API_KEY"] %>
maps:
- api_key: <%= ENV["MAPS_API_KEY"] %>
dynamic_provider: <%= Decidim::Env.new("MAPS_DYNAMIC_PROVIDER", ENV["MAPS_PROVIDER"]).to_s %>
static_provider: <%= Decidim::Env.new("MAPS_STATIC_PROVIDER", ENV["MAPS_PROVIDER"]).to_s %>
static_api_key: <%= Decidim::Env.new("MAPS_STATIC_API_KEY", ENV["MAPS_API_KEY"]).to_s %>
@@ -173,19 +158,15 @@
development:
<<: *default
- secret_key_base: 03fa9d9f31520718799a9b5e4178068ccd26dd69425d37d2daecad74d02c552ccb102e7c8e2832f32fe7d287a562fc096a02527f916792eb0b29f4930c48e4f6
+ secret_key_base: 8dc1d10917e0cb1bd3186791cd407ab7df28425257519d35a058e68766638fb3f62dfcb965fa53934033242d8d8b8feee10699090a29a67bc68683ced357705a
omniauth:
developer:
enabled: true
- icon: phone-line
- line_login:
- enabled: true
- client_id:
- client_secret:
+ icon: phone
test:
<<: *default
- secret_key_base: 491da42c427ea936bca09cc6e24a0678edceabdb573046dc6f5ed05a4b570ad42630f1e10d310fced91055d9e1c9c246af860baa5edfd3c8cb063d27d4893d25
+ secret_key_base: b6bf84c34c73c1092c6b7b77a77ecd2d6133cabcdfb943387326bef265984f826caa6be637f28ef82b115048155d1cebfad94c66007252af37564f4d2c5319d8
omniauth:
facebook:
enabled: true
@@ -208,15 +189,13 @@
# instead read values from the environment.
production:
<<: *default
- aws_access_key_id: <%= ENV["AWS_ACCESS_KEY_ID"] %>
- aws_secret_access_key: <%= ENV["AWS_SECRET_ACCESS_KEY"] %>
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
smtp_username: <%= ENV["SMTP_USERNAME"] %>
smtp_password: <%= ENV["SMTP_PASSWORD"] %>
smtp_address: <%= ENV["SMTP_ADDRESS"] %>
smtp_domain: <%= ENV["SMTP_DOMAIN"] %>
smtp_port: <%= Decidim::Env.new("SMTP_PORT", 587).to_i %>
- smtp_starttls_auto: true
+ smtp_starttls_auto: <%= Decidim::Env.new("SMTP_STARTTLS_AUTO").to_boolean_string %>
smtp_authentication: <%= Decidim::Env.new("SMTP_AUTHENTICATION", "plain").to_s %>
elections:
bulletin_board_server: <%= ENV["BULLETIN_BOARD_SERVER"] %>
@@ -227,7 +206,7 @@
scheme_name: <%= Decidim::Env.new("ELECTIONS_SCHEME_NAME", "electionguard").to_s %>
number_of_trustees: <%= Decidim::Env.new("ELECTIONS_NUMBER_OF_TRUSTEES").to_i %>
quorum: <%= Decidim::Env.new("ELECTIONS_QUORUM").to_i %>
- setup_minimum_hours_before_start: <%= Decidim::Env.new("ELECTIONS_SETUP_MINIMUM_HOURS_BEFORE_START", 1).to_i %>
+ setup_minimum_hours_before_start: <%= Decidim::Env.new("ELECTIONS_SETUP_MINIMUM_HOURS_BEFORE_START", 3).to_i %>
start_vote_maximum_hours_before_start: <%= Decidim::Env.new("ELECTIONS_START_VOTE_MAXIMUM_HOURS_BEFORE_START", 6).to_i %>
voter_token_expiration_minutes: <%= Decidim::Env.new("ELECTIONS_VOTER_TOKEN_EXPIRATION_MINUTES", 120).to_i %>
votings:
diff -uwbNr decidim-cfj/config/sidekiq.yml decidim/development_app/config/sidekiq.yml
--- decidim-cfj/config/sidekiq.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/sidekiq.yml 1970-01-01 09:00:00
@@ -1,10 +0,0 @@
-:concurrency: 3
-:queues:
- - default
- - mailers
- - newsletter
- - newsletters_opt_in
- - events
- - metrics
- - exports
- - translations
diff -uwbNr decidim-cfj/config/spring.rb decidim/development_app/config/spring.rb
--- decidim-cfj/config/spring.rb 2023-08-21 23:04:55
+++ decidim/development_app/config/spring.rb 2023-08-21 23:24:56
@@ -1,10 +1,8 @@
-# frozen_string_literal: true
-
require "decidim/spring"
-%w(
- .ruby-version
- .rbenv-vars
- tmp/restart.txt
- tmp/caching-dev.txt
-).each { |path| Spring.watch(path) }
+Spring.watch(
+ ".ruby-version",
+ ".rbenv-vars",
+ "tmp/restart.txt",
+ "tmp/caching-dev.txt"
+)
diff -uwbNr decidim-cfj/config/storage.yml decidim/development_app/config/storage.yml
--- decidim-cfj/config/storage.yml 2023-07-03 17:49:30
+++ decidim/development_app/config/storage.yml 2023-08-21 23:24:56
@@ -6,27 +6,37 @@
service: Disk
root: <%= Rails.root.join("storage") %>
-# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
-amazon:
+s3:
service: S3
- region: ap-northeast-1
- bucket: <%= ENV.fetch("AWS_BUCKET_NAME", "cfj-decidim") %>
+ access_key_id: <%= Rails.application.secrets.dig(:storage, :s3, :access_key_id) %>
+ secret_access_key: <%= Rails.application.secrets.dig(:storage, :s3, :secret_access_key) %>
+ bucket: <%= Rails.application.secrets.dig(:storage, :s3, :bucket) %>
+ <%= "region: #{Rails.application.secrets.dig(:storage, :s3, :region)}" if Rails.application.secrets.dig(:storage, :s3, :region) %>
+ <%= "endpoint: #{Rails.application.secrets.dig(:storage, :s3, :endpoint)}" if Rails.application.secrets.dig(:storage, :s3, :endpoint) %>
-# Remember not to checkin your GCS keyfile to a repository
-# google:
-# service: GCS
-# project: your_project
-# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
-# bucket: your_own_bucket
+azure:
+ service: AzureStorage
+ storage_account_name: <%= Rails.application.secrets.dig(:storage, :azure, :storage_account_name) %>
+ storage_access_key: <%= Rails.application.secrets.dig(:storage, :azure, :storage_access_key) %>
+ container: <%= Rails.application.secrets.dig(:storage, :azure, :container) %>
-# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
-# microsoft:
-# service: AzureStorage
-# storage_account_name: your_account_name
-# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
-# container: your_container_name
+gcs:
+ service: GCS
+ project: <%= Rails.application.secrets.dig(:storage, :gcs, :project) %>
+ bucket: <%= Rails.application.secrets.dig(:storage, :gcs, :bucket) %>
+ credentials:
+ type: <%= Rails.application.secrets.dig(:storage, :gcs, :type) %>
+ project_id: <%= Rails.application.secrets.dig(:storage, :gcs, :project_id) %>
+ private_key_id: <%= Rails.application.secrets.dig(:storage, :gcs, :private_key_id) %>
+ private_key: <%= Rails.application.secrets.dig(:storage, :gcs, :private_key) %>
+ client_email: <%= Rails.application.secrets.dig(:storage, :gcs, :client_email) %>
+ client_id: <%= Rails.application.secrets.dig(:storage, :gcs, :client_id) %>
+ auth_uri: <%= Rails.application.secrets.dig(:storage, :gcs, :auth_uri) %>
+ token_uri: <%= Rails.application.secrets.dig(:storage, :gcs, :token_uri) %>
+ auth_provider_x509_cert_url: <%= Rails.application.secrets.dig(:storage, :gcs, :auth_provider_x509_cert_url) %>
+ client_x509_cert_url: <%= Rails.application.secrets.dig(:storage, :gcs, :client_x509_cert_url) %>
# mirror:
# service: Mirror
# primary: local
-# mirrors: [ amazon, google, microsoft ]
+# mirrors: [ s3, gcs, azure ]
diff -uwbNr decidim-cfj/config/webpack/.modernizrrc decidim/development_app/config/webpack/.modernizrrc
--- decidim-cfj/config/webpack/.modernizrrc 1970-01-01 09:00:00
+++ decidim/development_app/config/webpack/.modernizrrc 2023-08-21 23:25:11
@@ -0,0 +1,9 @@
+{
+ "minify": true,
+ "options": [
+ "setClasses"
+ ],
+ "feature-detects": [
+ "css/transitions"
+ ]
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment