xmppit:guide:installazione-server-prosody
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Prossima revisione | Revisione precedente | ||
xmppit:guide:installazione-server-prosody [2024/03/03 18:09] – creata mario | xmppit:guide:installazione-server-prosody [2024/06/16 17:02] (versione attuale) – del roughnecks | ||
---|---|---|---|
Linea 1: | Linea 1: | ||
- | ====== Guida Installazione Server Prosody ====== | ||
- | |||
- | Prosody è uno dei server XMPP più famosi in circolazione, | ||
- | Questa guida vi aiuterà nell' | ||
- | |||
- | ===== Installazione Pacchetti ===== | ||
- | |||
- | Cominciamo con l' | ||
- | |||
- | nano / | ||
- | | ||
- | Aggiungete una riga in fondo come questa: | ||
- | |||
- | deb http:// | ||
- | | ||
- | Salvate, aggiornate la lista pacchetti con 'apt update' | ||
- | |||
- | apt install prosody prosody-modules | ||
- | | ||
- | ===== Configurazione ===== | ||
- | |||
- | Questo è il file di configurazione che viene fornito dal pacchetto appena installato e che si trova in '/ | ||
- | |||
- | < | ||
- | lua | ||
- | -- Prosody Example Configuration File | ||
- | -- | ||
- | -- Information on configuring Prosody can be found on our | ||
- | -- website at https:// | ||
- | -- | ||
- | -- Tip: You can check that the syntax of this file is correct | ||
- | -- when you have finished by running this command: | ||
- | -- | ||
- | -- If there are any errors, it will let you know what and where | ||
- | -- they are, otherwise it will keep quiet. | ||
- | -- | ||
- | -- The only thing left to do is rename this file to remove the .dist ending, and fill in the | ||
- | -- blanks. Good luck, and happy Jabbering! | ||
- | |||
- | |||
- | ---------- Server-wide settings ---------- | ||
- | -- Settings in this section apply to the whole server and are the default settings | ||
- | -- for any virtual hosts | ||
- | |||
- | -- This is a (by default, empty) list of accounts that are admins | ||
- | -- for the server. Note that you must create the accounts separately | ||
- | -- (see https:// | ||
- | -- Example: admins = { " | ||
- | admins = { } | ||
- | |||
- | -- This option allows you to specify additional locations where Prosody | ||
- | -- will search first for modules. For additional modules you can install, see | ||
- | -- the community module repository at https:// | ||
- | -- For a local administrator it's common to place local modifications | ||
- | -- under /usr/local/ hierarchy: | ||
- | plugin_paths = { "/ | ||
- | |||
- | -- This is the list of modules Prosody will load on startup. | ||
- | -- Documentation for bundled modules can be found at: https:// | ||
- | modules_enabled = { | ||
- | |||
- | -- Generally required | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | |||
- | -- Not essential, but recommended | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | |||
- | -- Nice to have | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | --" | ||
- | --" | ||
- | |||
- | -- Admin interfaces | ||
- | " | ||
- | " | ||
- | |||
- | -- HTTP modules | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | |||
- | -- Other specific functionality | ||
- | " | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | --" | ||
- | } | ||
- | |||
- | -- These modules are auto-loaded, | ||
- | -- to disable them then uncomment them here: | ||
- | modules_disabled = { | ||
- | -- " | ||
- | -- " | ||
- | -- " | ||
- | } | ||
- | |||
- | -- Debian: | ||
- | -- | ||
- | -- is one of the few directories Prosody is allowed to write to | ||
- | -- | ||
- | pidfile = "/ | ||
- | |||
- | -- Server-to-server authentication | ||
- | -- Require valid certificates for server-to-server connections? | ||
- | -- If false, other methods such as dialback (DNS) may be used instead. | ||
- | |||
- | s2s_secure_auth = true | ||
- | |||
- | -- Some servers have invalid or self-signed certificates. You can list | ||
- | -- remote domains here that will not be required to authenticate using | ||
- | -- certificates. They will be authenticated using other methods instead, | ||
- | -- even when s2s_secure_auth is enabled. | ||
- | |||
- | --s2s_insecure_domains = { " | ||
- | |||
- | -- Even if you disable s2s_secure_auth, | ||
- | -- certificates for some domains by specifying a list here. | ||
- | |||
- | --s2s_secure_domains = { " | ||
- | |||
- | |||
- | -- Rate limits | ||
- | -- Enable rate limits for incoming client and server connections. These help | ||
- | -- protect from excessive resource consumption and denial-of-service attacks. | ||
- | |||
- | limits = { | ||
- | c2s = { | ||
- | rate = " | ||
- | }; | ||
- | s2sin = { | ||
- | rate = " | ||
- | }; | ||
- | } | ||
- | |||
- | -- Authentication | ||
- | -- Select the authentication backend to use. The ' | ||
- | -- use Prosody' | ||
- | -- For more information see https:// | ||
- | |||
- | authentication = " | ||
- | |||
- | -- Many authentication providers, including the default one, allow you to | ||
- | -- create user accounts via Prosody' | ||
- | -- documentation at https:// | ||
- | |||
- | |||
- | -- Storage | ||
- | -- Select the storage backend to use. By default Prosody uses flat files | ||
- | -- in its configured data directory, but it also supports more backends | ||
- | -- through modules. An " | ||
- | -- additional dependencies. See https:// | ||
- | |||
- | --storage = " | ||
- | -- lua-dbi-sqlite3, | ||
- | |||
- | -- For the " | ||
- | --sql = { driver = " | ||
- | --sql = { driver = " | ||
- | --sql = { driver = " | ||
- | |||
- | |||
- | -- Archiving configuration | ||
- | -- If mod_mam is enabled, Prosody will store a copy of every message. This | ||
- | -- is used to synchronize conversations between multiple clients, even if | ||
- | -- they are offline. This setting controls how long Prosody will keep | ||
- | -- messages in the archive before removing them. | ||
- | |||
- | archive_expires_after = " | ||
- | |||
- | -- You can also configure messages to be stored in-memory only. For more | ||
- | -- archiving options, see https:// | ||
- | |||
- | |||
- | -- Audio/video call relay (STUN/TURN) | ||
- | -- To ensure clients connected to the server can establish connections for | ||
- | -- low-latency media streaming (such as audio and video calls), it is | ||
- | -- recommended to run a STUN/TURN server for clients to use. If you do this, | ||
- | -- specify the details here so clients can discover it. | ||
- | -- Find more information at https:// | ||
- | |||
- | -- Specify the address of the TURN service (you may use the same domain as XMPP) | ||
- | --turn_external_host = " | ||
- | |||
- | -- This secret must be set to the same value in both Prosody and the TURN server | ||
- | --turn_external_secret = " | ||
- | |||
- | |||
- | -- Logging configuration | ||
- | -- For advanced logging see https:// | ||
- | -- | ||
- | -- Debian: | ||
- | -- Logs info and higher to /var/log | ||
- | -- Logs errors to syslog also | ||
- | log = { | ||
- | -- Log files (change ' | ||
- | info = "/ | ||
- | error = "/ | ||
- | -- Syslog: | ||
- | { levels = { " | ||
- | } | ||
- | |||
- | |||
- | -- Uncomment to enable statistics | ||
- | -- For more info see https:// | ||
- | -- statistics = " | ||
- | |||
- | |||
- | -- Certificates | ||
- | -- Every virtual host and component needs a certificate so that clients and | ||
- | -- servers can securely verify its identity. Prosody will automatically load | ||
- | -- certificates/ | ||
- | -- For more information, | ||
- | -- (from e.g. Let's Encrypt) see https:// | ||
- | |||
- | -- Location of directory to find certificates in (relative to main config file): | ||
- | certificates = " | ||
- | |||
- | ----------- Virtual hosts ----------- | ||
- | -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. | ||
- | -- Settings under each VirtualHost entry apply *only* to that host. | ||
- | -- It's customary to maintain VirtualHost entries in separate config files | ||
- | -- under / | ||
- | -- be found in / | ||
- | |||
- | ------ Additional config files ------ | ||
- | -- For organizational purposes you may prefer to add VirtualHost and | ||
- | -- Component definitions in their own config files. This line includes | ||
- | -- all config files in / | ||
- | |||
- | VirtualHost " | ||
- | -- Prosody requires at least one enabled VirtualHost to function. You can | ||
- | -- safely remove or disable ' | ||
- | |||
- | |||
- | --VirtualHost " | ||
- | |||
- | ------ Components ------ | ||
- | -- You can specify components to add hosts that provide special services, | ||
- | -- like multi-user conferences, | ||
- | -- For more information on components, see https:// | ||
- | |||
- | ---Set up a MUC (multi-user chat) room server on conference.example.com: | ||
- | --Component " | ||
- | --- Store MUC messages in an archive and allow users to access it | ||
- | --modules_enabled = { " | ||
- | |||
- | ---Set up a file sharing component | ||
- | --Component " | ||
- | |||
- | ---Set up an external component (default component port is 5347) | ||
- | -- | ||
- | -- External components allow adding various services, such as gateways/ | ||
- | -- bridges to non-XMPP networks and services. For more info | ||
- | -- see: https:// | ||
- | -- | ||
- | --Component " | ||
- | -- component_secret = " | ||
- | |||
- | Include " | ||
- | |||
- | ---------- End of the Prosody Configuration file ---------- | ||
- | -- You usually **DO NOT** want to add settings here at the end, as they would | ||
- | -- only apply to the last defined VirtualHost or Component. | ||
- | -- | ||
- | -- Settings for the global section should go higher up, before the first | ||
- | -- VirtualHost or Component line, while settings intended for specific hosts | ||
- | -- should go under the corresponding VirtualHost or Component line. | ||
- | -- | ||
- | -- For more information see https:// | ||
- | |||
- | </ | ||
- | |||
- | |||
- | La configurazione ha una sezione " | ||
- | |||
- | Ogni riga che inizia con due trattini " | ||
- | |||
- | L' | ||
- | |||
- | La configurazione di base è un' | ||
- | |||
- | Cominciamo col sistemare il nostro ' | ||
- | |||
- | Sostituite il valore " | ||
- | |||
- | virtualhost " | ||
- | | ||
- | Sotto questa riga andiamo a caricare alcuni moduli utili (a mio giudizio): alcuni di questi dovranno essere installati dal repository della comunità di prosody, poiché non inclusi nei pacchetti debian, o comunque più aggiornati - più avanti vedremo come fare. | ||
- | |||
- | < | ||
- | lua | ||
- | modules_enabled = { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | </ | ||
- | |||
- | Poco più sotto aggiungiamo la configurazione del modulo " | ||
- | |||
- | < | ||
- | lua | ||
- | invites_page = " | ||
- | http_paths = { | ||
- | invites_page = "/ | ||
- | invites_register_web = "/ | ||
- | } | ||
- | </ | ||
- | |||
- | Tutti questi moduli che sto consigliano di installare permettono di rendere l' | ||
- | |||
- | Tornando alla configurazione, | ||
- | |||
- | < | ||
- | lua | ||
- | allow_registration = true | ||
- | registration_invite_only = true | ||
- | invite_expiry = 86400 * 7 | ||
- | </ | ||
- | |||
- | Questo rende l' | ||
- | |||
- | Ansiamo ora ad aggiungere il primo componente fondamentale: | ||
- | Ovvero Multi User Chat, quello che vi permette di creare conversazioni di gruppo (stnze, gruppi, conversazioni, | ||
- | |||
- | Sotto Alla configurazione del virtualhost aggiungete: | ||
- | |||
- | Component " | ||
- | |||
- | " | ||
- | |||
- | Ovviamente sostituite pure " | ||
- | |||
- | Come abbiamo fatto per il virtualhost, | ||
- | |||
- | < | ||
- | lua | ||
- | modules_enabled = { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | </ | ||
- | |||
- | Spiegare cosa facciano questi moduli sarebbe troppo dispendioso, | ||
- | |||
- | [[https:// | ||
- | |||
- | Sotto ai moduli caricati inseriamo alcune configurazioni: | ||
- | |||
- | < | ||
- | lua | ||
- | name = "My Cool Chatrooms" | ||
- | restrict_room_creation = " | ||
- | muc_rtbl_jid = " | ||
- | muc_rtbl_node = " | ||
- | muc_max_nick_length = 20 | ||
- | pastebin_trigger = " | ||
- | pastebin_threshold = 1000 | ||
- | pastebin_line_threshold = 20 | ||
- | pastebin_expire_after = 72 | ||
- | </ | ||
- | |||
- | |||
- | Bene, la configurazione è per adesso terminata, l' | ||
- | |||
- | admins = { } | ||
- | | ||
- | Sostitutela con: | ||
- | |||
- | | ||
- | |||
- | L' | ||
- | |||
- | Prima di avviare prosody dovrete installare i moduli che non sono già presenti nel sistema (ovvero nel pacco " | ||
- | |||
- | Per verificare la lista dei moduli attualmente disponibili, | ||
- | |||
- | plugin_paths = { "/ | ||
- | | ||
- | Qualora un modulo di quelli consigliati non sia già presente, installatelo col comando che trovate in ogni pagina dei moduli sulla community, ad esempio in https:// | ||
- | |||
- | sudo prosodyctl install --server=https:// | ||
- | |||
- | Usate " | ||
- | |||
- | |||
- | ===== DNS ===== | ||
- | |||
- | |||
- | E' giunto il momento di configurare i nomi di dominio che abbiamo utilzzato finora: ' | ||
- | Utilizzate " | ||
- | |||
- | |||
- | apt install certbot | ||
- | |||
- | Adesso generiamo i certificati, | ||
- | |||
- | systemctl stop nginx | ||
- | | ||
- | certbot certonly --standalone -d domain.tld --dry-run | ||
- | | ||
- | L' | ||
- | |||
- | Proseguite poi col sottodominio | ||
- | |||
- | certbot certonly --standalone -d chat.domain.tld --dry-run | ||
- | | ||
- | Riavviare ngix (o Apache/ | ||
- | |||
- | Una volta generati i certificati, | ||
- | | ||
- | prosodyctl --root cert import / | ||
- | | ||
- | Quando avete completato, riavviate prosody: | ||
- | |||
- | systemctl restart prosody | ||
- | | ||
- | E controllate la configurazione: | ||
- | |||
- | prosodyctl check config | ||
- | prosodyctl check dns | ||
- | prosodyctl check certs | ||
- | | ||
- | Se non ci sono errori potete creare il vostro account admin e loggarvi sul server: | ||
- | |||
- | prosodyctl adduser admin@domain.tld | ||
- | |||
- | Per generare un invito usate come sempre il comando " | ||
- | |||
- | prosodyctl mod_invites generate domain.tld | ||
- | | ||
- | Verrà restituito un indirizzo web da comunicare alla persona che si vuole invitare | ||
xmppit/guide/installazione-server-prosody.1709485769.txt.gz · Ultima modifica: da mario