1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kimai2_ynh.git synced 2024-09-03 19:26:26 +02:00

Add domain for mail in .env

This commit is contained in:
anmol26s 2018-10-07 05:40:48 +05:30
parent 3169fea971
commit d3024acd10
3 changed files with 28 additions and 5 deletions

View file

@ -4,10 +4,11 @@
# KIMAI DEFAULT ENV VARS # KIMAI DEFAULT ENV VARS
DATABASE_PREFIX=kimai2_ DATABASE_PREFIX=kimai2_
MAILER_FROM=admin@__DOMAIN__
###> symfony/framework-bundle ### ###> symfony/framework-bundle ###
APP_ENV=prod APP_ENV=prod
APP_SECRET=random_key APP_SECRET=__RANDOM_KEY__
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2 #TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com #TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-bundle ### ###< symfony/framework-bundle ###
@ -16,7 +17,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 # 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" # 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 # Configure your db driver and server_version in config/packages/doctrine.yaml
#DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name # DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite
###< doctrine/doctrine-bundle ### ###< doctrine/doctrine-bundle ###

View file

@ -121,7 +121,9 @@ sudo cp ../conf/.env $final_path/.env
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_replace_string "random_key" "$random_key" "$final_path/.env" ynh_replace_string "__RANDOM_KEY__" "$random_key" "$final_path/.env"
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/.env"
init_composer $final_path init_composer $final_path
cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:schema:create cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:schema:create

View file

@ -83,7 +83,12 @@ version=`cd /var/www/$app && bin/console kimai:version --short 2> /dev/null || s
# Create a temporary directory # Create a temporary directory
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir # Backup the config file in the temp dir
cp -a "$final_path/.env" "$tmpdir/." if [ -f $final_path/config/packages/local.yaml ]; then
cp -af "$final_path/config/packages/local.yaml" "$tmpdir/."
fi
if [ -d $final_path/var/invoices ]; then
cp -af "$final_path/var/invoices" "$tmpdir/."
fi
cp -a "$final_path/var/data/kimai.sqlite" "$tmpdir/." cp -a "$final_path/var/data/kimai.sqlite" "$tmpdir/."
ynh_setup_source "$final_path" ynh_setup_source "$final_path"
@ -97,9 +102,24 @@ then
fi fi
ynh_secure_remove "$final_path" ynh_secure_remove "$final_path"
ynh_setup_source "$final_path" ynh_setup_source "$final_path"
sudo cp -a "$tmpdir/.env" "$final_path/." if [ -f $tmpdir/local.yaml ]; then
cp -af "$tmpdir/local.yaml" "$final_path/config/packages/."
fi
if [ -d $tmpdir/invoices ]; then
cp -af "$tmpdir/invoices" "$final_path/var/."
fi
sudo cp -af "$tmpdir/kimai.sqlite" "$final_path/var/data/." sudo cp -af "$tmpdir/kimai.sqlite" "$final_path/var/data/."
sudo rm -Rf "$tmpdir" sudo rm -Rf "$tmpdir"
# setup application config
sudo cp ../conf/.env $final_path/.env
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_replace_string "__RANDOM_KEY__" "$random_key" "$final_path/.env"
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/.env"
init_composer $final_path init_composer $final_path
( (
cd $final_path && sudo /usr/bin/php7.2 bin/console cache:clear --env=prod cd $final_path && sudo /usr/bin/php7.2 bin/console cache:clear --env=prod