1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/spip_ynh.git synced 2024-09-03 20:25:59 +02:00

Merge pull request #39 from YunoHost-Apps/testing

4.0.1
This commit is contained in:
Kayou 2022-01-04 15:09:34 +01:00 committed by GitHub
commit 7c82142293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 48 additions and 57 deletions

View file

@ -14,7 +14,7 @@ SPIP is a publishing system for the Internet in which great importance is attach
Source: [spip.net](http://www.spip.net/en_rubrique25.html) Source: [spip.net](http://www.spip.net/en_rubrique25.html)
**Shipped version:** 4.0.0 **Shipped version:** 4.0.1
## Screenshots ## Screenshots

View file

@ -14,7 +14,7 @@ SPIP est un système de publication pour lInternet qui sattache particuli
Source: [spip.net](http://www.spip.net/fr_rubrique91.html) Source: [spip.net](http://www.spip.net/fr_rubrique91.html)
**Version incluse:** 4.0.0 **Version incluse:** 4.0.1
## Captures d'écran ## Captures d'écran

View file

@ -1,10 +1,10 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
path="/path" (PATH) path="/path"
admin="john" (USER) admin="john"
users_status="Editor" users_status="Editor"
is_public=1 (PUBLIC|public=1|private=0) is_public=1
password="thisisapassword" password="thisisapassword"
; Checks ; Checks
pkg_linter=1 pkg_linter=1

View file

@ -1,7 +1,6 @@
SOURCE_URL=https://files.spip.net/spip/archives/spip-v4.0.0.zip SOURCE_URL=https://files.spip.net/spip/archives/spip-v4.0.1.zip
SOURCE_SUM=d17513fcdac32c07b327ad18032facfcadd174719fba2d4598f10b1c931b7e5a SOURCE_SUM=509881b6d8ec23de23ce69f3026610713e756a6d03ceecc7793e864394a8e705
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=
SOURCE_EXTRACT=true SOURCE_EXTRACT=true

View file

@ -4,11 +4,6 @@ location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/ ; alias __FINALPATH__/ ;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php; index index.php;
client_max_body_size 30M; client_max_body_size 30M;

View file

@ -6,7 +6,7 @@
"en": "CMS with a focus on collaborative edition and multilingualism", "en": "CMS with a focus on collaborative edition and multilingualism",
"fr": "CMS conçu pour l'édition collaborative et le multilinguisme" "fr": "CMS conçu pour l'édition collaborative et le multilinguisme"
}, },
"version": "4.0.0~ynh2", "version": "4.0.1~ynh1",
"url": "http://www.spip.net/", "url": "http://www.spip.net/",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"maintainer": { "maintainer": {
@ -14,7 +14,7 @@
"email": "cyp@rouquin.me" "email": "cyp@rouquin.me"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.2.7" "yunohost": ">= 4.3.2"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -25,8 +25,7 @@
"install" : [ "install" : [
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"example": "example.com"
}, },
{ {
"name": "path", "name": "path",
@ -36,13 +35,11 @@
}, },
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user"
"example": "johndoe"
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password"
"example": "Choose a password"
}, },
{ {
"name": "is_public", "name": "is_public",

View file

@ -6,7 +6,7 @@
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="7.3"
extra_php_dependencies="php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-gd" pkg_dependencies="php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-gd"
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS

View file

@ -54,6 +54,13 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=users_status --value=$users_status ynh_app_setting_set --app=$app --key=users_status --value=$users_status
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -100,7 +107,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring PHP-FPM..." ynh_script_progression --message="Configuring PHP-FPM..."
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
@ -115,8 +122,6 @@ chown -R $app:www-data "$final_path"
# Set the app as temporarily public for curl call # Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring SSOwat..."
# Making the app public for curl
ynh_permission_update --permission="main" --add="visitors"
# Installation with curl # Installation with curl
ynh_script_progression --message="Finalizing installation..." ynh_script_progression --message="Finalizing installation..."
@ -147,9 +152,6 @@ email=$(yunohost user info $admin | grep mail: | cut -d' ' -f2 | tr -d '\n')
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=3b" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" "sel_db=$db_name" "nom=$admin" "email=$email" "login=$admin" "pass=$password" "pass_verif=$password" ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=3b" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" "sel_db=$db_name" "nom=$admin" "email=$email" "login=$admin" "pass=$password" "pass_verif=$password"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=fin" ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=fin"
# Remove the public access
ynh_permission_update --permission="main" --remove="visitors"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================

View file

@ -39,6 +39,14 @@ ynh_script_progression --message="Removing the MySQL database..."
# 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..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================

View file

@ -39,10 +39,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." ynh_script_progression --message="Validating restoration parameters..."
ynh_webpath_available --domain=$domain --path_url=$path_url \ test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
@ -81,8 +78,15 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..."
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"
# Recreate a dedicated php-fpm config # Recreate a dedicated php-fpm config
ynh_add_fpm_config --phpversion=$phpversion --package="$extra_php_dependencies" ynh_add_fpm_config --phpversion=$phpversion
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION

View file

@ -59,9 +59,8 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." ynh_script_progression --message="Ensuring downward compatibility..."
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
# Remove is_public # Remove is_public
if [ -n "$is_public" ]; then if [ -n "$(ynh_app_setting_get --app=$app --key=is_public)" ]; then
ynh_app_setting_delete --app=$app --key=is_public ynh_app_setting_delete --app=$app --key=is_public
fi fi
@ -145,13 +144,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..."
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -167,15 +173,6 @@ chown -R $app:www-data "$final_path"
# Set the app as temporarily public for curl call # Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring SSOwat..."
if ! ynh_permission_has_user --permission=main --user="visitors"; then
is_public=0
# Making the app public for curl
ynh_permission_update --permission="main" --add="visitors"
else
is_public=1
fi
ynh_backup_if_checksum_is_different --file="$final_path/config/connect.php" ynh_backup_if_checksum_is_different --file="$final_path/config/connect.php"
mv $final_path/config/connect.php $final_path/config/connect.php.ynh_bkp mv $final_path/config/connect.php $final_path/config/connect.php.ynh_bkp
@ -230,17 +227,6 @@ ynh_store_file_checksum --file="$final_path/config/connect.php"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..."
# Make app private if necessary
if [ $is_public -eq 0 ]
then
ynh_permission_update --permission="main" --remove="visitors"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================