servers:prosody
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
servers:prosody [2018/01/16 17:47] – Sean Rhone | servers:prosody [2018/07/23 12:32] (current) – Sean Rhone | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Information ====== | ||
+ | * Prosody ((https:// | ||
+ | * [[Information: | ||
+ | * chat.realmofespionage.xyz ((XMPP)) | ||
+ | |||
+ | ===== Prerequisites ===== | ||
+ | |||
+ | * [[distros: | ||
+ | * [[servers: | ||
+ | |||
+ | ===== Notes ===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | ====== Dependencies ====== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo apt install ' | ||
+ | |||
+ | ====== Firewall ====== | ||
+ | |||
+ | * 5222/tcp is XMPP c2s ((client to server communications)) and needs forwarded from the router | ||
+ | * 5269/tcp is XMPP s2s ((server to server communications)) and needs forwarded from the router | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | < | ||
+ | [prosody-custom] | ||
+ | title=prosody-custom | ||
+ | description=Prosody XMPP C2S and S2S | ||
+ | ports=5222, | ||
+ | |||
+ | ====== Settings ====== | ||
+ | |||
+ | ===== General ===== | ||
+ | |||
+ | * Should be set out-the-box | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | Include " | ||
+ | |||
+ | ===== RoE | Chat ===== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | admins = { " | ||
+ | | ||
+ | ssl = { | ||
+ | key = "/ | ||
+ | certificate = "/ | ||
+ | protocol = " | ||
+ | ciphers = " | ||
+ | } | ||
+ | | ||
+ | c2s_require_encryption = true | ||
+ | | ||
+ | s2s_secure_auth = true | ||
+ | | ||
+ | authentication = " | ||
+ | | ||
+ | VirtualHost " | ||
+ | |||
+ | ==== Enable Host ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo rm -f '/ | ||
+ | |||
+ | ====== Let's Encrypt SSL Cert ====== | ||
+ | |||
+ | ===== Initial ===== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo cp '/ | ||
+ | |||
+ | ===== Certbot Automation ===== | ||
+ | |||
+ | ==== Prosody ==== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | post-hook = cp '/ | ||
+ | |||
+ | ==== nginx + Prosody ==== | ||
+ | |||
+ | * Requires [[servers: | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | post-hook = systemctl start ' | ||
+ | |||
+ | ==== nginx + murmur + Prosody ==== | ||
+ | |||
+ | * Requires [[servers: | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | post-hook = systemctl start ' | ||
+ | |||
+ | ====== Create User ====== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo -H -u ' | ||
+ | |||
+ | ====== Services ====== | ||
+ | |||
+ | ===== Initial ===== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo systemctl enable ' | ||
+ | |||
+ | ===== Backup ===== | ||
+ | |||
+ | ==== Service ==== | ||
+ | |||
+ | mkdir -p ~/' | ||
+ | |||
+ | [Service] | ||
+ | Type=oneshot | ||
+ | WorkingDirectory=/ | ||
+ | ExecStart='/ | ||
+ | ExecStartPost='/ | ||
+ | |||
+ | ==== Timer ==== | ||
+ | |||
+ | * This happens weekly ((I assume the files aren't mission-critical enough to be backed-up daily)) | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | [Unit] | ||
+ | Description=Prosody Files Backup | ||
+ | | ||
+ | [Timer] | ||
+ | OnCalendar=weekly | ||
+ | Persistent=true | ||
+ | | ||
+ | [Install] | ||
+ | WantedBy=timers.target | ||
+ | |||
+ | ====== Backup ====== | ||
+ | |||
+ | * Create backup archive on server and transfer to client computer | ||
+ | |||
+ | ===== Server ===== | ||
+ | |||
+ | ==== Archive Files ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | cd '/ | ||
+ | |||
+ | ===== Client ===== | ||
+ | |||
+ | ==== Transfer Archive to Client ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | scp espionage724@192.168.1.153: | ||
+ | |||
+ | ====== Restore ====== | ||
+ | |||
+ | ===== Client ===== | ||
+ | |||
+ | ==== Transfer Archive to Server ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | scp ~/' | ||
+ | |||
+ | ==== Remove Archive ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | rm ~/' | ||
+ | |||
+ | ===== Server ===== | ||
+ | |||
+ | ==== Stop Prosody ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo systemctl stop ' | ||
+ | |||
+ | ==== Remove Previous Folder ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo rm -Rf '/ | ||
+ | |||
+ | ==== Restore Files ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | cd '/ | ||
+ | |||
+ | ==== Start Prosody ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo systemctl start ' | ||
+ | |||
+ | ==== Remove Archive ==== | ||
+ | |||
+ | * Verify that Prosody works before running | ||
+ | |||
+ | rm -R ~/' |