From c5c548e66c3e9f8bae1fdb8f6c80be3cc8b84302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:26:34 +0100 Subject: [PATCH 01/28] v2 --- conf/cron | 6 ++-- conf/nginx.conf | 2 +- manifest.toml | 54 ++++++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 16 +++++----- scripts/install | 68 ++++++++++++++++++++--------------------- scripts/remove | 30 +++++++++--------- scripts/restore | 52 +++++++++++++++---------------- scripts/upgrade | 76 +++++++++++++++++++++++----------------------- 9 files changed, 180 insertions(+), 126 deletions(-) create mode 100644 manifest.toml diff --git a/conf/cron b/conf/cron index a1e84f8..cd2baf3 100644 --- a/conf/cron +++ b/conf/cron @@ -1,4 +1,4 @@ -* * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/public/index.php scheduled-activities -* * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/public/index.php scheduled-video-clips -* * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/public/index.php scheduled-websub-publish +* * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/public/index.php scheduled-activities +* * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/public/index.php scheduled-video-clips +* * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/public/index.php scheduled-websub-publish diff --git a/conf/nginx.conf b/conf/nginx.conf index b052afb..950c275 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/public/; + alias __INSTALL_DIR__/public/; index index.php; diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..89964f8 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,54 @@ +packaging_format = 2 + +id = "castopod" +name = "Castopod" +description.en = "Hosting platform made for podcasters" +description.fr = "Plateforme d'hébergement conçue pour les podcasteurs" + +version = "1.0.1~ynh1" + +maintainers = ["eric_G"] + +[upstream] +license = "GPL-3.0-only" +website = "https://castopod.org/" +demo = "https://podcast.podlibre.org/@podlibre_fr" +admindoc = "https://docs.castopod.org/" +code = "https://code.castopod.org/adaures/castopod" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64/armel), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant" +sso = "?" # FIXME: replace with true, false, or "not_relevant" +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + help.en = "Castopod needs to be installed in a dedicated domain or sub-domain." + help.fr = "Castopod doit être installé dans un domaine ou sous-domaine dédié." + type = "domain" + full_domain = true + + [install.init_main_permission] + help.en = "If enabled, Castopod will be accessible by people who do not have an account. This can be changed later via the webadmin." + help.fr = "Si cette case est cochée, Castopod sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + type = "group" + default = "visitors" + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + + [resources.database] + type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 947108f..684e259 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ YNH_PHP_VERSION="8.1" -pkg_dependencies="ffmpeg php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" +#REMOVEME? pkg_dependencies="ffmpeg php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 35163de..b818c8e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,19 +14,19 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -37,7 +37,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index 4d0679a..7639ab0 100755 --- a/scripts/install +++ b/scripts/install @@ -13,22 +13,22 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url="/" -is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +path="/" +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME fpm_footprint="low" fpm_free_footprint=0 @@ -37,21 +37,21 @@ fpm_usage="low" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage @@ -59,40 +59,40 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path +#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --weight=2 +#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=2 -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 +#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) +#REMOVEME? db_user=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=2 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION @@ -101,7 +101,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -123,9 +123,9 @@ redis_db=$(ynh_redis_get_free_db) ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" #redis_number=$(( $YNH_APP_INSTANCE_NUMBER - 1 )) -ynh_add_config --template="../conf/.env.example" --destination="$final_path/.env" -chmod 600 $final_path/.env -chown $app:www-data "$final_path/.env" +ynh_add_config --template="../conf/.env.example" --destination="$install_dir/.env" +chmod 600 $install_dir/.env +chown $app:www-data "$install_dir/.env" #================================================= # SETUP A CRON @@ -139,14 +139,14 @@ chmod 644 "/etc/cron.d/$app" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=10 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=10 # Make app public if necessary or protect it -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 207e1b3..fc7f1a7 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,23 +12,23 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." --weight=1 # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE THE REDIS DATABASE @@ -40,10 +40,10 @@ ynh_redis_remove_db "$redis_db" #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE NGINX CONFIGURATION @@ -64,10 +64,10 @@ ynh_remove_fpm_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # REMOVE VARIOUS FILES @@ -81,10 +81,10 @@ ynh_secure_remove --file="/etc/cron.d/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 7a1bbd6..7ddccc1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,66 +14,66 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=2 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -92,10 +92,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=2 +#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=2 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? 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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d5355e8..6bf3d4e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,21 +12,21 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) +#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK VERSION @@ -37,16 +37,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -56,13 +56,13 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi # If fpm_footprint doesn't exist, create it @@ -84,8 +84,8 @@ if [ -z "$fpm_usage" ]; then fi # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi @@ -93,10 +93,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -106,15 +106,15 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - ynh_secure_remove --file="$final_path/app" - ynh_secure_remove --file="$final_path/public/assets" +#REMOVEME? ynh_secure_remove --file="$install_dir/app" +#REMOVEME? ynh_secure_remove --file="$install_dir/public/assets" # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep=".env" + ynh_setup_source --dest_dir="$install_dir" --keep=".env" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # MYSQL CONFIGURATION @@ -129,9 +129,9 @@ fi #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION @@ -140,7 +140,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -155,9 +155,9 @@ ynh_add_nginx_config #================================================= # ynh_script_progression --message="Configuring Castopod..." --weight=1 -# ynh_add_config --template="../conf/.env.example" --destination="$final_path/.env" -# chmod 600 $final_path/.env -# chown $app:www-data "$final_path/.env" +# ynh_add_config --template="../conf/.env.example" --destination="$install_dir/.env" +# chmod 600 $install_dir/.env +# chown $app:www-data "$install_dir/.env" #================================================= # SETUP CRON From bfbb69e20214ba239dbc08d43237266dd4c7401a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:32:58 +0100 Subject: [PATCH 02/28] v2 --- manifest.json | 53 -------------------------- manifest.toml | 14 ++++--- scripts/_common.sh | 2 - scripts/backup | 19 ---------- scripts/change_url | 8 ---- scripts/from_beta_16.sql | 11 ------ scripts/install | 72 +---------------------------------- scripts/remove | 44 +-------------------- scripts/restore | 56 ++------------------------- scripts/upgrade | 82 ++++------------------------------------ 10 files changed, 22 insertions(+), 339 deletions(-) delete mode 100755 manifest.json delete mode 100644 scripts/from_beta_16.sql diff --git a/manifest.json b/manifest.json deleted file mode 100755 index a6d53d8..0000000 --- a/manifest.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "Castopod", - "id": "castopod", - "packaging_format": 1, - "description": { - "en": "Hosting platform made for podcasters", - "fr": "Plateforme d'hébergement conçue pour les podcasteurs" - }, - "version": "1.0.1~ynh1", - "url": "https://castopod.org/", - "upstream": { - "license": "GPL-3.0-only", - "website": "https://castopod.org/", - "demo": "https://podcast.podlibre.org/@podlibre_fr", - "admindoc": "https://docs.castopod.org/", - "code": "https://code.castopod.org/adaures/castopod" - }, - "license": "GPL-3.0-only", - "maintainer": { - "name": "eric_G", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": true, - "services": [ - "nginx", - "php8.1-fpm", - "mysql" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain", - "help": { - "en": "Castopod needs to be installed in a dedicated domain or sub-domain.", - "fr": "Castopod doit être installé dans un domaine ou sous-domaine dédié." - } - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If enabled, Castopod will be accessible by people who do not have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, Castopod sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." - }, - "default": true - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 89964f8..6542932 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,15 +15,13 @@ website = "https://castopod.org/" demo = "https://podcast.podlibre.org/@podlibre_fr" admindoc = "https://docs.castopod.org/" code = "https://code.castopod.org/adaures/castopod" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64/armel), for example: ["amd64", "i386"] +yunohost = ">= 11.1.0" +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant" -sso = "?" # FIXME: replace with true, false, or "not_relevant" +ldap = "false" +sso = "false" disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... @@ -52,3 +50,7 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.database] type = "mysql" + + [resources.apt] + packages = "ffmpeg php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" + diff --git a/scripts/_common.sh b/scripts/_common.sh index 684e259..1a2ec90 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,8 +6,6 @@ YNH_PHP_VERSION="8.1" -#REMOVEME? pkg_dependencies="ffmpeg php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index b818c8e..8af0451 100755 --- a/scripts/backup +++ b/scripts/backup @@ -9,25 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index daaf6f0..aff5392 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -21,14 +21,6 @@ new_path="/" app=$YNH_APP_INSTANCE_NAME -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= diff --git a/scripts/from_beta_16.sql b/scripts/from_beta_16.sql deleted file mode 100644 index 61af150..0000000 --- a/scripts/from_beta_16.sql +++ /dev/null @@ -1,11 +0,0 @@ -SET AUTOCOMMIT = 0; -START TRANSACTION; - -ALTER TABLE `cp_settings` -ADD COLUMN context VARCHAR(255) NULL AFTER `type`; - -ALTER TABLE cp_podcasts ADD COLUMN published_at DATETIME DEFAULT NULL AFTER -updated_by; -UPDATE cp_podcasts SET published_at = created_at; - -COMMIT; diff --git a/scripts/install b/scripts/install index 7639ab0..77240cb 100755 --- a/scripts/install +++ b/scripts/install @@ -9,84 +9,28 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -path="/" -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - fpm_footprint="low" fpm_free_footprint=0 fpm_usage="low" -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=1 -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=2 - -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=2 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" @@ -101,7 +45,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -136,19 +79,6 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=10 - -# Make app public if necessary or protect it -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/remove b/scripts/remove index fc7f1a7..bbbe3a5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,23 +12,9 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) - -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." --weight=1 - -# Remove a database if it exists, along with the associated user -#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # REMOVE THE REDIS DATABASE @@ -37,14 +23,6 @@ ynh_script_progression --message="Removing the Redis database..." --weight=1 ynh_redis_remove_db "$redis_db" -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -61,14 +39,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - #================================================= # REMOVE VARIOUS FILES #================================================= @@ -76,16 +46,6 @@ ynh_remove_fpm_config # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 7ddccc1..4e41a05 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,51 +10,13 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir +fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # RESTORE THE APP MAIN DIR @@ -67,14 +29,6 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -92,10 +46,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=2 +ynh_script_progression --message="Restoring the MySQL database..." --weight=2 -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? 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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6bf3d4e..2f88e7a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,21 +12,12 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) +fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) +fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK VERSION @@ -34,37 +25,11 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - # If fpm_footprint doesn't exist, create it if [ -z "$fpm_footprint" ]; then fpm_footprint=low @@ -83,21 +48,6 @@ if [ -z "$fpm_usage" ]; then ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -106,8 +56,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 -#REMOVEME? ynh_secure_remove --file="$install_dir/app" -#REMOVEME? ynh_secure_remove --file="$install_dir/public/assets" + ynh_secure_remove --file="$install_dir/app" + ynh_secure_remove --file="$install_dir/public/assets" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep=".env" fi @@ -116,23 +66,6 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# MYSQL CONFIGURATION -#================================================= - -if ynh_compare_current_package_version --comparison eq --version 1.0.0-96~ynh1 -then - ynh_script_progression --message="Upgrading MySQL configuration..." --weight=1 - ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./from_beta_16.sql -fi - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -140,7 +73,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION From b4ac27bc02ddfba66614d6ab4b96f2e66d7e3d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 5 Jan 2023 18:36:25 +0100 Subject: [PATCH 03/28] Update _common.sh --- scripts/_common.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 947108f..80cc780 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,9 @@ YNH_PHP_VERSION="8.1" -pkg_dependencies="ffmpeg php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" +php_dependencies="php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" + +pkg_dependencies="ffmpeg $php_dependencies" #================================================= # PERSONAL HELPERS From 36e8cc7197f721ae58534aa95e167124d5317c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 5 Jan 2023 18:37:29 +0100 Subject: [PATCH 04/28] Update DESCRIPTION.md --- doc/DESCRIPTION.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 6e38db4..05c704e 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -9,12 +9,9 @@ Castopod is currently in beta but already quite stable and used by podcasters ar ### Features -- Free & open-source (AGPL v3 License) - Focused on data sovereignty: your content, audience, and analytics belong to you, and you only -- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites, … -- Built-in social network -- Built-in analytics -- Built-in marketing tools +- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites… +- Built-in social network, analytics, marketing tools - Monetization - Publish your episodes everywhere with RSS: - Podcast import: move your existing podcast into Castopod From 63bf82491573a720922cec74e67834857a26435f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 5 Jan 2023 17:37:34 +0000 Subject: [PATCH 05/28] Auto-update README --- README.md | 7 ++----- README_fr.md | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cce0c39..c20e65c 100755 --- a/README.md +++ b/README.md @@ -26,12 +26,9 @@ Castopod is currently in beta but already quite stable and used by podcasters ar ### Features -- Free & open-source (AGPL v3 License) - Focused on data sovereignty: your content, audience, and analytics belong to you, and you only -- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites, … -- Built-in social network -- Built-in analytics -- Built-in marketing tools +- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites… +- Built-in social network, analytics, marketing tools - Monetization - Publish your episodes everywhere with RSS: - Podcast import: move your existing podcast into Castopod diff --git a/README_fr.md b/README_fr.md index 31801d0..d7948d0 100755 --- a/README_fr.md +++ b/README_fr.md @@ -26,12 +26,9 @@ Castopod is currently in beta but already quite stable and used by podcasters ar ### Features -- Free & open-source (AGPL v3 License) - Focused on data sovereignty: your content, audience, and analytics belong to you, and you only -- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites, … -- Built-in social network -- Built-in analytics -- Built-in marketing tools +- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites… +- Built-in social network, analytics, marketing tools - Monetization - Publish your episodes everywhere with RSS: - Podcast import: move your existing podcast into Castopod From fb5fee3a4157e90dfc13c34bc296737a44acb86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 19 Jan 2023 14:59:58 +0100 Subject: [PATCH 06/28] Remove database update --- scripts/from_beta_16.sql | 11 ----------- scripts/upgrade | 10 ---------- 2 files changed, 21 deletions(-) delete mode 100644 scripts/from_beta_16.sql diff --git a/scripts/from_beta_16.sql b/scripts/from_beta_16.sql deleted file mode 100644 index 61af150..0000000 --- a/scripts/from_beta_16.sql +++ /dev/null @@ -1,11 +0,0 @@ -SET AUTOCOMMIT = 0; -START TRANSACTION; - -ALTER TABLE `cp_settings` -ADD COLUMN context VARCHAR(255) NULL AFTER `type`; - -ALTER TABLE cp_podcasts ADD COLUMN published_at DATETIME DEFAULT NULL AFTER -updated_by; -UPDATE cp_podcasts SET published_at = created_at; - -COMMIT; diff --git a/scripts/upgrade b/scripts/upgrade index 5f60b4e..78cd7df 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,16 +116,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# MYSQL CONFIGURATION -#================================================= - -if ynh_compare_current_package_version --comparison eq --version 1.0.0-96~ynh1 -then - ynh_script_progression --message="Upgrading MySQL configuration..." --weight=1 - ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./from_beta_16.sql -fi - #================================================= # UPGRADE DEPENDENCIES #================================================= From 59cbf94cc9186a323ee43350a593b7e3c075d8f8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 19 Jan 2023 14:00:06 +0000 Subject: [PATCH 07/28] Auto-update README --- README_fr.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README_fr.md b/README_fr.md index d7948d0..1a0777e 100755 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,15 @@ It shall NOT be edited by hand. # Castopod pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) [![Installer Castopod avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=castopod) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Castopod rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Castopod rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble Castopod is a free & open-source hosting platform made for podcasters who want engage and interact with their audience. @@ -41,9 +41,9 @@ Castopod is currently in beta but already quite stable and used by podcasters ar **Démo :** https://podcast.podlibre.org/@podlibre_fr -## Captures d'écran +## Captures d’écran -![Capture d'écran de Castopod](./doc/screenshots/screenshot.png) +![Capture d’écran de Castopod](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -62,9 +62,9 @@ Castopod is currently in beta but already quite stable and used by podcasters ar ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -80,4 +80,4 @@ ou sudo yunohost app upgrade castopod -u https://github.com/YunoHost-Apps/castopod_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From db418a2c721d9c2835f2ced1893e1996cbba5bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 19 Jan 2023 15:57:20 +0100 Subject: [PATCH 08/28] Update .env.example --- conf/.env.example | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/.env.example b/conf/.env.example index afcfd8a..a203646 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -31,7 +31,9 @@ database.default.DBPrefix="cp_" # Email configuration #-------------------------------------------------------------------- # email.fromEmail="your_email_address" -# email.SMTPHost="your_smtp_host" +# email.fromName="Castopod" +# email.SMTPHost="localhost" +# email.SMTPPort="25" # email.SMTPUser="your_smtp_user" # email.SMTPPass="your_smtp_password" @@ -55,4 +57,3 @@ cache.redis.database=__REDIS_DB__ # REST API configuration #-------------------------------------------------------------------- # restapi.enabled=true - From 7ec393755fe56b3bd3a6cbda4c3cb4f525d159f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Mar 2023 23:29:29 +0100 Subject: [PATCH 09/28] v2 --- doc/ADMIN.md | 1 + doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 doc/DISCLAIMER.md | 12 ------------ manifest.toml | 19 +++++++++---------- scripts/install | 13 ------------- scripts/remove | 10 ---------- scripts/restore | 14 -------------- scripts/upgrade | 11 ----------- tests.toml | 3 +++ 9 files changed, 13 insertions(+), 70 deletions(-) create mode 100644 doc/ADMIN.md rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) delete mode 100644 doc/DISCLAIMER.md create mode 100644 tests.toml diff --git a/doc/ADMIN.md b/doc/ADMIN.md new file mode 100644 index 0000000..f4d0806 --- /dev/null +++ b/doc/ADMIN.md @@ -0,0 +1 @@ +How to configure this app: Go to `__DOMAIN__/cp-admin` to connect to the administration panel. diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 155a15a..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,12 +0,0 @@ -## Configuration - - * How to configure this app: Go to `domain.ltd/cp-admin` to connect to the administration panel. - -#### Multi-user support - - * Are LDAP and HTTP auth supported? **No** - * Can the app be used by multiple users? **Yes** - -## Limitations - -* :warning: Installation possible only on a root domain or subdomain. diff --git a/manifest.toml b/manifest.toml index 6542932..2284e4a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,18 +17,17 @@ admindoc = "https://docs.castopod.org/" code = "https://code.castopod.org/adaures/castopod" [integration] -yunohost = ">= 11.1.0" +yunohost = ">= 11.1.12" architectures = "all" multi_instance = true -ldap = "false" -sso = "false" -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core help.en = "Castopod needs to be installed in a dedicated domain or sub-domain." help.fr = "Castopod doit être installé dans un domaine ou sous-domaine dédié." type = "domain" @@ -48,9 +47,9 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.permissions] main.url = "/" + [resources.apt] + packages = "mariadb-server ffmpeg php8.1-fpm php8.1-mysql php8.1-gd php8.1-intl php8.1-curl php8.1-mbstring php8.1-xml php8.1-mysqlnd" + [resources.database] type = "mysql" - [resources.apt] - packages = "ffmpeg php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" - diff --git a/scripts/install b/scripts/install index 77240cb..ccbd567 100755 --- a/scripts/install +++ b/scripts/install @@ -34,7 +34,6 @@ ynh_script_progression --message="Setting up source files..." --weight=2 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -46,11 +45,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - # Create a dedicated NGINX config ynh_add_nginx_config @@ -79,13 +73,6 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index bbbe3a5..3638a02 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,19 +23,9 @@ ynh_script_progression --message="Removing the Redis database..." --weight=1 ynh_redis_remove_db "$redis_db" -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config diff --git a/scripts/restore b/scripts/restore index 4e41a05..09b0a21 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,14 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -25,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -36,11 +27,6 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2f88e7a..ba8049c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,16 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - #================================================= # CHECK VERSION #================================================= @@ -62,7 +52,6 @@ then ynh_setup_source --dest_dir="$install_dir" --keep=".env" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..eb73b8d --- /dev/null +++ b/tests.toml @@ -0,0 +1,3 @@ +test_format = 1.0 + +[default] \ No newline at end of file From 8ee8b2267f166d1f1fd1491fffd0d2b29225c43d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 Mar 2023 22:29:33 +0000 Subject: [PATCH 10/28] Auto-update README --- README.md | 18 ++---------------- README_fr.md | 36 +++++++++++------------------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index e648c44..afe5bbf 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Castopod for YunoHost -[![Integration level](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Working status](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Working status](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) + [![Install Castopod with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=castopod) *[Lire ce readme en français.](./README_fr.md)* @@ -48,21 +49,6 @@ Castopod is currently in beta but already quite stable and used by podcasters ar ![Screenshot of Castopod](./doc/screenshots/screenshot.png) -## Disclaimers / important information - -## Configuration - - * How to configure this app: Go to `domain.ltd/cp-admin` to connect to the administration panel. - -#### Multi-user support - - * Are LDAP and HTTP auth supported? **No** - * Can the app be used by multiple users? **Yes** - -## Limitations - -* :warning: Installation possible only on a root domain or subdomain. - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 2afc7e5..02d2b60 100755 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,16 @@ It shall NOT be edited by hand. # Castopod pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) + [![Installer Castopod avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=castopod) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Castopod rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Castopod rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble Castopod is a free & open-source hosting platform made for podcasters who want engage and interact with their audience. @@ -44,30 +45,15 @@ Castopod is currently in beta but already quite stable and used by podcasters ar **Démo :** https://podcast.podlibre.org/@podlibre_fr -## Captures d'écran +## Captures d’écran -![Capture d'écran de Castopod](./doc/screenshots/screenshot.png) - -## Avertissements / informations importantes - -## Configuration - - * Comment configurer cette application : Accédez à `domain.ltd/cp-admin` pour vous connecter au panneau d'administration. - -#### Prise en charge multi-utilisateurs - - * Les authentifications LDAP et HTTP sont-elles prises en charge ? **Non** - * L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** - -## Limites - -* :warning : Installation possible uniquement sur un domaine racine ou un sous-domaine. +![Capture d’écran de Castopod](./doc/screenshots/screenshot.png) ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -83,4 +69,4 @@ ou sudo yunohost app upgrade castopod -u https://github.com/YunoHost-Apps/castopod_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From ad268b27410b508c37906dbf5e7516a42af9e86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Mar 2023 23:34:12 +0100 Subject: [PATCH 11/28] Fix --- doc/DESCRIPTION.md | 11 ++----- doc/PRE_UPGRADE.md | 1 + manifest.toml | 1 - scripts/_common.sh | 2 -- scripts/change_url | 76 +--------------------------------------------- 5 files changed, 4 insertions(+), 87 deletions(-) create mode 100644 doc/PRE_UPGRADE.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 6e38db4..a0cb5c3 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,17 +1,11 @@ Castopod is a free & open-source hosting platform made for podcasters who want engage and interact with their audience. - Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP framework with a very small footprint. -### Status - -Castopod is currently in beta but already quite stable and used by podcasters around the world! - ### Features -- Free & open-source (AGPL v3 License) - Focused on data sovereignty: your content, audience, and analytics belong to you, and you only -- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites, … +- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites… - Built-in social network - Built-in analytics - Built-in marketing tools @@ -20,5 +14,4 @@ Castopod is currently in beta but already quite stable and used by podcasters ar - Podcast import: move your existing podcast into Castopod - Move your podcast out of Castopod - Multi-tenant: host as many podcasts as you want -- Multi-user: add contributors and set roles -- i18n support: translated in English, French & Polish with more to come! \ No newline at end of file +- Multi-user: add contributors and set roles \ No newline at end of file diff --git a/doc/PRE_UPGRADE.md b/doc/PRE_UPGRADE.md new file mode 100644 index 0000000..810a9e8 --- /dev/null +++ b/doc/PRE_UPGRADE.md @@ -0,0 +1 @@ +Castopod will not upgrade from previous beta versions. diff --git a/manifest.toml b/manifest.toml index 2284e4a..4a4386c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -52,4 +52,3 @@ ram.runtime = "50M" [resources.database] type = "mysql" - diff --git a/scripts/_common.sh b/scripts/_common.sh index 1a2ec90..d847bb9 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,6 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="8.1" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/change_url b/scripts/change_url index aff5392..9f98084 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,86 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path="/" - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=5 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload +ynh_change_url_nginx_config #================================================= # END OF SCRIPT From 9f257a75394757a4d657ca2a68ac002199f6fc8f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 Mar 2023 22:34:22 +0000 Subject: [PATCH 12/28] Auto-update README --- README.md | 9 +-------- README_fr.md | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index afe5bbf..23852dc 100755 --- a/README.md +++ b/README.md @@ -17,19 +17,13 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Castopod is a free & open-source hosting platform made for podcasters who want engage and interact with their audience. - Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP framework with a very small footprint. -### Status - -Castopod is currently in beta but already quite stable and used by podcasters around the world! - ### Features -- Free & open-source (AGPL v3 License) - Focused on data sovereignty: your content, audience, and analytics belong to you, and you only -- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites, … +- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites… - Built-in social network - Built-in analytics - Built-in marketing tools @@ -39,7 +33,6 @@ Castopod is currently in beta but already quite stable and used by podcasters ar - Move your podcast out of Castopod - Multi-tenant: host as many podcasts as you want - Multi-user: add contributors and set roles -- i18n support: translated in English, French & Polish with more to come! **Shipped version:** 1.0.1~ynh1 diff --git a/README_fr.md b/README_fr.md index 02d2b60..ff52139 100755 --- a/README_fr.md +++ b/README_fr.md @@ -17,19 +17,13 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble Castopod is a free & open-source hosting platform made for podcasters who want engage and interact with their audience. - Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP framework with a very small footprint. -### Status - -Castopod is currently in beta but already quite stable and used by podcasters around the world! - ### Features -- Free & open-source (AGPL v3 License) - Focused on data sovereignty: your content, audience, and analytics belong to you, and you only -- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites, … +- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites… - Built-in social network - Built-in analytics - Built-in marketing tools @@ -39,7 +33,6 @@ Castopod is currently in beta but already quite stable and used by podcasters ar - Move your podcast out of Castopod - Multi-tenant: host as many podcasts as you want - Multi-user: add contributors and set roles -- i18n support: translated in English, French & Polish with more to come! **Version incluse :** 1.0.1~ynh1 From 4812a0950af47d08622442da41c94447079e264d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 Mar 2023 22:37:53 +0000 Subject: [PATCH 13/28] Auto-update README --- README.md | 2 +- README_fr.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0d93826..f1eec27 100755 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP - Multi-tenant: host as many podcasts as you want - Multi-user: add contributors and set roles -**Shipped version:** 1.1.2~ynh1 +**Shipped version:** 1.0.1~ynh1 **Demo:** https://podcast.podlibre.org/@podlibre_fr diff --git a/README_fr.md b/README_fr.md index 64c2c75..2be966b 100755 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Castopod pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/castopod.svg)](https://dash.yunohost.org/appci/app/castopod) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/castopod.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/castopod.maintain.svg) + [![Installer Castopod avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=castopod) *[Read this readme in english.](./README.md)* @@ -31,7 +32,7 @@ Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP - Multi-tenant: host as many podcasts as you want - Multi-user: add contributors and set roles -**Version incluse :** 1.1.2~ynh1 +**Version incluse :** 1.0.1~ynh1 **Démo :** https://podcast.podlibre.org/@podlibre_fr From 1c426ab0ed39c03e898bc3e0fe535241aff853d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:34:04 +0100 Subject: [PATCH 14/28] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 4a4386c..db44344 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://docs.castopod.org/" code = "https://code.castopod.org/adaures/castopod" [integration] -yunohost = ">= 11.1.12" +yunohost = ">= 11.1.13" architectures = "all" multi_instance = true ldap = false From 17eeb54d3f8e6865b371b1c81a943bf412d9a93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:35:35 +0100 Subject: [PATCH 15/28] Update upgrade --- scripts/upgrade | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ba8049c..f790f70 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,21 +56,22 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=10 - # Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" + #================================================= # CONFIGURE CASTOPOD #================================================= @@ -80,22 +81,6 @@ ynh_add_nginx_config # chmod 600 $install_dir/.env # chown $app:www-data "$install_dir/.env" -#================================================= -# SETUP CRON -#================================================= -ynh_script_progression --message="Setuping cron..." --weight=1 - -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From 993a4c6b2297715bdd0855de55743c8dfee4653f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:40:32 +0100 Subject: [PATCH 16/28] fix --- doc/ADMIN_fr.md | 13 +------------ doc/DESCRIPTION_fr.md | 14 ++++++++++++++ doc/PRE_UPGRADE_fr.md | 1 + 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 doc/DESCRIPTION_fr.md create mode 100644 doc/PRE_UPGRADE_fr.md diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index df72b05..a20f12b 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1,12 +1 @@ -## Configuration - - * Comment configurer cette application : Accédez à `domain.ltd/cp-admin` pour vous connecter au panneau d'administration. - -#### Prise en charge multi-utilisateurs - - * Les authentifications LDAP et HTTP sont-elles prises en charge ? **Non** - * L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** - -## Limites - -* :warning : Installation possible uniquement sur un domaine racine ou un sous-domaine. +Comment configurer cette application : Accédez à `__DOMAIN__/cp-admin` pour vous connecter au panneau d'administration. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..cb451e4 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,14 @@ +Castopod est une plate-forme d'hébergement gratuite et open source conçue pour les podcasteurs qui souhaitent interagir avec leur public. + + +### Caractéristiques + +- Axé sur la souveraineté des données : votre contenu, votre audience et vos analyses vous appartiennent, et vous seul +- Fonctionnalités du podcasting 2.0 : GUID, verrouillé, transcriptions, financement, chapitres, localisation, personnes, extraits sonores… +- Réseau social intégré, outils d'analyse et de marketing +- Monétisation +- Publiez vos épisodes partout avec RSS +- Importation de podcast : déplacez votre podcast existant dans Castopod +- Déplacez votre podcast hors de Castopod +- Multi-locataire : hébergez autant de podcasts que vous le souhaitez +- Multi-utilisateur : ajouter des contributeurs et définir des rôles \ No newline at end of file diff --git a/doc/PRE_UPGRADE_fr.md b/doc/PRE_UPGRADE_fr.md new file mode 100644 index 0000000..a460454 --- /dev/null +++ b/doc/PRE_UPGRADE_fr.md @@ -0,0 +1 @@ +Castopod ne mettra pas à jour les versions bêta précédentes. \ No newline at end of file From a6dbf83d528a2fe0c8b5e345a78252333c3afbfd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 Mar 2023 08:40:37 +0000 Subject: [PATCH 17/28] Auto-update README --- README_fr.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README_fr.md b/README_fr.md index 2be966b..f12267b 100755 --- a/README_fr.md +++ b/README_fr.md @@ -16,21 +16,20 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Castopod is a free & open-source hosting platform made for podcasters who want engage and interact with their audience. -Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP framework with a very small footprint. +Castopod est une plate-forme d'hébergement gratuite et open source conçue pour les podcasteurs qui souhaitent interagir avec leur public. -### Features +### Caractéristiques -- Focused on data sovereignty: your content, audience, and analytics belong to you, and you only -- Podcasting 2.0 features: GUID, locked, transcripts, funding, chapters, location, persons, soundbites… -- Built-in social network, analytics, marketing tools -- Monetization -- Publish your episodes everywhere with RSS: -- Podcast import: move your existing podcast into Castopod -- Move your podcast out of Castopod -- Multi-tenant: host as many podcasts as you want -- Multi-user: add contributors and set roles +- Axé sur la souveraineté des données : votre contenu, votre audience et vos analyses vous appartiennent, et vous seul +- Fonctionnalités du podcasting 2.0 : GUID, verrouillé, transcriptions, financement, chapitres, localisation, personnes, extraits sonores… +- Réseau social intégré, outils d'analyse et de marketing +- Monétisation +- Publiez vos épisodes partout avec RSS +- Importation de podcast : déplacez votre podcast existant dans Castopod +- Déplacez votre podcast hors de Castopod +- Multi-locataire : hébergez autant de podcasts que vous le souhaitez +- Multi-utilisateur : ajouter des contributeurs et définir des rôles **Version incluse :** 1.0.1~ynh1 From 7f5119bb8c70fa5f1901fc59f5fc21d0c524777f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:49:23 +0100 Subject: [PATCH 18/28] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index db44344..64c8347 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Castopod" description.en = "Hosting platform made for podcasters" description.fr = "Plateforme d'hébergement conçue pour les podcasteurs" -version = "1.0.1~ynh1" +version = "1.1.2~ynh1" maintainers = ["eric_G"] From bc800480e1d9b68e9eea87d8a6fa1f7219965351 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 Mar 2023 08:49:30 +0000 Subject: [PATCH 19/28] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f1eec27..0d93826 100755 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP - Multi-tenant: host as many podcasts as you want - Multi-user: add contributors and set roles -**Shipped version:** 1.0.1~ynh1 +**Shipped version:** 1.1.2~ynh1 **Demo:** https://podcast.podlibre.org/@podlibre_fr diff --git a/README_fr.md b/README_fr.md index f12267b..e7a155c 100755 --- a/README_fr.md +++ b/README_fr.md @@ -31,7 +31,7 @@ Castopod est une plate-forme d'hébergement gratuite et open source conçue pour - Multi-locataire : hébergez autant de podcasts que vous le souhaitez - Multi-utilisateur : ajouter des contributeurs et définir des rôles -**Version incluse :** 1.0.1~ynh1 +**Version incluse :** 1.1.2~ynh1 **Démo :** https://podcast.podlibre.org/@podlibre_fr From 7d0a6d28127ccdb25382eaa277703f6121c62ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:53:45 +0100 Subject: [PATCH 20/28] Update install --- scripts/install | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index ccbd567..58de286 100755 --- a/scripts/install +++ b/scripts/install @@ -38,9 +38,9 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint @@ -48,6 +48,10 @@ ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint # Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" + #================================================= # SPECIFIC SETUP #================================================= @@ -64,15 +68,6 @@ ynh_add_config --template="../conf/.env.example" --destination="$install_dir/.en chmod 600 $install_dir/.env chown $app:www-data "$install_dir/.env" -#================================================= -# SETUP A CRON -#================================================= -ynh_script_progression --message="Setuping a cron..." --weight=1 - -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" - #================================================= # END OF SCRIPT #================================================= From ac8a256ca8364281db811776def2d528541ecbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:55:20 +0100 Subject: [PATCH 21/28] Update restore --- scripts/restore | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/restore b/scripts/restore index 09b0a21..6e0a9ef 100755 --- a/scripts/restore +++ b/scripts/restore @@ -20,15 +20,6 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -37,9 +28,15 @@ ynh_script_progression --message="Restoring the MySQL database..." --weight=2 ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= -# RESTORE VARIOUS FILES +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring cron job..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=3 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" @@ -48,9 +45,9 @@ chmod 644 "/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND PHP-FPM +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload From d785e38b11eda44b7acfc2a79552ae1b1bc49850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:56:09 +0100 Subject: [PATCH 22/28] Update upgrade --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index f790f70..17e52ec 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,19 +21,19 @@ upgrade_type=$(ynh_check_app_version_changed) ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If fpm_footprint doesn't exist, create it -if [ -z "$fpm_footprint" ]; then +if [ -z "${fpm_footprint:-}" ]; then fpm_footprint=low ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint fi # If fpm_free_footprint doesn't exist, create it -if [ -z "$fpm_free_footprint" ]; then +if [ -z "${fpm_free_footprint:-}" ]; then fpm_free_footprint=0 ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint fi # If fpm_usage doesn't exist, create it -if [ -z "$fpm_usage" ]; then +if [ -z "${fpm_usage:-}" ]; then fpm_usage=low ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi From 067f5b5f800b4688782282ea3b0ae688b0da4781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:57:47 +0100 Subject: [PATCH 23/28] Fix --- manifest.toml | 2 +- tests.toml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 64c8347..f6190d2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Castopod" description.en = "Hosting platform made for podcasters" description.fr = "Plateforme d'hébergement conçue pour les podcasteurs" -version = "1.1.2~ynh1" +version = "1.1.2~ynh2" maintainers = ["eric_G"] diff --git a/tests.toml b/tests.toml index eb73b8d..e9a1126 100644 --- a/tests.toml +++ b/tests.toml @@ -1,3 +1,9 @@ test_format = 1.0 -[default] \ No newline at end of file +[default] + + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + test_upgrade_from.72a5f668.name = "Upgrade from 1.1.2" From e5850176f35ccaac3647e460cee5f8bec8302297 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 Mar 2023 08:57:56 +0000 Subject: [PATCH 24/28] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d93826..9b2a7ca 100755 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Castopod is easy to install and was built on top of CodeIgniter4, a powerful PHP - Multi-tenant: host as many podcasts as you want - Multi-user: add contributors and set roles -**Shipped version:** 1.1.2~ynh1 +**Shipped version:** 1.1.2~ynh2 **Demo:** https://podcast.podlibre.org/@podlibre_fr diff --git a/README_fr.md b/README_fr.md index e7a155c..9b3f0e8 100755 --- a/README_fr.md +++ b/README_fr.md @@ -31,7 +31,7 @@ Castopod est une plate-forme d'hébergement gratuite et open source conçue pour - Multi-locataire : hébergez autant de podcasts que vous le souhaitez - Multi-utilisateur : ajouter des contributeurs et définir des rôles -**Version incluse :** 1.1.2~ynh1 +**Version incluse :** 1.1.2~ynh2 **Démo :** https://podcast.podlibre.org/@podlibre_fr From 31ca59d43f71396569094e311100f40a3789a687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:00:51 +0100 Subject: [PATCH 25/28] Update remove --- scripts/remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 3638a02..0c6b882 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,9 +12,9 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +# ynh_script_progression --message="Loading installation settings..." --weight=1 -redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) +# redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # REMOVE THE REDIS DATABASE From d055773d659c787e16bcdf7dca03f8eeae86811b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:34:33 +0100 Subject: [PATCH 26/28] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 0c6b882..e101710 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,7 +19,7 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE THE REDIS DATABASE #================================================= -ynh_script_progression --message="Removing the Redis database..." --weight=1 +ynh_script_progression --message="Removing Redis database..." --weight=1 ynh_redis_remove_db "$redis_db" From 3f63ed9377d8deed3b320076cb72014daba80a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:43:22 +0100 Subject: [PATCH 27/28] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index f6190d2..0816022 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,7 +23,7 @@ multi_instance = true ldap = false sso = false disk = "50M" -ram.build = "50M" +ram.build = "100M" ram.runtime = "50M" [install] From fd517aacd85a810ad7509db76b3fa9d4679f1860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:46:34 +0100 Subject: [PATCH 28/28] fix --- doc/POST_INSTALL.md | 1 + doc/POST_INSTALL_fr.md | 1 + 2 files changed, 2 insertions(+) create mode 100644 doc/POST_INSTALL.md create mode 100644 doc/POST_INSTALL_fr.md diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..04f51ca --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1 @@ +After post-installation configuration, go to `__DOMAIN__/cp-admin` to connect to the administration panel. \ No newline at end of file diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md new file mode 100644 index 0000000..5468339 --- /dev/null +++ b/doc/POST_INSTALL_fr.md @@ -0,0 +1 @@ +Après la configuration post-installation, accédez à `__DOMAIN__/cp-admin` pour vous connecter au panneau d'administration. \ No newline at end of file