1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tyto_ynh.git synced 2024-09-04 01:25:56 +02:00

Merge pull request #9 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-07-01 13:53:38 +02:00 committed by GitHub
commit db9a6b110a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 174 additions and 212 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View file

@ -1,46 +1,55 @@
--- ---
name: Bug report name: Bug report
about: Create a report to help us debug, it would be nice to fill the template as much as you can to help us, help you and help us all. 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** **How to post a meaningful bug report**
1. *Read this whole template first.* 1. *Read this whole template first.*
2. *Determine if you are on the right place:* 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!* - *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 Tyto itself. Refer to its documentation or repository for help.* - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
- *If you have a doubt, post here, we will figure it out together.* - *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.* 3. *Delete the italic comments as you write over them below, and remove this guide.*
--- ---
**Describe the bug** ### Describe the bug
*A clear and concise description of what the bug is.* *A clear and concise description of what the bug is.*
**Versions** ### Context
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
- YunoHost version: x.x.x - YunoHost version: x.x.x
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* - 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* - Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
- If yes, please explain: - If yes, please explain:
- Using, or trying to install package version/branch: - 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`* - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
**To Reproduce** ### Steps to reproduce
*Steps to reproduce the behavior.*
- *If you performed a command from the CLI, the command itself is enough. For example:* - *If you performed a command from the CLI, the command itself is enough. For example:*
```sh ```sh
sudo yunohost app install tyto sudo yunohost app install the_app
``` ```
- *If you used the webadmin, please perform the equivalent command from the CLI first.* - *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:* - *If the error occurs in your browser, explain what you did:*
1. *Go to '...'* 1. *Go to '...'*
2. *Click on '....'* 2. *Click on '...'*
3. *Scroll down to '....'* 3. *Scroll down to '...'*
4. *See error* 4. *See error*
**Expected behavior** ### 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.* *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** ### Logs
*After a failed command, YunoHost makes the log available to you, but also to others, thanks to `yunohost log display [log name] --share`. The actual command, with the correct log name, is displayed at the end of the failed attempt in the CLI. Execute it and copy here the share link it outputs.*
*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.* *If applicable and useful, add screenshots to help explain your problem.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View 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)

View file

@ -1,54 +1,39 @@
# Tyto for YunoHost ![alt tag](https://github.com/YunoHost-Apps/tyto_ynh/blob/master/68747470733a2f2f7261772e6769746875622e636f6d2f6a6833792f7479746f2f6d61737465722f7372632f696d672f7479746f2e706e67.png) <!--
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.
-->
# Tyto for YunoHost
[![Integration level](https://dash.yunohost.org/integration/tyto.svg)](https://dash.yunohost.org/appci/app/tyto) ![](https://ci-apps.yunohost.org/ci/badges/tyto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/tyto.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/tyto.svg)](https://dash.yunohost.org/appci/app/tyto) ![](https://ci-apps.yunohost.org/ci/badges/tyto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/tyto.maintain.svg)
[![Install Tyto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=tyto) [![Install Tyto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tyto)
> *This package allows you to install Tyto quickly and simply on a YunoHost server. *[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Tyto 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.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## Overview
Tyto arose from the want for an electronic post-it board without the need for accounts. Something simple and intuitive that could be easily shared.
**Shipped version:** 3.0.4 Simple, minimal electronic post-it board
**Shipped version:** 3.0.4~ynh2
**Demo:** https://jh3y.github.io/tyto/
## Screenshots ## Screenshots
![](https://github.com/YunoHost-Apps/tyto_ynh/blob/master/68747470733a2f2f7261772e6769746875622e636f6d2f6a6833792f706963732f6d61737465722f7479746f2f6164645f7461736b2e676966.gif.) ![](./doc/screenshots/screenshot.png)
## Demo ## Documentation and resources
* [Official demo](https://jh3y.github.io/tyto) * Official app website: https://jh3y.github.io/tyto/
* Official user documentation: https://yunohost.org/apps
* Upstream app code repository: https://github.com/jh3y/tyto
* YunoHost documentation for this app: https://yunohost.org/app_tyto
* Report a bug: https://github.com/YunoHost-Apps/tyto_ynh/issues
## Developer info
### Features
* minimal UI
* no accounts necessary
* intuitive
* extensible
* localStorage persistence
* time tracking
* sortable UI
* task linking
* Markdown support
* etc.
## YunoHost specific features
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/tyto%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/tyto/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/tyto%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/tyto/)
## Links
* Report a bug: https://github.com/YunoHost-Apps/tyto_ynh/issues
* Upstream app repository: https://github.com/jh3y/tyto
* YunoHost website: https://yunohost.org/
---
Developer info
----------------
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/tyto_ynh/tree/testing). Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/tyto_ynh/tree/testing).
@ -58,3 +43,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/tyto_ynh/tree/testing
or or
sudo yunohost app upgrade tyto -u https://github.com/YunoHost-Apps/tyto_ynh/tree/testing --debug sudo yunohost app upgrade tyto -u https://github.com/YunoHost-Apps/tyto_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

43
README_fr.md Normal file
View file

@ -0,0 +1,43 @@
# Tyto pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/tyto.svg)](https://dash.yunohost.org/appci/app/tyto) ![](https://ci-apps.yunohost.org/ci/badges/tyto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/tyto.maintain.svg)
[![Installer Tyto avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tyto)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Tyto 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.*
## Vue d'ensemble
Tableau de post-it électroniques, simple et minimaliste
**Version incluse :** 3.0.4~ynh2
**Démo :** https://jh3y.github.io/tyto/
## Captures d'écran
![](./doc/screenshots/screenshot.png)
## Documentations et ressources
* Site officiel de l'app : https://jh3y.github.io/tyto/
* Documentation officielle utilisateur : https://yunohost.org/apps
* Dépôt de code officiel de l'app : https://github.com/jh3y/tyto
* Documentation YunoHost pour cette app : https://yunohost.org/app_tyto
* Signaler un bug : https://github.com/YunoHost-Apps/tyto_ynh/issues
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/tyto_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/tyto_ynh/tree/testing --debug
ou
sudo yunohost app upgrade tyto -u https://github.com/YunoHost-Apps/tyto_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,13 +1,8 @@
# See here for more informations
# https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
path="/path" (PATH) path="/path"
is_public=1 (PUBLIC|public=1|private=0) is_public=1
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1
@ -18,13 +13,7 @@
upgrade=1 upgrade=1
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
# incorrect_path=1
port_already_use=0
change_url=1 change_url=1
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto
;;; Options ;;; Options
Email=anmol@datamol.org Email=anmol@datamol.org
Notification=change Notification=change

View file

@ -9,13 +9,6 @@ location __PATH__/ {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }
index index.php index.html;
# Common parameter to increase upload size limit in conjuction with dedicated php-fpm file
#client_max_body_size 50M;
try_files $uri $uri/ index.php index.html;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }

BIN
doc/.DS_Store vendored Normal file

Binary file not shown.

0
doc/DISCLAIMER.md Normal file
View file

View file

@ -3,11 +3,18 @@
"id": "tyto", "id": "tyto",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "A simple, minimal electronic post-it board", "en": "Simple, minimal electronic post-it board",
"fr": "Un tableau de post-it électroniques, simple et minimaliste" "fr": "Tableau de post-it électroniques, simple et minimaliste"
}, },
"version": "3.0.4~ynh1", "version": "3.0.4~ynh2",
"url": "https://github.com/jh3y/tyto", "url": "https://github.com/jh3y/tyto",
"upstream": {
"license": "MIT",
"website": "https://jh3y.github.io/tyto/",
"demo": "https://jh3y.github.io/tyto/",
"userdoc": "https://yunohost.org/apps",
"code": "https://github.com/jh3y/tyto"
},
"license": "MIT", "license": "MIT",
"maintainer": { "maintainer": {
"name": "Anmol Sharma", "name": "Anmol Sharma",
@ -15,7 +22,7 @@
"url": "https://datamol.org" "url": "https://datamol.org"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.5" "yunohost": ">= 4.2.4"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -26,25 +33,20 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for Tyto"
},
"example": "example.com" "example": "example.com"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for Tyto"
},
"example": "/tyto", "example": "/tyto",
"default": "/tyto" "default": "/tyto"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": { "help": {
"en": "Is it a public application?" "en": "If enabled, Tyto will be accessible by people who do not have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, Tyto sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
}, },
"default": true "default": true
} }

View file

@ -1,18 +0,0 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## 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
---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/tyto_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/tyto_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -4,9 +4,6 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# dependencies used by the app
pkg_dependencies=""
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================

View file

@ -44,7 +44,6 @@ ynh_backup --src_path="$final_path"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -29,15 +29,10 @@ ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config" # Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# Add settings here as needed by your application
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#db_user=$db_name
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..."
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -72,7 +67,7 @@ fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating nginx web server configuration..." 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
@ -101,7 +96,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,10 +44,15 @@ ynh_script_progression --message="Storing installation settings..."
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 # CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -57,52 +62,33 @@ 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"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files
chown -R $app: $final_path
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring permissions..."
if [ $is_public -eq 0 ]
then # Remove the public access
ynh_app_setting_delete $app skipped_uris
fi
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
# unprotected_uris allows SSO credentials to be passed anyway. ynh_permission_update --permission="main" --add="visitors"
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
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,7 +32,7 @@ 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

@ -43,10 +43,18 @@ test ! -d $final_path \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the nginx configuration..." ynh_script_progression --message="Restoring the NGINX configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" 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..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -54,28 +62,16 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
#================================================= chmod 750 "$final_path"
# RECREATE THE DEDICATED USER chmod -R o-rwx "$final_path"
#================================================= chown -R $app:www-data "$final_path"
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# RESTORE USER RIGHTS
#=================================================
ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files
chown -R root: $final_path
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
# 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)
#================================================= #=================================================
@ -33,21 +32,19 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." 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
fi
# If final_path doesn't exist, create it # If final_path doesn't exist, create it
if [ -z "$final_path" ]; then if [ -z "$final_path" ]; then
final_path=/var/www/$app final_path=/var/www/$app
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -63,11 +60,12 @@ ynh_clean_setup () {
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
# CHECK THE PATH # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Normalize the URL path syntax # Create a dedicated user (if not existing)
path_url=$(ynh_normalize_url_path --path_url=$path_url) ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
@ -83,52 +81,22 @@ then
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
fi fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# 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
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..."
# Set right permissions for curl installation
chown -R $app: $final_path
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..."
if [ $is_public -eq 0 ]
then # Remove the public access
ynh_app_setting_delete $app skipped_uris
fi
# Make app public if necessary
if [ $is_public -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway
ynh_app_setting_set $app unprotected_uris "/"
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