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:
Éric Gaspar 2024-09-01 18:04:55 +02:00
parent 1e8870e44a
commit 3eede2c0ae
7 changed files with 9 additions and 33 deletions

View file

@ -22,7 +22,7 @@ code = "https://github.com/krille-chan/fluffychat"
fund = "https://ko-fi.com/krille" fund = "https://ko-fi.com/krille"
[integration] [integration]
yunohost = ">= 11.2.18" yunohost = ">= 11.2.29"
helpers_version = "2.1" helpers_version = "2.1"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers

View file

@ -14,7 +14,6 @@ ynh_config_change_url_nginx
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
#================================================= #=================================================
# remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/} path_without_trailing_slash=${path%/}
ynh_replace --match="<base href=".*">" --replace="<base href=\"$path_without_trailing_slash/\">" --file="$install_dir/index.html" ynh_replace --match="<base href=".*">" --replace="<base href=\"$path_without_trailing_slash/\">" --file="$install_dir/index.html"

View file

@ -6,8 +6,6 @@
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#REMOVEME? ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
#================================================= #=================================================

View file

@ -13,14 +13,11 @@ default_matrix_server=${default_matrix_server#*://}
default_matrix_server=${default_matrix_server%/} default_matrix_server=${default_matrix_server%/}
ynh_app_setting_set --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 # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression "Setting up source files..." 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" ynh_setup_source --dest_dir="$install_dir"
# remove potential trailing slash to avoid double slashes # remove potential trailing slash to avoid double slashes
@ -30,13 +27,11 @@ ynh_replace --match="<base href=".*">" --replace="<base href=\"$path_without_tra
# patching main.dart.js to replace the default matrix server # 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" ynh_replace --match="=\"matrix.org\"" --replace="=\"$default_matrix_server\"" --file="$install_dir/main.dart.js"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "www-data:www-data" "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression "Adding system configurations related to $app..." ynh_script_progression "Adding system configurations related to $app..."
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_config_add_nginx ynh_config_add_nginx
#================================================= #=================================================

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -11,7 +10,6 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir" ynh_restore "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "www-data:www-data" "$install_dir"
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================

View file

@ -4,35 +4,22 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# if we update from a version prior to the config panel, create new setting # if we update from a version prior to the config panel, create new setting
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=default_matrix_server --value="matrix.org" ynh_app_setting_set_default --key=default_matrix_server --value="matrix.org"
if [ -z "${default_matrix_server:-}" ]; then
default_matrix_server="matrix.org"
ynh_app_setting_set --key=default_matrix_server --value="$default_matrix_server"
fi
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression "Upgrading source files..."
# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed ynh_setup_source --dest_dir="$install_dir" --full_replace
if ynh_app_upstream_version_changed
then
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from manifest.toml # remove potential trailing slash to avoid double slashes
ynh_setup_source --dest_dir="$install_dir" --full_replace 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 # patching main.dart.js to replace the default matrix server
path_without_trailing_slash=${path%/} ynh_replace --match="=\"matrix.org\"" --replace="=\"$default_matrix_server\"" --file="$install_dir/main.dart.js"
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 --match="=\"matrix.org\"" --replace="=\"$default_matrix_server\"" --file="$install_dir/main.dart.js"
fi
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "www-data:www-data" "$install_dir"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================