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

Fix upgrade

This commit is contained in:
yalh76 2021-05-24 12:31:28 +02:00
parent b2132a7291
commit 85a1fc63ba
5 changed files with 122 additions and 112 deletions

View file

@ -14,6 +14,7 @@
setup_private=1
setup_public=1
upgrade=1
#3.2.4~ynh1
upgrade=1 from_commit=e079b0d81e698c9cde7e9ce50b29da1d5715bf65
backup_restore=1
multi_instance=1

View file

@ -4,3 +4,4 @@ SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -1,65 +1,65 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
# Path to source
alias __FINALPATH__/ ;
# Path to source
alias __FINALPATH__/ ;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
# 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;
try_files $uri $uri/ index.php;
try_files $uri $uri/ index.php;
if (!-e $request_filename)
{
rewrite ^/([^/]*)/robots\.txt$ __PATH__/spip.php?page=robots.txt last;
rewrite ^/([^/]*)/sitemap\.xml$ __PATH__/spip.php?page=sitemap.xml last;
rewrite ^(.+)$ __PATH__/index.php?q=$1 last;
}
if (!-e $request_filename)
{
rewrite ^/([^/]*)/robots\.txt$ __PATH__/spip.php?page=robots.txt last;
rewrite ^/([^/]*)/sitemap\.xml$ __PATH__/spip.php?page=sitemap.xml last;
rewrite ^(.+)$ __PATH__/index.php?q=$1 last;
}
# Add headers to serve security related headers
more_set_headers 'Strict-Transport-Security: max-age=15768000';
more_set_headers 'X-Content-Type-Options: nosniff';
more_set_headers 'X-Frame-Options: SAMEORIGIN';
more_set_headers 'X-XSS-Protection: 1, mode=block';
more_set_headers 'X-Robots-Tag: none';
more_set_headers 'X-Download-Options: noopen';
more_set_headers 'X-Permitted-Cross-Domain-Policies: none';
# Add headers to serve security related headers
more_set_headers 'Strict-Transport-Security: max-age=15768000';
more_set_headers 'X-Content-Type-Options: nosniff';
more_set_headers 'X-Frame-Options: SAMEORIGIN';
more_set_headers 'X-XSS-Protection: 1, mode=block';
more_set_headers 'X-Robots-Tag: none';
more_set_headers 'X-Download-Options: noopen';
more_set_headers 'X-Permitted-Cross-Domain-Policies: none';
location ~^/(tmp|config|\.ht)/{
deny all;
}
location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ {
# Le contenu statique, est signalé au navigateur comme étant
# à garder en cache une semaine. Si il y a un proxy sur la
# route, celui-ci est autorisé à faire une copie et à la
# cacher.
rewrite ^/([^/]*)/favicon\.ico$ __PATH__/spip.php?page=favicon.ico last;
expires 1w;
more_set_headers 'Cache-Control: public';
}
location ~^/(tmp|config|\.ht)/{
deny all;
}
location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ {
# Le contenu statique, est signalé au navigateur comme étant
# à garder en cache une semaine. Si il y a un proxy sur la
# route, celui-ci est autorisé à faire une copie et à la
# cacher.
rewrite ^/([^/]*)/favicon\.ico$ __PATH__/spip.php?page=favicon.ico last;
expires 1w;
more_set_headers 'Cache-Control: public';
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
set $ecrire 0;
if ($uri ~ ^/ecrire.*) {
set $ecrire 1;
}
}
set $ecrire 0;
if ($uri ~ ^/ecrire.*) {
set $ecrire 1;
}
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}

View file

@ -1,64 +1,64 @@
{
"name": "SPIP",
"id": "spip",
"packaging_format": 1,
"description": {
"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",
"url": "http://www.spip.net/",
"license": "GPL-3.0-or-later",
"maintainer": {
"name": "cyp",
"email": "cyp@rouquin.me"
},
"requirements": {
"yunohost": ">= 4.1.0"
},
"multi_instance": true,
"services": [
"nginx",
"mysql"
],
"arguments": {
"install" : [
"name": "SPIP",
"id": "spip",
"packaging_format": 1,
"description": {
"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",
"url": "http://www.spip.net/",
"license": "GPL-3.0-or-later",
"maintainer": {
"name": "cyp",
"email": "cyp@rouquin.me"
},
"requirements": {
"yunohost": ">= 4.1.0"
},
"multi_instance": true,
"services": [
"nginx",
"mysql"
],
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain",
"example": "example.com"
},
{
"name": "path",
"type": "path",
"example": "/spip",
"default": "/spip"
},
{
"name": "admin",
"type": "user",
"example": "johndoe"
},
{
"name": "password",
"type": "password",
{
"name": "path",
"type": "path",
"example": "/spip",
"default": "/spip"
},
{
"name": "admin",
"type": "user",
"example": "johndoe"
},
{
"name": "password",
"type": "password",
"example": "Choose a password"
},
{
"name": "is_public",
"type": "boolean",
"default": true
},
{
"name": "users_status",
"type": "string",
"ask": {
"en": "Choose the status of YunoHost users",
"fr": "Choisissez le status des utilisateurs de YunoHost"
},
"choices": ["Administrator", "Editor", "Visitor"],
"default": "Editor"
}
]
}
},
{
"name": "is_public",
"type": "boolean",
"default": true
},
{
"name": "users_status",
"type": "string",
"ask": {
"en": "Choose the status of YunoHost users",
"fr": "Choisissez le status des utilisateurs de YunoHost"
},
"choices": ["Administrator", "Editor", "Visitor"],
"default": "Editor"
}
]
}
}

View file

@ -24,6 +24,7 @@ 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)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
#=================================================
@ -99,8 +100,8 @@ if [ -z $password ]; then
ynh_app_setting_set --app=$app --key=password --value=$password
fi
if ynh_legacy_permissions_exists
then
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
fi
@ -161,10 +162,11 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
ynh_script_progression --message="Setuping application with CURL..."
# Set right permissions for curl install
mkdir -p $final_path/plugins/auto
chown -R $app: $final_path
chown -R $app:www-data "$final_path"
# Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..."
@ -175,6 +177,8 @@ ynh_backup_if_checksum_is_different --file="$final_path/config/connect.php"
ynh_secure_remove --file="$final_path/config/connect.php"
# 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=3" "adresse_db=localhost" "login_db=$db_name" "pass_db=$db_pwd" "server_db=mysql" "choix_db=$db_name" "tprefix=$db_name"
@ -208,10 +212,14 @@ ynh_permission_update --permission="main" --remove="visitors"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
#ynh_replace_string --match_string="'','utf8');" --replace_string="'ldap.php','utf8');" --target_file=$final_path/config/connect.php
cp ../conf/mes_options.php $final_path/config/mes_options.php
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_store_file_checksum --file="$final_path/config/connect.php"
#=================================================