diff --git a/check_process b/check_process index a1fa64f..0eeb140 100644 --- a/check_process +++ b/check_process @@ -1,14 +1,9 @@ -# See here for more informations -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - admin="john" (USER) + domain="domain.tld" + admin="john" registration=1 - is_public=1 (PUBLIC|public=1|private=0) + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=0 @@ -22,13 +17,7 @@ from_commit=f26285511a167a1ed591a7fa96ae786ea89efb1e backup_restore=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. - # incorrect_path=1 - port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email= Notification=change diff --git a/conf/.env.mysql b/conf/.env.mysql index c49f744..df4c6d3 100644 --- a/conf/.env.mysql +++ b/conf/.env.mysql @@ -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_USER__:__DB_PASSWORD__@127.0.0.1:3306/__DB_NAME__ +DATABASE_URL=mysql://__DB_NAME__:__DB_PWD__@127.0.0.1:3306/__DB_NAME__ # DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite ###< doctrine/doctrine-bundle ### diff --git a/conf/.env.sqlite b/conf/.env.sqlite index f06eba7..498e30a 100644 --- a/conf/.env.sqlite +++ b/conf/.env.sqlite @@ -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_USER__:__DB_PASSWORD__@127.0.0.1:3306/__DB_NAME__ +# DATABASE_URL=mysql://__DB_NAME__:__DB_PWD__@127.0.0.1:3306/__DB_NAME__ DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite ###< doctrine/doctrine-bundle ### diff --git a/conf/app.src b/conf/app.src index 39973ce..2e82ee1 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,5 @@ -SOURCE_URL=https://github.com/kevinpapst/kimai2/archive/refs/tags/1.14.3.tar.gz -SOURCE_SUM=1a5d084fbac071ca7c5897ef439bd4bec5fb1f367e6f39b029917590110fda7d +SOURCE_URL=https://github.com/kevinpapst/kimai2/archive/refs/tags/1.15.2.tar.gz +SOURCE_SUM=b321983d323bd9471444792c3527cc293376087d2c3b573d7f311f9f4693c394 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/manifest.json b/manifest.json index 0e90bae..e7f556a 100644 --- a/manifest.json +++ b/manifest.json @@ -3,9 +3,9 @@ "id": "kimai2", "packaging_format": 1, "description": { - "en": "A multi-user application for time-tracking with support for mobile devices", - "fr": "Une application web de suivi du temps, multi-utilisateurs, et compatible avec les appareils mobiles", - "de": "Eine web-basierte Mehrbenutzer-Zeiterfassung mit Rechnungsdruck mit Unterstützung für mobile Endgeräte", + "en": "Multi-user application for time-tracking with support for mobile devices", + "fr": "Application web de suivi du temps, multi-utilisateurs, et compatible avec les appareils mobiles", + "de": "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í" }, "version": "1.14.3~ynh1", @@ -15,12 +15,12 @@ "name": "Anmol Sharma" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.2.4" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { @@ -33,8 +33,7 @@ "fr": "Choisissez un nom de domaine pour Kimai2", "de": "Wählen Sie einen Domainnamen für Kimai2", "cs": "Zvolte doménu pro Kimai2" - }, - "example": "kimai2.example.com" + } }, { "name": "admin", @@ -44,8 +43,7 @@ "fr": "Choisissez l’administrateur (should be a YunoHost registered user).", "de": "Wählen Sie einen Admin Benutzer (sollte ein registrierter YunoHost Benutzer sein).", "cs": "Zvolte administrátora (musí to být registrovaný uživatel YunoHostu)." - }, - "example": "johndoe" + } }, { "name": "is_public", diff --git a/scripts/backup b/scripts/backup index 2b2278a..1901662 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,9 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -51,17 +48,14 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/${YNH_PHP_VERSION}/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= - - ynh_print_info --message="Backing up the MySQL database..." -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 #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index e1a6cee..6e752a5 100755 --- a/scripts/install +++ b/scripts/install @@ -14,9 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -52,19 +49,17 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=registration --value=$registration ynh_app_setting_set --app=$app --key=random_key --value=$random_key ynh_app_setting_set --app=$app --key=update --value=$update #================================================= -# STANDARD MODIFICATIONS +# CREATE DEDICATED USER #================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Configuring system user..." -ynh_install_app_dependencies $pkg_dependencies +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -74,25 +69,20 @@ ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Clone the latest version +git clone -b $tag --depth 1 https://github.com/kevinpapst/kimai2.git $final_path --quiet -git clone -b $tag --depth 1 https://github.com/kevinpapst/kimai2.git $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -130,10 +120,14 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_n 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_PASSWORD__" --replace_string="$db_pwd" --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" + + #================================================= # BUILD KIMAI2 #================================================= @@ -177,7 +171,6 @@ ynh_permission_create --permission="super_admin" --allowed "$admin" # Make app public if necessary if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. ynh_permission_update --permission "main" --add "visitors" fi diff --git a/scripts/restore b/scripts/restore index c9ddafa..ce70890 100755 --- a/scripts/restore +++ b/scripts/restore @@ -36,8 +36,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path "