66
77require "csv"
88
9- # Require the gems listed in Gemfile, including any gems
10- # you've limited to :test, :development, or :production.
119Bundler . require ( *Rails . groups )
1210
1311module DMPRoadmap
@@ -78,21 +76,19 @@ class Application < Rails::Application
7876 # APPLICATION SETTINGS #
7977 # -------------------- #
8078
81- # Used throughout the system via ApplicationService.application_name
8279 config . x . application . name = ENV [ 'APPLICATION_NAME' ]
83- # Used as the default domain when 'archiving' (aka anonymizing) a user account
84- # for example `jane.doe@uni.edu` becomes `1234@removed_accounts-example.org`
80+
8581 config . x . application . archived_accounts_email_suffix = ENV [ 'APPLICATION_ARCHIVED_ACCOUNTS_EMAIL_SUFFIX' ]
86- # Available CSV separators, the default is ','
82+
8783 config . x . application . csv_separators = [ ',' , '|' , '#' ]
88- # The largest page size allowed in requests to the API (all versions)
84+
8985 config . x . application . api_max_page_size = ENV [ 'APPLICATION_API_MAX_PAGE_SIZE' ]
90- # The link to the API documentation - used in emails about the API
86+
9187 config . x . application . api_documentation_urls = {
9288 v0 : ENV [ 'APPLICATION_API_DOCUMENTATION_URLS_VO' ] ,
9389 v1 : ENV [ 'APPLICATION_API_DOCUMENTATION_URLS_V1' ]
9490 }
95- # The links that appear on the home page. Add any number of links
91+
9692 config . x . application . welcome_links = [
9793 {
9894 title : ENV [ 'APPLICATION_WELCOME_LINK_TITLE_1' ] ,
@@ -126,37 +122,33 @@ class Application < Rails::Application
126122 }
127123 }
128124 }
129- # Setting to only take orgs from local and not allow on-the-fly creation
125+ # only take orgs from local and not allow on-the-fly creation
130126 config . x . application . restrict_orgs = ENV [ 'APPLICATION_RESTRICT_ORGS' ]
131- # Setting to display phone number in contributor form
127+
132128 config . x . application . display_contributor_phone_number = ENV [ 'APPLICATION_DISPLAY_CONTRIBUTOR_PHONE_NUMBER' ]
133129
134- # Setting require contributor requirement of contributor name and email
135130 config . x . application . require_contributor_name = ENV [ 'APPLICATION_REQUIRE_CONTRIBUTOR_NAME' ]
131+
136132 config . x . application . require_contributor_email = ENV [ 'APPLICATION_REQUIRE_CONTRIBUTOR_EMAIL' ]
137133
138- # Defines if Guidances/Comments in toggleable & if it's opened by default
139134 config . x . application . guidance_comments_toggleable = ENV [ 'APPLICATION_GUIDANCE_COMMENTS_TOGGLEABLE' ]
135+
140136 config . x . application . guidance_comments_opened_by_default = ENV [ 'APPLICATION_GUIDANCE_COMMENTS_OPENED_BY_DEFAULT' ]
141137
142138 # ------------------- #
143139 # SHIBBOLETH SETTINGS #
144140 # ------------------- #
145141
146- # Enable shibboleth as an alternative authentication method
147- # Requires server configuration and omniauth shibboleth provider configuration
148- # See config/initializers/devise.rb
149142 config . x . shibboleth . enabled = true
150143
151- # Relative path to Shibboleth SSO Logouts
152144 config . x . shibboleth . login_url = '/Shibboleth.sso/Login'
145+
153146 config . x . shibboleth . logout_url = '/Shibboleth.sso/Logout?return='
154147
155148 # If this value is set to true your users will be presented with a list of orgs that have a
156- # shibboleth identifier in the orgs_identifiers table. If it is set to false (default), the user
149+ # shibboleth identifier in the orgs_identifiers table (and a super admin will also be able
150+ # to associate orgs with their shibboleth entityIds). If it is set to false (default), the user
157151 # will be driven out to your federation's discovery service
158- #
159- # A super admin will also be able to associate orgs with their shibboleth entityIds if this is set to true
160152 config . x . shibboleth . use_filtered_discovery_service = false
161153
162154 # ------- #
@@ -200,11 +192,12 @@ class Application < Rails::Application
200192 # plan can be submitted for feedback
201193 config . x . plans . default_percentage_answered = 50
202194
203- # Whether or not Super adminis can read all of the user's plans regardless of
204- # the plans visibility and whether or not the plan has been shared
205- config . x . plans . org_admins_read_all = true
206195 # Whether or not Organisational administrators can read all of the user's plans
207196 # regardless of the plans visibility and whether or not the plan has been shared
197+ config . x . plans . org_admins_read_all = true
198+
199+ # Whether or not super admins can read all of the user's plans regardless of
200+ # the plans visibility and whether or not the plan has been shared
208201 config . x . plans . super_admins_read_all = true
209202
210203 # Check download of a plan coversheet tickbox
@@ -225,30 +218,36 @@ class Application < Rails::Application
225218 # this is the abbreviation for the installation's root org as set in the org table
226219 config . x . google_analytics . tracker_root = ''
227220
228- # ------------------------------------------------------------------------ #
229- # reCAPTCHA - recaptcha appears on the create account and contact us forms #
230- # ------------------------------------------------------------------------ #
221+ # --------- #
222+ # reCAPTCHA #
223+ # --------- #
231224 config . x . recaptcha . enabled = false
232225
233226 # --------------------------------------------------- #
234227 # Machine Actionable / Networked DMP Features (maDMP) #
235228 # --------------------------------------------------- #
236229 # Enable/disable functionality on the Project Details tab
237230 config . x . madmp . enable_ethical_issues = true
231+
238232 config . x . madmp . enable_research_domain = true
239233
240234 # This flag will enable/disable the entire Research Outputs tab. The others below will
241235 # just enable/disable specific functionality on the Research Outputs tab
242236 config . x . madmp . enable_research_outputs = true
237+
243238 config . x . madmp . enable_license_selection = true
239+
244240 config . x . madmp . enable_metadata_standard_selection = true
241+
245242 config . x . madmp . enable_repository_selection = true
246243
247244 # The following flags will allow the system to include the question and answer in the JSON output
248245 # - questions with a theme equal to 'Preservation'
249246 config . x . madmp . extract_preservation_statements_from_themed_questions = false
247+
250248 # - questions with a theme equal to 'Data Collection'
251249 config . x . madmp . extract_data_quality_statements_from_themed_questions = false
250+
252251 # - questions with a theme equal to 'Ethics & privacy' or 'Storage & security'
253252 config . x . madmp . extract_security_privacy_statements_from_themed_questions = false
254253
@@ -269,56 +268,92 @@ class Application < Rails::Application
269268 'CC-BY-NC-ND-%{latest}' ,
270269 'CC0-%{latest}'
271270 ]
271+
272272 # Link to external guidance about selecting one of the preferred licenses. A default
273273 # URL will be displayed if none is provided here. See app/views/research_outputs/licenses/_form
274274 config . x . madmp . preferred_licenses_guidance_url = 'https://creativecommons.org/about/cclicenses/'
275275
276276
277277 # don adding environment variables from ./config/environments/* files
278278 config . cache_classes = ENV [ "CACHE_CLASSES" ]
279+
279280 config . eager_load = ENV [ "EAGER_LOAD" ]
281+
280282 config . consider_all_requests_local = ENV [ "CONSIDER_ALL_REQUESTS_LOCAL" ]
283+
281284 config . action_controller . perform_caching = ENV [ "PERFORM_CACHING" ]
285+
282286 config . cache_store = ENV [ "CACHE_STORE" ] . to_sym
287+
283288 config . active_storage . service = ENV [ "ACTIVE_STORAGE_SERVICE" ] . to_sym
289+
284290 config . action_mailer . raise_delivery_errors = ENV [ "ACTION_MAILER_RAISE_DELIVERY_ERRORS" ]
291+
285292 config . action_mailer . delivery_method = ENV [ "ACTION_MAILER_DELIVERY_METHOD" ] . to_sym
286- config . action_mailer . smtp_settings = { address : ENV [ "ACTION_MAILER_SMTP_SETTINGS_ADDRESS" ] , port : ENV [ "ACTION_MAILER_SMTP_SETTINGS_PORT" ] }
293+
294+ config . action_mailer . smtp_settings = {
295+ address : ENV [ "ACTION_MAILER_SMTP_SETTINGS_ADDRESS" ] ,
296+ port : ENV [ "ACTION_MAILER_SMTP_SETTINGS_PORT" ]
297+ }
298+
287299 config . log_level = ENV [ "LOG_LEVEL" ]
300+
288301 config . active_support . disallowed_deprecation = ENV [ "ACTIVE_SUPPORT_DISALLOWED_DEPRECATION" ] . to_sym
302+
289303 config . active_support . disallowed_deprecation_warnings = JSON . parse ( ENV [ "ACTIVE_SUPPORT_DISALLOWED_DEPRECATION_WARNINGS" ] )
304+
290305 config . active_record . migration_error = ENV [ "ACTIVE_RECORD_MIGRATION_ERROR" ] . to_sym
306+
291307 config . active_record . verbose_query_logs = ENV [ "ACTIVE_RECORD_VERBOSE_QUERY_LOGS" ]
308+
292309 config . assets . debug = ENV [ "ASSETS_DEBUG" ]
310+
293311 config . assets . quiet = ENV [ "ASSETS_QUIET" ]
312+
294313 config . file_watcher = ENV [ "FILE_WATCHER" ] != "" ? ENV [ "FILE_WATCHER" ] . constantize : nil
314+
295315 config . routes . default_url_options [ :host ] = JSON . parse ( ENV [ "DMPROADMAP_HOSTS" ] ) . first
296316
297317 config . action_view . cache_template_loading = ENV [ "ACTION_VIEW_CACHE_TEMPLATE_LOADING" ]
318+
298319 config . public_file_server . enabled = ENV [ "PUBLIC_FILE_SERVER_ENABLED" ]
320+
299321 config . public_file_server . headers = {
300322 "Cache-Control" => [
301323 "public" ,
302324 "max-age=#{ ENV [ "PUBLIC_FILE_SERVER_CACHE_SECONDS" ] } " ,
303325 ENV [ "PUBLIC_FILE_SERVER_CACHE_EXTRA" ] . presence
304326 ] . compact . join ( ", " )
305327 }
328+
306329 config . action_dispatch . show_exceptions = ENV [ "ACTION_DISPACTH_SHOW_EXCEPTIONS" ]
330+
307331 config . action_controller . allow_forgery_protection = ENV [ "ACTION_CONTROLLER_ALLOW_FORGERY_PROTECTION" ]
332+
308333 config . action_mailer . perform_caching = ENV [ "ACTION_MAILER_PERFORM_CACHING" ]
334+
309335 config . active_support . deprecation = ENV [ "ACTIVE_SUPPORT_DEPRECATION" ] . to_sym
336+
310337 config . i18n . enforce_available_locales = ENV [ "I18N_ENFORCE_AVAILABLE_LOCALES" ]
338+
311339 config . require_master_key = ENV [ "REQUIRE_MASTER_KEY" ]
340+
312341 config . assets . compile = ENV [ "ASSETS_COMPILE" ]
342+
313343 config . log_tags = ENV [ "LOG_TAGS" ]
344+
314345 config . i18n . fallbacks = ENV [ "I18N_FALLBACKS" ]
346+
315347 config . log_formatter = Logger ::Formatter . new
348+
316349 if ENV [ 'RAILS_LOG_TO_STDOUT' ] == "true"
317350 logger = ActiveSupport ::Logger . new ( $stdout)
318351 logger . formatter = config . log_formatter
319352 config . logger = ActiveSupport ::TaggedLogging . new ( logger )
320353 end
354+
321355 config . active_record . dump_schema_after_migration = ENV [ "ACTIVE_RECORD_DUMP_SCHEMA_AFTER_MIGRATION" ]
356+
322357 end
323358
324359end
0 commit comments