1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mantis_ynh.git synced 2024-09-03 19:36:33 +02:00
* Upgrade to 2.25.2
This commit is contained in:
Éric Gaspar 2021-06-22 17:14:40 +02:00 committed by GitHub
parent dddf2e1d71
commit 6ad4c649c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 207 additions and 231 deletions

View file

@ -6,11 +6,11 @@ about: When creating a bug report, please use the following template to provide
**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. *Make sure 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 the app 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.*
- *In doubt, ask here and we will figure it out together.* - *When in doubt, post here and we will figure it out together.*
3. *Delete these 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
@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide
- *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 mantis 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:*

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,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.
-->
# Mantis for YunoHost # Mantis for YunoHost
[![Integration level](https://dash.yunohost.org/integration/mantis.svg)](https://dash.yunohost.org/appci/app/mantis) ![](https://ci-apps.yunohost.org/ci/badges/mantis.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mantis.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/mantis.svg)](https://dash.yunohost.org/appci/app/mantis) ![](https://ci-apps.yunohost.org/ci/badges/mantis.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mantis.maintain.svg)
@ -5,56 +10,25 @@
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Mantis quickly and simply on a YunoHost server. > *This package allows you to install Mantis 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
Mantis Bug Tracker is a free and open source, web-based bug tracking system. The most common use of MantisBT is to track software defects. However, MantisBT is often configured by users to serve as a more generic issue tracking system and project management tool. Bug tracking system.
**Shipped version:** 2.25.0 **Shipped version:** 2.25.2~ynh1
## Screenshots **Demo:** https://mantisbt.org/bugs/my_view_page.php
![](https://github.com/mantisbt/mantisbt/blob/master/doc/modern_my_view.png) ## Documentation and resources
## Demo * Official app website: https://mantisbt.org/
* Official user documentation: https://yunohost.org/en/app_mantis
* [Official demo](https://mantisbt.org/bugs/my_view_page.php) * Official admin documentation: https://mantisbt.org/documentation.php
* Upstream app code repository: https://github.com/mantisbt/mantisbt/
## Documentation * YunoHost documentation for this app: https://yunohost.org/app_mantis
* Report a bug: https://github.com/YunoHost-Apps/mantis_ynh/issues
* Official documentation: https://mantisbt.org/documentation.php
* YunoHost documentation: https://yunohost.org/en/app_mantis
## YunoHost specific features
#### Multi-user support
* Are LDAP and HTTP auth supported ? **Yes**
* Can the app be used by multiple users? **Yes**
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mantis.svg)](https://ci-apps.yunohost.org/ci/apps/mantis/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mantis.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mantis/)
## Limitations
* Any known limitations.
## Additional information
* Other info you would like to add about this app.
## Links
* Report a bug: https://github.com/YunoHost-Apps/mantis_ynh/issues
* App website: https://mantisbt.org/
* Upstream app repository: https://github.com/mantisbt/mantisbt/
* YunoHost website: https://yunohost.org/
---
## Developer info ## Developer info
@ -66,3 +40,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/mantis_ynh/tree/testi
or or
sudo yunohost app upgrade mantis -u https://github.com/YunoHost-Apps/mantis_ynh/tree/testing --debug sudo yunohost app upgrade mantis -u https://github.com/YunoHost-Apps/mantis_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

View file

@ -1,60 +1,30 @@
# Mantis pour YunoHost # Mantis pour YunoHost
[![Integration level](https://dash.yunohost.org/integration/mantis.svg)](https://dash.yunohost.org/appci/app/mantis) ![](https://ci-apps.yunohost.org/ci/badges/mantis.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mantis.maintain.svg) [![Niveau d'intégration](https://dash.yunohost.org/integration/mantis.svg)](https://dash.yunohost.org/appci/app/mantis) ![](https://ci-apps.yunohost.org/ci/badges/mantis.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mantis.maintain.svg)
[![Installer Mantis pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mantis) [![Installer Mantis avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mantis)
*[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 Mantis rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer Mantis rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* 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
Mantis Bug Tracker est un système de suivi des bogues gratuit et open source. L'utilisation la plus courante de MantisBT est de suivre les bogues logiciels. Cependant, MantisBT est souvent configuré par les utilisateurs pour servir de système de suivi des problèmes plus générique et d'outil de gestion de projet. Système de suivi des bugs.
**Version incluse :** 2.25.0 **Version incluse :** 2.25.2~ynh1
## Captures d'écran **Démo :** https://mantisbt.org/bugs/my_view_page.php
![](https://github.com/mantisbt/mantisbt/blob/master/doc/modern_my_view.png) ## Documentations et ressources
## Démo * Site officiel de l'app : https://mantisbt.org/
* Documentation officielle utilisateur : https://yunohost.org/en/app_mantis
* [Démo officielle](https://mantisbt.org/bugs/my_view_page.php) * Documentation officielle de l'admin : https://mantisbt.org/documentation.php
* Dépôt de code officiel de l'app : https://github.com/mantisbt/mantisbt/
## Documentation * Documentation YunoHost pour cette app : https://yunohost.org/app_mantis
* Signaler un bug : https://github.com/YunoHost-Apps/mantis_ynh/issues
* Documentation officielle : https://mantisbt.org/documentation.php
* Documentation YunoHost : https://yunohost.org/fr/app_mantis
## Caractéristiques spécifiques YunoHost
#### Support multi-utilisateur
* L'authentification LDAP et HTTP est-elle prise en charge ? **Oui**
* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui**
#### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mantis.svg)](https://ci-apps.yunohost.org/ci/apps/mantis/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mantis.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mantis/)
## Limitations
* Limitations connues.
## Informations additionnelles
* Autres informations que vous souhaitez ajouter sur cette application.
## Liens
* Signaler un bug : https://github.com/YunoHost-Apps/mantis_ynh/issues
* Site de l'application : https://mantisbt.org/
* Dépôt de l'application principale : https://github.com/mantisbt/mantisbt/
* Site web YunoHost : https://yunohost.org/
---
## Informations pour les développeurs ## Informations pour les développeurs
@ -63,6 +33,8 @@ Merci de faire vos pull request sur la [branche testing](https://github.com/Yuno
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.
``` ```
sudo yunohost app install https://github.com/YunoHost-Apps/mantis_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/mantis_ynh/tree/testing --debug
or ou
sudo yunohost app upgrade mantis -u https://github.com/YunoHost-Apps/mantis_ynh/tree/testing --debug sudo yunohost app upgrade mantis -u https://github.com/YunoHost-Apps/mantis_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,14 +1,9 @@
# See here for more information
# 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="/mantis" (PATH) path="/path"
admin="john" (USER) admin="john"
is_public=1 (PUBLIC|public=1|private=0) is_public=1
default_access_level="REPORTER" default_access_level="REPORTER"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
@ -29,4 +24,3 @@ Notification=none
; commit=888c0e02d4fa4afae4800d7599ee3e145c942548 ; commit=888c0e02d4fa4afae4800d7599ee3e145c942548
name=Testing (#9) name=Testing (#9)
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://sourceforge.net/projects/mantisbt/files/mantis-stable/2.25.0/mantisbt-2.25.0.tar.gz/download SOURCE_URL=https://sourceforge.net/projects/mantisbt/files/mantis-stable/2.25.2/mantisbt-2.25.2.tar.gz/download
SOURCE_SUM=d8973d3677ecb2ccbfee95e2267b3128049fbdcc59aa1f007686a342d93a4c0a SOURCE_SUM=8b087e71594fd70d2d2e39d2d2e1285b47a9919d8d8fd268df009df76ebc3671
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

0
doc/DISCLAIMER.md Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

View file

@ -3,18 +3,26 @@
"id": "mantis", "id": "mantis",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Bug tracking system based on a web interface.", "en": "Bug tracking system.",
"fr": "Système de suivi des bugs reposant sur une interface web." "fr": "Système de suivi des bugs."
}, },
"version": "2.25.0~ynh2", "version": "2.25.2~ynh1",
"url": "https://www.mantisbt.org/", "url": "https://www.mantisbt.org/",
"upstream": {
"license": "GPL-3.0-only",
"website": "https://mantisbt.org/",
"demo": "https://mantisbt.org/bugs/my_view_page.php",
"admindoc": "https://mantisbt.org/documentation.php",
"userdoc": "https://yunohost.org/en/app_mantis",
"code": "https://github.com/mantisbt/mantisbt/"
},
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"maintainer": { "maintainer": {
"name": "liberodark", "name": "liberodark",
"email": "liberodark@gmail.com" "email": "liberodark@gmail.com"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.1.7" "yunohost": ">= 4.2.4"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -23,7 +31,8 @@
"mysql" "mysql"
], ],
"arguments": { "arguments": {
"install": [{ "install" : [
{
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"example": "example.com" "example": "example.com"
@ -33,17 +42,17 @@
"type": "path", "type": "path",
"example": "/mantis", "example": "/mantis",
"default": "/mantis" "default": "/mantis"
},
{
"name": "is_public",
"type": "boolean",
"default": true
}, },
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",
"example": "johndoe" "example": "johndoe"
}, },
{
"name": "is_public",
"type": "boolean",
"default": true
},
{ {
"name": "default_access_level", "name": "default_access_level",
"type": "string", "type": "string",

View file

@ -1,16 +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
---
* 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!"*

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
@ -61,4 +62,4 @@ ynh_mysql_dump_db --database="$db_name" > db.sql
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for Mantis. (YunoHost will then actually copy those files to the archive)." ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -33,11 +33,12 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
default_access_level=$(ynh_app_setting_get --app=$app --key=default_access_level)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up Mantis before changing its URL (may take a while)..." --weight=7 ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=7
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -45,7 +46,7 @@ ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# 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
@ -98,6 +99,14 @@ then
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi fi
#=================================================
# MODIFY A CONFIG FILE
#=================================================
random=$(ynh_string_random --length=20)
domain="$new_domain"
ynh_add_config --template="../conf/config_inc.php" --destination="$final_path/config/config_inc.php"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#================================================= #=================================================
@ -111,4 +120,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for Mantis" --last ynh_script_progression --message="Change of URL completed for $app" --last

View file

@ -19,11 +19,10 @@ ynh_abort_if_errors
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
# Retrieve arguments
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC
admin=$YNH_APP_ARG_ADMIN admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
default_access_level=$YNH_APP_ARG_DEFAULT_ACCESS_LEVEL default_access_level=$YNH_APP_ARG_DEFAULT_ACCESS_LEVEL
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -34,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME
ynh_script_progression --message="Validating installation parameters..." --weight=1 ynh_script_progression --message="Validating installation parameters..." --weight=1
final_path=/var/www/$app final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder" test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path # Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
@ -47,8 +46,19 @@ 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=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=default_access_level --value=$default_access_level ynh_app_setting_set --app=$app --key=default_access_level --value=$default_access_level
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# 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
#================================================= #=================================================
# CREATE A MYSQL DATABASE # CREATE A MYSQL DATABASE
#================================================= #=================================================
@ -59,6 +69,14 @@ db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
#=================================================
# 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"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -68,6 +86,11 @@ 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"
# Set permissions to app files
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -76,51 +99,44 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=10
# 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..." --weight=1
# Create a system user
ynh_system_user_create --username=$app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 ynh_script_progression --message="Configuring PHP-FPM..." --weight=3
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# MODIFY A CONFIG FILE # SPECIFIC SETUP
#================================================= #=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..."
random=$(ynh_string_random --length=20) random=$(ynh_string_random --length=20)
ynh_add_config --template="../conf/config_inc.php" --destination="$final_path/config/config_inc.php" ynh_add_config --template="../conf/config_inc.php" --destination="$final_path/config/config_inc.php"
#================================================= chmod 750 "$final_path"
# GENERIC FINALIZATION chmod -R o-rwx "$final_path"
#================================================= chown -R $app:www-data "$final_path"
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chown -R $app: $final_path
chmod -R 755 $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 # Reload NGINX
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
# Installation with curl
ynh_script_progression --message="Finalizing installation..." --weight=10 ynh_script_progression --message="Finalizing installation..." --weight=10
# Installation with cURL # Installation with cURL
@ -131,20 +147,27 @@ ynh_local_curl $installUrl "install=2" "db_type=mysqli" "hostname=localhost" "db
# Remove the `admin/` directory from within the MantisBT installation path. # Remove the `admin/` directory from within the MantisBT installation path.
# The scripts within this directory should not be accessible on a live MantisBT site # The scripts within this directory should not be accessible on a live MantisBT site
# or on any installation that is accessible via the Internet. # or on any installation that is accessible via the Internet.
ynh_secure_remove "$final_path/admin" ynh_secure_remove --file="$final_path/admin"
# Set the user chosen at installation as administrator # Set the user chosen at installation as administrator
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" <<< "UPDATE ${db_name}_user_table SET username = '$admin' WHERE id = 1;" ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" <<< "UPDATE ${db_name}_user_table SET username = '$admin' WHERE id = 1;"
# Remove the public access
ynh_permission_update --permission="main" --remove="visitors"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring permissions..." --weight=1 ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary or protect it # Make app public if necessary
if [ $is_public -eq 0 ] if [ $is_public -eq 1 ]
then then
ynh_permission_update --permission="main" --remove="visitors" # Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission="main" --add="visitors"
fi fi
#================================================= #=================================================
@ -158,4 +181,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of Mantis completed" --last ynh_script_progression --message="Installation of $app completed" --last

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info "Loading installation settings..." ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -23,18 +23,10 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service" --weight=1
# Remove the dedicated systemd config
ynh_remove_systemd_config
#================================================= #=================================================
# REMOVE THE MYSQL DATABASE # REMOVE THE MYSQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Removing the MySQL database" --weight=1 ynh_script_progression --message="Removing the MySQL database..." --weight=1
# Remove a database if it exists, along with the associated user # Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
@ -50,10 +42,10 @@ ynh_remove_app_dependencies
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing Mantis main directory..." --weight=4 ynh_script_progression --message="Removing app main directory..." --weight=4
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove "$final_path" ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION

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
@ -44,31 +45,28 @@ test ! -d $final_path \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE 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"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring Mantis main directory..." --weight=5
ynh_restore_file --origin_path="$final_path"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username=$app ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring app main directory..." --weight=5
# Restore permissions on app files ynh_restore_file --origin_path="$final_path"
chown -R $app: $final_path
chmod -R 755 $final_path chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
@ -103,4 +101,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for Mantis" --last ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -19,18 +19,36 @@ 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)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
db_user=$db_name db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
default_access_level=$(ynh_app_setting_get --app=$app --key=default_access_level) default_access_level=$(ynh_app_setting_get --app=$app --key=default_access_level)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up app before upgrading (may take a while)..." --weight=5
# 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
#=================================================
# STANDARD UPGRADE STEPS
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
@ -62,18 +80,20 @@ if ynh_legacy_permissions_exists; then
fi fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Backing up Mantis before upgrading (may take a while)..." --weight=5 ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Backup the current version of the app # Create a dedicated user (if not existing)
ynh_backup_before_upgrade ynh_system_user_create --username=$app --home_dir=$final_path
ynh_clean_setup () {
# restore it if the upgrade fails #=================================================
ynh_restore_upgradebackup # CREATE DEDICATED USER
} #=================================================
# Exit if an error occurs during the execution of the script ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
ynh_abort_if_errors
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -100,6 +120,11 @@ then
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi fi
# Set permissions to app files
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -108,14 +133,6 @@ 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..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -125,29 +142,18 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SPECIFIC UPGRADE
#=================================================
# Set permissions to app files
chown -R $app: $final_path
chmod -R 755 $final_path
#================================================= #=================================================
# SETUP APPLICATION WITH CURL # SETUP APPLICATION WITH CURL
#================================================= #=================================================
# Set the app as temporarily public for cURL call # Set the app as temporarily public for cURL call
ynh_permission_has_user --permission="main" --user="visitors" ynh_permission_update --permission="main" --add="visitors"
contains_visitors=$?
if [ $contains_visitors -eq 1 ]
then
ynh_permission_update --permission="main" --add="visitors"
fi
# Reload NGINX # Reload NGINX
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
# Installation with curl
ynh_script_progression --message="Finalizing installation..." --weight=10 ynh_script_progression --message="Finalizing installation..." --weight=10
# Installation with cURL # Installation with cURL
@ -158,15 +164,10 @@ ynh_local_curl $installUrl "install=2" "db_type=mysqli" "hostname=localhost" "db
# Remove the `admin/` directory from within the MantisBT installation path. # Remove the `admin/` directory from within the MantisBT installation path.
# The scripts within this directory should not be accessible on a live MantisBT site # The scripts within this directory should not be accessible on a live MantisBT site
# or on any installation that is accessible via the Internet. # or on any installation that is accessible via the Internet.
ynh_secure_remove "$final_path/admin" ynh_secure_remove --file="$final_path/admin"
#================================================= # Make app public if necessary
# SETUP SSOWAT if [ $is_public -eq 0 ]
#=================================================
ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary or protect it
if [ $contains_visitors -eq 1 ]
then then
ynh_permission_update --permission="main" --remove="visitors" ynh_permission_update --permission="main" --remove="visitors"
fi fi
@ -181,4 +182,5 @@ ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of Mantis completed" --last
ynh_script_progression --message="Upgrade of $app completed" --last