1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh.git synced 2024-09-03 19:46:01 +02:00
This commit is contained in:
gredin67 2023-01-19 12:49:24 +01:00
parent b99c05e5e7
commit b0d3c95bc1
3 changed files with 13 additions and 22 deletions

View file

@ -5,33 +5,33 @@ name = "Main Settings"
services = ["__APP__"] services = ["__APP__"]
[main.permissions] [main.permissions]
name = "Permissions for using the bridge." name = "Permissions for using the bridge"
[main.permissions.helptext] [main.permissions.helptext]
ask = ''' ask = '''
Allowed values: Roles with Increasing Power: Relay<User<Admin
Allowed values for roles:
- * : All Matrix users - * : All Matrix users
- domain.tld : All users on a given homeserver - domain.tld : All users on a given homeserver
- mxid (@user:matrix.org) : Specific Matrix user - mxid (@user:matrix.org) : Specific Matrix user
Increasing Power: Relay<User<Admin
''' '''
type = "markdown" type = "markdown"
[main.permissions.listrelay] [main.permissions.listrelay]
ask = "Users bridged thanks to Relay Mode" ask = "Users bridged thanks to Relay Mode"
type = "tags" type = "tags"
help = "Talk on WhatsApp through the RelayBot in a room where it's activated '!wa set-relay', no access otherwise." help = "Relay Role: Talk on WhatsApp through the RelayBot in a room where it has been activated with '!wa set-relay', no access otherwise."
visible = "enable_relaybot" visible = "enable_relaybot"
[main.permissions.listuser] [main.permissions.listuser]
ask = "Bridge Users" ask = "Bridge Users"
type = "tags" type = "tags"
help = "Access to use the bridge to chat with a WhatsApp account." help = "User Role: Access to use the bridge to chat with a WhatsApp account."
[main.permissions.listadmin] [main.permissions.listadmin]
ask = "Bridge Administrators" ask = "Bridge Administrators"
type = "tags" type = "tags"
help = "User level and some additional administration tools." help = "Admin Role: User level and some additional administration tools."
[main.bridge] [main.bridge]
name = "Puppetting Bridge Settings" name = "Puppetting Bridge Settings"
@ -71,7 +71,7 @@ services = ["__APP__"]
[main.bot.avatar] [main.bot.avatar]
ask = "Avatar for Bot" ask = "Avatar for Bot"
type = "string" type = "string"
help = "Should be in format 'mxc://__SERVER_NAME__/NeXNQarUbrlYBiPCpprYsRqr', see README for tutorial. Set to 'remove' to remove avatar, leave empty to use standard WhatsApp logo." help = "Should be in format 'mxc://server_name/NeXNQarUbrlYBiPCpprYsRqr', see README for tutorial. Set to 'remove' to remove avatar, leave empty to use standard WhatsApp logo."
bind = ":__FINALPATH__/config.yaml" bind = ":__FINALPATH__/config.yaml"
[privacy] [privacy]
@ -83,12 +83,14 @@ services = ["__APP__"]
[privacy.portal_rooms.text] [privacy.portal_rooms.text]
ask = ''' ask = '''
!! Inviting the Bridge in an encrypted room **breaks End-to-End Encryption (e2ee)** !! Messages will be unencrypted on the Bridge Server! !! Inviting the Bridge in an encrypted room !!
!! breaks real End-to-End Encryption (e2ee) !!
!! Messages will be unencrypted on the Bridge Server !!
''' '''
type = "markdown" type = "markdown"
[privacy.portal_rooms.encryption] [privacy.portal_rooms.encryption]
ask = "Allow Encryption from Matrix Client to Bridge Server?" ask = "Allow Encryption between Matrix Client and Bridge Server?"
type = "boolean" type = "boolean"
yes = "true" yes = "true"
no = "false" no = "false"

View file

@ -69,7 +69,7 @@ url_previews="false"
encryption_default="false" encryption_default="false"
encryption_require="false" encryption_require="false"
admin_only="true" admin_only="true"
print_level="INFO" print_level="info"
enable_relaybot="true" enable_relaybot="true"
listrelay="*" listrelay="*"

View file

@ -180,7 +180,7 @@ then
fi fi
if [ -z "$print_level" ] if [ -z "$print_level" ]
then then
print_level="INFO" print_level="info"
ynh_app_setting_set --app=$app --key=print_level --value=$print_level ynh_app_setting_set --app=$app --key=print_level --value=$print_level
fi fi
if [ -z "$listrelay" ] if [ -z "$listrelay" ]
@ -253,17 +253,6 @@ ynh_script_progression --message="Updating a configuration file..." --weight=2
ynh_add_config --template="../conf/config.yaml" --destination="$final_path/config.yaml" ynh_add_config --template="../conf/config.yaml" --destination="$final_path/config.yaml"
# Re-apply permissions to avoid wrong syntax "domain.tld,domain2.tld: admin"
# x="$(yunohost app config get mautrix_whatsapp main.permissions.listuser)"
# yunohost app config set mautrix_whatsapp main.permissions.listuser -v ""
# yunohost app config set mautrix_whatsapp main.permissions.listuser -v "$x"
# x="$(yunohost app config get mautrix_whatsapp main.permissions.listrelay)"
# yunohost app config set mautrix_whatsapp main.permissions.listrelay -v ""
# yunohost app config set mautrix_whatsapp main.permissions.listrelay -v "$x"
# x="$(yunohost app config get mautrix_whatsapp main.permissions.listadmin)"
# yunohost app config set mautrix_whatsapp main.permissions.listadmin -v ""
# yunohost app config set mautrix_whatsapp main.permissions.listadmin -v "$x"
chmod 400 "$final_path/config.yaml" chmod 400 "$final_path/config.yaml"
chown $app:$app "$final_path/config.yaml" chown $app:$app "$final_path/config.yaml"