mirror of
https://github.com/YunoHost-Apps/castopod_ynh.git
synced 2024-09-03 18:16:14 +02:00
commit
ab67f35130
11 changed files with 66 additions and 41 deletions
|
@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
||||||
|
|
||||||
Hosting platform made for podcasters
|
Hosting platform made for podcasters
|
||||||
|
|
||||||
**Shipped version:** 1.0.0-76~ynh1
|
**Shipped version:** 1.0.0-77~ynh1
|
||||||
|
|
||||||
**Demo:** https://podcast.podlibre.org/@podlibre_fr
|
**Demo:** https://podcast.podlibre.org/@podlibre_fr
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
||||||
|
|
||||||
Plateforme d'hébergement conçue pour les podcasteurs
|
Plateforme d'hébergement conçue pour les podcasteurs
|
||||||
|
|
||||||
**Version incluse :** 1.0.0-76~ynh1
|
**Version incluse :** 1.0.0-77~ynh1
|
||||||
|
|
||||||
**Démo :** https://podcast.podlibre.org/@podlibre_fr
|
**Démo :** https://podcast.podlibre.org/@podlibre_fr
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
#1.0.0 alpha.64
|
|
||||||
upgrade=1 from_commit=8ae9bec1e274f8764ad0a5db5297542c3274d999
|
|
||||||
#1.0.0 alpha.75
|
#1.0.0 alpha.75
|
||||||
upgrade=1 from_commit=c8a5545d2b1d61342d837b7608fdc64a5b71b25b
|
upgrade=1 from_commit=c8a5545d2b1d61342d837b7608fdc64a5b71b25b
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
|
@ -24,8 +22,6 @@
|
||||||
Email=
|
Email=
|
||||||
Notification=none
|
Notification=none
|
||||||
;;; Upgrade options
|
;;; Upgrade options
|
||||||
; commit=8ae9bec1e274f8764ad0a5db5297542c3274d999
|
|
||||||
name=1.0.0 alpha.64
|
|
||||||
; commit=c8a5545d2b1d61342d837b7608fdc64a5b71b25b
|
; commit=c8a5545d2b1d61342d837b7608fdc64a5b71b25b
|
||||||
name=1.0.0 alpha.75
|
name=1.0.0 alpha.75
|
||||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&
|
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://code.podlibre.org/podlibre/castopod-host/uploads/d55c14c57d8ab40911bdd53bd7e8c2a5/castopod-host-1.0.0-alpha.76.zip
|
SOURCE_URL=https://code.podlibre.org/podlibre/castopod-host/uploads/85507bef4675ce7e04e71b7dd419f0ce/castopod-host-1.0.0-alpha.77.zip
|
||||||
SOURCE_SUM=5f28f6cc1b8bf1b49f7238de7916b18f7e7a880235397dc5dfb17cec897ad9d5
|
SOURCE_SUM=89d6315cf7b16518f7dc2dbc675508806582df674d4a734311525b96c54ec861
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=zip
|
SOURCE_FORMAT=zip
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -3,17 +3,11 @@ location / {
|
||||||
# Path to source
|
# Path to source
|
||||||
alias __FINALPATH__/public/;
|
alias __FINALPATH__/public/;
|
||||||
|
|
||||||
# Force usage of https
|
|
||||||
if ($scheme = http) {
|
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
|
||||||
}
|
|
||||||
|
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
client_max_body_size 512M;
|
client_max_body_size 512M;
|
||||||
|
|
||||||
try_files $uri $uri/ /index.php;
|
try_files $uri $uri/ /index.php;
|
||||||
|
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Hosting platform made for podcasters",
|
"en": "Hosting platform made for podcasters",
|
||||||
"fr": "Plateforme d'hébergement conçue pour les podcasteurs"
|
"fr": "Plateforme d'hébergement conçue pour les podcasteurs"
|
||||||
},
|
},
|
||||||
"version": "1.0.0-76~ynh1",
|
"version": "1.0.0-77~ynh1",
|
||||||
"url": "https://podlibre.org/",
|
"url": "https://podlibre.org/",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
|
@ -21,12 +21,12 @@
|
||||||
"email": ""
|
"email": ""
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.2.4"
|
"yunohost": ">= 4.3.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
"nginx",
|
"nginx",
|
||||||
"php7.3-fpm",
|
"php8.0-fpm",
|
||||||
"mysql"
|
"mysql"
|
||||||
],
|
],
|
||||||
"arguments": {
|
"arguments": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
YNH_PHP_VERSION="8.0"
|
YNH_PHP_VERSION="8.0"
|
||||||
|
|
||||||
extra_php_dependencies="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}-json php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd"
|
pkg_dependencies="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}-json php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
|
@ -26,6 +26,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
password=$YNH_APP_ARG_PASSWORD
|
password=$YNH_APP_ARG_PASSWORD
|
||||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
phpversion=$YNH_PHP_VERSION
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -48,6 +49,14 @@ 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=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||||
|
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# INSTALL DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Installing dependencies..." --weight=1
|
||||||
|
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -94,8 +103,7 @@ ynh_add_nginx_config
|
||||||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
ynh_add_fpm_config
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
@ -119,6 +127,8 @@ chown $app:www-data "$final_path/.env"
|
||||||
ynh_script_progression --message="Setuping a cron..."
|
ynh_script_progression --message="Setuping a cron..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||||
|
chown root: "/etc/cron.d/$app"
|
||||||
|
chmod 644 "/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP APPLICATION WITH CURL
|
# SETUP APPLICATION WITH CURL
|
||||||
|
|
|
@ -30,6 +30,14 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=1
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing dependencies..." --weight=1
|
||||||
|
|
||||||
|
# Remove metapackage and its dependencies
|
||||||
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE REDIS DATABASE
|
# REMOVE THE REDIS DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -36,8 +36,7 @@ phpversion=$YNH_PHP_VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||||
|
|
||||||
test ! -d $final_path \
|
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
|
@ -69,11 +68,17 @@ chown -R $app:www-data "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# 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/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
#=================================================
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
# REINSTALL DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
||||||
|
|
||||||
|
# Define and install dependencies
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE MYSQL DATABASE
|
# RESTORE THE MYSQL DATABASE
|
||||||
|
@ -87,8 +92,11 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
# RESTORE VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring cron job..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
|
chown root: "/etc/cron.d/$app"
|
||||||
|
chmod 644 "/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -30,6 +30,20 @@ phpversion=$YNH_PHP_VERSION
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
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
|
||||||
|
|
||||||
|
# Backup the current version of the app
|
||||||
|
ynh_backup_before_upgrade
|
||||||
|
ynh_clean_setup () {
|
||||||
|
# Restore it if the upgrade fails
|
||||||
|
ynh_restore_upgradebackup
|
||||||
|
}
|
||||||
|
# Exit if an error occurs during the execution of the script
|
||||||
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -54,20 +68,6 @@ if ynh_legacy_permissions_exists; then
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
||||||
#=================================================
|
|
||||||
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 () {
|
|
||||||
# Restore it if the upgrade fails
|
|
||||||
ynh_restore_upgradebackup
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -102,13 +102,20 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# UPGRADE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
||||||
|
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
ynh_add_fpm_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE CASTOPOD
|
# CONFIGURE CASTOPOD
|
||||||
|
@ -122,9 +129,11 @@ chown $app:www-data "$final_path/.env"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP CRON
|
# SETUP CRON
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setuping cron..."
|
ynh_script_progression --message="Setuping cron..." --weight=1
|
||||||
|
|
||||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
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
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Add table
Reference in a new issue