mirror of
https://github.com/YunoHost-Apps/mautrix_discord_ynh.git
synced 2024-09-03 19:36:35 +02:00
Add config panel and remove change_url
This commit is contained in:
parent
b2053a92f5
commit
28ad7505f8
4 changed files with 76 additions and 50 deletions
73
config_panel.toml
Normal file
73
config_panel.toml
Normal file
|
@ -0,0 +1,73 @@
|
|||
version = "1.0"
|
||||
|
||||
[main]
|
||||
name = "Main Settings"
|
||||
services = ["__APP__"]
|
||||
|
||||
[main.permissions]
|
||||
name = "Permissions for using the bridge"
|
||||
|
||||
[main.permissions.helptext]
|
||||
ask = '''
|
||||
Roles with Increasing Power: Relay<User<Admin
|
||||
Allowed values for roles:
|
||||
- * : All Matrix users
|
||||
- domain.tld : All users on a given homeserver
|
||||
- mxid (@user:matrix.org) : Specific Matrix user
|
||||
'''
|
||||
type = "markdown"
|
||||
|
||||
[main.permissions.listrelay]
|
||||
ask = "Users bridged thanks to Relay Mode"
|
||||
type = "tags"
|
||||
help = "Relay Role: Talk on WhatsApp through the RelayBot in a room where it has been activated with '!wa set-relay', no access otherwise."
|
||||
|
||||
[main.permissions.listuser]
|
||||
ask = "Bridge Users"
|
||||
type = "tags"
|
||||
help = "User Role: Access to use the bridge to chat with a WhatsApp account."
|
||||
|
||||
[main.permissions.listadmin]
|
||||
ask = "Bridge Administrators"
|
||||
type = "tags"
|
||||
help = "Admin Role: User level and some additional administration tools."
|
||||
|
||||
[main.bridge]
|
||||
name = "Puppetting Bridge Settings"
|
||||
|
||||
[main.bridge.enable_relaybot]
|
||||
ask = "Should Relay Mode be allowed?"
|
||||
type = "boolean"
|
||||
yes = "true"
|
||||
no = "false"
|
||||
help = "If allowed, '!wa set-relay' can be used to turn any Bridge User into a RelayBot for that chat. This allows people to talk on WhatsApp without an own account."
|
||||
bind = "relay>enabled:__INSTALL_DIR__/config.yaml"
|
||||
|
||||
[main.bridge.admin_only]
|
||||
ask = "Should only Bridge Admins be allowed to set themselves as Relay Users?"
|
||||
type = "boolean"
|
||||
yes = "true"
|
||||
no = "false"
|
||||
help = "See User management -> Admins"
|
||||
bind = ":__INSTALL_DIR__/config.yaml"
|
||||
|
||||
[main.bot]
|
||||
name = "Robot Settings"
|
||||
|
||||
[main.bot.botname]
|
||||
ask = "Username of the AppService Bot"
|
||||
type = "string"
|
||||
help = "Sets bot username. Please keep in mind that the bot admin room for previous bot username will stop working so you may need to create a new one using the new username"
|
||||
bind = "bot>username:__INSTALL_DIR__/config.yaml"
|
||||
|
||||
[main.bot.displayname]
|
||||
ask = "Display name for Bot"
|
||||
type = "string"
|
||||
help = "Set to 'remove' to remove display name, leave empty to set default 'WhatsApp bridge bot'"
|
||||
bind = ":__INSTALL_DIR__/config.yaml"
|
||||
|
||||
[main.bot.avatar]
|
||||
ask = "Avatar for Bot"
|
||||
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."
|
||||
bind = ":__INSTALL_DIR__/config.yaml"
|
Binary file not shown.
Before Width: | Height: | Size: 35 KiB |
|
@ -1,47 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||
|
||||
ynh_change_url_nginx_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC MODIFICATIONS
|
||||
#=================================================
|
||||
# ...
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
Loading…
Reference in a new issue