1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fluffychat_ynh.git synced 2024-09-03 18:36:04 +02:00

Merge pull request #14 from YunoHost-Apps/testing

This commit is contained in:
OniriCorpe 2024-02-26 03:28:33 +01:00 committed by GitHub
commit cd3411f5a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 115 additions and 15 deletions

View file

@ -1,5 +1,5 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
It shall NOT be edited by hand.
-->
@ -16,10 +16,11 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
FluffyChat is an open source, nonprofit and cute [[matrix](https://matrix.org)] client written in [Flutter](https://flutter.dev). The goal of the app is to create an easy to use instant messenger which is open source and accessible for everyone.
FluffyChat is an open source, nonprofit and cute [[matrix](https://matrix.org)] client written in [Flutter](https://flutter.dev).
The goal of the app is to create an easy to use instant messenger which is open source and accessible for everyone.
**Shipped version:** 1.17.3~ynh1
**Shipped version:** 1.18.0~ynh1
**Demo:** https://fluffychat.im/web

View file

@ -1,5 +1,5 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
It shall NOT be edited by hand.
-->
@ -16,9 +16,11 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
## Vue densemble
[FluffyChat](https://fluffychat.im) est un client [[matrix](https://matrix.org)] open-source, à but non lucratif et mignon écrit en [Flutter](https://flutter.dev). Le but de cette app est de créer un client de messagerie instantannée facile d'utilisation, open-source et accessible pour tout le monde.
FluffyChat est un client [[matrix](https://matrix.org)] open-source, à but non lucratif et mignon écrit en [Flutter](https://flutter.dev).
Le but de cette app est de créer un client de messagerie instantannée facile d'utilisation, open-source et accessible pour tout le monde.
**Version incluse :** 1.17.3~ynh1
**Version incluse :** 1.18.0~ynh1
**Démo :** https://fluffychat.im/web

25
config_panel.toml Normal file
View file

@ -0,0 +1,25 @@
version = "1.0"
[main]
name.en = "Config panel"
name.fr = "Panneau de configuration"
help = "Here you can easily configure some things about your Fluffychat instance."
####################
#### FLUFFYCHAT CONFIG
####################
[main.fluffychat]
name = "Fluffychat config"
help = "The changes may not appear if you do not clear your browser's cache."
[main.fluffychat.default_matrix_server]
ask.en = "Default Matrix server?"
ask.fr = "Serveur Matrix par défaut ?"
help.en = "This option changes the default Matrix server on the Fluffychat login page."
help.fr = "Cette option modifie le serveur Matrix renseigné par défaut sur la page de connexion de Fluffychat."
type = "string"
pattern.regexp = '^(?!\.)^(\.?[-a-zA-Z0-9]){1,256}(\.[a-zA-Z0-9]{1,6}){1}$'
pattern.error = "Must be a domain name or a sub-domain. Must not start with 'http://' or 'https://'."

View file

@ -1 +1,2 @@
FluffyChat is an open source, nonprofit and cute [[matrix](https://matrix.org)] client written in [Flutter](https://flutter.dev). The goal of the app is to create an easy to use instant messenger which is open source and accessible for everyone.
FluffyChat is an open source, nonprofit and cute [[matrix](https://matrix.org)] client written in [Flutter](https://flutter.dev).
The goal of the app is to create an easy to use instant messenger which is open source and accessible for everyone.

View file

@ -1 +1,2 @@
[FluffyChat](https://fluffychat.im) est un client [[matrix](https://matrix.org)] open-source, à but non lucratif et mignon écrit en [Flutter](https://flutter.dev). Le but de cette app est de créer un client de messagerie instantannée facile d'utilisation, open-source et accessible pour tout le monde.
FluffyChat est un client [[matrix](https://matrix.org)] open-source, à but non lucratif et mignon écrit en [Flutter](https://flutter.dev).
Le but de cette app est de créer un client de messagerie instantannée facile d'utilisation, open-source et accessible pour tout le monde.

View file

@ -0,0 +1,2 @@
Starting with this update, you can configure Fluffychat using the config panel integrated in Yunohost, you will find it in the web admin interface of your Yunohost by following these steps:
`Applications > Fluffychat > Config Panel`

View file

@ -7,7 +7,7 @@ name = "Fluffychat"
description.en = "Matrix messenger client"
description.fr = "Client de messagerie Matrix"
version = "1.17.3~ynh1"
version = "1.18.0~ynh1"
maintainers = [ "OniriCorpe" ]
@ -45,14 +45,17 @@ ram.runtime = "50M"
type = "group"
default = "visitors"
[install.default_matrix_server]
ask.en = "Default Matrix server"
help.en = "Must be a domain name or a sub-domain. Must not contain a path."
type = "url"
default = "matrix.org"
[resources]
[resources.sources]
[resources.sources.main]
url = "https://github.com/krille-chan/fluffychat/releases/download/v1.17.3/fluffychat-web.tar.gz"
sha256 = "cd88c8d6aaf1c90ddba1b69696eda8212d7d529d2c1f5f6943a589621ae38ca9"
url = "https://github.com/krille-chan/fluffychat/releases/download/v1.18.0/fluffychat-web.tar.gz"
sha256 = "0b9fbc74e1098c3df966dd1b689ec16bef5aa3e83cecb7d3f408a5fab6128cf7"
in_subdir = 2
autoupdate.asset = "fluffychat-web.tar.gz"

43
scripts/config Normal file
View file

@ -0,0 +1,43 @@
#!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
#=================================================
# SPECIFIC GETTERS
#=================================================
get__default_matrix_server() {
default_matrix_server=$(ynh_app_setting_get --app="$app" --key=default_matrix_server)
echo "$default_matrix_server"
}
#=================================================
# SPECIFIC SETTERS
#=================================================
set__default_matrix_server() {
# patching main.dart.js to replace the default matrix server
ynh_replace_string --match_string="\$\.cmx=\".*\"" --replace_string="\$\.cmx=\"$default_matrix_server\"" --target_file="$install_dir/main.dart.js"
ynh_app_setting_set --app="$app" --key=default_matrix_server --value="$default_matrix_server"
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run "$1"

View file

@ -9,6 +9,16 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# INITIALIZE AND STORE SETTINGS
#=================================================
# remove the 'https://' part
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"
#=================================================
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
#=================================================
@ -23,6 +33,9 @@ ynh_setup_source --dest_dir="$install_dir"
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="\$\.cmx=\"matrix.org\"" --replace_string="\$\.cmx=\"$default_matrix_server\"" --target_file="$install_dir/main.dart.js"
chown -R "www-data:www-data" "$install_dir"
#=================================================

View file

@ -11,6 +11,12 @@ 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
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
@ -27,6 +33,9 @@ then
# 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="\$\.cmx=\".*\"" --replace_string="\$\.cmx=\"$default_matrix_server\"" --target_file="$install_dir/main.dart.js"
fi
chown -R "www-data:www-data" "$install_dir"