WIP: doc XMPP
This commit is contained in:
parent
1626f7e2ac
commit
4e44b675a0
286
README.md
286
README.md
|
@ -36,13 +36,293 @@ sudo ejabberdctl reload_config
|
|||
|
||||
Le débogage peut se faire à l'aide du fichier journal `/var/log/ejabberd/ejabberd.log`.
|
||||
|
||||
## Configuration du serveur
|
||||
## Installation de Biboumi
|
||||
|
||||
On installe le paquet `biboumi` depuis les dépôts de Debian stable.
|
||||
|
||||
```
|
||||
sudo apt install biboumi
|
||||
```
|
||||
|
||||
On crée un utilisateur et un rôle pour psql :
|
||||
|
||||
```
|
||||
sudo adduser _biboumi
|
||||
sudo -u _biboumi psql
|
||||
CREATE ROLE biboumi LOGIN PASSWORD '***masqué***';
|
||||
```
|
||||
|
||||
On configure ensuite dans `/etc/biboumi/biboumi.cfg`.
|
||||
|
||||
## Configuration de ejabberd et Biboumi
|
||||
|
||||
Afin de pouvoir réaliser des statistiques sur l'utilisation des appels audio/vidéo, on renforce la verbosité tout en masquant le maximum de données privées.
|
||||
|
||||
```
|
||||
# loglevel: Verbosity of log files generated by ejabberd
|
||||
loglevel: info
|
||||
hide_sensitive_log_data: true
|
||||
```
|
||||
|
||||
On paramètre les domaines couverts par le service.
|
||||
|
||||
```
|
||||
hosts:
|
||||
- chalec.org
|
||||
```
|
||||
|
||||
On indique l'emplacement des certificats (préalablement créés avec certbot) et on désactive le système interne de demande de certificat.
|
||||
|
||||
```
|
||||
certfiles:
|
||||
- /etc/letsencrypt/live/xmpp.chalec.org/fullchain.pem
|
||||
- /etc/letsencrypt/live/xmpp.chalec.org/privkey.pem
|
||||
- /etc/letsencrypt/live/chalec.org/fullchain.pem
|
||||
- /etc/letsencrypt/live/chalec.org/privkey.pem
|
||||
|
||||
acme:
|
||||
auto: false
|
||||
```
|
||||
|
||||
On peut alors paramétrer les différents modules du service XMPP, c'est à dire le C2S, le S2S, TURN/STUN pour les appels audio/vidéo ainsi que Biboumi (irc.chalec.org)
|
||||
|
||||
```
|
||||
listen:
|
||||
-
|
||||
port: 5222
|
||||
ip: "::"
|
||||
module: ejabberd_c2s
|
||||
max_stanza_size: 262144
|
||||
shaper: c2s_shaper
|
||||
access: c2s
|
||||
starttls_required: true
|
||||
protocol_options: 'TLS_OPTIONS'
|
||||
-
|
||||
port: 5223
|
||||
ip: "::"
|
||||
module: ejabberd_c2s
|
||||
max_stanza_size: 262144
|
||||
shaper: c2s_shaper
|
||||
access: c2s
|
||||
tls: true
|
||||
protocol_options: 'TLS_OPTIONS'
|
||||
-
|
||||
port: 5269
|
||||
ip: "::"
|
||||
module: ejabberd_s2s_in
|
||||
max_stanza_size: 524288
|
||||
-
|
||||
port: 5444
|
||||
ip: "::"
|
||||
module: ejabberd_http
|
||||
tls: true
|
||||
protocol_options: 'TLS_OPTIONS'
|
||||
request_handlers:
|
||||
/api: mod_http_api
|
||||
/bosh: mod_bosh
|
||||
/captcha: ejabberd_captcha
|
||||
/upload: mod_http_upload
|
||||
/ws: ejabberd_http_ws
|
||||
-
|
||||
port: 8888
|
||||
ip: "127.0.0.1"
|
||||
module: ejabberd_service
|
||||
access: all
|
||||
hosts:
|
||||
"irc.chalec.org":
|
||||
password: ***masqué***
|
||||
-
|
||||
port: 5280
|
||||
ip: "::"
|
||||
module: ejabberd_http
|
||||
tls: true
|
||||
protocol_options: 'TLS_OPTIONS'
|
||||
request_handlers:
|
||||
/admin: ejabberd_web_admin
|
||||
/.well-known/acme-challenge: ejabberd_acme
|
||||
|
||||
# PUBLIC TURN
|
||||
-
|
||||
port: 3475
|
||||
ip: "::"
|
||||
transport: udp
|
||||
module: ejabberd_stun
|
||||
use_turn: true
|
||||
auth_type: anonymous
|
||||
#auth_realm:
|
||||
turn_ipv4_address: PUBLIC_IPV4
|
||||
turn_ipv6_address: PUBLIC_IPV6
|
||||
-
|
||||
port: 3475
|
||||
ip: "::"
|
||||
transport: tcp
|
||||
module: ejabberd_stun
|
||||
use_turn: true
|
||||
auth_type: anonymous
|
||||
#auth_realm:
|
||||
turn_ipv4_address: PUBLIC_IPV4
|
||||
turn_ipv6_address: PUBLIC_IPV6
|
||||
|
||||
-
|
||||
port: 3478
|
||||
ip: "::"
|
||||
transport: udp
|
||||
module: ejabberd_stun
|
||||
use_turn: true
|
||||
#auth_type: anonymous
|
||||
auth_realm: chalec.org
|
||||
turn_ipv4_address: PUBLIC_IPV4
|
||||
turn_ipv6_address: PUBLIC_IPV6
|
||||
-
|
||||
port: 3478
|
||||
ip: "::"
|
||||
transport: tcp
|
||||
module: ejabberd_stun
|
||||
use_turn: true
|
||||
#auth_type: anonymous
|
||||
auth_realm: chalec.org
|
||||
turn_ipv4_address: PUBLIC_IPV4
|
||||
turn_ipv6_address: PUBLIC_IPV6
|
||||
```
|
||||
|
||||
On active SCRAM pour les mots de passes utilisateurs et STARTTLS pour les connexions S2S.
|
||||
|
||||
```
|
||||
s2s_use_starttls: required
|
||||
|
||||
## Store the plain passwords or hashed for SCRAM:
|
||||
auth_password_format: scram
|
||||
```
|
||||
|
||||
On met aussi en place la connexion à la base de données pour ejabberd.
|
||||
|
||||
```
|
||||
auth_method: sql
|
||||
|
||||
sql_type: pgsql
|
||||
sql_server: "localhost"
|
||||
sql_database: "ejabberd"
|
||||
sql_username: "ejabberd"
|
||||
sql_password: "87Dd8fb4y866Z5ASj5utP8oK"
|
||||
|
||||
|
||||
sql_pool_size: 10
|
||||
new_sql_schema: true
|
||||
default_db: sql
|
||||
```
|
||||
|
||||
On paramètre notre système de génération de captcha.
|
||||
|
||||
```
|
||||
## Full path to a script that generates the image.
|
||||
captcha_cmd: "/opt/chalec-xmpp-outils/captcha/captcha.sh"
|
||||
captcha_url: https://xmpp.chalec.org:5444/captcha
|
||||
registration_timeout: 60
|
||||
```
|
||||
|
||||
On active l'inscription "in-band".
|
||||
|
||||
```
|
||||
mod_register:
|
||||
## Only accept registration requests from the "trusted"
|
||||
## network (see access_rules section above).
|
||||
## Think twice before enabling registration from any
|
||||
## address. See the Jabber SPAM Manifesto for details:
|
||||
## https://github.com/ge0rg/jabber-spam-fighting-manifesto
|
||||
ip_access: all
|
||||
access: chalec_server
|
||||
captcha_protected: true
|
||||
registration_watchers: [admin@chalec.org, neox@chalec.org]
|
||||
welcome_message:
|
||||
subject: Message de bienvenue
|
||||
body: "Salut! Nous vous souhaitons la bienvenue sur l'instance XMPP de Chalec,
|
||||
|
||||
opérée par l'association Libre en Communs !
|
||||
|
||||
|
||||
Pour plus d'informations sur nos actions : https://www.a-lec.org
|
||||
|
||||
Vous pouvez également rejoindre le salon public de l'association ici : xmpp:a-lec@salons.a-lec.org?join
|
||||
|
||||
|
||||
Vous souhaitant un bon usage de nos services,
|
||||
|
||||
Librement,
|
||||
|
||||
|
||||
L'équipe de Chalec."
|
||||
|
||||
```
|
||||
|
||||
On paramètre les quotas pour le téléversement de fichiers.
|
||||
|
||||
```
|
||||
shaper_rules:
|
||||
max_user_sessions: 10
|
||||
max_user_offline_messages:
|
||||
5000: admin
|
||||
500: all
|
||||
c2s_shaper:
|
||||
none: admin
|
||||
normal: all
|
||||
s2s_shaper: fast
|
||||
soft_upload_quota: #MiB
|
||||
250: all
|
||||
hard_upload_quota: #MiB
|
||||
255: all
|
||||
|
||||
|
||||
mod_http_upload:
|
||||
hosts: ["xmpp.@HOST@"]
|
||||
put_url: "https://xmpp.@HOST@:5444/upload"
|
||||
get_url: "https://xmpp.@HOST@:5444/upload"
|
||||
docroot: /var/www/upload
|
||||
max_size: 262144000 # 250 MB
|
||||
file_mode: "0644"
|
||||
dir_mode: "2755"
|
||||
secret_length: 20
|
||||
jid_in_url: sha1
|
||||
custom_headers:
|
||||
"Access-Control-Allow-Origin": "https://@HOST@"
|
||||
"Access-Control-Allow-Methods": "GET,HEAD,PUT,OPTIONS"
|
||||
"Access-Control-Allow-Headers": "Content-Type"
|
||||
mod_http_upload_quota:
|
||||
max_days: 30
|
||||
```
|
||||
|
||||
Et enfin, pour que les appels audio/vidéo fonctionnent correctement :
|
||||
|
||||
```
|
||||
mod_stun_disco: {}
|
||||
```
|
||||
|
||||
Note : il faut penser également à paramétrer un compte administrateur dans la section `acl`.
|
||||
|
||||
Pour Biboumi il faut configurer la connexion à la base de données (créer un utilisateur dédié dans pgsql est le mieux à faire). On paramètre aussi la customisation des noms d'utilisateurs pour que les utilisateurs puissent changer de nick sur IRC. On rend les canaux IRC persistants pour que l'historique soit enregistré lorsque l'utilisateur est hors-ligne (effet BNC/ZNC).
|
||||
|
||||
```
|
||||
hostname=irc.chalec.org
|
||||
password=***masqué***
|
||||
|
||||
xmpp_server_ip=127.0.0.1
|
||||
port=8888
|
||||
|
||||
admin=admin@chalec.org
|
||||
realname_customization=true
|
||||
realname_from_jid=true
|
||||
persistent_by_default=true
|
||||
|
||||
ca_file=
|
||||
outgoing_bind=
|
||||
|
||||
log_level=1
|
||||
db_name=postgresql://_biboumi:***masqué***@localhost
|
||||
```
|
||||
|
||||
## Création d'un premier compte
|
||||
|
||||
```
|
||||
sudo ejabberdctl register pseudo@chalec.org
|
||||
sudo ejabberdctl register admin@chalec.org mot_de_passe
|
||||
```
|
||||
|
||||
## Installation de Biboumi
|
||||
|
||||
|
|
Loading…
Reference in New Issue