mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
(bug) unable to read provider config if no file
This commit is contained in:
parent
f5366f2cc1
commit
68aad57b14
@ -13,7 +13,7 @@ class AuthProvider < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def strategy_name
|
def strategy_name
|
||||||
"database-#{name.downcase.parameterize}"
|
'database-simpleauthprovider'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3,7 +3,11 @@
|
|||||||
# Deals with the yml file keeping the configuration of the current authentication provider
|
# Deals with the yml file keeping the configuration of the current authentication provider
|
||||||
class ProviderConfig
|
class ProviderConfig
|
||||||
def initialize
|
def initialize
|
||||||
@config = YAML.safe_load_file('config/auth_provider.yml').with_indifferent_access 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
|
||||||
|
else
|
||||||
|
{ providable_type: 'DatabaseProvider', name: 'DatabaseProvider::SimpleAuthProvider' }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def db
|
def db
|
||||||
|
@ -22,7 +22,7 @@ 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
|
||||||
# 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/auth_provider.yml\"]" docker-compose.yml
|
||||||
chmod 644 docker-compose.yml
|
chmod 644 docker-compose.yml
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user