Commit 7b4f5a7e authored by Fabrice Gangler's avatar Fabrice Gangler 🎨
Browse files

FEAT: allow to use quickly API Particulier (customize API_PARTICULIER_URL and...

FEAT: allow to use quickly API Particulier (customize API_PARTICULIER_URL and ENCRYPTION_SERVICE_SALT in DS .env file)
parent 772cfccd
......@@ -54,6 +54,11 @@ $_path_bundle = "$_ds_home/rbenv/shims/"
$db_database = 'vagrant'
$db_pool = ''
# Environment variable ENCRYPTION_SERVICE_SALT (see: .env file)
# is mandatory to use API Particulier
# /!\ Do not forget to change this value in production
$ds_encryption_service_salt = 'aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017'
# #############################################################################
# System user for Démarches Simplifiées app
accounts::user { $_system_username:
......@@ -117,32 +122,52 @@ file { "$_ds_project_directory/.env":
# As long as this is not a pupet module, we don't use a template but 'file_line'.
# Puppuet module should use a template to set proper values.
# Set values for Database and Github Oauth token in config file '.env'
file_line { 'DB_DATABASE':
file_line { '.env file DB_DATABASE':
ensure => present,
path => "$_ds_project_directory/.env",
line => "DB_DATABASE=\"$db_name\"",
match => '^DB_DATABASE="tps_development"',
require => File["$_ds_project_directory/.env"],
}
file_line { 'DB_USERNAME':
file_line { '.env file DB_USERNAME':
ensure => present,
path => "$_ds_project_directory/.env",
line => "DB_USERNAME=\"$db_user_name\"",
match => '^DB_USERNAME="tps_development"',
require => File["$_ds_project_directory/.env"],
}
file_line { 'DB_PASSWORD':
file_line { '.env file DB_PASSWORD':
ensure => present,
path => "$_ds_project_directory/.env",
line => "DB_PASSWORD=\"$db_user_password\"",
match => '^DB_PASSWORD="tps_development"',
require => File["$_ds_project_directory/.env"],
}
file_line { 'SUPER_ADMIN_OTP_DISABLED':
file_line { '.env file ENCRYPTION_SERVICE_SALT':
# mandatory to use API Particulier
ensure => present,
path => "$_ds_project_directory/.env",
line => "ENCRYPTION_SERVICE_SALT=\"$ds_encryption_service_salt\"",
match => '^ENCRYPTION_SERVICE_SALT=""',
require => File["$_ds_project_directory/.env"],
}
# Optional environment variables
file_line { '.env file, optional environment variables':
ensure => present,
path => "$_ds_project_directory/.env",
line => "\n##################################\n\n# Optional environment variables",
require => File["$_ds_project_directory/.env"],
}
file_line { '.env file SUPER_ADMIN_OTP_DISABLED':
ensure => present,
path => "$_ds_project_directory/.env",
line => 'SUPER_ADMIN_OTP_ENABLED="disabled" # "enabled" par défaut',
match => '^# Clé de chiffrement OTP, pour 2FA',
require => File["$_ds_project_directory/.env"],
}
file_line { '.env file API_PARTICULIER_URL':
ensure => present,
path => "$_ds_project_directory/.env",
line => 'API_PARTICULIER_URL="https://particulier-test.api.gouv.fr/api"',
require => File["$_ds_project_directory/.env"],
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment