From 6b806f609bbfc51fcfeb1eb1921da668f4d59d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 9 Sep 2023 17:59:00 +0200 Subject: [PATCH 1/8] Update upgrade --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index d46766b..511f98a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,6 +114,9 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --keep="config/packages/local.yaml var/invoices/ var/data/" + pushd "$final_path" + ynh_exec_as $app php$YNH_PHP_VERSION bin/console cache:clear --env=prod + popd fi chmod 750 "$final_path" From 81860ac58862fb23e10150c0915becbf3c0e39f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 9 Sep 2023 18:00:51 +0200 Subject: [PATCH 2/8] Update upgrade --- scripts/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 511f98a..9c0d412 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,7 +116,9 @@ then ynh_setup_source --dest_dir="$final_path" --keep="config/packages/local.yaml var/invoices/ var/data/" pushd "$final_path" ynh_exec_as $app php$YNH_PHP_VERSION bin/console cache:clear --env=prod - popd + popd + + #ynh_secure_remove --file="$final_path/var/cache/prod" fi chmod 750 "$final_path" From 1f63ff40263a86415ebe6b3c7c477a3649dea92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 9 Sep 2023 19:06:24 +0200 Subject: [PATCH 3/8] Update upgrade --- scripts/upgrade | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9c0d412..fbb7cb9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,11 +114,6 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --keep="config/packages/local.yaml var/invoices/ var/data/" - pushd "$final_path" - ynh_exec_as $app php$YNH_PHP_VERSION bin/console cache:clear --env=prod - popd - - #ynh_secure_remove --file="$final_path/var/cache/prod" fi chmod 750 "$final_path" @@ -159,8 +154,13 @@ ynh_add_nginx_config ynh_script_progression --message="Building Kimai2..." --weight=1 ynh_install_composer --phpversion="$YNH_PHP_VERSION" --workdir="$final_path" --install_args="--optimize-autoloader" + pushd "$final_path" + ynh_exec_as $app php$YNH_PHP_VERSION bin/console cache:clear --env=prod + popd ynh_composer_exec --phpversion="$YNH_PHP_VERSION" --workdir="$final_path" --commands="require laminas/laminas-ldap" +#ynh_secure_remove --file="$final_path/var/cache/prod" + chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" From 2ca0d587707d80a722913115ff8e97a12ff61f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 9 Sep 2023 20:55:30 +0200 Subject: [PATCH 4/8] Update upgrade --- scripts/upgrade | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index fbb7cb9..ccca4da 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -153,14 +153,10 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Building Kimai2..." --weight=1 +ynh_secure_remove --file="$final_path/var/cache/prod" ynh_install_composer --phpversion="$YNH_PHP_VERSION" --workdir="$final_path" --install_args="--optimize-autoloader" - pushd "$final_path" - ynh_exec_as $app php$YNH_PHP_VERSION bin/console cache:clear --env=prod - popd ynh_composer_exec --phpversion="$YNH_PHP_VERSION" --workdir="$final_path" --commands="require laminas/laminas-ldap" -#ynh_secure_remove --file="$final_path/var/cache/prod" - chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" From 26b1b8c61828fe7b0426280f8eadbe54631289bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 10 Sep 2023 08:22:58 +0200 Subject: [PATCH 5/8] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ac5df09..78dc385 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,7 +8,7 @@ YNH_PHP_VERSION=8.2 -YNH_COMPOSER_VERSION=2.3.3 +YNH_COMPOSER_VERSION=2.5.8 php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3" From 262343e3c1e237ff82d4d97d7ce56172a14e70e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 10 Sep 2023 09:23:26 +0200 Subject: [PATCH 6/8] Revert "Update _common.sh" This reverts commit 26b1b8c61828fe7b0426280f8eadbe54631289bd. --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 78dc385..ac5df09 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,7 +8,7 @@ YNH_PHP_VERSION=8.2 -YNH_COMPOSER_VERSION=2.5.8 +YNH_COMPOSER_VERSION=2.3.3 php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3" From fa8b6fda2788f374b0bd1f2edd40bab0f016f7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 10 Sep 2023 11:47:14 +0200 Subject: [PATCH 7/8] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ccca4da..8403df7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -154,7 +154,7 @@ ynh_add_nginx_config ynh_script_progression --message="Building Kimai2..." --weight=1 ynh_secure_remove --file="$final_path/var/cache/prod" -ynh_install_composer --phpversion="$YNH_PHP_VERSION" --workdir="$final_path" --install_args="--optimize-autoloader" +ynh_install_composer --phpversion="$YNH_PHP_VERSION" --workdir="$final_path" --install_args="--optimize-autoloader --no-scripts" ynh_composer_exec --phpversion="$YNH_PHP_VERSION" --workdir="$final_path" --commands="require laminas/laminas-ldap" chmod 750 "$final_path" From eb80851c8695e14ae8941fc94c2210d300fbe8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 10 Sep 2023 11:54:09 +0200 Subject: [PATCH 8/8] Update .env --- conf/.env | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/conf/.env b/conf/.env index 30b9315..68d97ba 100644 --- a/conf/.env +++ b/conf/.env @@ -1,21 +1,47 @@ -# Configure your database connection and set the correct server version: -# for MySQL "serverVersion=5.7" and for MariaDB "serverVersion=mariadb-10.5.8" +# +# You should NOT use this file in production, but instead move the environment variables to your webserver configuration. +# The .env file is only existing to simplify the initial setup! +# + +#================================================================================ +# Configure your database connection and set the correct server version. +# +# You have to replace the following values with your defaults: +# - the version "5.7" (the database server version, examples for MySQL and MariaDB below) +# - the database username "user" +# - the password "password" for "user" +# - the database schema "database" +# - you might have to adapt port "3306" and server IP "127.0.0.1" as well +# +# For MySQL that would be "serverVersion=5.7" as in: +# DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8mb4&serverVersion=5.7 +# +# For MariaDB it would be "serverVersion=mariadb-10.5.8": +# DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8mb4&serverVersion=mariadb-10.5.8 +# DATABASE_URL=mysql://__DB_USER__:__DB_PWD__@127.0.0.1:3306/__DB_NAME__?charset=utf8&serverVersion=mariadb-10.5.12 -# Email will be sent with this address as sender +#================================================================================ +# The full documentation can be found at https://www.kimai.org/documentation/emails.html +# +# Email will be sent with this address as sender: MAILER_FROM=admin@__DOMAIN__ -# Email connection (disabled by default) more info at https://www.kimai.org/documentation/emails.html +# Email connection (disabled by default) - see documentation for the format MAILER_URL=smtp://localhost:25?encryption=&auth_mode= +#================================================================================ # do not change, unless you are developing for Kimai APP_ENV=prod -# should be changed to a unique character sequence +#================================================================================ +# should be changed to a unique character sequence, used for hashing cookies APP_SECRET=__RANDOM_KEY__ -# unlikely, that you need to change this one -CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$ - -# Running behind reverse proxies? Use those: +#================================================================================ +# Running behind reverse proxies? Try these: TRUSTED_PROXIES=127.0.0.1 TRUSTED_HOSTS=localhost,__DOMAIN__ + +#================================================================================ +# unlikely, that you need to change this one +CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$