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 # Changelog Fab-manager
- Fix a bug: unable to write the configuration of the auth provider
## v6.0.0 2023 April 03 ## v6.0.0 2023 April 03
- Updated ruby to 3.2 - Updated ruby to 3.2

View File

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

View File

@ -20,9 +20,10 @@ config()
add_mount() add_mount()
{ {
if [[ ! $(yq eval ".services.$SERVICE.volumes.[] | select (. == \"*auth_provider.yml\")" docker-compose.yml) ]]; then 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 # change docker-compose.yml permissions for fix yq can't modify file issue
chmod 666 docker-compose.yml 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 chmod 644 docker-compose.yml
fi fi
} }

View File

@ -19,7 +19,7 @@ services:
- ./log:/var/log/supervisor - ./log:/var/log/supervisor
- ./plugins:/usr/src/app/plugins - ./plugins:/usr/src/app/plugins
- ./accounting:/usr/src/app/accounting - ./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: depends_on:
- postgres - postgres
- redis - redis