mirror of
https://github.com/YunoHost-Apps/jappix_ynh.git
synced 2024-09-03 19:26:19 +02:00
fix
This commit is contained in:
parent
b74a28989b
commit
146fe2942b
4 changed files with 46 additions and 16 deletions
|
@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
## Overview
|
||||
Jappix is a fully-featured XMPP web-client with an open social platform which enables you to host your communication platform wherever you want to.
|
||||
|
||||
**Shipped version:** 1.1.7
|
||||
**Shipped version:** 1.2
|
||||
|
||||
#### Supported architectures
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "A free social network",
|
||||
"fr": "Un réseau social libre"
|
||||
},
|
||||
"version": "1.1.7~ynh1",
|
||||
"version": "1.2~ynh1",
|
||||
"url": "https://jappix.org/",
|
||||
"license": "AGPL-3",
|
||||
"maintainer": {
|
||||
|
@ -44,6 +44,7 @@
|
|||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose a name for Jappix",
|
||||
"fr": "Choisissez un nom pour Jappix"
|
||||
|
@ -53,6 +54,7 @@
|
|||
},
|
||||
{
|
||||
"name": "language",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose the default language of Jappix",
|
||||
"fr": "Choissisez la langue par défaut de Jappix"
|
||||
|
|
|
@ -84,15 +84,15 @@ ynh_add_nginx_config
|
|||
# Set Jappix configuration
|
||||
#=================================================
|
||||
|
||||
sed -i "s@PATHTOCHANGE@${path}@g" "${final_path}/store/conf/hosts.xml"
|
||||
sed -i "s@CHANGELANG@${language}@g" "${final_path}/store/conf/main.xml"
|
||||
sed -i "s@CHANGENAME@${name}@g" "${final_path}/store/conf/main.xml"
|
||||
sed -i "s@DOMAINTOCHANGE@${domain}@g" "${final_path}/store/conf/hosts.xml"
|
||||
sed -i "s@PATHTOCHANGE@${final_path}@g" "$final_path/store/conf/hosts.xml"
|
||||
sed -i "s@CHANGELANG@${language}@g" "$final_path/store/conf/main.xml"
|
||||
sed -i "s@CHANGENAME@${name}@g" "$final_path/store/conf/main.xml"
|
||||
sed -i "s@DOMAINTOCHANGE@${domain}@g" "$final_path/store/conf/hosts.xml"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." -weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." -weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -24,12 +24,35 @@ path=$(ynh_app_setting_get $app path)
|
|||
name=$(ynh_app_setting_get "$app" name)
|
||||
language=$(ynh_app_setting_get "$app" language)
|
||||
|
||||
# Set default values
|
||||
name="${name:-YunoJappix}"
|
||||
language="${language:-en}"
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."--weight=1
|
||||
|
||||
# Remove trailing "/" for next commands
|
||||
CHECK_PATH
|
||||
# Set default values
|
||||
if [ -z "$language" ]; then
|
||||
language="${language:-en}"
|
||||
ynh_app_setting_set --app=$language --key=language --value=$language
|
||||
fi
|
||||
|
||||
if [ -z "$name" ]; then
|
||||
name=${name:-YunoJappix}
|
||||
ynh_app_setting_set --app=$app --key=name --value=$name
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1
|
||||
|
||||
# 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
|
||||
|
||||
#=================================================
|
||||
# Copy files to the right place
|
||||
|
@ -44,10 +67,15 @@ cp ../conf/*.xml "${final_path}/store/conf/"
|
|||
# Set permissions to jappix directory
|
||||
sudo chown -R www-data: "$final_path"
|
||||
|
||||
# Set and copy NGINX configuraion
|
||||
sed -i "s@PATHTOCHANGE@${path}@g" ../conf/nginx.conf
|
||||
sed -i "s@ALIASTOCHANGE@${final_path}/@g" ../conf/nginx.conf
|
||||
cp ../conf/nginx.conf "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
|
||||
|
||||
# Set Jappix configuration
|
||||
sed -i "s@PATHTOCHANGE@${path}@g" "${final_path}/store/conf/hosts.xml"
|
||||
|
|
Loading…
Add table
Reference in a new issue