doc:appunti:linux:sa:matrix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:sa:matrix [2021/01/21 12:00] – [Client web] niccolo | doc:appunti:linux:sa:matrix [2024/03/27 14:04] – [Creazione di un account] niccolo | ||
---|---|---|---|
Line 155: | Line 155: | ||
openssl dhparam -out / | openssl dhparam -out / | ||
</ | </ | ||
+ | |||
+ | ===== Gestione utenti ===== | ||
==== Creazione di un account ==== | ==== Creazione di un account ==== | ||
Line 178: | Line 180: | ||
Success! | Success! | ||
</ | </ | ||
+ | |||
+ | ==== Reset password ==== | ||
+ | |||
+ | Generare un nuovo hash con il tool **hash_password** (incluso nel pacchetto Debian **matrix-synapse**): | ||
+ | |||
+ | < | ||
+ | hash_password -p MySecret | ||
+ | $2b$12$6Q.zARcyW0nnRzmmo8d1H.NblSGbj309lBevr/ | ||
+ | </ | ||
+ | |||
+ | Collegarsi al database di backend, individuare l' | ||
+ | |||
+ | <code sql> | ||
+ | SELECT name FROM users; | ||
+ | SET password_hash=' | ||
+ | WHERE name=' | ||
+ | </ | ||
+ | |||
==== Configurazione del DNS ==== | ==== Configurazione del DNS ==== | ||
Line 309: | Line 329: | ||
===== Migrazione da SQLite a Postgres ===== | ===== Migrazione da SQLite a Postgres ===== | ||
- | L' | + | L' |
+ | |||
+ | Verificate che siano installati i pacchetti Debian: | ||
+ | |||
+ | * **postgresql** - Object-relational SQL database | ||
+ | * **python3-psycopg2** - Python 3 module for PostgreSQL | ||
+ | * **libpq5** - PostgreSQL C client library | ||
+ | |||
+ | Cambiare utente in **postgres** ed eseguire nella shell **psql** i seguenti comandi SQL: | ||
+ | |||
+ | <code sql> | ||
+ | CREATE USER synapse_user PASSWORD ' | ||
+ | CREATE DATABASE synapse | ||
+ | ENCODING ' | ||
+ | LC_COLLATE=' | ||
+ | LC_CTYPE=' | ||
+ | template=template0 | ||
+ | OWNER synapse_user; | ||
+ | </ | ||
+ | |||
+ | Nel file di configurazione **/ | ||
+ | |||
+ | < | ||
+ | server_name: | ||
+ | </ | ||
+ | |||
+ | Preparare una nuova versione del file di configurazione **/ | ||
+ | |||
+ | < | ||
+ | # Database configuration | ||
+ | database: | ||
+ | name: " | ||
+ | args: | ||
+ | user: synapse_user | ||
+ | password: MyDbSecret | ||
+ | database: synapse | ||
+ | host: 127.0.0.1 | ||
+ | cp_min: 5 | ||
+ | cp_max: 10 | ||
+ | </ | ||
+ | |||
+ | Spostarsi nella directory **/ | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh -xe | ||
+ | cd / | ||
+ | systemctl stop matrix-synapse.service | ||
+ | synapse_port_db \ | ||
+ | --sqlite-database / | ||
+ | --postgres-config / | ||
+ | mv / | ||
+ | mv / | ||
+ | systemctl start matrix-synapse.service | ||
+ | </ | ||
+ | |||
+ | La nostra ricetta semplificata **tiene fermo il servizio Matrix per tutto il tempo della migrazione**. Con database di una certa dimensione questa operazione potrebbe richiedere diversi minuti; vedere le **[[https:// | ||
===== Web References ===== | ===== Web References ===== | ||
doc/appunti/linux/sa/matrix.txt · Last modified: 2024/04/15 14:46 by niccolo