1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fluffychat_ynh.git synced 2024-09-03 18:36:04 +02:00
This commit is contained in:
YunoHost Bot 2024-09-02 00:00:45 +02:00 committed by GitHub
commit 670031937c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 46 additions and 130 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
*~
*.sw[op]
.DS_Store

View file

@ -20,7 +20,7 @@ FluffyChat is an open source, nonprofit and cute [[matrix](https://matrix.org)]
The goal of the app is to create an easy to use instant messenger which is open source and accessible for everyone.
**Versión actual:** 1.22.0~ynh1
**Versión actual:** 1.21.2~ynh1
**Demo:** <https://fluffychat.im/web>

BIN
doc/.DS_Store vendored

Binary file not shown.

View file

@ -22,7 +22,8 @@ code = "https://github.com/krille-chan/fluffychat"
fund = "https://ko-fi.com/krille"
[integration]
yunohost = ">= 11.2"
yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = "all"
multi_instance = true
@ -71,8 +72,8 @@ ram.runtime = "50M"
autoupdate.strategy = "latest_github_release"
[resources.install_dir]
group = "www-data:r-x"
owner = "www-data:rx"
group = "www-data:rx"
[resources.permissions]
main.url = "/"

View file

@ -1,17 +1,5 @@
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
# COMMON VARIABLES AND CUSTOM HELPERS
#=================================================

View file

@ -1,34 +1,24 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
ynh_print_info "Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="$install_dir"
ynh_backup "$install_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -1,31 +1,24 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_script_progression "Updating NGINX web server configuration..."
ynh_change_url_nginx_config
ynh_config_change_url_nginx
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/}
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path_without_trailing_slash/\">" --target_file="$install_dir/index.html"
ynh_replace --match="<base href=".*">" --replace="<base href=\"$path_without_trailing_slash/\">" --file="$install_dir/index.html"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last
ynh_script_progression "Change of URL completed for $app"

View file

@ -6,13 +6,11 @@
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
install_dir=$(ynh_app_setting_get --key=install_dir)
#=================================================
# SPECIFIC GETTERS
@ -20,7 +18,7 @@ install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
get__default_matrix_server() {
default_matrix_server=$(ynh_app_setting_get --app="$app" --key=default_matrix_server)
default_matrix_server=$(ynh_app_setting_get --key=default_matrix_server)
echo "$default_matrix_server"
}
@ -34,12 +32,10 @@ set__default_matrix_server() {
old_value=${old[default_matrix_server]}
# patching main.dart.js to replace the default matrix server
ynh_replace_string --match_string="=\"$old_value\"" --replace_string="=\"$default_matrix_server\"" --target_file="$install_dir/main.dart.js"
ynh_replace --match="=\"$old_value\"" --replace="=\"$default_matrix_server\"" --file="$install_dir/main.dart.js"
ynh_app_setting_set --app="$app" --key=default_matrix_server --value="$default_matrix_server"
ynh_app_setting_set --key=default_matrix_server --value="$default_matrix_server"
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run "$1"

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
@ -17,36 +11,30 @@ source /usr/share/yunohost/helpers
default_matrix_server=${default_matrix_server#*://}
# remove any trailing slash
default_matrix_server=${default_matrix_server%/}
ynh_app_setting_set --app="$app" --key=default_matrix_server --value="$default_matrix_server"
ynh_app_setting_set --key=default_matrix_server --value="$default_matrix_server"
#=================================================
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_script_progression "Setting up source files..."
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir"
# remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/}
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path_without_trailing_slash/\">" --target_file="$install_dir/index.html"
ynh_replace --match="<base href=".*">" --replace="<base href=\"$path_without_trailing_slash/\">" --file="$install_dir/index.html"
# patching main.dart.js to replace the default matrix server
ynh_replace_string --match_string="=\"matrix.org\"" --replace_string="=\"$default_matrix_server\"" --target_file="$install_dir/main.dart.js"
chown -R "www-data:www-data" "$install_dir"
ynh_replace --match="=\"matrix.org\"" --replace="=\"$default_matrix_server\"" --file="$install_dir/main.dart.js"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
ynh_script_progression "Adding system configurations related to $app..."
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config
ynh_config_add_nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last
ynh_script_progression "Installation of $app completed"

View file

@ -1,23 +1,17 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
ynh_script_progression "Removing system configurations related to $app..."
ynh_remove_nginx_config
ynh_config_remove_nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last
ynh_script_progression "Removal of $app completed"

View file

@ -1,42 +1,31 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_script_progression "Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir"
chown -R "www-data:www-data" "$install_dir"
ynh_restore "$install_dir"
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_script_progression "Restoring system configurations related to $app..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_script_progression "Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload
ynh_systemctl --service=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last
ynh_script_progression "Restoration completed for $app"

View file

@ -1,54 +1,34 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
# if we update from a version prior to the config panel, create new setting
if [ -z "${default_matrix_server:-}" ]; then
default_matrix_server="matrix.org"
ynh_app_setting_set --app="$app" --key=default_matrix_server --value="$default_matrix_server"
fi
ynh_app_setting_set_default --key=default_matrix_server --value="matrix.org"
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir" --full_replace
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
# remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/}
ynh_replace --match="<base href=".*">" --replace="<base href=\"$path_without_trailing_slash/\">" --file="$install_dir/index.html"
# remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/}
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path_without_trailing_slash/\">" --target_file="$install_dir/index.html"
# patching main.dart.js to replace the default matrix server
ynh_replace_string --match_string="=\"matrix.org\"" --replace_string="=\"$default_matrix_server\"" --target_file="$install_dir/main.dart.js"
fi
chown -R "www-data:www-data" "$install_dir"
# patching main.dart.js to replace the default matrix server
ynh_replace --match="=\"matrix.org\"" --replace="=\"$default_matrix_server\"" --file="$install_dir/main.dart.js"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
ynh_script_progression "Upgrading system configurations related to $app..."
ynh_add_nginx_config
ynh_config_add_nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last
ynh_script_progression "Upgrade of $app completed"

View file

@ -1,2 +0,0 @@
*~
*.sw[op]

View file

@ -1,2 +0,0 @@
*~
*.sw[op]