Align project files with CodeHarbor

Since both projects are developed together and by the same team, we also want to have the same code structure and utility methods available in both projects. Therefore, this commit changes many files, but without a functional change.
This commit is contained in:
Sebastian Serth
2023-10-10 23:25:02 +02:00
parent fb3e8972d9
commit 99bd46af1a
112 changed files with 433 additions and 320 deletions

View File

@ -45,6 +45,9 @@ module CodeOcean
config.action_cable.mount_path = "#{ENV.fetch('RAILS_RELATIVE_URL_ROOT', '')}/cable"
# Disable concurrent ActionCable workers to ensure ACE change events keep their order
config.action_cable.worker_pool_size = 1
config.telegraf.tags = {application: 'codeocean'}
config.after_initialize do
@ -55,13 +58,15 @@ module CodeOcean
Runner.strategy_class.initialize_environment
end
# Specify default options for Rails generators
config.generators do |g|
g.orm :active_record, primary_key_type: :uuid
end
# Allow tables in addition to existing default tags
config.action_view.sanitized_allowed_tags = ActionView::Base.sanitized_allowed_tags + %w[table thead tbody tfoot td tr]
# Extract Sentry-related parameters from WebSocket connection
config.middleware.insert_before 0, Middleware::WebSocketSentryHeaders
# Disable concurrent ActionCable workers to ensure ACE change events keep their order
config.action_cable.worker_pool_size = 1
end
end

View File

@ -13,6 +13,9 @@ production:
<<: *default
database: codeocean_production
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: codeocean_test

View File

@ -5,6 +5,7 @@ require 'active_support/core_ext/integer/time'
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Allowed IPs for the Vagrant setup
config.web_console.allowed_ips = '192.168.0.0/16'
# In the development environment your application's code is reloaded any time
@ -43,10 +44,6 @@ Rails.application.configure do
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Perform deliveries via letter opener
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :letter_opener
config.action_mailer.perform_caching = false
# Print deprecation notices to the Rails logger.

View File

@ -22,6 +22,7 @@ Rails.application.configure do
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
config.read_encrypted_secrets = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
@ -67,7 +68,7 @@ Rails.application.configure do
# 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 = "code_ocean_production"
# config.active_job.queue_name_prefix = "codeocean_production"
config.action_mailer.perform_caching = false

View File

@ -59,8 +59,8 @@ Rails.application.configure do
config.active_support.disallowed_deprecation_warnings = []
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
config.action_view.annotate_rendered_view_with_filenames = true
end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do

View File

@ -1,4 +1,5 @@
# 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:

View File

@ -8,14 +8,13 @@ RailsAdmin.config do |config|
# config.authenticate_with do
# warden.authenticate! scope: :user
# end
# config.current_user_method(&:current_user)
config.current_user_method(&:current_user)
## == CancanCan ==
# config.authorize_with :cancancan
## == Pundit ==
# config.authorize_with :pundit
config.parent_controller = '::RailsAdminController'
config.authorize_with do
# Important! We need to check the authorization here, we skip Pundit checks in the RailsAdminController.
@ -30,6 +29,9 @@ RailsAdmin.config do |config|
### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
config.parent_controller = '::RailsAdminController'
config.excluded_models = %w[Generators::TestingFrameworkAdapterGenerator]
## == Gravatar integration ==
## To disable Gravatar integration in Navigation Bar set to false
# config.show_gravatar = true
@ -51,8 +53,6 @@ RailsAdmin.config do |config|
end
end
config.excluded_models = %w[Generators::TestingFrameworkAdapterGenerator]
config.actions do
# mandatory
dashboard do

View File

@ -7,16 +7,16 @@ default: &default
# Alternatively, you can use '/' to use the whole source_path directory.
source_entry_path: /
# If nested_entries is true, then we'll pick up subdirectories within the source_entry_path.
# You cannot set this option to true if you set source_entry_path to '/'
nested_entries: false
# While using a File-System-based automated bundle generation feature, miscellaneous warnings suggesting css order
# conflicts may arise due to the mini-css-extract-plugin. For projects where css ordering has been mitigated through
# consistent use of scoping or naming conventions, the css order warnings can be disabled by setting
# css_extract_ignore_order_warnings to true
css_extract_ignore_order_warnings: false
# If nested_entries is true, then we'll pick up subdirectories within the source_entry_path.
# You cannot set this option to true if you set source_entry_path to '/'
nested_entries: false
public_root_path: public
public_output_path: packs
cache_path: tmp/shakapacker
@ -38,7 +38,7 @@ default: &default
webpack_loader: 'babel'
# Set to true to enable check for matching versions of shakapacker gem and NPM package - will raise an error if there is a mismatch or wildcard versioning is used
ensure_consistent_versioning: true
ensure_consistent_versioning: false
# Select whether the compiler will use SHA digest ('digest' option) or most most recent modified timestamp ('mtime') to determine freshness
compiler_strategy: digest
@ -60,10 +60,10 @@ development:
# If HMR is on, CSS will by inlined by delivering it as part of the script payload via style-loader. Be sure
# that you add style-loader to your project dependencies.
#
# If you want to instead deliver CSS via <link> with the mini-extract-css-plugin, set inline_css to false.
# If you want to instead deliver CSS via <link> with the mini-css-extract-plugin, set inline_css to false.
# In that case, style-loader is not needed as a dependency.
#
# mini-extract-css-plugin is a required dependency in both cases.
# mini-css-extract-plugin is a required dependency in both cases.
inline_css: true
# Defaults to the inverse of hmr. Uncomment to manually set this.
# live_reload: true

View File

@ -20,7 +20,7 @@ const public_output_path = webpackConfig.output.publicPath;
const envConfig = module.exports = {
node: {
global: false,
global: false,
},
module: {
rules: [