1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/prettynoemiecms_ynh.git synced 2024-09-03 20:06:36 +02:00

Merge pull request #26 from YunoHost-Apps/upgrade

Upgrade
This commit is contained in:
yalh76 2022-08-15 16:00:13 +02:00 committed by GitHub
commit fa39bbb2a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 144 additions and 109 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# PrettyNoemie CMS for YunoHost # PrettyNoemie CMS for YunoHost
[![Integration level](https://dash.yunohost.org/integration/prettynoemiecms.svg)](https://dash.yunohost.org/appci/app/prettynoemiecms) ![](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/prettynoemiecms.svg)](https://dash.yunohost.org/appci/app/prettynoemiecms) ![Working status](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.maintain.svg)
[![Install PrettyNoemie CMS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=prettynoemiecms) [![Install PrettyNoemie CMS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=prettynoemiecms)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
@ -18,13 +18,11 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
PrettyNoemieCMS offers its users an ergonomic solution, simple and elegant to build in no time responsive windows sites with modern design. PrettyNoemieCMS offers its users an ergonomic solution, simple and elegant to build in no time responsive windows sites with modern design.
The construction of your site will consist of arranging at your convenience various modules, edit their content, and customize your site by choosing fonts, formatting text, and display colors. The construction of your site will consist of arranging at your convenience various modules, edit their content, and customize your site by choosing fonts, formatting text, and display colors.
**Shipped version:** 2020.01.07~ynh2 **Shipped version:** 2022.06.26~ynh1
**Demo:** https://demo-pretty-noemie.frama.site
## Screenshots ## Screenshots
![](./doc/screenshots/pages-framasite-theme-light.gif) ![Screenshot of PrettyNoemie CMS](./doc/screenshots/pages-framasite-theme-light.gif)
## Disclaimers / important information ## Disclaimers / important information
@ -34,20 +32,21 @@ How to configure this app: by an admin panel at: `your.domain.tld/your_path/admi
## Documentation and resources ## Documentation and resources
* Official user documentation: https://framagit.org/framasoft/PrettyNoemieCMS * Official user documentation: <https://framagit.org/framasoft/PrettyNoemieCMS>
* Upstream app code repository: https://framagit.org/framasoft/PrettyNoemieCMS * Upstream app code repository: <https://framagit.org/framasoft/PrettyNoemieCMS>
* YunoHost documentation for this app: https://yunohost.org/app_prettynoemiecms * YunoHost documentation for this app: <https://yunohost.org/app_prettynoemiecms>
* Report a bug: https://github.com/YunoHost-Apps/prettynoemiecms_ynh/issues * Report a bug: <https://github.com/YunoHost-Apps/prettynoemiecms_ynh/issues>
## Developer info ## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing). Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug
or or
sudo yunohost app upgrade prettynoemiecms -u https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug sudo yunohost app upgrade prettynoemiecms -u https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps **More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,10 +1,14 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# PrettyNoemie CMS pour YunoHost # PrettyNoemie CMS pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/prettynoemiecms.svg)](https://dash.yunohost.org/appci/app/prettynoemiecms) ![](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.maintain.svg) [![Niveau d'intégration](https://dash.yunohost.org/integration/prettynoemiecms.svg)](https://dash.yunohost.org/appci/app/prettynoemiecms) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.maintain.svg)
[![Installer PrettyNoemie CMS avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=prettynoemiecms) [![Installer PrettyNoemie CMS avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=prettynoemiecms)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer PrettyNoemie CMS rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer PrettyNoemie CMS 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.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
@ -14,13 +18,11 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
CMS offrant à ses utilisateurs une solution ergonomique, simple et élégante pour construire en un rien de temps des sites vitrines responsives au design moderne. CMS offrant à ses utilisateurs une solution ergonomique, simple et élégante pour construire en un rien de temps des sites vitrines responsives au design moderne.
La construction de votre site consistera à agencer à votre convenance des modules variés, d'éditer leurs contenus, et de personnaliser votre site en choisissant les polices de caractère, la mise en forme du texte, ainsi que les couleurs d'affichage. La construction de votre site consistera à agencer à votre convenance des modules variés, d'éditer leurs contenus, et de personnaliser votre site en choisissant les polices de caractère, la mise en forme du texte, ainsi que les couleurs d'affichage.
**Version incluse :** 2020.01.07~ynh2 **Version incluse :** 2022.06.26~ynh1
**Démo :** https://demo-pretty-noemie.frama.site
## Captures d'écran ## Captures d'écran
![](./doc/screenshots/pages-framasite-theme-light.gif) ![Capture d'écran de PrettyNoemie CMS](./doc/screenshots/pages-framasite-theme-light.gif)
## Avertissements / informations importantes ## Avertissements / informations importantes
@ -30,20 +32,21 @@ Comment configurer cette application: via le panneau d'administration à : `votr
## Documentations et ressources ## Documentations et ressources
* Documentation officielle utilisateur : https://framagit.org/framasoft/PrettyNoemieCMS * Documentation officielle utilisateur : <https://framagit.org/framasoft/PrettyNoemieCMS>
* Dépôt de code officiel de l'app : https://framagit.org/framasoft/PrettyNoemieCMS * Dépôt de code officiel de l'app : <https://framagit.org/framasoft/PrettyNoemieCMS>
* Documentation YunoHost pour cette app : https://yunohost.org/app_prettynoemiecms * Documentation YunoHost pour cette app : <https://yunohost.org/app_prettynoemiecms>
* Signaler un bug : https://github.com/YunoHost-Apps/prettynoemiecms_ynh/issues * Signaler un bug : <https://github.com/YunoHost-Apps/prettynoemiecms_ynh/issues>
## Informations pour les développeurs ## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade prettynoemiecms -u https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug sudo yunohost app upgrade prettynoemiecms -u https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps **Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -2,9 +2,9 @@
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
path="/path" path="/path"
admin="john"
language="fr_FR"
is_public=1 is_public=1
language="fr_FR"
admin="john"
password="pass" password="pass"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
@ -14,14 +14,14 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 2020.01.07~ynh1
upgrade=1 from_commit=a2309f4c622bab3b728e765b125245ebf55f3f59 upgrade=1 from_commit=a2309f4c622bab3b728e765b125245ebf55f3f59
# 2020.01.07~ynh2
upgrade=1 from_commit=fb3e67f476810196b53c0a9eac0174b7665f6050
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options
; commit=a2309f4c622bab3b728e765b125245ebf55f3f59
name=Merge pull request #13 from YunoHost-Apps/testing
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&

View file

@ -1,6 +1,7 @@
SOURCE_URL=https://framagit.org/framasoft/PrettyNoemieCMS/-/archive/96754fa446c41fe4cc30aefb4c5feed641a6ec93/PrettyNoemieCMS-96754fa446c41fe4cc30aefb4c5feed641a6ec93.tar.gz SOURCE_URL=https://framagit.org/framasoft/PrettyNoemieCMS/-/archive/2cc12314388c06f2194b07ee7204bc213fb65230/PrettyNoemieCMS-2cc12314388c06f2194b07ee7204bc213fb65230.tar.gz
SOURCE_SUM=a70d9b265fc7f45b34523958a050d84174d58f74abcfc3ee118b823e0aa6d10d SOURCE_SUM=a873d7abf5325bef70156d669872cb78ab6f15716c5edcc59015ab88540a6723
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME= SOURCE_FILENAME=
SOURCE_EXTRACT=true

9
conf/config.json Normal file
View file

@ -0,0 +1,9 @@
{
"siteDomain":"__DOMAIN__",
"siteLabel":"__DOMAIN__",
"admins":[
],
"siteLang":"__LANGUAGE__",
"siteDescription":"",
"siteKeywords":""
}

View file

@ -2,7 +2,7 @@
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/ ; alias __FINALPATH__/;
index index.php; index index.php;

View file

@ -6,11 +6,10 @@
"en": "Ergonomic, simple and elegant CMS to build in no time landpage websites with modern design", "en": "Ergonomic, simple and elegant CMS to build in no time landpage websites with modern design",
"fr": "CMS ergonomique, simple et élégant pour construire en un rien de temps des sites vitrines avec un design moderne" "fr": "CMS ergonomique, simple et élégant pour construire en un rien de temps des sites vitrines avec un design moderne"
}, },
"version": "2020.01.07~ynh2", "version": "2022.06.26~ynh1",
"url": "https://framagit.org/framasoft/PrettyNoemieCMS", "url": "https://framagit.org/framasoft/PrettyNoemieCMS",
"upstream": { "upstream": {
"license": "AGPL-3.0", "license": "AGPL-3.0",
"demo": "https://demo-pretty-noemie.frama.site",
"userdoc": "https://framagit.org/framasoft/PrettyNoemieCMS", "userdoc": "https://framagit.org/framasoft/PrettyNoemieCMS",
"code": "https://framagit.org/framasoft/PrettyNoemieCMS" "code": "https://framagit.org/framasoft/PrettyNoemieCMS"
}, },
@ -28,7 +27,7 @@
"php7.3-fpm" "php7.3-fpm"
], ],
"arguments": { "arguments": {
"install" : [ "install": [
{ {
"name": "domain", "name": "domain",
"type": "domain" "type": "domain"
@ -39,10 +38,6 @@
"example": "/prettynoemiecms", "example": "/prettynoemiecms",
"default": "/prettynoemiecms" "default": "/prettynoemiecms"
}, },
{
"name": "admin",
"type": "user"
},
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
@ -58,6 +53,10 @@
"choices": ["fr_FR", "en_EN"], "choices": ["fr_FR", "en_EN"],
"default": "fr_FR" "default": "fr_FR"
}, },
{
"name": "admin",
"type": "user"
},
{ {
"name": "password", "name": "password",
"type": "password" "type": "password"

View file

@ -6,6 +6,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -32,8 +33,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
ynh_print_info --message="Declaring files to be backed up..." ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# STANDARD BACKUP STEPS
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================

View file

@ -45,6 +45,7 @@ ynh_clean_setup () {
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED # CHECK WHICH PARTS SHOULD BE CHANGED
#================================================= #=================================================
@ -70,19 +71,19 @@ ynh_script_progression --message="Updating NGINX web server configuration..." --
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
# Change the path in the nginx config file # Change the path in the NGINX config file
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
then then
# Make a backup of the original nginx config file if modified # Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path" ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Set global variables for nginx helper # Set global variables for NGINX helper
domain="$old_domain" domain="$old_domain"
path_url="$new_path" path_url="$new_path"
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
fi fi
# Change the domain for nginx # Change the domain for NGINX
if [ $change_domain -eq 1 ] if [ $change_domain -eq 1 ]
then then
# Delete file checksum for the old conf file location # Delete file checksum for the old conf file location

View file

@ -22,9 +22,9 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE language=$YNH_APP_ARG_LANGUAGE
admin=$YNH_APP_ARG_ADMIN
password=$YNH_APP_ARG_PASSWORD password=$YNH_APP_ARG_PASSWORD
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -47,8 +47,8 @@ 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=language --value=$language ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=admin --value=$admin
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -76,13 +76,9 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
#================================================= chmod 750 "$final_path"
# NGINX CONFIGURATION chmod -R o-rwx "$final_path"
#================================================= chown -R $app:www-data "$final_path"
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
@ -93,6 +89,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
@ -101,16 +105,15 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
ynh_script_progression --message="Installing composer..." --weight=6 ynh_script_progression --message="Installing composer..." --weight=6
# Install composer # Install composer
ynh_install_composer ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
#================================================= #=================================================
# CREATE FILES AND DIRECTORIES # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..."
mkdir -p "$final_path/sites/$domain" mkdir -p "$final_path/sites/$domain"
ynh_add_config --template="../conf/config.json" --destination="$final_path/sites/$domain/config.json"
echo "{\"siteDomain\":\"$domain\",\"siteLabel\":\"$domain\",\"admins\":[],\"siteLang\":\"$language\",\
\"siteDescription\":\"Site r\u00e9alis\u00e9 avec FramaSite\",\"siteKeywords\":\"\"}" > "$final_path/sites/$domain/config.json"
# Set permissions to app files # Set permissions to app files
chmod 750 "$final_path" chmod 750 "$final_path"
@ -120,13 +123,13 @@ chown -R $app:www-data "$final_path"
#================================================= #=================================================
# SETUP APPLICATION WITH CURL # SETUP APPLICATION WITH CURL
#================================================= #=================================================
ynh_script_progression --message="Setuping application with CURL..."
# Set the app as temporarily public for cURL call # Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..."
# Making the app public for curl
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
# Reload NGINX
ynh_systemd_action --service_name=nginx --action=reload
# Installation with curl # Installation with curl
ynh_script_progression --message="Finalizing installation..." --weight=2 ynh_script_progression --message="Finalizing installation..." --weight=2
ynh_local_curl "/signIn" "username=$admin" "password=$password" "repeatPassword=$password" ynh_local_curl "/signIn" "username=$admin" "password=$password" "repeatPassword=$password"
@ -134,16 +137,9 @@ ynh_local_curl "/signIn" "username=$admin" "password=$password" "repeatPassword=
# Remove the public access # Remove the public access
ynh_permission_update --permission="main" --remove="visitors" ynh_permission_update --permission="main" --remove="visitors"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/sites/$domain/config.json" ynh_store_file_checksum --file="$final_path/sites/$domain/config.json"
# Fix a bug where images can't be uploaded
ynh_replace_string --match_string="isMediaPathModified = true" --replace_string="" --target_file="$final_path/app/config/config.ini"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
@ -154,6 +150,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then 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" --add="visitors"
# Only the admin can access the admin panel of the app (if the app has an admin panel) # Only the admin can access the admin panel of the app (if the app has an admin panel)
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin

View file

@ -33,7 +33,7 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated nginx config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#================================================= #=================================================
@ -41,7 +41,7 @@ ynh_remove_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1
# Remove the dedicated php-fpm config # Remove the dedicated PHP-FPM config
ynh_remove_fpm_config ynh_remove_fpm_config
#================================================= #=================================================

View file

@ -6,6 +6,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -19,7 +20,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -38,12 +39,6 @@ test ! -d $final_path \
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -63,15 +58,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=2
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#================================================= #=================================================
@ -82,6 +68,20 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=9
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=2
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..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -18,14 +18,15 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
language=$(ynh_app_setting_get --app=$app --key=language)
admin=$(ynh_app_setting_get --app=$app --key=admin) admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
@ -37,12 +38,14 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
# restore it if the upgrade fails # Restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
@ -74,8 +77,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# STANDARD UPGRADE STEPS
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -85,21 +86,13 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=4 ynh_script_progression --message="Upgrading source files..." --weight=4
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path" --keep="sites/"
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
@ -112,22 +105,36 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated php-fpm config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# STORE THE CONFIG FILE CHECKSUM # UPDATE DEPENDENCIES WITH COMPOSER
#================================================= #=================================================
ynh_script_progression --message="Upgrading Composer depedencies..." --weight=6
# Install composer
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
ynh_backup_if_checksum_is_different --file="$final_path/sites/$domain/config.json" ynh_backup_if_checksum_is_different --file="$final_path/sites/$domain/config.json"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/sites/$domain/config.json"
# Fix a bug where images can't be uploaded
ynh_replace_string --match_string="isMediaPathModified = true" --replace_string="" --target_file="$final_path/app/config/config.ini"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================

View file

@ -0,0 +1,8 @@
--- a/app/config/config.ini
+++ a/app/config/config.ini
@@ -3,5 +3,4 @@
UI=app/views/
AUTOLOAD=app/controllers/;app/fixtures/
SitesFolder = sites/
-isMediaPathModified = true

View file

@ -0,0 +1,11 @@
--- a/app/views/base/footer/footer.htm
+++ b/app/views/base/footer/footer.htm
@@ -40,7 +40,7 @@
<div class="" style="background-color: rgba(0,0,0,0.28)">
<div class="footer-copyright grey-text text-lighten-2 " >
<div class="container" style="font-size: 0.9em" >
- Hébergé par <a class="grey-text text-lighten-2" href="https://framasoft.org"><b>Framasoft</b></a>. Créé grâce à <a class="grey-text text-lighten-2" href="https://framagit.org/framasoft/PrettyNoemieCMS" > <img src="public/img/logo-final-white.png" class="responsive-img" style="height: 1.6em; margin: auto 0 -1px 5px" alt=""><b>oemieCMS</b></a>. Créez librement et gratuitement votre <a class="grey-text text-lighten-2" href="https://frama.site/"><b>Page Framasite ici</b></a>.
+ Créé grâce à <a class="grey-text text-lighten-2" href="https://framagit.org/framasoft/PrettyNoemieCMS" > <img src="public/img/logo-final-white.png" class="responsive-img" style="height: 1.6em; margin: auto 0 -1px 5px" alt=""><b>oemieCMS</b></a>.
</div>
</div>
</div>