mirror of
https://github.com/YunoHost-Apps/strut_ynh.git
synced 2024-09-03 20:26:33 +02:00
commit
1cf6a9128f
18 changed files with 209 additions and 122 deletions
55
.github/ISSUE_TEMPLATE.md
vendored
Normal file
55
.github/ISSUE_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
|
||||
|
||||
---
|
||||
|
||||
**How to post a meaningful bug report**
|
||||
1. *Read this whole template first.*
|
||||
2. *Determine if you are on the right place:*
|
||||
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
|
||||
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
|
||||
- *When in doubt, post here and we will figure it out together.*
|
||||
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
||||
---
|
||||
|
||||
### Describe the bug
|
||||
|
||||
*A clear and concise description of what the bug is.*
|
||||
|
||||
### Context
|
||||
|
||||
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
|
||||
- YunoHost version: x.x.x
|
||||
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
|
||||
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
|
||||
- If yes, please explain:
|
||||
- Using, or trying to install package version/branch:
|
||||
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
||||
```sh
|
||||
sudo yunohost app install the_app
|
||||
```
|
||||
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
||||
- *If the error occurs in your browser, explain what you did:*
|
||||
1. *Go to '...'*
|
||||
2. *Click on '...'*
|
||||
3. *Scroll down to '...'*
|
||||
4. *See error*
|
||||
|
||||
### Expected behavior
|
||||
|
||||
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
|
||||
|
||||
### Logs
|
||||
|
||||
*When an operation fails, YunoHost provides a simple way to share the logs.*
|
||||
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
|
||||
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
|
||||
|
||||
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
|
||||
|
||||
*If applicable and useful, add screenshots to help explain your problem.*
|
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
## Problem
|
||||
|
||||
- *Description of why you made this PR*
|
||||
|
||||
## Solution
|
||||
|
||||
- *And how do you fix that problem*
|
||||
|
||||
## PR Status
|
||||
|
||||
- [ ] Code finished and ready to be reviewed/tested
|
||||
- [ ] The fix/enhancement were manually tested (if applicable)
|
||||
|
||||
## Automatic tests
|
||||
|
||||
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
|
55
README.md
55
README.md
|
@ -1,3 +1,8 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
# Strut for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/strut)  
|
||||
|
@ -5,38 +10,22 @@
|
|||
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *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.*
|
||||
> *This package allows you to install Strut quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
|
||||
|
||||
## Overview
|
||||
|
||||
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:** 20220404~ynh1
|
||||
|
||||
**Demo:** http://strut.io/dist/
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||

|
||||
|
||||
## Demo
|
||||
|
||||
* [Official demo](http://strut.io/editor/index.html)
|
||||
|
||||
## Configuration
|
||||
|
||||
If configuration is needed, feel free to contribute.
|
||||
|
||||
## Documentation
|
||||
|
||||
* YunoHost documentation: If specific documentation is needed, feel free to contribute.
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
#### Multi-users support
|
||||
|
||||
#### Supported architectures
|
||||
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/strut/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/strut/)
|
||||
## Disclaimers / important information
|
||||
|
||||
## Limitations
|
||||
No import/export from/to OpenDocument or pptx.
|
||||
|
@ -49,18 +38,16 @@ Initial Strut software includes Google Analytics and is bind to Imgur to upload
|
|||
|
||||
To avoid to take time to build this html/js app, this package setups a builded version of Strut with the patch that remove Google Analytics and Imgur dependencies. It is a build of this version https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce . So it's not the more recent version.
|
||||
|
||||
## Links
|
||||
## Documentation and resources
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/strut_ynh/issues
|
||||
* Strut website: http://strut.io
|
||||
* Strut repository: https://github.com/MohannadNaj/Strut
|
||||
* YunoHost website: https://yunohost.org/
|
||||
* Official app website: http://strut.io
|
||||
* Upstream app code repository: https://github.com/MohannadNaj/Strut
|
||||
* YunoHost documentation for this app: https://yunohost.org/app_strut
|
||||
* Report a bug: https://github.com/YunoHost-Apps/strut_ynh/issues
|
||||
|
||||
---
|
||||
## Developer info
|
||||
|
||||
## Developers info
|
||||
|
||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/strut_ynh/tree/testing).
|
||||
Please send 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.
|
||||
```
|
||||
|
@ -68,3 +55,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/strut_ynh/tree/testin
|
|||
or
|
||||
sudo yunohost app upgrade strut -u https://github.com/YunoHost-Apps/strut_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
50
README_fr.md
50
README_fr.md
|
@ -1,42 +1,28 @@
|
|||
# Strut pour YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/strut)
|
||||
[](https://dash.yunohost.org/appci/app/strut)  
|
||||
[](https://install-app.yunohost.org/?app=strut)
|
||||
|
||||
*[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 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
|
||||
|
||||
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).
|
||||
|
||||
**Version incluse :** 20171224-1
|
||||
|
||||
**Version incluse :** 20220404~ynh1
|
||||
|
||||
**Démo :** http://strut.io/dist/
|
||||
|
||||
## Captures d'écran
|
||||
|
||||

|
||||

|
||||
|
||||
## Démo
|
||||
|
||||
* [Démo officielle](http://strut.io/editor/index.html)
|
||||
|
||||
## Configuration
|
||||
|
||||
S'il y a une configuration possible, sentez vous libre d'y contribuer.
|
||||
|
||||
## Documentation
|
||||
|
||||
* S'il y a une documentation spéficique, sentez vous libre d'y contribuer.
|
||||
|
||||
## Caractéristiques spécifiques à YunoHost
|
||||
|
||||
#### Support multi-utilisateurs
|
||||
|
||||
#### Architectures supportées
|
||||
|
||||
* x86-64b - [](https://ci-apps.yunohost.org/ci/apps/strut/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/strut/)
|
||||
## Avertissements / informations importantes
|
||||
|
||||
## Limitations
|
||||
|
||||
|
@ -53,14 +39,12 @@ Pour compiler le logiciel, cela nécessite grunt, ce qui ne peut pas être suppr
|
|||
Pour éviter de devoir générer cette application HTML/JS, ce package créé une version compilée de Strut avec le patch qui supprime les dépendances à Google Analytics et Imgur.
|
||||
Voici la version compilée https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce. Ce n'est pas la version la plus récente.
|
||||
|
||||
## Liens
|
||||
## Documentations et ressources
|
||||
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/strut_ynh/issues
|
||||
* Site web de Strut : http://strut.io
|
||||
* Dépôt de Strut : https://github.com/MohannadNaj/Strut
|
||||
* Site web de YunoHost : https://yunohost.org/
|
||||
|
||||
---
|
||||
* Site officiel de l'app : http://strut.io
|
||||
* Dépôt de code officiel de l'app : https://github.com/MohannadNaj/Strut
|
||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_strut
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/strut_ynh/issues
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
||||
|
@ -72,3 +56,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/strut_ynh/tree/testin
|
|||
ou
|
||||
sudo yunohost app upgrade strut -u https://github.com/YunoHost-Apps/strut_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
|
@ -1,8 +1,8 @@
|
|||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
is_public=1
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
|
|
|
@ -4,11 +4,6 @@ location __PATH__/ {
|
|||
# Path to source
|
||||
alias __FINALPATH__/ ;
|
||||
|
||||
# Force usage of https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
|
|
1
doc/DESCRIPTION.md
Normal file
1
doc/DESCRIPTION.md
Normal file
|
@ -0,0 +1 @@
|
|||
Strut is a simple, online editor that doesn't even require registration to operate. Everything you do is recoverable and re-usable.
|
1
doc/DESCRIPTION_fr.md
Normal file
1
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +1 @@
|
|||
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).
|
10
doc/DISCLAIMER.md
Normal file
10
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
## Limitations
|
||||
No import/export from/to OpenDocument or pptx.
|
||||
|
||||
## Additional information
|
||||
|
||||
* This package doesn't contained the exact sources of the upstream https://github.com/tantaman/Strut.
|
||||
|
||||
Initial Strut software includes Google Analytics and is bind to Imgur to upload images. This kind of trackers or external services are not accepted by the package team of YunoHost. So this trackers are removed from sources, a pull request has been done and merged but has finally be removed from the strut upstream with no explanation. In more, Strut developers don't deliver builded versions. To build a version it needs grunt, that can't be removed easily.
|
||||
|
||||
To avoid to take time to build this html/js app, this package setups a builded version of Strut with the patch that remove Google Analytics and Imgur dependencies. It is a build of this version https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce . So it's not the more recent version.
|
14
doc/DISCLAIMER_fr.md
Normal file
14
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
## Limitations
|
||||
|
||||
Pas d'import/export possible depuis ou vers des fichiers OpenDocument ou pptx.
|
||||
|
||||
## Information supplémentaires
|
||||
|
||||
* Ce package ne contient pas les sources exactes de [la version originale de Strut](https://github.com/tantaman/Strut)
|
||||
|
||||
Strut, à l'origine, inclut Google Analytics et est lié à Imgur pour téléverser des images. Ces pisteurs ou services externes ne sont pas acceptés par l'équipe de YunoHost.
|
||||
Ils sont donc supprimés par rapport aux sources.
|
||||
Une pull request pour les supprimer de leur côté a été validée et mergée mais finalement supprimée sans explication. De plus, les développeurs de Strut ne fournissent pas le logiciel compilé.
|
||||
Pour compiler le logiciel, cela nécessite grunt, ce qui ne peut pas être supprimé facilement.
|
||||
Pour éviter de devoir générer cette application HTML/JS, ce package créé une version compilée de Strut avec le patch qui supprime les dépendances à Google Analytics et Imgur.
|
||||
Voici la version compilée https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce. Ce n'est pas la version la plus récente.
|
BIN
doc/screenshots/f1003c6a-be74-11e2-84b9-14776c652afb.png
Normal file
BIN
doc/screenshots/f1003c6a-be74-11e2-84b9-14776c652afb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 509 KiB |
|
@ -2,20 +2,26 @@
|
|||
"name": "Strut",
|
||||
"id": "strut",
|
||||
"packaging_format": 1,
|
||||
"version": "20171224-1~ynh2",
|
||||
"url": "http://strut.io",
|
||||
"license": "AGPL-3.0",
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.1.7"
|
||||
},
|
||||
"description": {
|
||||
"en": "Slide editor for creating impress.js presentations.",
|
||||
"fr": "Éditeur de diapositives permettant de créer des présentations impress.js."
|
||||
"en": "Slide editor for creating impress.js presentations",
|
||||
"fr": "Éditeur de diapositives permettant de créer des présentations impress.js"
|
||||
},
|
||||
"version": "20220404~ynh1",
|
||||
"url": "http://strut.io",
|
||||
"upstream": {
|
||||
"license": "AGPL-3.0",
|
||||
"website": "http://strut.io",
|
||||
"demo": "http://strut.io/dist/",
|
||||
"code": "https://github.com/MohannadNaj/Strut"
|
||||
},
|
||||
"license": "AGPL-3.0",
|
||||
"maintainer": {
|
||||
"name": "ljf",
|
||||
"email": "ljf+yunohost@grimaud.me"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.3.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
"nginx"
|
||||
|
@ -24,8 +30,7 @@
|
|||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"example": "example.com"
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
## Problem
|
||||
- *Description of why you made this PR*
|
||||
|
||||
## Solution
|
||||
- *And how you fix that*
|
||||
|
||||
## PR Status
|
||||
- [ ] Code finished.
|
||||
- [ ] Tested with Package_check.
|
||||
- [ ] Fix or enhancement tested.
|
||||
- [ ] Upgrade from last version tested.
|
||||
- [ ] Can be reviewed and tested.
|
||||
|
||||
## Package_check results
|
||||
---
|
||||
* 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!"*
|
|
@ -82,7 +82,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -45,6 +45,14 @@ 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=path --value=$path_url
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --weight=1
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
|
@ -86,14 +94,14 @@ ynh_replace_string --match_string="are currently uploaded to imgur.*re working o
|
|||
#=================================================
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R root:www-data "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chmod -R 640 "$final_path"
|
||||
find "$final_path" -type d -print0 | xargs -0 chmod 750
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring permissions..."
|
||||
ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]
|
||||
|
@ -104,7 +112,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -37,6 +37,14 @@ ynh_script_progression --message="Removing NGINX web server configuration..."
|
|||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
||||
|
||||
# Delete a system user
|
||||
ynh_system_user_delete --username=$app
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -32,8 +32,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=3
|
||||
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
|
@ -42,13 +40,22 @@ test ! -d $final_path \
|
|||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..."
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
|
@ -57,7 +64,7 @@ ynh_restore_file --origin_path="$final_path"
|
|||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R root:www-data "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chmod -R 640 "$final_path"
|
||||
find "$final_path" -type d -print0 | xargs -0 chmod 750
|
||||
|
||||
|
@ -66,7 +73,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -26,10 +26,24 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
|
@ -45,18 +59,12 @@ if ynh_legacy_permissions_exists; then
|
|||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
|
@ -81,7 +89,7 @@ fi
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -106,14 +114,14 @@ fi
|
|||
#=================================================
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R root:www-data "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chmod -R 640 "$final_path"
|
||||
find "$final_path" -type d -print0 | xargs -0 chmod 750
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue