1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/strut_ynh.git synced 2024-09-03 20:26:33 +02:00

Merge pull request #28 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-05-01 11:27:38 +02:00 committed by GitHub
commit a1aacf62c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 51 additions and 106 deletions

View file

@ -1,15 +1,15 @@
# Strut for YunoHost # Strut for YunoHost
[![Integration level](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) [![Integration level](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) ![](https://ci-apps.yunohost.org/ci/badges/strut.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/strut.maintain.svg)
[![Install Strut with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=strut) [![Install Strut with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=strut)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install Strut quickly and simply on a YunoHost server. > *This package allow you to install Strut quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.*
## Overview ## Overview
Strut is an HTML/JS slide presentation editor. It work with [impress.js](http://bartaz.github.com/impress.js/#/bored). Strut is a simple, online editor that doesn't even require registration to operate. Everything you do is recoverable and re-usable.
**Shipped version:** 20171224-1 **Shipped version:** 20171224-1
@ -35,9 +35,8 @@ If configuration is needed, feel free to contribute.
#### Supported architectures #### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/strut%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/strut/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/strut.svg)](https://ci-apps.yunohost.org/ci/apps/strut/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/strut%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/strut/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/strut.svg)](https://ci-apps-arm.yunohost.org/ci/apps/strut/)
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/strut%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/strut/)
## Limitations ## Limitations
No import/export from/to OpenDocument or pptx. No import/export from/to OpenDocument or pptx.
@ -59,10 +58,8 @@ To avoid to take time to build this html/js app, this package setups a builded v
--- ---
Developers info ## Developers info
----------------
**Only if you want to use a testing branch for coding, instead of merging directly into master.**
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/strut_ynh/tree/testing). Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/strut_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.

View file

@ -1,12 +1,12 @@
# Strut pour YunoHost # Strut pour YunoHost
[![Niveau d'integration](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) [![Niveau d'integration](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut)
[![Installer Strut avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=strut) [![Installer Strut avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=strut)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer Strut rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer Strut 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*
## Vue d'ensemble ## Vue d'ensemble
Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. Il fonctinne grâce à [impress.js](http://bartaz.github.com/impress.js/#/bored). Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. Il fonctinne grâce à [impress.js](http://bartaz.github.com/impress.js/#/bored).
@ -35,9 +35,8 @@ S'il y a une configuration possible, sentez vous libre d'y contribuer.
#### Architectures supportées #### Architectures supportées
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/strut%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/strut/) * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/strut.svg)](https://ci-apps.yunohost.org/ci/apps/strut/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/strut%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/strut/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/strut.svg)](https://ci-apps-arm.yunohost.org/ci/apps/strut/)
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/strut%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/strut/)
## Limitations ## Limitations
@ -62,10 +61,9 @@ Voici la version compilée https://github.com/tantaman/Strut/commits/6761b141ee7
* Site web de YunoHost : https://yunohost.org/ * Site web de YunoHost : https://yunohost.org/
--- ---
Informations pour les développeurs
----------------
**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** ## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/strut_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/strut_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.

View file

@ -14,11 +14,7 @@
upgrade=1 from_commit=f6565f66d82fa077d752226f8b8267018f7b91d8 upgrade=1 from_commit=f6565f66d82fa077d752226f8b8267018f7b91d8
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=1
port_already_use=0
change_url=1 change_url=1
;;; Levels
Level 5=auto
;;; Options ;;; Options
Email=ljf+ynh-strut@grimaud.me Email=ljf+ynh-strut@grimaud.me
Notification=down Notification=down

View file

@ -2,11 +2,11 @@
"name": "Strut", "name": "Strut",
"id": "strut", "id": "strut",
"packaging_format": 1, "packaging_format": 1,
"version": "20171224-1~ynh1", "version": "20171224-1~ynh2",
"url": "http://strut.io", "url": "http://strut.io",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"requirements": { "requirements": {
"yunohost": ">= 3.5.0" "yunohost": ">= 4.1.7"
}, },
"description": { "description": {
"en": "Slide editor for creating impress.js presentations.", "en": "Slide editor for creating impress.js presentations.",
@ -25,33 +25,19 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain for Strut",
"fr": "Choisissez un nom de domaine pour Strut"
},
"example": "example.com" "example": "example.com"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for Strut",
"fr": "Choisissez l'adresse pour Strut"
},
"example": "/strut", "example": "/strut",
"default": "/strut" "default": "/strut"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Could non member create presentations ?",
"fr": "Une personne non membre peut elle créer une présentation ?"
},
"default": true "default": true
} }
] ]
} }
} }

View file

@ -11,14 +11,6 @@
- [ ] Upgrade from last version tested. - [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested. - [ ] Can be reviewed and tested.
## Validation ## Package_check results
--- ---
*Minor decision* * An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
- **Upgrade previous version** :
- [ ] **Code review** :
- [ ] **Approval (LGTM)** :
- [ ] **Approval (LGTM)** :
- **CI succeeded** :
[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/strut_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/strut_ynh%20PR-NUM-/)
*Please replace '-NUM-' in this link by the PR number.*
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.

View file

@ -19,7 +19,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=2 ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -27,18 +27,19 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#================================================= #=================================================
# STANDARD BACKUP STEPS # DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up nginx web server configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -46,4 +47,4 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -8,6 +8,7 @@
# source _common.sh # source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
@ -50,23 +51,23 @@ fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
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
@ -81,7 +82,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -44,7 +44,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
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=is_public --value=$is_public
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -65,9 +64,9 @@ ynh_secure_remove --file="$tmp_dir"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." --weight=4 ynh_script_progression --message="Configuring NGINX web server..." --weight=4
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
@ -94,18 +93,18 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring permissions..."
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
ynh_app_setting_set --app=$app --key=skipped_uris --value="/" ynh_permission_update --permission="main" --add="visitors"
fi fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -32,9 +32,9 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing nginx web server configuration..." ynh_script_progression --message="Removing NGINX web server configuration..."
# Remove the dedicated nginx config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#================================================= #=================================================

View file

@ -66,7 +66,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -18,7 +18,6 @@ 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)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#================================================= #=================================================
@ -32,23 +31,17 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." ynh_script_progression --message="Ensuring downward compatibility..."
if [ "${version}" = "20160501-7" ]; then # If final_path doesn't exist, create it
public_site=$(ynh_app_setting_get --app=$app --key=public_site) if [ -z "$final_path" ]; then
# Fix is_public as a boolean value final_path=/var/www/$app
if [ "$public_site" = "Yes" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path
ynh_app_setting_set --app=$app --key=is_public --value=1 fi
is_public=1
elif [ "$public_site" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
fi
ynh_app_setting_delete $app public_site
# If final_path doesn't exist, create it # Cleaning legacy permissions
if [ -z "$final_path" ]; then if ynh_legacy_permissions_exists; then
final_path=/var/www/$app ynh_legacy_permissions_delete_all
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi ynh_app_setting_delete --app=$app --key=is_public
fi fi
#================================================= #=================================================
@ -65,13 +58,6 @@ 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 THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path --path_url=$path_url)
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -95,7 +81,7 @@ fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." 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
@ -124,21 +110,10 @@ chown -R root:www-data "$final_path"
chmod -R 640 "$final_path" chmod -R 640 "$final_path"
find "$final_path" -type d -print0 | xargs -0 chmod 750 find "$final_path" -type d -print0 | xargs -0 chmod 750
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=5
# Make app public if necessary
if [ $is_public -eq 1 ]
then
ynh_app_setting_set --app=$app --key=skipped_uris --value="/"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload