mirror of
https://github.com/YunoHost-Apps/thelounge_ynh.git
synced 2024-09-03 20:35:54 +02:00
Cleaning up
This commit is contained in:
parent
79bf455914
commit
d9ee68e25b
6 changed files with 30 additions and 32 deletions
|
@ -29,7 +29,7 @@ How to configure this app: by an admin panel.
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
* Official documentation: https://thelounge.chat/docs
|
* Official documentation: https://thelounge.chat/docs
|
||||||
* YunoHost documentation: https://yunohost.org/#/app_thelounge
|
* YunoHost documentation: https://yunohost.org/en/app_thelounge
|
||||||
|
|
||||||
## YunoHost specific features
|
## YunoHost specific features
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ Comment configurer cette application : via le panneau d’administration.
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
* Documentation officielle : https://thelounge.chat/docs
|
* Documentation officielle : https://thelounge.chat/docs
|
||||||
* Documentation YunoHost : https://yunohost.org/#/app_thelounge_fr
|
* Documentation YunoHost : https://yunohost.org/fr/app_thelounge
|
||||||
|
|
||||||
## Caractéristiques spécifiques YunoHost
|
## Caractéristiques spécifiques YunoHost
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"email": "beudbeud@beudibox.fr"
|
"email": "beudbeud@beudibox.fr"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8.1"
|
"yunohost": ">= 4.1.7"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -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!"*
|
||||||
|
|
||||||
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/thelounge_ynh%20PR-NUM-%20(USERNAME)/)
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ ynh_script_progression --message="Storing installation settings..."
|
||||||
|
|
||||||
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=is_public --value=$is_public
|
|
||||||
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
|
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -106,12 +105,14 @@ ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
mkdir -p $config_path
|
mkdir -p $config_path
|
||||||
|
|
||||||
# Main config File
|
# # Main config File
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.js"
|
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.js"
|
||||||
|
|
||||||
cp -a ../conf/config.js "$config_path"
|
# cp -a ../conf/config.js "$config_path"
|
||||||
|
|
||||||
ynh_store_file_checksum "$config_path/config.js"
|
# ynh_store_file_checksum "$config_path/config.js"
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/config.js" --destination="$config_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL THE LOUNGE
|
# INSTALL THE LOUNGE
|
||||||
|
@ -129,8 +130,8 @@ popd
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..."
|
ynh_script_progression --message="Configuring a systemd service..."
|
||||||
|
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service"
|
#ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
|
#ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__NODE__" --replace_string="$nodejs_path" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__NODE__" --replace_string="$nodejs_path" --target_file="../conf/systemd.service"
|
||||||
|
|
||||||
|
@ -165,10 +166,10 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..."
|
ynh_script_progression --message="Configuring permissions..."
|
||||||
|
|
||||||
# Make app public if necessary or protect it
|
# Make app public if necessary or protect it
|
||||||
[ $is_public -eq 0 ] || ynh_permission_update --permission "main" --add "visitors"
|
[ $is_public -eq 0 ] || ynh_permission_update --permission="main" --add="visitors"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
|
@ -18,7 +18,6 @@ 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)
|
||||||
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)
|
||||||
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
@ -35,15 +34,6 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
|
|
||||||
# Fix is_public as a boolean value
|
|
||||||
if [ "$is_public" = "Yes" ]; then
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=1
|
|
||||||
is_public=1
|
|
||||||
elif [ "$is_public" = "No" ]; then
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=0
|
|
||||||
is_public=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If final_path doesn't exist, create it
|
# If final_path doesn't exist, create it
|
||||||
if [ -z "$final_path" ]; then
|
if [ -z "$final_path" ]; then
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
|
@ -56,6 +46,13 @@ if [ -z "$config_path" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
|
ynh_app_setting_set --app=$app --key=config_path --value=$config_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
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -142,20 +139,22 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different --file="$config_path"
|
# ynh_backup_if_checksum_is_different --file="$config_path"
|
||||||
# Main config File
|
# # Main config File
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.js"
|
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.js"
|
||||||
|
|
||||||
cp -a ../conf/config.js "$config_path"
|
# cp -a ../conf/config.js "$config_path"
|
||||||
ynh_store_file_checksum "$config_path/config.js"
|
# ynh_store_file_checksum "$config_path/config.js"
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/config.js" --destination="$config_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading systemd configuration..."
|
ynh_script_progression --message="Upgrading systemd configuration..."
|
||||||
|
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service"
|
#ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
|
#ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__NODE__" --replace_string="$nodejs_path" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__NODE__" --replace_string="$nodejs_path" --target_file="../conf/systemd.service"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue