# update on the permission view in the future, if not already scheduled.
AsyncPermissionsUpdateInterval: 20
+ # RailsSessionSecretToken is a string of alphanumeric characters
+ # used by Rails to sign session tokens. IMPORTANT: This is a
+ # site secret. It should be at least 50 characters.
+ RailsSessionSecretToken: ""
+
Users:
# Config parameters to automatically setup new users. If enabled,
# this users will be able to self-activate. Enable this if you want
arvcfg.declare_config "API.MaxIndexDatabaseRead", Integer, :max_index_database_read
arvcfg.declare_config "API.MaxItemsPerResponse", Integer, :max_items_per_response
arvcfg.declare_config "API.AsyncPermissionsUpdateInterval", ActiveSupport::Duration, :async_permissions_update_interval
+arvcfg.declare_config "API.RailsSessionSecretToken", NonemptyString, :secret_token
arvcfg.declare_config "Users.AutoSetupNewUsers", Boolean, :auto_setup_new_users
arvcfg.declare_config "Users.AutoSetupNewUsersWithVmUUID", String, :auto_setup_new_users_with_vm_uuid
arvcfg.declare_config "Users.AutoSetupNewUsersWithRepository", Boolean, :auto_setup_new_users_with_repository
# Checks for wrongly typed configuration items, and essential items
# that can't be empty
+arvcfg.coercion_and_check $base_arvados_config, check_nonempty: false
arvcfg.coercion_and_check $arvados_config
dbcfg.coercion_and_check $arvados_config
+if $arvados_config["Collections"]["DefaultTrashLifetime"] < 86400.seconds then
+ raise "default_trash_lifetime is %d, must be at least 86400" % Rails.configuration.Collections.DefaultTrashLifetime
+end
+
#
# Special case for test database where there's no database.yml,
# because the Arvados config.yml doesn't have a concept of multiple
remainders
end
- def coercion_and_check check_cfg
+ def coercion_and_check check_cfg, check_nonempty: true
@config_types.each do |cfgkey, cfgtype|
cfg = check_cfg
k = cfgkey
end
if cfgtype == NonemptyString
- if (!cfg[k] || cfg[k] == "")
+ if (!cfg[k] || cfg[k] == "") && check_nonempty
raise "#{cfgkey} cannot be empty"
end
if cfg[k].is_a? String
+++ /dev/null
-# Copyright (C) The Arvados Authors. All rights reserved.
-#
-# SPDX-License-Identifier: AGPL-3.0
-
-namespace :config do
- desc 'Ensure site configuration has all required settings'
- task check: :environment do
- $stderr.puts "%-32s %s" % ["AppVersion (discovered)", AppVersion.hash]
- $application_config.sort.each do |k, v|
- if ENV.has_key?('QUIET') then
- # Make sure we still check for the variable to exist
- eval("Rails.configuration.#{k}")
- else
- if /(password|secret|signing_key)/.match(k) then
- # Make sure we still check for the variable to exist, but don't print the value
- eval("Rails.configuration.#{k}")
- $stderr.puts "%-32s %s" % [k, '*********']
- else
- $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")]
- end
- end
- end
- # default_trash_lifetime cannot be less than 24 hours
- if Rails.configuration.Collections.DefaultTrashLifetime < 86400 then
- raise "default_trash_lifetime is %d, must be at least 86400" % Rails.configuration.Collections.DefaultTrashLifetime
- end
- end
-end
+++ /dev/null
-# Copyright (C) The Arvados Authors. All rights reserved.
-#
-# SPDX-License-Identifier: AGPL-3.0
-
-namespace :config do
- desc 'Print active site configuration'
- task dump: :environment do
- combined = $arvados_config.deep_dup
- combined.update $remaining_config
- puts combined.to_yaml
- end
-end