diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/application.rb | 58 | ||||
| -rw-r--r-- | config/boot.rb | 5 | ||||
| -rw-r--r-- | config/cable.yml | 10 | ||||
| -rw-r--r-- | config/environment.rb | 7 | ||||
| -rw-r--r-- | config/environments/development.rb | 38 | ||||
| -rw-r--r-- | config/environments/production.rb | 42 | ||||
| -rw-r--r-- | config/environments/test.rb | 54 | ||||
| -rw-r--r-- | config/initializers/content_security_policy.rb | 29 | ||||
| -rw-r--r-- | config/initializers/filter_parameter_logging.rb | 8 | ||||
| -rw-r--r-- | config/initializers/inflections.rb | 18 | ||||
| -rw-r--r-- | config/initializers/new_framework_defaults_8_1.rb | 74 | ||||
| -rw-r--r-- | config/initializers/routing_filter_rails71_patch.rb | 38 | ||||
| -rw-r--r-- | config/puma.rb | 42 | ||||
| -rw-r--r-- | config/routes.rb | 87 | ||||
| -rw-r--r-- | config/tinymce.yml | 7 |
15 files changed, 332 insertions, 185 deletions
diff --git a/config/application.rb b/config/application.rb index d92802f..3ddad2d 100644 --- a/config/application.rb +++ b/config/application.rb | |||
| @@ -1,62 +1,20 @@ | |||
| 1 | # Put this in config/application.rb | 1 | require_relative "boot" |
| 2 | require File.expand_path('../boot', __FILE__) | ||
| 3 | 2 | ||
| 4 | require 'rails/all' | 3 | require "rails/all" |
| 5 | 4 | ||
| 6 | Bundler.require(:default, Rails.env) if defined?(Bundler) | 5 | Bundler.require(*Rails.groups) |
| 7 | |||
| 8 | require 'action_controller' | ||
| 9 | |||
| 10 | module ActionController | ||
| 11 | class Base | ||
| 12 | def self.consider_all_requests_local=(val) | ||
| 13 | # no-op: controlled via config.consider_all_requests_local in environment files | ||
| 14 | end | ||
| 15 | end | ||
| 16 | end | ||
| 17 | 6 | ||
| 18 | module Cccms | 7 | module Cccms |
| 19 | class Application < Rails::Application | 8 | class Application < Rails::Application |
| 20 | config.autoload_paths += [config.root.join('lib')] | 9 | config.load_defaults 8.1 |
| 21 | config.encoding = 'utf-8' | 10 | |
| 22 | # Settings in config/environments/* take precedence over those specified here. | 11 | config.autoload_lib(ignore: %w[assets tasks]) |
| 23 | # Application configuration should go into files in config/initializers | 12 | |
| 24 | # -- all .rb files in that directory are automatically loaded. | ||
| 25 | |||
| 26 | # Add additional load paths for your own custom dirs | ||
| 27 | # config.load_paths += %W( #{RAILS_ROOT}/extras ) | ||
| 28 | |||
| 29 | # Only load the plugins named here, in the order given (default is alphabetical). | ||
| 30 | # :all can be used as a placeholder for all plugins not explicitly named | ||
| 31 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] | ||
| 32 | |||
| 33 | # Allowed Tags | ||
| 34 | # strong em b i p code pre tt samp kbd var sub sup dfn cite big small | ||
| 35 | # address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dt dd abbr | ||
| 36 | # acronym a img blockquote del ins | ||
| 37 | |||
| 38 | # Allowed Attributes: | ||
| 39 | # href src width height alt cite datetime title class name xml:lang abbr)) | ||
| 40 | |||
| 41 | # Add tags to whitelist with: | ||
| 42 | # config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td' | ||
| 43 | |||
| 44 | # Add attributes to whitelist with: | ||
| 45 | # config.action_view.sanitized_allowed_attributes = 'id', 'class', 'style' | ||
| 46 | |||
| 47 | # Activate observers that should always be running | ||
| 48 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer | ||
| 49 | |||
| 50 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. | ||
| 51 | # Run "rake -D time" for a list of tasks for finding time zone names. | ||
| 52 | config.time_zone = 'Berlin' | 13 | config.time_zone = 'Berlin' |
| 53 | 14 | ||
| 54 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. | ||
| 55 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] | ||
| 56 | config.i18n.default_locale = :de | 15 | config.i18n.default_locale = :de |
| 57 | config.i18n.fallbacks = { en: [:en, :de] } | 16 | config.i18n.fallbacks = { en: [:en, :de] } |
| 58 | 17 | ||
| 59 | config.filter_parameters += [:password, :password_confirmation] | 18 | config.filter_parameters += [:password, :password_confirmation] |
| 60 | config.serve_static_files = true | ||
| 61 | end | 19 | end |
| 62 | end | 20 | end |
diff --git a/config/boot.rb b/config/boot.rb index b92444f..2820116 100644 --- a/config/boot.rb +++ b/config/boot.rb | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | require 'rubygems' | 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) |
| 2 | require 'bundler/setup' | 2 | |
| 3 | require "bundler/setup" # Set up gems listed in the Gemfile. | ||
diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..0c11ddb --- /dev/null +++ b/config/cable.yml | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | development: | ||
| 2 | adapter: async | ||
| 3 | |||
| 4 | test: | ||
| 5 | adapter: test | ||
| 6 | |||
| 7 | production: | ||
| 8 | adapter: redis | ||
| 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> | ||
| 10 | channel_prefix: cccms_production | ||
diff --git a/config/environment.rb b/config/environment.rb index 6fdeb06..cac5315 100644 --- a/config/environment.rb +++ b/config/environment.rb | |||
| @@ -1,2 +1,5 @@ | |||
| 1 | require File.expand_path('../application', __FILE__) | 1 | # Load the Rails application. |
| 2 | Cccms::Application.initialize! | 2 | require_relative "application" |
| 3 | |||
| 4 | # Initialize the Rails application. | ||
| 5 | Rails.application.initialize! | ||
diff --git a/config/environments/development.rb b/config/environments/development.rb index 1c26f7d..56174f8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb | |||
| @@ -1,26 +1,38 @@ | |||
| 1 | # Settings specified here will take precedence over those in config/environment.rb | 1 | require "active_support/core_ext/integer/time" |
| 2 | 2 | ||
| 3 | Cccms::Application.configure do | 3 | Rails.application.configure do |
| 4 | # In the development environment your application's code is reloaded on | ||
| 5 | # every request. This slows down response time but is perfect for development | ||
| 6 | # since you don't have to restart the webserver when you make code changes. | ||
| 7 | config.enable_reloading = true | 4 | config.enable_reloading = true |
| 5 | config.eager_load = false | ||
| 6 | |||
| 7 | config.consider_all_requests_local = true | ||
| 8 | config.server_timing = true | ||
| 8 | 9 | ||
| 9 | # Log error messages when you accidentally call methods on nil. | 10 | if Rails.root.join("tmp/caching-dev.txt").exist? |
| 11 | config.action_controller.perform_caching = true | ||
| 12 | config.action_controller.enable_fragment_cache_logging = true | ||
| 13 | config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } | ||
| 14 | else | ||
| 15 | config.action_controller.perform_caching = false | ||
| 16 | end | ||
| 10 | 17 | ||
| 11 | # Show full error reports and disable caching | 18 | config.cache_store = :memory_store |
| 12 | config.action_controller.consider_all_requests_local = true | ||
| 13 | config.action_controller.perform_caching = false | ||
| 14 | 19 | ||
| 15 | # Don't care if the mailer can't send | ||
| 16 | config.action_mailer.raise_delivery_errors = false | 20 | config.action_mailer.raise_delivery_errors = false |
| 21 | config.action_mailer.perform_caching = false | ||
| 22 | config.action_mailer.default_url_options = { host: "localhost", port: 3000 } | ||
| 17 | 23 | ||
| 18 | config.active_support.deprecation = :log | 24 | config.active_support.deprecation = :log |
| 19 | config.public_file_server.enabled = true | ||
| 20 | config.eager_load = false | ||
| 21 | 25 | ||
| 22 | config.hosts.clear | 26 | config.active_record.migration_error = :page_load |
| 27 | config.active_record.verbose_query_logs = true | ||
| 28 | config.active_record.query_log_tags_enabled = true | ||
| 29 | |||
| 30 | config.active_job.verbose_enqueue_logs = true | ||
| 31 | config.action_dispatch.verbose_redirect_logs = true | ||
| 32 | config.action_view.annotate_rendered_view_with_filenames = true | ||
| 33 | config.action_controller.raise_on_missing_callback_actions = true | ||
| 23 | 34 | ||
| 35 | config.hosts.clear | ||
| 24 | config.middleware.delete ExceptionNotification::Rack | 36 | config.middleware.delete ExceptionNotification::Rack |
| 25 | 37 | ||
| 26 | config.assets.debug = false | 38 | config.assets.debug = false |
diff --git a/config/environments/production.rb b/config/environments/production.rb index 82b918a..f8d078e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb | |||
| @@ -1,34 +1,20 @@ | |||
| 1 | # Settings specified here will take precedence over those in config/environment.rb | 1 | require "active_support/core_ext/integer/time" |
| 2 | 2 | ||
| 3 | Cccms::Application.configure do | 3 | Rails.application.configure do |
| 4 | # The production environment is meant for finished, "live" apps. | 4 | config.enable_reloading = false |
| 5 | # Code is not reloaded between requests | ||
| 6 | config.cache_classes = true | ||
| 7 | |||
| 8 | # Full error reports are disabled and caching is turned on | ||
| 9 | config.action_controller.consider_all_requests_local = false | ||
| 10 | config.action_controller.perform_caching = true | ||
| 11 | |||
| 12 | # See everything in the log (default is :info) | ||
| 13 | config.log_level = :info | ||
| 14 | |||
| 15 | config.active_support.deprecation = :notify | ||
| 16 | config.eager_load = true | 5 | config.eager_load = true |
| 6 | config.assume_ssl = true | ||
| 17 | 7 | ||
| 18 | # Use a different logger for distributed setups | 8 | config.consider_all_requests_local = false |
| 19 | # config.logger = SyslogLogger.new | 9 | config.action_controller.perform_caching = true |
| 20 | 10 | ||
| 21 | # Use a different cache store in production | 11 | config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } |
| 22 | # config.cache_store = :mem_cache_store | ||
| 23 | 12 | ||
| 24 | # Enable serving of images, stylesheets, and javascripts from an asset server | 13 | config.log_tags = [ :request_id ] |
| 25 | # config.action_controller.asset_host = "http://assets.example.com" | 14 | config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) |
| 15 | config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") | ||
| 26 | 16 | ||
| 27 | # Disable delivery errors, bad email addresses will be ignored | 17 | config.active_support.report_deprecations = false |
| 28 | # config.action_mailer.raise_delivery_errors = false | ||
| 29 | |||
| 30 | # Enable threaded mode | ||
| 31 | # config.threadsafe! | ||
| 32 | 18 | ||
| 33 | config.action_mailer.delivery_method = :sendmail | 19 | config.action_mailer.delivery_method = :sendmail |
| 34 | config.action_mailer.sendmail_settings = { | 20 | config.action_mailer.sendmail_settings = { |
| @@ -37,4 +23,10 @@ Cccms::Application.configure do | |||
| 37 | } | 23 | } |
| 38 | config.action_mailer.perform_deliveries = true | 24 | config.action_mailer.perform_deliveries = true |
| 39 | config.action_mailer.raise_delivery_errors = true | 25 | config.action_mailer.raise_delivery_errors = true |
| 26 | config.action_mailer.default_url_options = { host: "ccc.de" } | ||
| 27 | |||
| 28 | config.i18n.fallbacks = true | ||
| 29 | |||
| 30 | config.active_record.dump_schema_after_migration = false | ||
| 31 | config.active_record.attributes_for_inspect = [ :id ] | ||
| 40 | end | 32 | end |
diff --git a/config/environments/test.rb b/config/environments/test.rb index 48aafe8..bb89065 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb | |||
| @@ -1,17 +1,55 @@ | |||
| 1 | Cccms::Application.configure do | 1 | # The test environment is used exclusively to run your application's |
| 2 | # test suite. You never need to work with it otherwise. Remember that | ||
| 3 | # your test database is "scratch space" for the test suite and is wiped | ||
| 4 | # and recreated between test runs. Don't rely on the data there! | ||
| 2 | 5 | ||
| 6 | Rails.application.configure do | ||
| 7 | # Settings specified here will take precedence over those in config/application.rb. | ||
| 8 | |||
| 9 | # While tests run files are not watched, reloading is not necessary. | ||
| 3 | config.enable_reloading = false | 10 | config.enable_reloading = false |
| 4 | 11 | ||
| 5 | config.action_controller.consider_all_requests_local = true | 12 | # Eager loading loads your entire application. When running a single test locally, |
| 6 | config.action_controller.perform_caching = false | 13 | # this is usually not necessary, and can slow down your test suite. However, it's |
| 14 | # recommended that you enable it in continuous integration systems to ensure eager | ||
| 15 | # loading is working properly before deploying your code. | ||
| 16 | config.eager_load = ENV["CI"].present? | ||
| 17 | |||
| 18 | # Configure public file server for tests with cache-control for performance. | ||
| 19 | config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } | ||
| 20 | |||
| 21 | # Show full error reports. | ||
| 22 | config.consider_all_requests_local = true | ||
| 23 | config.cache_store = :null_store | ||
| 24 | |||
| 25 | # Render exception templates for rescuable exceptions and raise for other exceptions. | ||
| 26 | config.action_dispatch.show_exceptions = :rescuable | ||
| 27 | |||
| 28 | # Disable request forgery protection in test environment. | ||
| 29 | config.action_controller.allow_forgery_protection = false | ||
| 7 | 30 | ||
| 8 | config.action_controller.allow_forgery_protection = false | 31 | # Store uploaded files on the local file system in a temporary directory. |
| 32 | config.active_storage.service = :test | ||
| 9 | 33 | ||
| 34 | # Tell Action Mailer not to deliver emails to the real world. | ||
| 35 | # The :test delivery method accumulates sent emails in the | ||
| 36 | # ActionMailer::Base.deliveries array. | ||
| 10 | config.action_mailer.delivery_method = :test | 37 | config.action_mailer.delivery_method = :test |
| 11 | 38 | ||
| 12 | config.active_support.deprecation = :log | 39 | # Set host to be used by links generated in mailer templates. |
| 40 | config.action_mailer.default_url_options = { host: "example.com" } | ||
| 41 | |||
| 42 | # Print deprecation notices to the stderr. | ||
| 43 | config.active_support.deprecation = :stderr | ||
| 44 | |||
| 45 | # Raises error for missing translations. | ||
| 46 | # config.i18n.raise_on_missing_translations = true | ||
| 47 | |||
| 48 | # Annotate rendered view with file names. | ||
| 49 | # config.action_view.annotate_rendered_view_with_filenames = true | ||
| 50 | |||
| 51 | # Raise error when a before_action's only/except options reference missing actions. | ||
| 52 | config.action_controller.raise_on_missing_callback_actions = true | ||
| 13 | 53 | ||
| 14 | config.eager_load = false | 54 | config.assets.raise_runtime_errors = false |
| 15 | config.public_file_server.enabled = true | ||
| 16 | config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } | ||
| 17 | end | 55 | end |
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..d51d713 --- /dev/null +++ b/config/initializers/content_security_policy.rb | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # Be sure to restart your server when you modify this file. | ||
| 2 | |||
| 3 | # Define an application-wide content security policy. | ||
| 4 | # See the Securing Rails Applications Guide for more information: | ||
| 5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header | ||
| 6 | |||
| 7 | # Rails.application.configure do | ||
| 8 | # config.content_security_policy do |policy| | ||
| 9 | # policy.default_src :self, :https | ||
| 10 | # policy.font_src :self, :https, :data | ||
| 11 | # policy.img_src :self, :https, :data | ||
| 12 | # policy.object_src :none | ||
| 13 | # policy.script_src :self, :https | ||
| 14 | # policy.style_src :self, :https | ||
| 15 | # # Specify URI for violation reports | ||
| 16 | # # policy.report_uri "/csp-violation-report-endpoint" | ||
| 17 | # end | ||
| 18 | # | ||
| 19 | # # Generate session nonces for permitted importmap, inline scripts, and inline styles. | ||
| 20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } | ||
| 21 | # config.content_security_policy_nonce_directives = %w(script-src style-src) | ||
| 22 | # | ||
| 23 | # # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag` | ||
| 24 | # # if the corresponding directives are specified in `content_security_policy_nonce_directives`. | ||
| 25 | # # config.content_security_policy_nonce_auto = true | ||
| 26 | # | ||
| 27 | # # Report violations without enforcing the policy. | ||
| 28 | # # config.content_security_policy_report_only = true | ||
| 29 | # end | ||
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c0b717f --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | # Be sure to restart your server when you modify this file. | ||
| 2 | |||
| 3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. | ||
| 4 | # Use this to limit dissemination of sensitive information. | ||
| 5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. | ||
| 6 | Rails.application.config.filter_parameters += [ | ||
| 7 | :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc | ||
| 8 | ] | ||
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index d531b8b..3860f65 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb | |||
| @@ -1,10 +1,16 @@ | |||
| 1 | # Be sure to restart your server when you modify this file. | 1 | # Be sure to restart your server when you modify this file. |
| 2 | 2 | ||
| 3 | # Add new inflection rules using the following format | 3 | # Add new inflection rules using the following format. Inflections |
| 4 | # (all these examples are active by default): | 4 | # are locale specific, and you may define rules for as many different |
| 5 | # ActiveSupport::Inflector.inflections do |inflect| | 5 | # locales as you wish. All of these examples are active by default: |
| 6 | # inflect.plural /^(ox)$/i, '\1en' | 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| |
| 7 | # inflect.singular /^(ox)en/i, '\1' | 7 | # inflect.plural /^(ox)$/i, "\\1en" |
| 8 | # inflect.irregular 'person', 'people' | 8 | # inflect.singular /^(ox)en/i, "\\1" |
| 9 | # inflect.irregular "person", "people" | ||
| 9 | # inflect.uncountable %w( fish sheep ) | 10 | # inflect.uncountable %w( fish sheep ) |
| 10 | # end | 11 | # end |
| 12 | |||
| 13 | # These inflection rules are supported but not enabled by default: | ||
| 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| | ||
| 15 | # inflect.acronym "RESTful" | ||
| 16 | # end | ||
diff --git a/config/initializers/new_framework_defaults_8_1.rb b/config/initializers/new_framework_defaults_8_1.rb new file mode 100644 index 0000000..8569b5b --- /dev/null +++ b/config/initializers/new_framework_defaults_8_1.rb | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | # Be sure to restart your server when you modify this file. | ||
| 2 | # | ||
| 3 | # This file eases your Rails 8.1 framework defaults upgrade. | ||
| 4 | # | ||
| 5 | # Uncomment each configuration one by one to switch to the new default. | ||
| 6 | # Once your application is ready to run with all new defaults, you can remove | ||
| 7 | # this file and set the `config.load_defaults` to `8.1`. | ||
| 8 | # | ||
| 9 | # Read the Guide for Upgrading Ruby on Rails for more info on each option. | ||
| 10 | # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html | ||
| 11 | |||
| 12 | ### | ||
| 13 | # Skips escaping HTML entities and line separators. When set to `false`, the | ||
| 14 | # JSON renderer no longer escapes these to improve performance. | ||
| 15 | # | ||
| 16 | # Example: | ||
| 17 | # class PostsController < ApplicationController | ||
| 18 | # def index | ||
| 19 | # render json: { key: "\u2028\u2029<>&" } | ||
| 20 | # end | ||
| 21 | # end | ||
| 22 | # | ||
| 23 | # Renders `{"key":"\u2028\u2029\u003c\u003e\u0026"}` with the previous default, but `{"key":" <>&"}` with the config | ||
| 24 | # set to `false`. | ||
| 25 | # | ||
| 26 | # Applications that want to keep the escaping behavior can set the config to `true`. | ||
| 27 | #++ | ||
| 28 | # Rails.configuration.action_controller.escape_json_responses = false | ||
| 29 | |||
| 30 | ### | ||
| 31 | # Skips escaping LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) in JSON. | ||
| 32 | # | ||
| 33 | # Historically these characters were not valid inside JavaScript literal strings but that changed in ECMAScript 2019. | ||
| 34 | # As such it's no longer a concern in modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. | ||
| 35 | #++ | ||
| 36 | # Rails.configuration.active_support.escape_js_separators_in_json = false | ||
| 37 | |||
| 38 | ### | ||
| 39 | # Raises an error when order dependent finder methods (e.g. `#first`, `#second`) are called without `order` values | ||
| 40 | # on the relation, and the model does not have any order columns (`implicit_order_column`, `query_constraints`, or | ||
| 41 | # `primary_key`) to fall back on. | ||
| 42 | # | ||
| 43 | # The current behavior of not raising an error has been deprecated, and this configuration option will be removed in | ||
| 44 | # Rails 8.2. | ||
| 45 | #++ | ||
| 46 | # Rails.configuration.active_record.raise_on_missing_required_finder_order_columns = true | ||
| 47 | |||
| 48 | ### | ||
| 49 | # Controls how Rails handles path relative URL redirects. | ||
| 50 | # When set to `:raise`, Rails will raise an `ActionController::Redirecting::UnsafeRedirectError` | ||
| 51 | # for relative URLs without a leading slash, which can help prevent open redirect vulnerabilities. | ||
| 52 | # | ||
| 53 | # Example: | ||
| 54 | # redirect_to "example.com" # Raises UnsafeRedirectError | ||
| 55 | # redirect_to "@attacker.com" # Raises UnsafeRedirectError | ||
| 56 | # redirect_to "/safe/path" # Works correctly | ||
| 57 | # | ||
| 58 | # Applications that want to allow these redirects can set the config to `:log` (previous default) | ||
| 59 | # to only log warnings, or `:notify` to send ActiveSupport notifications. | ||
| 60 | #++ | ||
| 61 | # Rails.configuration.action_controller.action_on_path_relative_redirect = :raise | ||
| 62 | |||
| 63 | ### | ||
| 64 | # Use a Ruby parser to track dependencies between Action View templates | ||
| 65 | #++ | ||
| 66 | # Rails.configuration.action_view.render_tracker = :ruby | ||
| 67 | |||
| 68 | ### | ||
| 69 | # When enabled, hidden inputs generated by `form_tag`, `token_tag`, `method_tag`, and the hidden parameter fields | ||
| 70 | # included in `button_to` forms will omit the `autocomplete="off"` attribute. | ||
| 71 | # | ||
| 72 | # Applications that want to keep generating the `autocomplete` attribute for those tags can set it to `false`. | ||
| 73 | #++ | ||
| 74 | # Rails.configuration.action_view.remove_hidden_field_autocomplete = true | ||
diff --git a/config/initializers/routing_filter_rails71_patch.rb b/config/initializers/routing_filter_rails71_patch.rb deleted file mode 100644 index 35e3576..0000000 --- a/config/initializers/routing_filter_rails71_patch.rb +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | # routing-filter 0.7.0 is broken on Rails 7.1+ due to a change in how | ||
| 2 | # ActionDispatch::Journey::Router#find_routes yields results (lazy iterator | ||
| 3 | # vs eager enumerable). This patch restores the expected behaviour. | ||
| 4 | # See: https://github.com/svenfuchs/routing-filter/pull/87 | ||
| 5 | # Remove this file if routing-filter ever releases a fixed version, | ||
| 6 | # or when routing-filter is replaced with native Rails i18n scope routing. | ||
| 7 | |||
| 8 | if Gem.loaded_specs['routing-filter'].version > Gem::Version.new('0.7.0') | ||
| 9 | raise 'routing-filter has been updated — check if this patch is still needed and remove it if so.' | ||
| 10 | end | ||
| 11 | |||
| 12 | ActionDispatchJourneyRouterWithFiltering.remove_method(:find_routes) | ||
| 13 | |||
| 14 | module RoutingFilterRails71Fix | ||
| 15 | def find_routes(env) | ||
| 16 | path = env.is_a?(Hash) ? env['PATH_INFO'] : env.path_info | ||
| 17 | filter_parameters = {} | ||
| 18 | original_path = path.dup | ||
| 19 | |||
| 20 | @routes.filters.run(:around_recognize, path, env) do | ||
| 21 | filter_parameters | ||
| 22 | end | ||
| 23 | |||
| 24 | super(env) do |match, parameters, route| | ||
| 25 | parameters = parameters.merge(filter_parameters) | ||
| 26 | |||
| 27 | if env.is_a?(Hash) | ||
| 28 | env['PATH_INFO'] = original_path | ||
| 29 | else | ||
| 30 | env.path_info = original_path | ||
| 31 | end | ||
| 32 | |||
| 33 | yield [match, parameters, route] | ||
| 34 | end | ||
| 35 | end | ||
| 36 | end | ||
| 37 | |||
| 38 | ActionDispatch::Journey::Router.prepend(RoutingFilterRails71Fix) | ||
diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..38c4b86 --- /dev/null +++ b/config/puma.rb | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | # This configuration file will be evaluated by Puma. The top-level methods that | ||
| 2 | # are invoked here are part of Puma's configuration DSL. For more information | ||
| 3 | # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. | ||
| 4 | # | ||
| 5 | # Puma starts a configurable number of processes (workers) and each process | ||
| 6 | # serves each request in a thread from an internal thread pool. | ||
| 7 | # | ||
| 8 | # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You | ||
| 9 | # should only set this value when you want to run 2 or more workers. The | ||
| 10 | # default is already 1. You can set it to `auto` to automatically start a worker | ||
| 11 | # for each available processor. | ||
| 12 | # | ||
| 13 | # The ideal number of threads per worker depends both on how much time the | ||
| 14 | # application spends waiting for IO operations and on how much you wish to | ||
| 15 | # prioritize throughput over latency. | ||
| 16 | # | ||
| 17 | # As a rule of thumb, increasing the number of threads will increase how much | ||
| 18 | # traffic a given process can handle (throughput), but due to CRuby's | ||
| 19 | # Global VM Lock (GVL) it has diminishing returns and will degrade the | ||
| 20 | # response time (latency) of the application. | ||
| 21 | # | ||
| 22 | # The default is set to 3 threads as it's deemed a decent compromise between | ||
| 23 | # throughput and latency for the average Rails application. | ||
| 24 | # | ||
| 25 | # Any libraries that use a connection pool or another resource pool should | ||
| 26 | # be configured to provide at least as many connections as the number of | ||
| 27 | # threads. This includes Active Record's `pool` parameter in `database.yml`. | ||
| 28 | threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) | ||
| 29 | threads threads_count, threads_count | ||
| 30 | |||
| 31 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. | ||
| 32 | port ENV.fetch("PORT", 3000) | ||
| 33 | |||
| 34 | # Allow puma to be restarted by `bin/rails restart` command. | ||
| 35 | plugin :tmp_restart | ||
| 36 | |||
| 37 | # Run the Solid Queue supervisor inside of Puma for single-server deployments. | ||
| 38 | plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] | ||
| 39 | |||
| 40 | # Specify the PID file. Defaults to tmp/pids/server.pid in development. | ||
| 41 | # In other environments, only set the PID file if requested. | ||
| 42 | pidfile ENV["PIDFILE"] if ENV["PIDFILE"] | ||
diff --git a/config/routes.rb b/config/routes.rb index c3fd5c6..9d4b41d 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -1,60 +1,65 @@ | |||
| 1 | Cccms::Application.routes.draw do | 1 | Cccms::Application.routes.draw do |
| 2 | filter :locale | ||
| 3 | 2 | ||
| 4 | root :to => 'content#render_page', :page_path => ['home'], :locale => 'de' | 3 | # Provides the locale prefix url scheme |
| 4 | scope '(:locale)', locale: ->(v) { I18n.available_locales.map(&:to_s).include?(v) } do | ||
| 5 | 5 | ||
| 6 | resources :tags | 6 | root :to => 'content#render_page', :page_path => ['home'], :locale => 'de' |
| 7 | resources :occurrences | ||
| 8 | resources :events | ||
| 9 | 7 | ||
| 10 | resources :pages do | 8 | resources :tags |
| 11 | member do | 9 | resources :occurrences |
| 12 | get :preview | 10 | resources :events |
| 13 | put :sort_images | ||
| 14 | end | ||
| 15 | end | ||
| 16 | 11 | ||
| 17 | resources :nodes do | 12 | resources :pages do |
| 18 | member do | 13 | member do |
| 19 | put :unlock | 14 | get :preview |
| 20 | put :publish | 15 | put :sort_images |
| 16 | end | ||
| 21 | end | 17 | end |
| 22 | 18 | ||
| 23 | resources :revisions do | 19 | resources :nodes do |
| 24 | collection do | ||
| 25 | post :diff | ||
| 26 | end | ||
| 27 | member do | 20 | member do |
| 28 | put :restore | 21 | put :unlock |
| 22 | put :publish | ||
| 23 | end | ||
| 24 | |||
| 25 | resources :revisions do | ||
| 26 | collection do | ||
| 27 | post :diff | ||
| 28 | end | ||
| 29 | member do | ||
| 30 | put :restore | ||
| 31 | end | ||
| 29 | end | 32 | end |
| 30 | end | 33 | end |
| 31 | end | ||
| 32 | 34 | ||
| 33 | scope '/admin' do | 35 | scope '/admin' do |
| 34 | resources :assets | 36 | resources :assets |
| 35 | end | 37 | end |
| 36 | 38 | ||
| 37 | match '/logout' => 'sessions#destroy', :as => :logout, :via => :delete | 39 | match '/logout' => 'sessions#destroy', :as => :logout, :via => :delete |
| 38 | match '/login' => 'sessions#new', :as => :login, :via => :get | 40 | match '/login' => 'sessions#new', :as => :login, :via => :get |
| 39 | match 'admin' => 'admin#index', :as => :admin, :via => :get | 41 | match 'admin' => 'admin#index', :as => :admin, :via => :get |
| 40 | match 'admin/search' => 'admin#search', :as => :admin_search, :via => :get | 42 | match 'admin/search' => 'admin#search', :as => :admin_search, :via => :get |
| 41 | match 'search' => 'search#index', :as => :search, :via => :get | 43 | match 'search' => 'search#index', :as => :search, :via => :get |
| 42 | 44 | ||
| 43 | resources :users | 45 | resources :users |
| 44 | 46 | ||
| 45 | resources :menu_items do | 47 | resources :menu_items do |
| 46 | member do | 48 | member do |
| 47 | post :sort | 49 | post :sort |
| 50 | end | ||
| 48 | end | 51 | end |
| 49 | end | ||
| 50 | 52 | ||
| 51 | resource :session | 53 | resource :session |
| 54 | |||
| 55 | get 'rss/updates', :to => 'rss#updates', :as => :rss | ||
| 56 | get 'rss/updates.:format', :to => 'rss#updates', :as => :rss_feed, | ||
| 57 | :constraints => { :format => /xml|rdf/ } | ||
| 58 | get 'rss/recent_changes', :to => 'rss#recent_changes' | ||
| 52 | 59 | ||
| 53 | get 'rss/updates', :to => 'rss#updates', :as => :rss | 60 | match 'galleries/*page_path' => 'content#render_gallery', :via => :get |
| 54 | get 'rss/updates.:format', :to => 'rss#updates', :as => :rss_feed, | 61 | match '/*page_path' => 'content#render_page', :as => :content, :via => :get |
| 55 | :constraints => { :format => /xml|rdf/ } | 62 | |
| 56 | get 'rss/recent_changes', :to => 'rss#recent_changes' | 63 | end |
| 57 | 64 | ||
| 58 | match 'galleries/*page_path' => 'content#render_gallery', :via => :get | ||
| 59 | match '/*page_path' => 'content#render_page', :as => :content, :via => :get | ||
| 60 | end | 65 | end |
diff --git a/config/tinymce.yml b/config/tinymce.yml new file mode 100644 index 0000000..a97fbe7 --- /dev/null +++ b/config/tinymce.yml | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | license_key: gpl | ||
| 2 | plugins: | ||
| 3 | - paste | ||
| 4 | toolbar: bold italic underline | bullist numlist | link unlink | blocks | code | ||
| 5 | extended_valid_elements: "aggregate[tags|limit|order_by|order_direction|partial|conditions]" | ||
| 6 | relative_urls: false | ||
| 7 | entity_encoding: raw | ||
