Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Manifestv2 #18

Open
wants to merge 2 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,18 @@ This is a discord puppeting bridge for matrix. It handles bridging private and g
See <https://gitlab.com/mx-puppet/discord/mx-puppet-discord> for documentation.


**Shipped version:** 0.1.7~ynh4
**Shipped version:** 0.1.7~ynh5

## Screenshots

![Screenshot of Matrix-Discord bridge](./doc/screenshots/example.jpg)

## Disclaimers / important information

After the install is complete, start a chat with `@_discordpuppet_bot:yourserver.com`. When it joins, type `help` in the chat to see instructions.

You also may modify the `/etc/matrix-puppet-discord/user.config.yaml` file to customize some configuration (like permissions to use the bridge). Ensure then to restart the bridge (`systemctl restart matrix-puppet-discord`).

## :red_circle: Antifeatures

- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc.

## Documentation and resources

- Official app website: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Official admin documentation: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Upstream app code repository: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- YunoHost Store: <https://apps.yunohost.org/app/matrix-puppet-discord>
Expand Down
9 changes: 1 addition & 8 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,18 @@ Ceci est une passerelle vers Discord pour Matrix. Il gère la messagerie privée
Voir la documentation sur <https://gitlab.com/mx-puppet/discord/mx-puppet-discord> (en anglais).


**Version incluse :** 0.1.7~ynh4
**Version incluse :** 0.1.7~ynh5

## Captures d’écran

![Capture d’écran de Matrix-Discord bridge](./doc/screenshots/example.jpg)

## Avertissements / informations importantes

Après l'installation, lancer une conversation privée avec `@_discordpuppet_bot:yourserver.com`. Ensuite, entrer `help` dans le chat pour lire les instructions.

Vous pouvez par ailleurs modifier le fichier `/etc/matrix-puppet-discord/user.config.yaml` pour personnaliser la configuration (notamment les permissions pour utiliser la passerelle). Redémarrez bien ensuite la passerelle pour que les modifications soient effectives (`systemctl restart matrix-puppet-discord`).

## :red_circle: Anti-fonctionnalités

- **Application non maintenue**: Ce logiciel n'est plus maintenu. Attendez-vous à ce qu'il ne fonctionne plus avec le temps, et que l'on découvre des failles de sécurité qui ne seront pas corrigées, etc.

## Documentations et ressources

- Site officiel de l’app : <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Documentation officielle de l’admin : <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Dépôt de code officiel de l’app : <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- YunoHost Store : <https://apps.yunohost.org/app/matrix-puppet-discord>
Expand Down
9 changes: 1 addition & 8 deletions README_gl.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,18 @@ This is a discord puppeting bridge for matrix. It handles bridging private and g
See <https://gitlab.com/mx-puppet/discord/mx-puppet-discord> for documentation.


**Versión proporcionada:** 0.1.7~ynh4
**Versión proporcionada:** 0.1.7~ynh5

## Capturas de pantalla

![Captura de pantalla de Matrix-Discord bridge](./doc/screenshots/example.jpg)

## Avisos / información importante

After the install is complete, start a chat with `@_discordpuppet_bot:yourserver.com`. When it joins, type `help` in the chat to see instructions.

You also may modify the `/etc/matrix-puppet-discord/user.config.yaml` file to customize some configuration (like permissions to use the bridge). Ensure then to restart the bridge (`systemctl restart matrix-puppet-discord`).

## :red_circle: Caraterísticas cuestionables

- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc.

## Documentación e recursos

- Web oficial da app: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Documentación oficial para admin: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Repositorio de orixe do código: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Tenda YunoHost: <https://apps.yunohost.org/app/matrix-puppet-discord>
Expand Down
9 changes: 1 addition & 8 deletions README_it.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,18 @@ This is a discord puppeting bridge for matrix. It handles bridging private and g
See <https://gitlab.com/mx-puppet/discord/mx-puppet-discord> for documentation.


**Versione pubblicata:** 0.1.7~ynh4
**Versione pubblicata:** 0.1.7~ynh5

## Screenshot

![Screenshot di Matrix-Discord bridge](./doc/screenshots/example.jpg)

## Attenzione/informazioni importanti

After the install is complete, start a chat with `@_discordpuppet_bot:yourserver.com`. When it joins, type `help` in the chat to see instructions.

You also may modify the `/etc/matrix-puppet-discord/user.config.yaml` file to customize some configuration (like permissions to use the bridge). Ensure then to restart the bridge (`systemctl restart matrix-puppet-discord`).

## :red_circle: Anti-funzionalità

- **Applicazione non mantenuta**: Questo software non è più mantenuto. Ci si può aspettare che con il passare del tempo smetta di funzionare, sia esposto a falle di sicurezza, ecc.

## Documentazione e risorse

- Sito web ufficiale dell’app: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Documentazione ufficiale per gli amministratori: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Repository upstream del codice dell’app: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord>
- Store di YunoHost: <https://apps.yunohost.org/app/matrix-puppet-discord>
Expand Down
25 changes: 0 additions & 25 deletions check_process

This file was deleted.

7 changes: 0 additions & 7 deletions conf/app.src

This file was deleted.

2 changes: 1 addition & 1 deletion conf/base.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ logging:
# Log files are rotated daily by default
files:
# Log file path
- file: "__LOG_PATH__/bridge.log" # Will capture logs from DiscordBot
- file: "/var/log/__APP__/bridge.log" # Will capture logs from DiscordBot
# Log level for this file
#
# Allowed values starting with most verbose:
Expand Down
6 changes: 3 additions & 3 deletions conf/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
set -o errexit
set -o nounset

echo <<EOF > __FINALPATH__/config.yaml
echo <<EOF > __INSTALL_DIR__/config.yaml
# /!\ FILE GENERATED AUTOMATICALLY BEFORE EACH SERVICE RESTART
# CONSIDER EDITING /etc/__APP__/user.config.yaml
EOF

__PIP_PATH__/bin/yq -y -s '.[0] * .[1]' __FINALPATH__/base.config.yaml /etc/__APP__/user.config.yaml > __FINALPATH__/config.yaml
__INSTALL_DIR__/venv/bin/yq -y -s '.[0] * .[1]' __INSTALL_DIR__/base.config.yaml /etc/__APP__/user.config.yaml > __INSTALL_DIR__/config.yaml

__YNH_NPM__ start -- -c config.yaml $@
__YNH_NPM__ start -- -c config.yaml "$@"
4 changes: 2 additions & 2 deletions conf/systemd.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Environment=NODE_ENV=production
Environment="__YNH_NODE_LOAD_PATH__"
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/
ExecStart=__FINALPATH__/run.sh -f __APP__.yaml
WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/run.sh -f __APP__.yaml
StandardOutput=syslog
StandardError=syslog

Expand Down
4 changes: 2 additions & 2 deletions conf/user.config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# You can edit this file.
# This will override the configuration contained in the __FINALPATH__/base.config.yaml file.
# Don't hesitate to take a look at __FINALPATH__/sample.config.yaml to see all the available options.
# This will override the configuration contained in the __INSTALL_DIR__/base.config.yaml file.
# Don't hesitate to take a look at __INSTALL_DIR__/sample.config.yaml to see all the available options.
# Then, in order to take into account the changes, run: systemctl restart __APP__

provisioning:
Expand Down
File renamed without changes.
File renamed without changes.
47 changes: 0 additions & 47 deletions manifest.json

This file was deleted.

65 changes: 65 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json

packaging_format = 2

id = "matrix-puppet-discord"
name = "Matrix-Discord bridge"
description.en = "Discord puppeting bridge for Matrix/Synapse."
description.fr = "Passerelle Discord pour Matrix/Synapse."

version = "0.1.7~ynh5"

maintainers = ["fflorent"]

[upstream]
license = "Apache-2.0"
admindoc = "https://gitlab.com/mx-puppet/discord/mx-puppet-discord"
code = "https://gitlab.com/mx-puppet/discord/mx-puppet-discord"
fund = "https://liberapay.com/Sorunome/donate"

[integration]
yunohost = ">= 11.2"
architectures = "all"
multi_instance = true
ldap = "not_releant"
sso = "not_releant"
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...

[install.synapsenumber]
ask.en = "Choose the local synapse instance number to communicate with the Discord-Matrix bridge"
ask.fr = "Choisissez le numéro de l'instance synapse qui doit communiquer avec la passerelle Discord-Matrix"
help.en = "If you installed synapse only once time, then leave default value 1."
help.fr = "Si vous n'avez installé qu'une fois synapse, gardez la valeur par défaut 1."
type = "string"
example = "2 (for instance synapse__2)"
default = "1"

[resources]
[resources.sources.main]
url = "https://gitlab.com/mx-puppet/discord/mx-puppet-discord/-/archive/fd4402268e9a8b942ca632f3337702862e06d24f/mx-puppet-discord-master.tar.gz"
sha256 = "b0edc4dfe9d3670eb8b53dc229a8fd7fb794ada5fe1f3d3ba4c38b54ce5ca176"

autoupdate.strategy = "latest_gitlab_tag"

[resources.system_user]

[resources.install_dir]

[resources.permissions]

[resources.ports]

[resources.apt]
packages = [
"postgresql",
"libcairo2-dev",
"libpango1.0-dev",
"libjpeg-dev",
"libgif-dev",
"librsvg2-dev",
]

[resources.database]
type = "postgresql"
13 changes: 9 additions & 4 deletions scripts/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
# COMMON VARIABLES
#=================================================

# Node version
NODEJS_VERSION=12

# dependencies used by the app (must be on a single line)
pkg_dependencies="postgresql libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev"

#=================================================
# PERSONAL HELPERS
#=================================================

_venv_install() {
ynh_exec_as "$app" python3 -m venv --upgrade "$install_dir/venv"
venvpy="$install_dir/venv/bin/python3"

ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir pip

ynh_exec_as "$app" "$venvpy" -m pip install setuptools wheel pyyaml
}

#=================================================
# EXPERIMENTAL HELPERS
#=================================================
Expand Down
31 changes: 3 additions & 28 deletions scripts/backup
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
Expand All @@ -10,29 +8,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

#=================================================
# MANAGE SCRIPT FAILURE
#=================================================

ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."

app=$YNH_APP_INSTANCE_NAME

final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
log_path=$(ynh_app_setting_get --app=$app --key=log_path)
etc_path=$(ynh_app_setting_get --app=$app --key=etc_path)

#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
Expand All @@ -42,10 +17,10 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================

ynh_backup --src_path="$final_path"
ynh_backup --src_path="$install_dir"

#=================================================
# BACKUP SYSTEMD
# BACKUP SYSTEM FILES
#=================================================

ynh_backup --src_path="/etc/systemd/system/$app.service"
Expand All @@ -54,7 +29,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
# BACKUP VARIOUS FILES
#=================================================

ynh_backup --src_path="$log_path"
ynh_backup --src_path="/var/log/$app"
ynh_backup --src_path="$etc_path"

#=================================================
Expand Down