1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
- Upgrade to version 0.19
- Fix login
This commit is contained in:
Éric Gaspar 2021-02-21 22:20:08 +01:00 committed by GitHub
parent eb54592d2d
commit 80bdea70f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 41 additions and 60 deletions

View file

@ -12,7 +12,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
[Movim](https://movim.eu) is a decentralized social network, written in PHP and HTML5 and based on the XMPP standard protocol. [Movim](https://movim.eu) is a decentralized social network, written in PHP and HTML5 and based on the XMPP standard protocol.
**Shipped version:** 0.18 **Shipped version:** 0.19
## Screenshots ## Screenshots

View file

@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install
[Movim](https://movim.eu) est un réseau social décentralisé, écrit en PHP et HTML5 et basé sur le protocole standard XMPP. [Movim](https://movim.eu) est un réseau social décentralisé, écrit en PHP et HTML5 et basé sur le protocole standard XMPP.
**Version incluse :** 0.18 **Version incluse :** 0.19
## Captures d'écran ## Captures d'écran

View file

@ -1,8 +1,6 @@
# See here for more informations # See here for more informations
# https://github.com/YunoHost/package_check#syntax-check_process-file # 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" (DOMAIN)
@ -22,12 +20,12 @@
upgrade=1 upgrade=1
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=1 port_already_use=0
change_url=0 change_url=0
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=CommitHash ; commit=
name=Name and date of the commit. name=
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=phrasedepasse&port=9537& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=phrasedepasse&port=9537&

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/movim/movim/archive/v0.18.tar.gz SOURCE_URL=https://github.com/movim/movim/archive/v0.19.tar.gz
SOURCE_SUM=5d49757ee8c70c8b1a527a26279de76b9be5c938064aae7ed65cb123fe4290ca SOURCE_SUM=df98b5b0df6fd6bfa5fda88f387ac017bc7bcead42c462745296604f3e0ee501
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -36,6 +36,7 @@ location __PATH__/ {
proxy_send_timeout 14400s; proxy_send_timeout 14400s;
# (14400s is 4h) # (14400s is 4h)
} }
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }

View file

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

View file

@ -6,7 +6,7 @@
"en": "Web-based cross-platform XMPP client", "en": "Web-based cross-platform XMPP client",
"fr": "Client XMPP multiplateforme basé sur le Web" "fr": "Client XMPP multiplateforme basé sur le Web"
}, },
"version": "0.18~ynh5", "version": "0.19~ynh1",
"url": "https://movim.eu", "url": "https://movim.eu",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"maintainer": { "maintainer": {
@ -14,7 +14,7 @@
"email": "" "email": ""
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.0.0"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [

View file

@ -13,6 +13,4 @@
## Package_check results ## 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* * 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!"*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/movim_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/movim_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -9,7 +9,7 @@ pkg_dependencies="postgresql postgresql-contrib apt-transport-https"
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="7.3"
extra_php_dependencies="php${YNH_PHP_VERSION}-fpm 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" 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"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
@ -23,15 +23,3 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-curl php
# FUTURE OFFICIAL HELPERS # FUTURE OFFICIAL HELPERS
#================================================= #=================================================
# Execute a command as another user
# usage: ynh_exec_as USER COMMAND [ARG ...]
ynh_exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}

View file

@ -29,7 +29,6 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
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=db_pwd)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================

View file

@ -48,7 +48,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=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
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -76,13 +75,9 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name db_user=$db_name
db_pwd=$(ynh_string_random --length=30)
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_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database=$db_name ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database=$db_name
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name
@ -128,16 +123,14 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression --message="Modifying a config file..." --weight=1
cp ../conf/db.example.inc.php $final_path/config/db.inc.php ynh_add_config --template="../conf/db.example.inc.php" --destination="$final_path/config/db.inc.php"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config/db.inc.php"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config/db.inc.php"
ynh_store_file_checksum --file="$final_path/config/db.inc.php" ynh_store_file_checksum --file="$final_path/config/db.inc.php"
#================================================= #=================================================
# Install PHP dependencies using composer # Install PHP dependencies using composer
#================================================= #=================================================
ynh_script_progression --message="Configuring Composer..." --weight=1
pushd $final_path pushd $final_path
export COMPOSER_HOME=$final_path export COMPOSER_HOME=$final_path
@ -148,12 +141,12 @@ popd
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Configuring a systemd service..." --weight=12
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service 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="__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_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service
ynh_add_systemd_config ynh_add_systemd_config
@ -169,8 +162,8 @@ mkdir -p $cache_dir
chown -R $app $cache_dir chown -R $app $cache_dir
pushd $final_path pushd $final_path
ynh_exec_as $app php$phpversion composer.phar $app:migrate --quiet php$phpversion composer.phar $app:migrate --quiet
ynh_exec_as $app php$phpversion daemon.php config --username=$admin --password=$password --quiet php$phpversion daemon.php config --username=$admin --password=$password --quiet
popd popd
#================================================= #=================================================
@ -181,6 +174,7 @@ popd
chown -R $app:www-data $final_path chown -R $app:www-data $final_path
chown -R $app $final_path/src/Movim/ chown -R $app $final_path/src/Movim/
chmod u+rwx $final_path
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
@ -200,12 +194,12 @@ ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #--li
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1 ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary or protect it # Make app public if necessary or protect it
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
ynh_permission_update --permission "main" --add "visitors" ynh_permission_update --permission="main" --add="visitors"
fi fi
#================================================= #=================================================

View file

@ -32,7 +32,7 @@ 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)
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=psqlpwd)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================

View file

@ -23,7 +23,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
is_public=$(ynh_app_setting_get --app=$app --key=is_public) 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)
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=db_pwd) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
timezone=$(cat /etc/timezone) timezone=$(cat /etc/timezone)
@ -59,6 +59,13 @@ if [ -z "$final_path" ]; then
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
#================================================= #=================================================
@ -80,7 +87,7 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=23 ynh_script_progression --message="Stopping a systemd service..." --weight=23
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -133,6 +140,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
chown -R $app:www-data $final_path chown -R $app:www-data $final_path
chown -R $app $final_path/src/Movim/Bootstrap.php chown -R $app $final_path/src/Movim/Bootstrap.php
chmod u+rwx $final_path
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
@ -144,31 +152,26 @@ yunohost service add $app --description="Responsive web-based XMPP client" --log
#================================================= #=================================================
# INSTALL PHP DEPENDENCIES USING COMPOSER # INSTALL PHP DEPENDENCIES USING COMPOSER
#================================================= #=================================================
ynh_script_progression --message="Installing Composer..." --weight=1
pushd "$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" \ 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 config --global discard-changes true --quiet \
&& php$phpversion composer.phar install --no-interaction --quiet && php$phpversion composer.phar update --no-interaction --quiet \
&& php$phpversion composer.phar movim:migrate --quiet
popd popd
#================================================= #&& php$phpversion composer.phar install --no-interaction --quiet \
# Set-up database
#=================================================
ynh_script_progression --message="Configuring database.." --weight=1
pushd $final_path
ynh_exec_as $app php$phpversion composer.phar movim:migrate --quiet
popd
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=5
# Create a dedicated systemd config
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service 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="__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_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service
ynh_add_systemd_config ynh_add_systemd_config
@ -177,7 +180,7 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
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"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX