1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
* Fix linter warning
This commit is contained in:
Éric Gaspar 2021-01-15 13:32:05 +01:00 committed by GitHub
parent 1075b6c7ab
commit eb54592d2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 43 additions and 42 deletions

View file

@ -1,7 +1,7 @@
# 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)
[![Install Movim with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=movim)
[![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)*

View file

@ -1,7 +1,7 @@
# Movim pour 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)
[![Installer Movim avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=movim)
[![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)*

View file

@ -22,7 +22,6 @@
upgrade=1
backup_restore=1
multi_instance=0
incorrect_path=1
port_already_use=1
change_url=0
;;; Options

View file

@ -6,7 +6,7 @@ After=nginx.service network.target local-fs.target postgresql.service
Type=simple
User=__APP__
WorkingDirectory=__FINALPATH__
ExecStart=/usr/bin/php7.3 daemon.php start --interface=127.0.0.1 --url=https://__DOMAIN____PATH__/ --port=__PORT__
ExecStart=/usr/bin/php__PHP_VERSION__ daemon.php start --interface=127.0.0.1 --url=https://__DOMAIN____PATH__/ --port=__PORT__
StandardOutput=syslog
SyslogIdentifier=__APP__
PIDFile=/run/movim.pid

View file

@ -22,7 +22,7 @@ about: When creating a bug report, please use the following template to provide
- 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*
- 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`*

View file

@ -6,7 +6,7 @@
"en": "Web-based cross-platform XMPP client",
"fr": "Client XMPP multiplateforme basé sur le Web"
},
"version": "0.18~ynh4",
"version": "0.18~ynh5",
"url": "https://movim.eu",
"license": "AGPL-3.0-or-later",
"maintainer": {
@ -19,7 +19,7 @@
"multi_instance": false,
"services": [
"nginx",
"php7.0-fpm",
"php7.3-fpm",
"postgresql",
"metronome"
],

View file

@ -55,7 +55,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Configuring firewall..." --weight=2
ynh_script_progression --message="Finding an available port..." --weight=2
# Find a free port
port=$(ynh_find_port --port=9537)
@ -67,7 +67,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
ynh_script_progression --message="Installing dependencies..." --weight=1
# Install packages
ynh_install_app_dependencies $pkg_dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE A POSTGRESQL DATABASE
@ -139,12 +139,11 @@ ynh_store_file_checksum --file="$final_path/config/db.inc.php"
# Install PHP dependencies using composer
#=================================================
(
cd "$final_path"
pushd $final_path
export COMPOSER_HOME=$final_path
curl -sS https://getcomposer.org/installer | php${phpversion} -- --version="1.10.16" --install-dir="$final_path" \
&& php${phpversion} composer.phar install --no-interaction
)
ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php${phpversion} -- --version="1.10.16" --install-dir="$final_path" \
&& php${phpversion} composer.phar install --no-interaction --quiet
popd
#=================================================
# SETUP SYSTEMD
@ -153,7 +152,8 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service
ynh_add_systemd_config
@ -168,9 +168,10 @@ cache_dir="/home/$app"
mkdir -p $cache_dir
chown -R $app $cache_dir
cd "$final_path"
ynh_exec_as $app php$phpversion composer.phar $app:migrate
ynh_exec_as $app php$phpversion daemon.php config --username=$admin --password=$password
pushd $final_path
ynh_exec_as $app php$phpversion composer.phar $app:migrate --quiet
ynh_exec_as $app php$phpversion daemon.php config --username=$admin --password=$password --quiet
popd
#=================================================
# GENERIC FINALIZATION
@ -186,7 +187,7 @@ chown -R $app $final_path/src/Movim/
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
@ -194,7 +195,7 @@ yunohost service add $app --description "Responsive web-based XMPP client" --log
ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #--line_match="HTTP Server listening"
ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #--line_match="HTTP Server listening"
#=================================================
# SETUP SSOWAT

View file

@ -16,10 +16,10 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME
# Retrieve app settings
domain=$(ynh_app_setting_get --app="$app" --key=domain)
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
port=$(ynh_app_setting_get --app="$app" --key=port)
db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
#=================================================
@ -62,6 +62,7 @@ ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_app_dependencies

View file

@ -80,7 +80,7 @@ chown -R $app $final_path/src/Movim/
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# SPECIFIC RESTORATION
@ -90,7 +90,7 @@ ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
ynh_script_progression --message="Reinstalling dependencies..." --weight=2
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE POSTGRESQL DATABASE
@ -112,15 +112,16 @@ systemctl enable $app.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log"
#=================================================
# GENERIC FINALIZATION
@ -129,7 +130,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload
#=================================================

View file

@ -107,7 +107,7 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=4
ynh_install_app_dependencies $pkg_dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
@ -126,7 +126,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$timezone" --target_file=../conf/php-fpm.conf
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
#=================================================
# SET PERMISSIONS
@ -140,27 +139,26 @@ chown -R $app $final_path/src/Movim/Bootstrap.php
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
#=================================================
# Install PHP dependencies using composer
# INSTALL PHP DEPENDENCIES USING COMPOSER
#=================================================
(
cd "$final_path"
curl -sS https://getcomposer.org/installer | php$phpversion -- --version="1.10.16" --install-dir="$final_path" \
pushd "$final_path"
ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php$phpversion -- --version="1.10.16" --install-dir="$final_path" \
&& php$phpversion composer.phar config --global discard-changes true --quiet \
&& php$phpversion composer.phar install --no-interaction --quiet
)
popd
#=================================================
# Set-up database
#=================================================
ynh_script_progression --message="Configuring database.." --weight=1
(
cd "$final_path"
ynh_exec_as $app php$phpversion composer.phar movim:migrate
)
pushd $final_path
ynh_exec_as $app php$phpversion composer.phar movim:migrate --quiet
popd
#=================================================
# SETUP SYSTEMD
@ -169,7 +167,8 @@ ynh_script_progression --message="Configuring database.." --weight=1
# Create a dedicated systemd config
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service
ynh_add_systemd_config