1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00

Merge pull request #44 from YunoHost-Apps/testing

Apply last example_ynh
This commit is contained in:
yalh76 2022-06-23 13:08:31 +02:00 committed by GitHub
commit 53e75badad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 88 additions and 78 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Movim for YunoHost
[![Integration level](https://dash.yunohost.org/integration/movim.svg)](https://dash.yunohost.org/appci/app/movim) ![](https://ci-apps.yunohost.org/ci/badges/movim.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/movim.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/movim.svg)](https://dash.yunohost.org/appci/app/movim) ![Working status](https://ci-apps.yunohost.org/ci/badges/movim.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/movim.maintain.svg)
[![Install Movim with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=movim)
*[Lire ce readme en français.](./README_fr.md)*
@ -17,13 +17,14 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Web-based cross-platform XMPP client
**Shipped version:** 0.19~ynh2
**Shipped version:** 0.19~ynh4
**Demo:** https://nl.movim.eu/?login
## Screenshots
![](./doc/screenshots/movim.png)
![Screenshot of Movim](./doc/screenshots/movim.png)
## Disclaimers / important information
@ -33,21 +34,22 @@ Web-based cross-platform XMPP client
## Documentation and resources
* Official app website: https://movim.eu
* Official admin documentation: https://github.com/movim/movim/wiki
* Upstream app code repository: https://github.com/movim/movim
* YunoHost documentation for this app: https://yunohost.org/app_movim
* Report a bug: https://github.com/YunoHost-Apps/movim_ynh/issues
* Official app website: <https://movim.eu>
* Official admin documentation: <https://github.com/movim/movim/wiki>
* Upstream app code repository: <https://github.com/movim/movim>
* YunoHost documentation for this app: <https://yunohost.org/app_movim>
* Report a bug: <https://github.com/YunoHost-Apps/movim_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/movim_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/movim_ynh/tree/testing --debug
or
sudo yunohost app upgrade movim -u https://github.com/YunoHost-Apps/movim_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,10 +1,14 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Movim pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/movim.svg)](https://dash.yunohost.org/appci/app/movim) ![](https://ci-apps.yunohost.org/ci/badges/movim.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/movim.maintain.svg)
[![Niveau d'intégration](https://dash.yunohost.org/integration/movim.svg)](https://dash.yunohost.org/appci/app/movim) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/movim.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/movim.maintain.svg)
[![Installer Movim avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=movim)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Movim 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.*
@ -13,13 +17,14 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Client XMPP multiplateforme basé sur le Web
**Version incluse :** 0.19~ynh2
**Version incluse :** 0.19~ynh4
**Démo :** https://nl.movim.eu/?login
## Captures d'écran
![](./doc/screenshots/movim.png)
![Capture d'écran de Movim](./doc/screenshots/movim.png)
## Avertissements / informations importantes
@ -29,21 +34,22 @@ Client XMPP multiplateforme basé sur le Web
## Documentations et ressources
* Site officiel de l'app : https://movim.eu
* Documentation officielle de l'admin : https://github.com/movim/movim/wiki
* Dépôt de code officiel de l'app : https://github.com/movim/movim
* Documentation YunoHost pour cette app : https://yunohost.org/app_movim
* Signaler un bug : https://github.com/YunoHost-Apps/movim_ynh/issues
* Site officiel de l'app : <https://movim.eu>
* Documentation officielle de l'admin : <https://github.com/movim/movim/wiki>
* Dépôt de code officiel de l'app : <https://github.com/movim/movim>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_movim>
* Signaler un bug : <https://github.com/YunoHost-Apps/movim_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/movim_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/movim_ynh/tree/testing --debug
ou
sudo yunohost app upgrade movim -u https://github.com/YunoHost-Apps/movim_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -2,9 +2,9 @@
; Manifest
domain="domain.tld"
path="/path"
admin="john"
language="fr"
is_public=1
language="fr"
admin="john"
password="1Strong-Password"
; Checks
pkg_linter=1
@ -18,6 +18,7 @@
upgrade=1 from_commit=80bdea70f80aafef673718911ad492ddc54aab5c
backup_restore=1
multi_instance=0
port_already_use=0
change_url=1
;;; Options
Email=

View file

@ -2,7 +2,7 @@
location __PATH__/ {
# Path to source
alias __FINALPATH__/public/ ;
alias __FINALPATH__/public/;
more_set_headers "Access-Control-Allow-Origin: *";

View file

@ -8,7 +8,7 @@ User=__APP__
Group=__APP__
Environment=PUBLIC_URL=https://__DOMAIN____PATH__/
Environment=WS_PORT=__PORT__
WorkingDirectory=__FINALPATH__
WorkingDirectory=__FINALPATH__/
ExecStart=/usr/bin/php__PHPVERSION__ daemon.php start --url=${PUBLIC_URL} --port=${WS_PORT}
StandardOutput=syslog
SyslogIdentifier=__APP__

View file

@ -1 +1 @@
Client XMPP multiplateforme basé sur le Web
Client XMPP multiplateforme basé sur le Web

View file

@ -6,7 +6,7 @@
"en": "Web-based cross-platform XMPP client",
"fr": "Client XMPP multiplateforme basé sur le Web"
},
"version": "0.19~ynh3",
"version": "0.19~ynh4",
"url": "https://movim.eu",
"upstream": {
"license": "AGPL-3.0-or-later",
@ -42,15 +42,15 @@
"example": "/movim",
"default": "/movim"
},
{
"name": "admin",
"type": "user"
},
{
"name": "is_public",
"type": "boolean",
"default": true
},
{
"name": "admin",
"type": "user"
},
{
"name": "password",
"type": "password"

View file

@ -4,14 +4,11 @@
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies="postgresql postgresql-contrib apt-transport-https"
YNH_PHP_VERSION="7.3"
YNH_COMPOSER_VERSION="2.2.5"
extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-xml"
pkg_dependencies="postgresql postgresql-contrib apt-transport-https php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-xml"
#=================================================
# PERSONAL HELPERS

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

View file

@ -28,6 +28,8 @@ ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# Add settings here as needed by your application
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
port=$(ynh_app_setting_get --app=$app --key=port)
@ -39,6 +41,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# 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"

View file

@ -25,13 +25,14 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
admin=$YNH_APP_ARG_ADMIN
password=$YNH_APP_ARG_PASSWORD
timezone=$(cat /etc/timezone)
app=$YNH_APP_INSTANCE_NAME
timezone=$(cat /etc/timezone)
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@ -68,7 +69,6 @@ ynh_app_setting_set --app=$app --key=port --value=$port
#=================================================
ynh_script_progression --message="Installing dependencies..."
# Install packages
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
@ -110,6 +110,15 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..."
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -118,15 +127,6 @@ ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..."
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# SPECIFIC SETUP
#=================================================

View file

@ -46,13 +46,6 @@ test ! -d $final_path \
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@ -72,17 +65,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# SPECIFIC RESTORATION
#=================================================
@ -93,6 +75,24 @@ ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated PHP-FPM config
ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================

View file

@ -41,6 +41,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
@ -87,7 +88,7 @@ fi
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -98,7 +99,7 @@ then
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
ynh_setup_source --dest_dir="$final_path" --keep="config/db.inc.php"
# Temporary workaround to fix movim.ERROR: Error: Call to undefined function GuzzleHttp\Psr7\uri_for()
ynh_replace_string --match_string="0.3.5" --replace_string="0.4.1" --target_file="$final_path/composer.json"
@ -108,14 +109,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
@ -129,10 +122,18 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_add_fpm_config
#=================================================
# SPECIFIC SETUP
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE A CONFIG FILE
#=================================================