-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ce commit bouge aussi la configuration de la BDD (qui utilise les credentials chiffés de Rails) sous l'objet Settings pour n'avoir qu'un point d'entrée.
- Loading branch information
Showing
10 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Config.setup do |config| | ||
# Name of the constant exposing loaded settings | ||
config.const_name = "Settings" | ||
|
||
# Ability to remove elements of the array set in earlier loaded settings file. For example value: '--'. | ||
# | ||
# config.knockout_prefix = nil | ||
|
||
# Overwrite an existing value when merging a `nil` value. | ||
# When set to `false`, the existing value is retained after merge. | ||
# | ||
# config.merge_nil_values = true | ||
|
||
# Overwrite arrays found in previously loaded settings file. When set to `false`, arrays will be merged. | ||
# | ||
# config.overwrite_arrays = true | ||
|
||
# Defines current environment, affecting which settings file will be loaded. | ||
# Default: `Rails.env` | ||
# | ||
# config.environment = ENV.fetch('ENVIRONMENT', :development) | ||
|
||
# Load environment variables from the `ENV` object and override any settings defined in files. | ||
# | ||
config.use_env = false | ||
|
||
# Define ENV variable prefix deciding which variables to load into config. | ||
# | ||
# Reading variables from ENV is case-sensitive. If you define lowercase value below, ensure your ENV variables are | ||
# prefixed in the same way. | ||
# | ||
# When not set it defaults to `config.const_name`. | ||
# | ||
config.env_prefix = "SETTINGS" | ||
|
||
# What string to use as level separator for settings loaded from ENV variables. Default value of '.' works well | ||
# with Heroku, but you might want to change it for example for '__' to easy override settings from command line, where | ||
# using dots in variable names might not be allowed (eg. Bash). | ||
# | ||
config.env_separator = "__" | ||
|
||
# Ability to process variables names: | ||
# * nil - no change | ||
# * :downcase - convert to lower case | ||
# | ||
# config.env_converter = :downcase | ||
|
||
# Parse numeric values as integers instead of strings. | ||
# | ||
# config.env_parse_values = true | ||
|
||
# Validate presence and type of specific config values. Check https://github.com/dry-rb/dry-validation for details. | ||
# | ||
# config.schema do | ||
# required(:name).filled | ||
# required(:age).maybe(:int?) | ||
# required(:email).filled(format?: EMAIL_REGEX) | ||
# end | ||
|
||
# Evaluate ERB in YAML config files at load time. | ||
# | ||
config.evaluate_erb_in_yaml = true | ||
|
||
# Name of directory and file to store config keys | ||
# | ||
# config.file_name = 'settings' | ||
# config.dir_name = 'settings' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Settings.add_source!(credentials: Rails.application.credentials.to_h) | ||
Settings.reload! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# keys from rails' credentials are added under "credentials" (cf config_add_credentials.rb) |
Empty file.
Empty file.
Empty file.