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

Updated to v1.14.3

This commit is contained in:
Amo 2021-05-26 02:33:20 +05:30
parent f26285511a
commit f3afca2a85
9 changed files with 74 additions and 95 deletions

View file

@ -12,7 +12,7 @@ This is the reloaded version of the open source timetracker Kimai. Right now its
Kimai v2 has nothing in common with its predecessor Kimai v1 besides the basic ideas of time-tracking and the current development team. It is based on a lot of great frameworks. Special thanks to Symfony v4, Doctrine, AdminThemeBundle (based on AdminLTE). Kimai v2 has nothing in common with its predecessor Kimai v1 besides the basic ideas of time-tracking and the current development team. It is based on a lot of great frameworks. Special thanks to Symfony v4, Doctrine, AdminThemeBundle (based on AdminLTE).
https://github.com/kevinpapst/kimai2 https://github.com/kevinpapst/kimai2
Shipped Version: **1.11.1** Shipped Version: **1.14.3**
## Screenshots ## Screenshots

View file

@ -7,7 +7,6 @@
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld" (DOMAIN)
admin="john" (USER) admin="john" (USER)
database="mysql"
registration=1 registration=1
is_public=1 (PUBLIC|public=1|private=0) is_public=1 (PUBLIC|public=1|private=0)
; Checks ; Checks
@ -19,7 +18,8 @@
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 1.9~ynh1 # 1.9~ynh1
upgrade=1 from_commit=e5ce0d869526c6c856c1e2398b4b2ce0ba8e7542 upgrade=1
from_commit=f26285511a167a1ed591a7fa96ae786ea89efb1e
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
@ -30,7 +30,7 @@
# If the level 5 (Package linter) is forced to 1. Please add justifications here. # If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto Level 5=auto
;;; Options ;;; Options
Email=anmol@datamol.org Email=
Notification=change Notification=change
;;; Upgrade options ;;; Upgrade options
; commit=e5ce0d869526c6c856c1e2398b4b2ce0ba8e7542 ; commit=e5ce0d869526c6c856c1e2398b4b2ce0ba8e7542

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/kevinpapst/kimai2/archive/1.11.1.tar.gz SOURCE_URL=https://github.com/kevinpapst/kimai2/archive/refs/tags/1.14.3.tar.gz
SOURCE_SUM=ebca79e6fc4597a4a914a3005c3a450bbe956fd05fce8a4d962d9ca943589a28 SOURCE_SUM=1a5d084fbac071ca7c5897ef439bd4bec5fb1f367e6f39b029917590110fda7d
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -8,16 +8,14 @@
"de": "Eine web-basierte Mehrbenutzer-Zeiterfassung mit Rechnungsdruck mit Unterstützung für mobile Endgeräte", "de": "Eine web-basierte Mehrbenutzer-Zeiterfassung mit Rechnungsdruck mit Unterstützung für mobile Endgeräte",
"cs": "Víceuživatelská webová aplikace pro sledování času s podporou mobilních zařízení" "cs": "Víceuživatelská webová aplikace pro sledování času s podporou mobilních zařízení"
}, },
"version": "1.11.1~ynh1", "version": "1.14.3~ynh1",
"url": "https://www.kimai.org", "url": "https://www.kimai.org",
"license": "MIT", "license": "MIT",
"maintainer": { "maintainer": {
"name": "Anmol Sharma", "name": "Anmol Sharma"
"email": "anmol@datamol.org",
"url": "datamol.org"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8" "yunohost": ">= 4.0.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -60,18 +58,6 @@
}, },
"default": false "default": false
}, },
{
"name": "database",
"type": "string",
"ask": {
"en": "Choose the database to use (for production usage choose: mysql)",
"fr": "Choisissez le type de base de données à utiliser (mysql pour un usage en production)",
"de": "Wählen Sie die zu nutzende Datenbank (für produktive Zwecke wähle: mysql)",
"cs": "Zvolte databázi (pro produkční použití vyberte: mysql)"
},
"choices": ["mysql","sqlite"],
"default": "mysql"
},
{ {
"name": "registration", "name": "registration",
"type": "boolean", "type": "boolean",

View file

@ -29,7 +29,6 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
database=$(ynh_app_setting_get --app=$app --key=database)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
@ -58,11 +57,11 @@ ynh_backup --src_path="/etc/php/${YNH_PHP_VERSION}/fpm/pool.d/$app.conf"
# BACKUP THE MYSQL DATABASE # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
if [ "$database" = "mysql" ]; then
ynh_print_info --message="Backing up the MySQL database..." ynh_print_info --message="Backing up the MySQL database..."
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_mysql_dump_db --database="$db_name" > db.sql
fi
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -29,7 +29,6 @@ path_url="/"
admin=$YNH_APP_ARG_ADMIN admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
registration=$YNH_APP_ARG_REGISTRATION registration=$YNH_APP_ARG_REGISTRATION
database=$YNH_APP_ARG_DATABASE
random_key=$(ynh_string_random 32) random_key=$(ynh_string_random 32)
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -73,8 +72,10 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Setting up source files..." ynh_script_progression --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" # Clone the latest version
latest_tag=$(curl -s https://api.github.com/repos/kevinpapst/kimai2/releases/latest | grep 'tag_name' | cut -d\" -f4)
git clone -b $latest_tag --depth 1 https://github.com/kevinpapst/kimai2.git $final_path
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -118,9 +119,7 @@ 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 fi
env_conf="$final_path/.env"
# Configure environement
if [ "$database" = "mysql" ]; then
# setup application config # setup application config
cp ../conf/.env.mysql $env_conf cp ../conf/.env.mysql $env_conf
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
@ -132,12 +131,6 @@ if [ "$database" = "mysql" ]; then
ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$env_conf" ynh_replace_string --match_string="__DB_PASSWORD__" --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_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_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$env_conf"
else
# setup application config
cp ../conf/.env.sqlite $env_conf
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"
fi
#================================================= #=================================================
# BUILD KIMAI2 # BUILD KIMAI2

View file

@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
database=$(ynh_app_setting_get --app=$app --key=database)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -26,13 +26,13 @@ database=$(ynh_app_setting_get --app=$app --key=database)
# REMOVE THE MYSQL DATABASE # REMOVE THE MYSQL DATABASE
#================================================= #=================================================
if [ "$database" = "mysql" ]; then
ynh_script_progression --message="Removing the MySQL database..." ynh_script_progression --message="Removing the MySQL database..."
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
# Remove a database if it exists, along with the associated user # Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
fi
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES

View file

@ -30,7 +30,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
database=$(ynh_app_setting_get --app=$app --key=database)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
@ -99,14 +98,12 @@ ynh_install_app_dependencies $pkg_dependencies
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
if [ "$database" = "mysql" ]; then
ynh_script_progression --message="Restoring the MySQL database..." ynh_script_progression --message="Restoring the MySQL database..."
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
fi
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -23,7 +23,6 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public) is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
registration=$(ynh_app_setting_get --app=$app --key=registration) registration=$(ynh_app_setting_get --app=$app --key=registration)
database=$(ynh_app_setting_get --app=$app --key=database)
random_key=$(ynh_app_setting_get --app=$app --key=random_key) random_key=$(ynh_app_setting_get --app=$app --key=random_key)
#================================================= #=================================================
@ -72,9 +71,15 @@ ynh_abort_if_errors
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
latest_tag=$(curl -s https://api.github.com/repos/kevinpapst/kimai2/releases/latest | grep 'tag_name' | cut -d\" -f4)
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then
pushd "$final_path"
git fetch --tags
git checkout latest_tag
popd
else
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
# Create a temporary directory and backup config # Create a temporary directory and backup config
@ -107,6 +112,8 @@ then
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi fi
fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -161,9 +168,11 @@ ynh_store_file_checksum --file="$local_conf"
env_conf=$final_path/.env env_conf=$final_path/.env
ynh_backup_if_checksum_is_different --file="$env_conf" ynh_backup_if_checksum_is_different --file="$env_conf"
# Configure environement # Configure environement
if [ "$database" = "mysql" ]; then
# setup application config # setup application config
cp ../conf/.env.mysql $env_conf cp ../conf/.env.mysql $env_conf
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
@ -172,12 +181,7 @@ if [ "$database" = "mysql" ]; then
ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$env_conf" ynh_replace_string --match_string="__DB_PASSWORD__" --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_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_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$env_conf"
else
# setup application config
cp ../conf/.env.sqlite $env_conf
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"
fi
ynh_store_file_checksum --file="$env_conf" ynh_store_file_checksum --file="$env_conf"
#================================================= #=================================================