1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(bug) unable to write the configuration of the auth provider

This commit is contained in:
Sylvain 2023-04-03 15:27:04 +02:00
parent 3cd8693bb3
commit 378d6cfb8b
4 changed files with 17 additions and 8 deletions

View File

@ -1,5 +1,7 @@
# Changelog Fab-manager
- Fix a bug: unable to write the configuration of the auth provider
## v6.0.0 2023 April 03
- Updated ruby to 3.2

View File

@ -4,13 +4,10 @@
class ProviderConfig
def initialize
@config = if File.exist?('config/auth_provider.yml')
YAML.safe_load_file('config/auth_provider.yml').with_indifferent_access
content = YAML.safe_load_file('config/auth_provider.yml')
content.blank? ? simple_provider : content.with_indifferent_access
else
{
providable_type: 'DatabaseProvider',
name: 'DatabaseProvider::SimpleAuthProvider',
strategy_name: 'database-simpleauthprovider'
}
simple_provider
end
end
@ -67,4 +64,13 @@ class ProviderConfig
item
end
# @return [Hash{Symbol->String}]
def simple_provider
{
providable_type: 'DatabaseProvider',
name: 'DatabaseProvider::SimpleAuthProvider',
strategy_name: 'database-simpleauthprovider'
}
end
end

View File

@ -20,9 +20,10 @@ config()
add_mount()
{
if [[ ! $(yq eval ".services.$SERVICE.volumes.[] | select (. == \"*auth_provider.yml\")" docker-compose.yml) ]]; then
touch ./config/auth_provider.yml
# change docker-compose.yml permissions for fix yq can't modify file issue
chmod 666 docker-compose.yml
yq -i eval ".services.$SERVICE.volumes += [\"./config/auth_provider.yml:/usr/src/app/auth_provider.yml\"]" docker-compose.yml
yq -i eval ".services.$SERVICE.volumes += [\"./config/auth_provider.yml:/usr/src/app/config/auth_provider.yml\"]" docker-compose.yml
chmod 644 docker-compose.yml
fi
}

View File

@ -19,7 +19,7 @@ services:
- ./log:/var/log/supervisor
- ./plugins:/usr/src/app/plugins
- ./accounting:/usr/src/app/accounting
- ./config/auth_provider.yml:/usr/src/app/auth_provider.yml
- ./config/auth_provider.yml:/usr/src/app/config/auth_provider.yml
depends_on:
- postgres
- redis