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 #32 from YunoHost-Apps/testing

Upgrade to 4.0.0
This commit is contained in:
Kayou 2021-08-11 19:59:01 +02:00 committed by GitHub
commit 173d6e01bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 28 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)
**Shipped version:** 3.2.11
**Shipped version:** 4.0.0
## 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)
**Version incluse:** 3.2.11
**Version incluse:** 4.0.0
## Captures d'écran

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://files.spip.net/spip/archives/spip-v3.2.11.zip
SOURCE_SUM=6b713ec10d9ceff367ec7f76f32d9438b76919f493cae3ef3a3db0cfce570df3
SOURCE_URL=https://files.spip.net/spip/archives/spip-v4.0.0.zip
SOURCE_SUM=d17513fcdac32c07b327ad18032facfcadd174719fba2d4598f10b1c931b7e5a
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false

View file

@ -6,7 +6,7 @@
"en": "CMS with a focus on collaborative edition and multilingualism",
"fr": "CMS conçu pour l'édition collaborative et le multilinguisme"
},
"version": "3.2.11~ynh2",
"version": "4.0.0~ynh1",
"url": "http://www.spip.net/",
"license": "GPL-3.0-or-later",
"maintainer": {

View file

@ -4,7 +4,7 @@
# SET ALL CONSTANTS
#=================================================
YNH_PHP_VERSION="7.2"
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"

View file

@ -52,7 +52,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=users_status --value=$users_status
#=================================================
@ -122,7 +121,7 @@ ynh_permission_update --permission="main" --add="visitors"
# Installation with curl
ynh_script_progression --message="Finalizing installation..."
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=chmod"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=2" "chmod=755" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=2" "chmod=750" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=3" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" "choix_db=$db_name" "tprefix=$db_name"
# For now spip have a problem with LDAP
#ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=ldap1"

View file

@ -20,7 +20,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin)
password=$(ynh_app_setting_get --app=$app --key=password)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
users_status=$(ynh_app_setting_get --app=$app --key=users_status)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
@ -60,13 +59,10 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
# Remove is_public
if [ -n "$is_public" ]; then
ynh_app_setting_delete --app=$app --key=is_public
fi
# If db_name doesn't exist, create it
@ -170,17 +166,24 @@ chown -R $app:www-data "$final_path"
# Set the app as temporarily public for curl call
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_secure_remove --file="$final_path/config/connect.php"
mv $final_path/config/connect.php $final_path/config/connect.php.ynh_bkp
# Installation with curl
ynh_script_progression --message="Finalizing installation..."
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=chmod"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=2" "chmod=755" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=2" "chmod=750" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql"
ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=3" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" "choix_db=$db_name" "tprefix=$db_name"
# For now spip have a problem with LDAP
#ynh_local_curl "/ecrire/?suivant" "exec=install" "etape=ldap1"
@ -206,9 +209,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=fin"
# Remove the public access
ynh_permission_update --permission="main" --remove="visitors"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
@ -220,6 +220,12 @@ cp ../conf/mes_options.php $final_path/config/mes_options.php
# STORE THE CONFIG FILE CHECKSUM
#=================================================
if [ ! -f $final_path/config/connect.php ]; then
mv $final_path/config/connect.php.ynh_bkp $final_path/config/connect.php
else
ynh_secure_remove --file="$final_path/config/connect.php.ynh_bkp"
fi
ynh_store_file_checksum --file="$final_path/config/connect.php"
#=================================================
@ -229,12 +235,10 @@ ynh_store_file_checksum --file="$final_path/config/connect.php"
#=================================================
ynh_script_progression --message="Configuring permissions..."
# Make app public if necessary
if [ $is_public -eq 1 ]
# Make app private if necessary
if [ $is_public -eq 0 ]
then
# Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission="main" --add="visitors"
ynh_permission_update --permission="main" --remove="visitors"
fi
#=================================================