summaryrefslogtreecommitdiff
path: root/content/prosody.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/prosody.md')
-rw-r--r--content/prosody.md89
1 files changed, 60 insertions, 29 deletions
diff --git a/content/prosody.md b/content/prosody.md
index 5c6bbc1..df18ad3 100644
--- a/content/prosody.md
+++ b/content/prosody.md
@@ -64,7 +64,7 @@ The second line is important because it prevents non-admins from creating and sq
Read more about the `muc` plugin on the Prosody documentation page [here](https://prosody.im/doc/modules/mod_muc).
-### Enabling chat histories
+### Enabling Chat Histories
By default, Prosody will send out messages received only to the first available clients.
That means that if you have your desktop client turned off and your cell phone receives a message,
@@ -87,29 +87,21 @@ With this we can bring XMPP to the level of other popular instant messaging appl
It is extremely easy to setup.
This part is optional, but it can make XMPP more normie-friendly if you plan on moving family members and friends over to XMPP.
-First we need to install extra prosody modules. Run the following command:
-
-```sh
-apt install prosody-modules
-```
-
-Then we can add the following line to you prosody config file to enable file uploads:
+Add the following line to your prosody config file to enable file uploads:
```cfg
-Component "uploads.example.org" "http_upload"
+Component "{{<hl>}}uploads.example.org{{</hl>}}" "http_file_share"
```
As you will notice, you need another subdomain for this. We will add an ssl certficate for this later.
-You will also need to go back to `modules_enabled` and uncomment the `http_files` module.
-This is used to actually serve the files to users.
+### Proxy Support
-And the last part of the setup is to enable the built in proxy server.
-This helps with file transfers for devices behind a NAT, and unless you are using XMPP in a LAN, you probably need this.
+This helps with file transfers for devices behind a NAT, and unless you are using XMPP in a LAN, you **probably need this.**
Enable the proxy by adding the following line to the config:
```cfg
-Component "proxy.example.org" "proxy65"
+Component "{{<hl>}}proxy.example.org{{</hl>}}" "proxy65"
```
As you can see, another subdomain is needed. We will add ssl certificates for this later.
@@ -119,26 +111,45 @@ At this point, file sharing is now setup and ready to be used. Although there ar
A big concern with file sharing is large files, seeing as all files shared over XMPP will be stored on your server. This can become a problem when many (and large) files are being shared. We can put a cap on large files by adding the following line to our config:
```cfg
-http_upload_file_size_limit = 20971520
+http_file_share_size_limit = 20971520
```
This puts a 20MB cap on all files being shared. The value is specified in bytes. You can also specify after how long files should be deleted by adding the following line:
```cfg
-http_upload_expire_after = 60 * 60 * 24 * 7
+http_file_share_expire_after = 60 * 60 * 24 * 7
```
The value is specified in seconds. The above line will make prosody delete files after a week.
-If it is for some reason neccessary, you can also manually invoke expiry with the following command:
+### Database Setup
-```cfg
-prosodyctl mod_http_upload expire
+Prosody includes the `internal` and `sql` storage backends by default.
+If you wish to run Prosody with PostgreSQL, begin by installing the PostgreSQL:
+
+```sh
+apt install postgresql lua-dbi-postgresql
```
-### Database Setup
+Then start the daemon:
+
+```sh
+systemctl restart postgresql
+```
+
+Now create a user named `prosody` to manage your database:
+
+```sh
+su -c "createuser --pwprompt prosody" postgres
+```
-Prosody includes the `internal` and `sql` storage backends by default. If you wish to run Prosody with PostgreSQL, edit the following lines:
+And finally, create the actual database:
+
+```sh
+su -c "psql -c 'CREATE DATABASE prosody OWNER prosody;'" postgres
+```
+
+Finally, in `/etc/prosody/prosody.cfg.lua`, edit the following lines:
```cfg
storage = "sql"
@@ -152,7 +163,27 @@ sql = {
}
```
-(This is assuming you've installed the `postgresql` package, and setup a database named `prosody` with a user named `prosody` as the owner.)
+### Voice and Video Calling
+
+Prosody supports XMPP voice and video calls through an external TURN and STUN server.
+
+First, follow the guide on installing and setting up [coturn,](/coturn) setting **only a shared secret** for authentication.
+
+Then, uncomment the `turn_external` module in the modules section in `prosody.cfg.lua`.
+
+```cfg
+"turn_external";
+```
+
+Finally, specify the host and credentials lower in the config:
+
+```cfg
+-- Specify the address of the TURN service (you may use the same domain as XMPP)
+turn_external_host = "{{<hl>}}turn.example.org{{</hl>}}"
+
+-- This secret must be set to the same value in both Prosody and the TURN server
+turn_external_secret = "{{<hl>}}your shared secret{{</hl>}}"
+```
### Other things to check
@@ -171,14 +202,14 @@ Obviously, we want to have client-to-server and server-to-server encryption. Now
**If you have multi-user chat enabled, be sure to get a certificate for that subdomain as well.** Include the `--nginx` option assuming you have an Nginx server running.
```sh
-certbot -d chat.example.org --nginx
+certbot -d {{<hl>}}chat.example.org{{</hl>}} --nginx
```
**If you have file sharing enabled, be sure to get a certificate for those subdomains as well.**
```sh
-certbot -d uploads.example.org --nginx
-certbot -d proxy.example.org --nginx
+certbot -d {{<hl>}}uploads.example.org{{</hl>}} --nginx
+certbot -d {{<hl>}}proxy.example.org{{</hl>}} --nginx
```
Once you have the certificates for encryption, run the following to import them into Prosody.
@@ -196,7 +227,7 @@ Note that you might get an error that a certificate has not been found if your `
Let's manually create the admin user we prepared for above. Note that you can indeed do this in your XMPP client if you have not disabled registration, but this is how it is done on the command line:
```sh
-prosodyctl adduser chad@example.org
+prosodyctl adduser {{<hl>}}chad@example.org{{</hl>}}
```
This will prompt you to create a password as well.
@@ -217,7 +248,7 @@ Once your server is set up, you just need an XMPP client to use your new and sec
- Windows: [Gajim](https://gajim.org/) also runs on Windows.
- Android: [Conversations.im](https://conversations.im/) or
[snikket](https://snikket.org/)
-- Mac/iOS: [Monal IM](https://monal.im/) or
+- Mac/iOS: [Monal IM](https://monal-im.org/) or
[Siskin](https://siskin.im/) for iOS alone
- command-line (GNU/Linux, MacOS, Windows):
[Profanity](https://profanity-im.github.io/)
@@ -228,7 +259,7 @@ Install whichever of these clients you want on your computer or phone and you ca
### Account addresses
-XMPP account addressed look just like email addresses: `username@example.org`. You can message any account on any XMPP server on the internet with that format.
+XMPP account addresses look just like email addresses: `username@example.org`. You can message any account on any XMPP server on the internet with that format.
### Note on MUCs (multi-user chats)
@@ -236,6 +267,6 @@ Remember that MUCs are kept on a separate subdomain that we created and should'v
### Note on firewalls and opening ports
-If you use a firewall, you should open ports 5222 and 5281. The first one is needed for clients to be able to connect to your server. The second is only necessary if you are using the `http_upload` module for file sharing.
+If you use a firewall, you should open ports 5222 and 5281. The first one is needed for clients to be able to connect to your server. The second is only necessary if you are using the `http_file_share` module for file sharing, as 5281 is the port for serving content over HTTPS.
A complete list of ports used by Prosody can be found [here](https://prosody.im/doc/ports).