1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kimai2_ynh.git synced 2024-09-03 19:26:26 +02:00
This commit is contained in:
ericgaspar 2021-09-26 23:52:41 +02:00
parent 6a042f1020
commit 255e445859
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 12 additions and 12 deletions

View file

@ -13,7 +13,7 @@ APP_SECRET=__RANDOM_KEY__
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data/kimai.sqlite"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://__DB_NAME__:__DB_PWD__@127.0.0.1:3306/__DB_NAME__
DATABASE_URL=mysql://__DB_USER__:__DB_PWD__@127.0.0.1:3306/__DB_NAME__
# DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite
###< doctrine/doctrine-bundle ###

View file

@ -13,7 +13,7 @@ APP_SECRET=__RANDOM_KEY__
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data/kimai.sqlite"
# Configure your db driver and server_version in config/packages/doctrine.yaml
# DATABASE_URL=mysql://__DB_NAME__:__DB_PWD__@127.0.0.1:3306/__DB_NAME__
# DATABASE_URL=mysql://__DB_USER__:__DB_PWD__@127.0.0.1:3306/__DB_NAME__
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite
###< doctrine/doctrine-bundle ###

View file

@ -111,14 +111,14 @@ ynh_script_progression --message="Configuring Kimai2..."
local_conf="$final_path/config/packages/local.yaml"
# Configure registration
cp ../conf/local.yaml $local_conf
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$local_conf"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$local_conf"
# Registration should be allowed or not
if [ $registration -eq 1 ]
then
ynh_replace_string --match_string="__REGISTRATION__" --replace_string="true" --target_file="$local_conf"
ynh_replace_string --match_string="__REGISTRATION__" --replace_string="true" --target_file="$local_conf"
else
ynh_replace_string --match_string="__REGISTRATION__" --replace_string="false" --target_file="$local_conf"
ynh_replace_string --match_string="__REGISTRATION__" --replace_string="false" --target_file="$local_conf"
fi
env_conf="$final_path/.env"
@ -126,13 +126,13 @@ env_conf="$final_path/.env"
cp ../conf/.env.mysql $env_conf
db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
ynh_replace_string --match_string="__RANDOM_KEY__" --replace_string="$random_key" --target_file="$env_conf"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$env_conf"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$env_conf"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$env_conf"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$env_conf"
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
ynh_replace_string --match_string="__RANDOM_KEY__" --replace_string="$random_key" --target_file="$env_conf"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$env_conf"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$env_conf"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$env_conf"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$env_conf"
#ynh_add_config --template="../conf/.env.mysql" --destination="$final_path/.env"