<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.fsci.in/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AkhilVarkey</id>
	<title>FSCI Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.fsci.in/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AkhilVarkey"/>
	<link rel="alternate" type="text/html" href="https://wiki.fsci.in/Special:Contributions/AkhilVarkey"/>
	<updated>2026-05-31T22:28:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Codema.in&amp;diff=11011</id>
		<title>Codema.in</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Codema.in&amp;diff=11011"/>
		<updated>2021-09-06T15:20:56Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals.&lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We are now on a [https://www.scaleway.com/virtual-cloud-servers DEV1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
Moved to this server, by Dec 2019, to consolidate all groups related to FSCI and Indian Pirates from loomio.org and codema.fsci.org.in to a single loomio instance.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 20GB SSD Disk&lt;br /&gt;
* 100 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €5.58/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
Before moving the service to current server, we were on a [https://www.scaleway.com/virtual-cloud-servers DEV1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
We were initially on a [https://www.scaleway.com/virtual-cloud-servers VC1-S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Reserved Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server. The service was moved to &lt;br /&gt;
&lt;br /&gt;
=== Loomio Deployment Reference ===&lt;br /&gt;
&lt;br /&gt;
Initially loomio was deployed and updated on codema.fsci.org.in using this official guide - https://github.com/loomio/loomio-deploy.&lt;br /&gt;
Currently loomio is deployed and updated on codema.in using the same official guide but differs on the fact that compose file uses [https://hub.docker.com/r/dannycarrera/nginx-proxy nginx-proxy] and additional parameter of VIRTUAL_HOST_ALIAS in the env file. The VIRTUAL_HOST_ALIAS is for redirecting www.codema.in queries to codema.in. We use the smtp server from nemo.libreinfra.org for sending outbound mails.&lt;br /&gt;
&lt;br /&gt;
=== Codema data migration process ===&lt;br /&gt;
&lt;br /&gt;
For migration of loomio groups from both loomio.org and codema.fsci.org.in, the group data was exported using data export options provided by loomio. Changed the url links in the json data to point towards https://codema.in. The resulting json files was imported into the new codema instance after setting up the docker service as described [https://help.loomio.org/en/user_manual/groups/data_export/#import here]. &lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An archive of the old loomio page is available at [[Loomio/Archive_1|Loomio Archive]].&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Codema.in&amp;diff=11010</id>
		<title>Codema.in</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Codema.in&amp;diff=11010"/>
		<updated>2021-09-06T15:07:20Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: Added details about current running instance and data migration process.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals. &lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We are now on a [https://www.scaleway.com/virtual-cloud-servers DEV1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
Moved to this server to consolidate all groups related to FSCI and Indian Pirates from loomio.org and codema.fsci.org.in to a single loomio instance.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 20GB SSD Disk&lt;br /&gt;
* 100 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €5.58/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
Before moving the service to current server, we were on a [https://www.scaleway.com/virtual-cloud-servers DEV1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
We were initially on a [https://www.scaleway.com/virtual-cloud-servers VC1-S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Reserved Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server. The service was moved to &lt;br /&gt;
&lt;br /&gt;
=== Loomio Deployment Reference ===&lt;br /&gt;
&lt;br /&gt;
Initially loomio was deployed and updated on codema.fsci.org.in using this official guide - https://github.com/loomio/loomio-deploy.&lt;br /&gt;
Currently loomio is deployed and updated on codema.in using the same official guide but differs on the fact that compose file uses [https://hub.docker.com/r/dannycarrera/nginx-proxy nginx-proxy] and additional parameter of VIRTUAL_HOST_ALIAS in the env file. The VIRTUAL_HOST_ALIAS is for redirecting www.codema.in queries to codema.in. We use the smtp server from nemo.libreinfra.org for sending outbound mails.&lt;br /&gt;
&lt;br /&gt;
=== Codema data migration process ===&lt;br /&gt;
&lt;br /&gt;
For migration of loomio groups from both loomio.org and codema.fsci.org.in, the group data was exported using data export options provided by loomio. Changed the url links in the json data to point towards https://codema.in. The resulting json files was imported into the new codema instance after setting up the docker service as described [https://help.loomio.org/en/user_manual/groups/data_export/#import here]. &lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Codema.in&amp;diff=11009</id>
		<title>Codema.in</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Codema.in&amp;diff=11009"/>
		<updated>2021-09-06T14:30:36Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: Documentation for Loomio Setup and data migration.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=System_Administrators_Checklist&amp;diff=10965</id>
		<title>System Administrators Checklist</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=System_Administrators_Checklist&amp;diff=10965"/>
		<updated>2020-12-15T17:14:13Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: /* Free Software Camp Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-Requisites (you need to learn yourself) =&lt;br /&gt;
# How to install GNU/Linux&lt;br /&gt;
# Familiarity with Command Line&lt;br /&gt;
# disk partitioning with logical volume manager&lt;br /&gt;
# authenticating with ssh keys&lt;br /&gt;
&lt;br /&gt;
= Server basics (we will teach you) =&lt;br /&gt;
# switching users (sudo, su)&lt;br /&gt;
# remote access (scp, rsync, custom ssh port, mosh),&lt;br /&gt;
# software raid&lt;br /&gt;
# encrypted partitions/luks (using virtual machines)&lt;br /&gt;
# firewall with ufw&lt;br /&gt;
# postgresql replication (backup)&lt;br /&gt;
# scheduled backups (rsync and cron)&lt;br /&gt;
# lxc container (setup services on your local machine)&lt;br /&gt;
# sharing passwords with gpg encrypted files&lt;br /&gt;
# nginx basics (setup web server, add custom index page)&lt;br /&gt;
# screen/tmux/nohup&lt;br /&gt;
# symbolic links (ln -s)&lt;br /&gt;
# locales&lt;br /&gt;
# environment variables&lt;br /&gt;
# local network configuration (/etc/hosts, ip, ss).&lt;br /&gt;
# Starting and stopping services (systemctl)&lt;br /&gt;
# Log file handling (tail -f, truncate, logrotate)&lt;br /&gt;
&lt;br /&gt;
== Switching users ==&lt;br /&gt;
&lt;br /&gt;
sudo or su commands can be used to run commands as different users. `sudo -u &amp;lt;username&amp;gt;` for running as different user. `su - postgres` can give you a shell as postgres user.&lt;br /&gt;
&lt;br /&gt;
== Remote access to machines ==&lt;br /&gt;
&lt;br /&gt;
#. ssh - remote shell (with ssh server on custom ports)&lt;br /&gt;
#. scp/sftp/rsync - copy files&lt;br /&gt;
#. mosh - for bad connections&lt;br /&gt;
&lt;br /&gt;
== Symbolic links ==&lt;br /&gt;
&lt;br /&gt;
Symbolic links can be used to store data in data partition without changing configuration files. For example /var/lib/postgresql can be a symbolic link to /data/postgresql where /data is a dedicated partition for storing data.&lt;br /&gt;
&lt;br /&gt;
== Setup correct Locales ==&lt;br /&gt;
&lt;br /&gt;
`dpkg-reconfigure locales` &lt;br /&gt;
&lt;br /&gt;
= Free Software Camp Tasks =&lt;br /&gt;
* Setup feed2toot for fsci blog, diasp.in updates - https://git.fosscommunity.in/fsfi/camp/-/issues/36#notes&lt;br /&gt;
&lt;br /&gt;
= Free Software Camp Resources =&lt;br /&gt;
* [[Hosting_Providers_with_free_tiers_or_credits]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10878</id>
		<title>Poddery - Diaspora, Matrix and XMPP</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10878"/>
		<updated>2020-06-25T13:19:40Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: Details about compression of matrix-synapse, some re ordering and typo fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We run decentralized and federated [https://diasporafoundation.org/ Diaspora] social netowrk, [https://xmpp.org/ XMPP] and [https://matrix.org Matrix] instant messaging services at [https://poddery.com poddery.com]. Along with Diaspora, Poddery username and password can be used to access XMPP and Matrix services as well. [https://chat.poddery.com chat.poddery.com] provides Riot client (accessed by a web browser), which can be used to connect to any Matrix server without installing a Riot app/client.&lt;br /&gt;
&lt;br /&gt;
= Environment =&lt;br /&gt;
== Hosting ==&lt;br /&gt;
Poddery is hosted at [https://www.hetzner.com Hetzner] with the following specs:&lt;br /&gt;
&lt;br /&gt;
* Intel Xeon E3-1246V3 Process - 4 Cores, 3.5GHz&lt;br /&gt;
* 4TB HDD&lt;br /&gt;
* 32GB DDR3 RAM&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
* Debian Buster&lt;br /&gt;
&lt;br /&gt;
== User Visible Services ==&lt;br /&gt;
=== Diaspora ===&lt;br /&gt;
* Currently installed version is 0.7.6.1 which is available in [https://packages.debian.org/buster/diaspora-installer Debian Buster contrib]&lt;br /&gt;
* For live statistics see https://poddery.com/statistics&lt;br /&gt;
&lt;br /&gt;
=== Chat/XMPP ===&lt;br /&gt;
* [https://prosody.im/ Prosody] is used as the XMPP server which is modern and lightweight.&lt;br /&gt;
* Currently installed version is 0.11.2 which is available in [https://packages.debian.org/buster/prosody Debian Buster].&lt;br /&gt;
* All XEPs are enabled which the [https://conversations.im/ Conversations app] support.&lt;br /&gt;
&lt;br /&gt;
=== Chat/Matrix ===&lt;br /&gt;
* [https://matrix.org/docs/projects/server/synapse.html Synapse] is used as the Matrix server.&lt;br /&gt;
* Synapse is currently installed directly from the [https://github.com/matrix-org/synapse official GitHub repo].&lt;br /&gt;
* Riot-web Matrix client is hosted at https://chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
=== Homepage ===&lt;br /&gt;
Homepage and other static pages are maintained in FSCI [https://git.fosscommunity.in GitLab instance]. &lt;br /&gt;
* poddery.com -&amp;gt; https://git.fosscommunity.in/community/poddery.com&lt;br /&gt;
* save.poddery.com -&amp;gt; https://git.fosscommunity.in/community/save.poddery.com&lt;br /&gt;
* fund.poddery.com -&amp;gt; https://git.fosscommunity.in/community/fund-poddery&lt;br /&gt;
&lt;br /&gt;
== Backend Services ==&lt;br /&gt;
=== Web Server / Reverse Proxy ===&lt;br /&gt;
* Nginx web server which also acts as front-end (reverse proxy) for Diaspora and Matrix.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
* PostgreSQL for Matrix&lt;br /&gt;
* MySQL for Diaspora&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;: Consider migrating to PostgreSQL to optimize resources (We can reduce one service and RAM usage).&lt;br /&gt;
&lt;br /&gt;
=== Email ===&lt;br /&gt;
* Exim&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS certificates ===&lt;br /&gt;
* Let&#039;s Encrypt&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
* UFW (Uncomplicated Firewall)&lt;br /&gt;
&lt;br /&gt;
=== Intrusion Prevention ===&lt;br /&gt;
* Fail2ban&lt;br /&gt;
&lt;br /&gt;
= Coordination =&lt;br /&gt;
* [https://www.loomio.org/g/2bjVXqAu/fosscommunity-in-poddery-com-maintainer-s-group Loomio group] - Mainly used for decision making&lt;br /&gt;
* Matrix room - [https://matrix.to/#/#poddery:poddery.com #poddery:poddery.com]&lt;br /&gt;
* [https://git.fosscommunity.in/community/poddery.com/issues Issue tracker] - Used for tracking progress of tasks&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
* Email: poddery at autistici.org (alias that reaches Akhilan, Abhijith Balan, Fayad, Balasankar, Julius, Praveen, Prasobh, Sruthi, Shirish, Vamsee and Manukrishnan)&lt;br /&gt;
* The following people have their GPG keys in the [[#Server_Access|access file]]:&lt;br /&gt;
** ID: 0xCE1F9C674512C22A - Praveen Arimbrathodiyil (piratepin)&lt;br /&gt;
** ID: 0xB77D2E2E23735427 - Balasankar C&lt;br /&gt;
** ID: 0x5D0064186AF037D9 - Manu Krishnan T V&lt;br /&gt;
** ID: 0x51C954405D432381 - Fayad Fami (fayad)&lt;br /&gt;
** ID: 0x863D4DF2ED9C28EF - Abhijith PA&lt;br /&gt;
** ID: 0x6EF48CCD865A1FFC - Syam G Krishnan (sgk)&lt;br /&gt;
** ID: 0xFD49D0BC6FEAECDA - Sagar Ippalpalli&lt;br /&gt;
** ID: 0x92FDAB42A95FF20C - Pirate Bady (piratesin)&lt;br /&gt;
** ID: 0x0B1955F40C691CCE - Kannan&lt;br /&gt;
** ID: 0x32FF6C6F5B7AE248 - Akhil Varkey&lt;br /&gt;
** ID: 0xFBB7061C27CB70C1 - Ranjith Siji&lt;br /&gt;
** ID: 0xEAAFE4A8F39DE34F - Kiran S Kunjumon (hacksk)&lt;br /&gt;
* It&#039;s recommended to setup [http://www.vim.org/scripts/script.php?script_id=3645 Vim GnuPG Plugin] for transparent editing. Those who are new to GPG can follow [https://www.madboa.com/geek/gpg-quickstart/ this guide].&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
Maintained in a private git repo at https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
= Configuration and Maintenance =&lt;br /&gt;
== Disk Partitioning ==&lt;br /&gt;
* RAID 1 setup on 2x2TB HDDs (&amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sdb&amp;lt;/code&amp;gt;).&lt;br /&gt;
 mdadm --verbose --create /dev/mdX --level=mirror --raid-devices=2 /dev/sdaY /dev/sdbY&lt;br /&gt;
* Separate partitions for swap (&amp;lt;code&amp;gt;md0&amp;lt;/code&amp;gt; - 16GB), boot (&amp;lt;code&amp;gt;md1&amp;lt;/code&amp;gt; - 512MB) and root (&amp;lt;code&amp;gt;md2&amp;lt;/code&amp;gt; - 50GB).&lt;br /&gt;
* LVM on Luks for separate encrypted data partitions for database, static files and logs.&lt;br /&gt;
 # Setup LUKS (make sure &amp;lt;code&amp;gt;lvm2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; packages are installed).&lt;br /&gt;
 cryptsetup luksFormat /dev/mdX&lt;br /&gt;
 # Give disk encryption password as specified in the [[#Server_Access|access repo]]&lt;br /&gt;
 cryptsetup luksOpen /dev/mdX poddery&lt;br /&gt;
 &lt;br /&gt;
 # LVM Setup&lt;br /&gt;
 # Create physical volume named &amp;lt;code&amp;gt;poddery&amp;lt;/code&amp;gt;&lt;br /&gt;
 pvcreate /dev/mapper/poddery&lt;br /&gt;
 # Create volume group named &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
 vgcreate data /dev/mapper/poddery&lt;br /&gt;
 # Create logical volumes named &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static&amp;lt;/code&amp;gt;&lt;br /&gt;
 lvcreate -n log /dev/data -L 50G&lt;br /&gt;
 lvcreate -n db /dev/data -L 500G&lt;br /&gt;
 # Assign remaining free space for static files&lt;br /&gt;
 lvcreate -n static /dev/data -l 100%FREE &lt;br /&gt;
 &lt;br /&gt;
 # Setup filesystem on the logical volumes&lt;br /&gt;
 mkfs.ext4 /dev/data/log&lt;br /&gt;
 mkfs.ext4 /dev/data/db&lt;br /&gt;
 mkfs.ext4 /dev/data/static&lt;br /&gt;
 &lt;br /&gt;
 # Create directories for mounting the encrypted partitions&lt;br /&gt;
 mkdir /var/lib/db /var/lib/static /var/log/poddery&lt;br /&gt;
 &lt;br /&gt;
 # Manually mount encrypted partitions. This is needed on each reboot as Hetzner doesn&#039;t provide a web console so that we can&#039;t decrypt the partitions during booting.&lt;br /&gt;
 mount /dev/data/db /var/lib/db&lt;br /&gt;
 mount /dev/data/static /var/lib/static&lt;br /&gt;
 mount /dev/data/log /var/log/poddery&lt;br /&gt;
&lt;br /&gt;
== Hardening checklist ==&lt;br /&gt;
* SSH password based login disabled (allow only key based logins)&lt;br /&gt;
* SSH login disabled for root user (use a normal user with sudo)&lt;br /&gt;
 # Check for the following settings in /etc/ssh/sshd_config:&lt;br /&gt;
 ...&lt;br /&gt;
 PermitRootLogin no&lt;br /&gt;
 ...&lt;br /&gt;
 PasswordAuthentication no&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; firewall enabled with only the ports that needs to be opened ([https://fxdata.cloud/tutorials/set-up-a-firewall-with-ufw-on-ubuntu-16-04 ufw tutorial]):&lt;br /&gt;
 ufw default deny incoming&lt;br /&gt;
 ufw default allow outgoing&lt;br /&gt;
 ufw allow ssh&lt;br /&gt;
 ufw allow http/tcp&lt;br /&gt;
 ufw allow https/tcp&lt;br /&gt;
 ufw allow Turnserver&lt;br /&gt;
 ufw allow XMPP&lt;br /&gt;
 ufw allow 8448&lt;br /&gt;
&lt;br /&gt;
 ufw enable&lt;br /&gt;
 &lt;br /&gt;
 # Verify everything is setup properly&lt;br /&gt;
 ufw status&lt;br /&gt;
 &lt;br /&gt;
 # Enable ufw logging with default mode low&lt;br /&gt;
 ufw logging on&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fail2ban&amp;lt;/code&amp;gt; configured against brute force attacks:&lt;br /&gt;
 # Check for the following line &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 LogLevel VERBOSE&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # Restart SSH and enable fail2ban&lt;br /&gt;
 systemctl restart ssh&lt;br /&gt;
 systemctl enable fail2ban&lt;br /&gt;
 systemctl start fail2ban&lt;br /&gt;
 &lt;br /&gt;
 # To unban an IP, first check &amp;lt;code&amp;gt;/var/log/fail2ban.log&amp;lt;/code&amp;gt; to get the banned IP and then run the following&lt;br /&gt;
 # Here &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; is the defaut jail name, change it if you are using a different jail&lt;br /&gt;
 fail2ban-client set sshd unbanip &amp;lt;banned_ip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Diaspora ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;diaspora-installer&amp;lt;/code&amp;gt; from Debian Buster contrib:&lt;br /&gt;
 apt install diaspora-installer&lt;br /&gt;
&lt;br /&gt;
* Move MySQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop mysql&lt;br /&gt;
 systemctl disable mysql&lt;br /&gt;
 mv /var/lib/mysql /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/mysql /var/lib/&lt;br /&gt;
 systemctl start mysql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/diaspora&lt;br /&gt;
 mv /usr/share/diaspora/public/uploads /var/lib/static/diaspora&lt;br /&gt;
 ln -s /var/lib/static/diaspora/uploads /usr/share/diaspora/public/&lt;br /&gt;
 chown -R diaspora: /var/lib/static/diaspora&lt;br /&gt;
&lt;br /&gt;
* Modify configuration files at &amp;lt;code&amp;gt;/etc/diaspora&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/diaspora.conf&amp;lt;/code&amp;gt; as needed (backup of the current configuration files are available in the [[#Server_Access|access repo]]).&lt;br /&gt;
* Homepage configuration:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;acl&amp;lt;/code&amp;gt; packages are installed&lt;br /&gt;
 # Grant &amp;lt;code&amp;gt;rwx&amp;lt;/code&amp;gt; permissions for the ssh user to &amp;lt;code&amp;gt;/usr/share/diaspora/public&amp;lt;/code&amp;gt;&lt;br /&gt;
 setfacl -m &amp;quot;u:&amp;lt;ssh_user&amp;gt;:rwx&amp;quot; /usr/share/diaspora/public&lt;br /&gt;
 &lt;br /&gt;
 # Clone poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public&lt;br /&gt;
 git clone https://git.fosscommunity.in/community/poddery.com.git&lt;br /&gt;
 cd poddery.com &amp;amp;&amp;amp; mv * .[^.]* .. #Give yes for all files when prompted&lt;br /&gt;
 cd .. &amp;amp;&amp;amp; rmdir poddery.com&lt;br /&gt;
&lt;br /&gt;
* [https://save.poddery.com Save Poddery] repo is maintained as a sub module in poddery.com repo. See this [https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ tutorial] for working with git submodules. &lt;br /&gt;
 # Clone save.poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public/save&lt;br /&gt;
 git submodule init&lt;br /&gt;
 git submodule update&lt;br /&gt;
&lt;br /&gt;
== Matrix ==&lt;br /&gt;
* See the [https://github.com/matrix-org/synapse/blob/master/INSTALL.md official installation guide] of Synapse for installing from source.&lt;br /&gt;
* Nginx is used as reverse proxy to send requests that has &amp;lt;code&amp;gt;/_matrix/*&amp;lt;/code&amp;gt; in URL to Synapse on port &amp;lt;code&amp;gt;8008&amp;lt;/code&amp;gt;. This is configured in &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Shamil&#039;s [https://git.fosscommunity.in/necessary129/synapse-diaspora-auth Synapse Diaspora Auth] script is used to authenticate Synapse with Diaspora database.&lt;br /&gt;
* Move PostgreSQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop postgresql&lt;br /&gt;
 systemctl disable postgresql&lt;br /&gt;
 mv /var/lib/postgres /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/postgres /var/lib/&lt;br /&gt;
 systemctl start postgresql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/synapse&lt;br /&gt;
 mv /var/lib/matrix-synapse/uploads /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/uploads /var/lib/matrix-synapse/&lt;br /&gt;
 mv /var/lib/matrix-synapse/media /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/media /var/lib/matrix-synapse/&lt;br /&gt;
 chown -R matrix-synapse: /var/lib/static/synapse&lt;br /&gt;
&lt;br /&gt;
* Install identity server &amp;lt;code&amp;gt;mxisd&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;deb&amp;lt;/code&amp;gt; package available [https://github.com/kamax-matrix/mxisd/blob/master/docs/install/debian.md here])&lt;br /&gt;
&lt;br /&gt;
=== Workers ===&lt;br /&gt;
* For scalability, Poddery is running [https://github.com/matrix-org/synapse/blob/master/docs/workers.rst workers]. Currently all workers specified in that page, expect &amp;lt;code&amp;gt;synapse.app.appservice&amp;lt;/code&amp;gt; is running on poddery.com&lt;br /&gt;
* A new service [https://gist.github.com/necessary129/5dfbb140e4727496b0ad2bf801c10fdc &amp;lt;code&amp;gt;matrix-synapse@.service&amp;lt;/code&amp;gt;] is installed for the workers (Save the &amp;lt;code&amp;gt;synape_worker&amp;lt;/code&amp;gt; file somewhere like &amp;lt;code&amp;gt;/usr/local/bin/&amp;lt;/code&amp;gt; or something).&lt;br /&gt;
* The worker config can be found at &amp;lt;code&amp;gt;/etc/matrix-synapse/workers&amp;lt;/code&amp;gt;&lt;br /&gt;
* Synapse needs to be put under a reverse proxy see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/matrix&amp;lt;/code&amp;gt;. A lot of &amp;lt;code&amp;gt;/_matrix/&amp;lt;/code&amp;gt; urls needs to be overridden too see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;&lt;br /&gt;
* These lines must be added to &amp;lt;code&amp;gt;homeserver.yaml&amp;lt;/code&amp;gt; as we are running &amp;lt;code&amp;gt;media_repository&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;federation_sender&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pusher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_dir&amp;lt;/code&amp;gt; workers respectively:&lt;br /&gt;
  enable_media_repo: False&lt;br /&gt;
  send_federation: False&lt;br /&gt;
  start_pushers: False&lt;br /&gt;
  update_user_directory: false&lt;br /&gt;
&lt;br /&gt;
* These services must be enabled:&lt;br /&gt;
&lt;br /&gt;
 matrix-synapse@synchrotron.service matrix-synapse@federation_reader.service matrix-synapse@event_creator.service matrix-synapse@federation_sender.service matrix-synapse@pusher.service matrix-synapse@user_dir.service matrix-synapse@media_repository.service matrix-synapse@frontend_proxy.service matrix-synapse@client_reader.service matrix-synapse@synchrotron_2.service&lt;br /&gt;
&lt;br /&gt;
To load balance between the 2 synchrotrons, We are running [https://github.com/Sorunome/matrix-synchrotron-balancer matrix-synchrotron-balancer]. It has a systemd file at &amp;lt;code&amp;gt;/etc/systemd/system/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;. The files are in &amp;lt;code&amp;gt;/opt/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Synapse Updation ===&lt;br /&gt;
* First check [https://github.com/matrix-org/synapse/blob/master/UPGRADE.rst synapse/UPGRADE.rst] to see if anything extra needs to be done. Then, just run &amp;lt;code&amp;gt;/root/upgrade-synapse&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Riot-web Updation === &lt;br /&gt;
* Just run the following (make sure to replace &amp;lt;code&amp;gt;&amp;lt;version&amp;gt;&amp;lt;/code&amp;gt; with a proper version number like &amp;lt;code&amp;gt;v1.0.0&amp;lt;/code&amp;gt;):&lt;br /&gt;
 /var/www/get-riot &amp;lt;version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chat/XMPP ==&lt;br /&gt;
* Steps for setting up Prosody is given at https://wiki.debian.org/Diaspora/XMPP&lt;br /&gt;
 # Follow steps 1 to 6 from https://wiki.debian.org/Diaspora/XMPP and then run the following:&lt;br /&gt;
 mysql -u root -p # Enter password from the access repo&lt;br /&gt;
 &lt;br /&gt;
 CREATE USER &#039;prosody&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;&amp;lt;passwd_in_repo&amp;gt;&#039;;&lt;br /&gt;
 GRANT ALL PRIVILEGES ON diaspora_production.* TO &#039;prosody&#039;@&#039;localhost&#039;;&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 &lt;br /&gt;
 systemctl restart prosody&lt;br /&gt;
&lt;br /&gt;
* Install plugins&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;mercurial&amp;lt;/code&amp;gt; is installed&lt;br /&gt;
 cd /etc &amp;amp;&amp;amp; hg clone https://hg.prosody.im/prosody-modules/ prosody-modules&lt;br /&gt;
&lt;br /&gt;
=== Set Nginx Conf for BOSH URLS ===&lt;br /&gt;
* Add the following in &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration file to enable the BOSH URL to make JSXC Working:&lt;br /&gt;
 upstream chat_cluster {&lt;br /&gt;
   server localhost:5280;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 location /http-bind {&lt;br /&gt;
   proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
   proxy_set_header Host $http_host;&lt;br /&gt;
   proxy_set_header X-Forwarded-Proto https;&lt;br /&gt;
   proxy_redirect off;&lt;br /&gt;
   proxy_connect_timeout 5;&lt;br /&gt;
   proxy_buffering       off;&lt;br /&gt;
   proxy_read_timeout    70;&lt;br /&gt;
   keepalive_timeout     70;&lt;br /&gt;
   send_timeout          70;&lt;br /&gt;
   client_max_body_size 4M;&lt;br /&gt;
   client_body_buffer_size 128K;&lt;br /&gt;
   proxy_pass http://chat_cluster;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.diasporafoundation.org/Integration/Chat#Nginx See here] for more details on &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration. Alternatively, &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; settings can be found [https://github.com/jsxc/jsxc/wiki/Prepare-apache here].&lt;br /&gt;
&lt;br /&gt;
== TLS ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;letsencrypt&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Ensure proper permissions are set for &amp;lt;code&amp;gt;/etc/letsencrypt&amp;lt;/code&amp;gt; and its contents.&lt;br /&gt;
 chown -R root:ssl-cert /etc/letsencrypt&lt;br /&gt;
 chmod g+r -R /etc/letsencrypt&lt;br /&gt;
 chmod g+x /etc/letsencrypt/{archive,live}&lt;br /&gt;
* Generate certificates. For more details see https://certbot.eff.org.&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;diaspora&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/diaspora/ssl&lt;br /&gt;
 &#039;&#039;total 0&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 47 Apr  2 22:47 poddery.com-bundle.pem -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 45 Apr  2 22:48 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/diaspora/ssl/poddery.com-bundle.pem&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/diaspora/ssl/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;prosody&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/prosody/certs/&lt;br /&gt;
 &#039;&#039;total 0&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 40 Mar 28 01:16 poddery.com.crt -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 33 Mar 28 01:16 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/prosody/certs/poddery.com.crt&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/prosody/certs/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Note- letsencrypt executable used below is actually a symlik to /usr/bin/certbot&lt;br /&gt;
* Cron jobs:&lt;br /&gt;
 crontab -e&lt;br /&gt;
 &#039;&#039;30 2 * * 1 letsencrypt renew  &amp;gt;&amp;gt; /var/log/le-renew.log&#039;&#039;&lt;br /&gt;
 &#039;&#039;32 2 * * 1 /etc/init.d/nginx reload&#039;&#039;&lt;br /&gt;
 &#039;&#039;34 2 * * 1 /etc/init.d/prosody reload&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Manually updating TLS certificate:&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos -w /usr/share/diaspora/public  -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save -d save.poddery.com -w /var/www/riot -d chat.poddery.com&lt;br /&gt;
* To include an additional subdomain such as fund.poddery.com use with --expand parameter as shown below&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos --expand -w /usr/share/diaspora/public -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save/ -d save.poddery.com -w /var/www/riot/ -d chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
==Backup==&lt;br /&gt;
&lt;br /&gt;
Backup server is provided by Manu (KVM virtual machine with 180 GB storage and 1 GB ram ). &lt;br /&gt;
&lt;br /&gt;
Debian Stetch was upgraded Debian Buster before database relication of synapse database. &lt;br /&gt;
&lt;br /&gt;
Documentation: https://www.percona.com/blog/2018/09/07/setting-up-streaming-replication-postgresql/&lt;br /&gt;
&lt;br /&gt;
Currently postgres database for matrix-synapse is backed up.&lt;br /&gt;
&lt;br /&gt;
===Before Replication (specific to poddery.com)===&lt;br /&gt;
&lt;br /&gt;
Setup tinc vpn in the backup server&lt;br /&gt;
&lt;br /&gt;
 # apt install tinc&lt;br /&gt;
&lt;br /&gt;
Configure tinc by creating tinc.conf and host podderybackup under label fsci.&lt;br /&gt;
Add tinc-up and tinc-down scripts&lt;br /&gt;
Copy poddery host config to backup server and podderybackup host config to poddery.com server.&lt;br /&gt;
&lt;br /&gt;
Relaod tinc vpn service at both poddery.com and backup servers&lt;br /&gt;
&lt;br /&gt;
 # systemctl reload tinc@fsci.service&lt;br /&gt;
&lt;br /&gt;
Enable tinc@fsci systemd service for autostart&lt;br /&gt;
&lt;br /&gt;
 # systemctl enable tinc@fsci.service&lt;br /&gt;
&lt;br /&gt;
The synapse database was also pruned to reduce the size before replication by following this guide - https://levans.fr/shrink-synapse-database.html&lt;br /&gt;
If you want to follow this guide, make sure matrix synapse server is updated to version 1.13 atleast since it introduces the Rooms API mentioned the guide.&lt;br /&gt;
Changes done to steps in the guide.&lt;br /&gt;
&lt;br /&gt;
  # jq &#039;.rooms[] | select(.joined_local_members == 0) | .room_id&#039; &amp;lt; roomlist.json | sed -e &#039;s/&amp;quot;//g&#039; &amp;gt; to_purge.txt&lt;br /&gt;
&lt;br /&gt;
The room list obtained this way can, be looped to pass the room names as variables to the purge api. &lt;br /&gt;
&lt;br /&gt;
 # set +H // if you are using bash to avoid &#039;!&#039; in the roomname triggering the history substitution.&lt;br /&gt;
 # for room_id in $(cat to_purge.txt); do curl --header &amp;quot;Authorization: Bearer &amp;lt;your access token&amp;gt;&amp;quot; \&lt;br /&gt;
    -X POST -H &amp;quot;Content-Type: application/json&amp;quot; -d &amp;quot;{ \&amp;quot;room_id\&amp;quot;: \&amp;quot;$room_id\&amp;quot; }&amp;quot; \&lt;br /&gt;
    &#039;https://127.0.0.1:8008/_synapse/admin/v1/purge_room&#039;; done;&lt;br /&gt;
&lt;br /&gt;
We also did not remove old history of large rooms.&lt;br /&gt;
&lt;br /&gt;
===Step 1: Postgresql (for synapse) Primary configuration===&lt;br /&gt;
&lt;br /&gt;
Create postgresql user for replication.&lt;br /&gt;
&lt;br /&gt;
 $ psql -c &amp;quot;CREATE USER replication REPLICATION LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD &#039;yourpassword&#039;;&amp;quot;&lt;br /&gt;
The password is in the access repo if you need it later.&lt;br /&gt;
&lt;br /&gt;
Allow standby to connect to primary using the user just created.&lt;br /&gt;
&lt;br /&gt;
 $ cd /etc/postgresql/11/main&lt;br /&gt;
&lt;br /&gt;
 $ nano pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Add below line to allow replication user to get access to the server&lt;br /&gt;
&lt;br /&gt;
 host    replication     replication     172.16.0.3/32   md5&lt;br /&gt;
&lt;br /&gt;
Next , open the postgres configuration file&lt;br /&gt;
&lt;br /&gt;
 nano postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Set the following configuration options in the postgresql.conf file&lt;br /&gt;
&lt;br /&gt;
 listen_addresses = &#039;localhost,172.16.0.2&#039;&lt;br /&gt;
 port=5432&lt;br /&gt;
 wal_level = replica&lt;br /&gt;
 max_wal_senders = 1&lt;br /&gt;
 wal_keep_segments = 64&lt;br /&gt;
 archive_mode = on&lt;br /&gt;
 archive_command = &#039;cd .&#039;&lt;br /&gt;
&lt;br /&gt;
You need to restart since postgresql.conf was edited and parameters changed,&lt;br /&gt;
&lt;br /&gt;
 # systemctl restart postgresql&lt;br /&gt;
&lt;br /&gt;
===Step 2: Postgresql (for synapse) Standby configuration ===&lt;br /&gt;
&lt;br /&gt;
Install postgresql &lt;br /&gt;
&lt;br /&gt;
 # apt install postgresql&lt;br /&gt;
&lt;br /&gt;
Check postgresql server is running&lt;br /&gt;
&lt;br /&gt;
 # su postgres -c psql&lt;br /&gt;
&lt;br /&gt;
Make sure en_US.UTF-8 locale is available&lt;br /&gt;
&lt;br /&gt;
 # dpkg-reconfigure locales&lt;br /&gt;
&lt;br /&gt;
Stop postgresql before changing any configuration&lt;br /&gt;
&lt;br /&gt;
 #systemctl stop postgresql@11-main&lt;br /&gt;
&lt;br /&gt;
Switch to postgres user&lt;br /&gt;
&lt;br /&gt;
 # su - postgres&lt;br /&gt;
 $ cd /etc/postgresql/11/&lt;br /&gt;
&lt;br /&gt;
Copy data from master and create recovery.conf&lt;br /&gt;
&lt;br /&gt;
 $ pg_basebackup -h git.fosscommunity.in -D /var/lib/postgresql/11/main/ -P -U rep --wal-method=fetch  -R&lt;br /&gt;
&lt;br /&gt;
Open the postgres configuration file&lt;br /&gt;
&lt;br /&gt;
 $ nano postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Set the following configuration options in the postgresql.conf file&lt;br /&gt;
&lt;br /&gt;
 max_connections = 500 // This option and the one below are set to be same as in postgresql.conf at primary or the service won&#039;t start.&lt;br /&gt;
 max_worker_processes = 16&lt;br /&gt;
 host_standby = on // The above pg_basebackup command should set it. If it&#039;s not manually turn it to on.&lt;br /&gt;
&lt;br /&gt;
Start the stopped postgresql service&lt;br /&gt;
&lt;br /&gt;
 # systemctl start postgresql@11-main&lt;br /&gt;
&lt;br /&gt;
===Postgresql (for synapse) Replication Status===&lt;br /&gt;
&lt;br /&gt;
On Primary,&lt;br /&gt;
&lt;br /&gt;
 $ ps -ef | grep sender&lt;br /&gt;
 $ psql -c &amp;quot;select * from pg_stat_activity where usename=&#039;rep&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
On Standby,&lt;br /&gt;
&lt;br /&gt;
 $ ps -ef | grep receiver&lt;br /&gt;
&lt;br /&gt;
= History =&lt;br /&gt;
* [[Poddery/Archive|See here]] for the archive of Poddery wiki page before the migration to Hetzner.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10877</id>
		<title>Poddery - Diaspora, Matrix and XMPP</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10877"/>
		<updated>2020-06-25T08:40:45Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We run decentralized and federated [https://diasporafoundation.org/ Diaspora] social netowrk, [https://xmpp.org/ XMPP] and [https://matrix.org Matrix] instant messaging services at [https://poddery.com poddery.com]. Along with Diaspora, Poddery username and password can be used to access XMPP and Matrix services as well. [https://chat.poddery.com chat.poddery.com] provides Riot client (accessed by a web browser), which can be used to connect to any Matrix server without installing a Riot app/client.&lt;br /&gt;
&lt;br /&gt;
= Environment =&lt;br /&gt;
== Hosting ==&lt;br /&gt;
Poddery is hosted at [https://www.hetzner.com Hetzner] with the following specs:&lt;br /&gt;
&lt;br /&gt;
* Intel Xeon E3-1246V3 Process - 4 Cores, 3.5GHz&lt;br /&gt;
* 4TB HDD&lt;br /&gt;
* 32GB DDR3 RAM&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
* Debian Buster&lt;br /&gt;
&lt;br /&gt;
== User Visible Services ==&lt;br /&gt;
=== Diaspora ===&lt;br /&gt;
* Currently installed version is 0.7.6.1 which is available in [https://packages.debian.org/buster/diaspora-installer Debian Buster contrib]&lt;br /&gt;
* For live statistics see https://poddery.com/statistics&lt;br /&gt;
&lt;br /&gt;
=== Chat/XMPP ===&lt;br /&gt;
* [https://prosody.im/ Prosody] is used as the XMPP server which is modern and lightweight.&lt;br /&gt;
* Currently installed version is 0.11.2 which is available in [https://packages.debian.org/buster/prosody Debian Buster].&lt;br /&gt;
* All XEPs are enabled which the [https://conversations.im/ Conversations app] support.&lt;br /&gt;
&lt;br /&gt;
=== Chat/Matrix ===&lt;br /&gt;
* [https://matrix.org/docs/projects/server/synapse.html Synapse] is used as the Matrix server.&lt;br /&gt;
* Synapse is currently installed directly from the [https://github.com/matrix-org/synapse official GitHub repo].&lt;br /&gt;
* Riot-web Matrix client is hosted at https://chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
=== Homepage ===&lt;br /&gt;
Homepage and other static pages are maintained in FSCI [https://git.fosscommunity.in GitLab instance]. &lt;br /&gt;
* poddery.com -&amp;gt; https://git.fosscommunity.in/community/poddery.com&lt;br /&gt;
* save.poddery.com -&amp;gt; https://git.fosscommunity.in/community/save.poddery.com&lt;br /&gt;
* fund.poddery.com -&amp;gt; https://git.fosscommunity.in/community/fund-poddery&lt;br /&gt;
&lt;br /&gt;
== Backend Services ==&lt;br /&gt;
=== Web Server / Reverse Proxy ===&lt;br /&gt;
* Nginx web server which also acts as front-end (reverse proxy) for Diaspora and Matrix.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
* PostgreSQL for Matrix&lt;br /&gt;
* MySQL for Diaspora&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;: Consider migrating to PostgreSQL to optimize resources (We can reduce one service and RAM usage).&lt;br /&gt;
&lt;br /&gt;
=== Email ===&lt;br /&gt;
* Exim&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS certificates ===&lt;br /&gt;
* Let&#039;s Encrypt&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
* UFW (Uncomplicated Firewall)&lt;br /&gt;
&lt;br /&gt;
=== Intrusion Prevention ===&lt;br /&gt;
* Fail2ban&lt;br /&gt;
&lt;br /&gt;
= Coordination =&lt;br /&gt;
* [https://www.loomio.org/g/2bjVXqAu/fosscommunity-in-poddery-com-maintainer-s-group Loomio group] - Mainly used for decision making&lt;br /&gt;
* Matrix room - [https://matrix.to/#/#poddery:poddery.com #poddery:poddery.com]&lt;br /&gt;
* [https://git.fosscommunity.in/community/poddery.com/issues Issue tracker] - Used for tracking progress of tasks&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
* Email: poddery at autistici.org (alias that reaches Akhilan, Abhijith Balan, Fayad, Balasankar, Julius, Praveen, Prasobh, Sruthi, Shirish, Vamsee and Manukrishnan)&lt;br /&gt;
* The following people have their GPG keys in the [[#Server_Access|access file]]:&lt;br /&gt;
** ID: 0xCE1F9C674512C22A - Praveen Arimbrathodiyil (piratepin)&lt;br /&gt;
** ID: 0xB77D2E2E23735427 - Balasankar C&lt;br /&gt;
** ID: 0x5D0064186AF037D9 - Manu Krishnan T V&lt;br /&gt;
** ID: 0x51C954405D432381 - Fayad Fami (fayad)&lt;br /&gt;
** ID: 0x863D4DF2ED9C28EF - Abhijith PA&lt;br /&gt;
** ID: 0x6EF48CCD865A1FFC - Syam G Krishnan (sgk)&lt;br /&gt;
** ID: 0xFD49D0BC6FEAECDA - Sagar Ippalpalli&lt;br /&gt;
** ID: 0x92FDAB42A95FF20C - Pirate Bady (piratesin)&lt;br /&gt;
** ID: 0x0B1955F40C691CCE - Kannan&lt;br /&gt;
** ID: 0x32FF6C6F5B7AE248 - Akhil Varkey&lt;br /&gt;
** ID: 0xFBB7061C27CB70C1 - Ranjith Siji&lt;br /&gt;
** ID: 0xEAAFE4A8F39DE34F - Kiran S Kunjumon (hacksk)&lt;br /&gt;
* It&#039;s recommended to setup [http://www.vim.org/scripts/script.php?script_id=3645 Vim GnuPG Plugin] for transparent editing. Those who are new to GPG can follow [https://www.madboa.com/geek/gpg-quickstart/ this guide].&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
Maintained in a private git repo at https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
= Configuration and Maintenance =&lt;br /&gt;
== Disk Partitioning ==&lt;br /&gt;
* RAID 1 setup on 2x2TB HDDs (&amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sdb&amp;lt;/code&amp;gt;).&lt;br /&gt;
 mdadm --verbose --create /dev/mdX --level=mirror --raid-devices=2 /dev/sdaY /dev/sdbY&lt;br /&gt;
* Separate partitions for swap (&amp;lt;code&amp;gt;md0&amp;lt;/code&amp;gt; - 16GB), boot (&amp;lt;code&amp;gt;md1&amp;lt;/code&amp;gt; - 512MB) and root (&amp;lt;code&amp;gt;md2&amp;lt;/code&amp;gt; - 50GB).&lt;br /&gt;
* LVM on Luks for separate encrypted data partitions for database, static files and logs.&lt;br /&gt;
 # Setup LUKS (make sure &amp;lt;code&amp;gt;lvm2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; packages are installed).&lt;br /&gt;
 cryptsetup luksFormat /dev/mdX&lt;br /&gt;
 # Give disk encryption password as specified in the [[#Server_Access|access repo]]&lt;br /&gt;
 cryptsetup luksOpen /dev/mdX poddery&lt;br /&gt;
 &lt;br /&gt;
 # LVM Setup&lt;br /&gt;
 # Create physical volume named &amp;lt;code&amp;gt;poddery&amp;lt;/code&amp;gt;&lt;br /&gt;
 pvcreate /dev/mapper/poddery&lt;br /&gt;
 # Create volume group named &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
 vgcreate data /dev/mapper/poddery&lt;br /&gt;
 # Create logical volumes named &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static&amp;lt;/code&amp;gt;&lt;br /&gt;
 lvcreate -n log /dev/data -L 50G&lt;br /&gt;
 lvcreate -n db /dev/data -L 500G&lt;br /&gt;
 # Assign remaining free space for static files&lt;br /&gt;
 lvcreate -n static /dev/data -l 100%FREE &lt;br /&gt;
 &lt;br /&gt;
 # Setup filesystem on the logical volumes&lt;br /&gt;
 mkfs.ext4 /dev/data/log&lt;br /&gt;
 mkfs.ext4 /dev/data/db&lt;br /&gt;
 mkfs.ext4 /dev/data/static&lt;br /&gt;
 &lt;br /&gt;
 # Create directories for mounting the encrypted partitions&lt;br /&gt;
 mkdir /var/lib/db /var/lib/static /var/log/poddery&lt;br /&gt;
 &lt;br /&gt;
 # Manually mount encrypted partitions. This is needed on each reboot as Hetzner doesn&#039;t provide a web console so that we can&#039;t decrypt the partitions during booting.&lt;br /&gt;
 mount /dev/data/db /var/lib/db&lt;br /&gt;
 mount /dev/data/static /var/lib/static&lt;br /&gt;
 mount /dev/data/log /var/log/poddery&lt;br /&gt;
&lt;br /&gt;
== Hardening checklist ==&lt;br /&gt;
* SSH password based login disabled (allow only key based logins)&lt;br /&gt;
* SSH login disabled for root user (use a normal user with sudo)&lt;br /&gt;
 # Check for the following settings in /etc/ssh/sshd_config:&lt;br /&gt;
 ...&lt;br /&gt;
 PermitRootLogin no&lt;br /&gt;
 ...&lt;br /&gt;
 PasswordAuthentication no&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; firewall enabled with only the ports that needs to be opened ([https://fxdata.cloud/tutorials/set-up-a-firewall-with-ufw-on-ubuntu-16-04 ufw tutorial]):&lt;br /&gt;
 ufw default deny incoming&lt;br /&gt;
 ufw default allow outgoing&lt;br /&gt;
 ufw allow ssh&lt;br /&gt;
 ufw allow http/tcp&lt;br /&gt;
 ufw allow https/tcp&lt;br /&gt;
 ufw allow Turnserver&lt;br /&gt;
 ufw allow XMPP&lt;br /&gt;
 ufw allow 8448&lt;br /&gt;
&lt;br /&gt;
 ufw enable&lt;br /&gt;
 &lt;br /&gt;
 # Verify everything is setup properly&lt;br /&gt;
 ufw status&lt;br /&gt;
 &lt;br /&gt;
 # Enable ufw logging with default mode low&lt;br /&gt;
 ufw logging on&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fail2ban&amp;lt;/code&amp;gt; configured against brute force attacks:&lt;br /&gt;
 # Check for the following line &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 LogLevel VERBOSE&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # Restart SSH and enable fail2ban&lt;br /&gt;
 systemctl restart ssh&lt;br /&gt;
 systemctl enable fail2ban&lt;br /&gt;
 systemctl start fail2ban&lt;br /&gt;
 &lt;br /&gt;
 # To unban an IP, first check &amp;lt;code&amp;gt;/var/log/fail2ban.log&amp;lt;/code&amp;gt; to get the banned IP and then run the following&lt;br /&gt;
 # Here &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; is the defaut jail name, change it if you are using a different jail&lt;br /&gt;
 fail2ban-client set sshd unbanip &amp;lt;banned_ip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Diaspora ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;diaspora-installer&amp;lt;/code&amp;gt; from Debian Buster contrib:&lt;br /&gt;
 apt install diaspora-installer&lt;br /&gt;
&lt;br /&gt;
* Move MySQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop mysql&lt;br /&gt;
 systemctl disable mysql&lt;br /&gt;
 mv /var/lib/mysql /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/mysql /var/lib/&lt;br /&gt;
 systemctl start mysql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/diaspora&lt;br /&gt;
 mv /usr/share/diaspora/public/uploads /var/lib/static/diaspora&lt;br /&gt;
 ln -s /var/lib/static/diaspora/uploads /usr/share/diaspora/public/&lt;br /&gt;
 chown -R diaspora: /var/lib/static/diaspora&lt;br /&gt;
&lt;br /&gt;
* Modify configuration files at &amp;lt;code&amp;gt;/etc/diaspora&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/diaspora.conf&amp;lt;/code&amp;gt; as needed (backup of the current configuration files are available in the [[#Server_Access|access repo]]).&lt;br /&gt;
* Homepage configuration:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;acl&amp;lt;/code&amp;gt; packages are installed&lt;br /&gt;
 # Grant &amp;lt;code&amp;gt;rwx&amp;lt;/code&amp;gt; permissions for the ssh user to &amp;lt;code&amp;gt;/usr/share/diaspora/public&amp;lt;/code&amp;gt;&lt;br /&gt;
 setfacl -m &amp;quot;u:&amp;lt;ssh_user&amp;gt;:rwx&amp;quot; /usr/share/diaspora/public&lt;br /&gt;
 &lt;br /&gt;
 # Clone poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public&lt;br /&gt;
 git clone https://git.fosscommunity.in/community/poddery.com.git&lt;br /&gt;
 cd poddery.com &amp;amp;&amp;amp; mv * .[^.]* .. #Give yes for all files when prompted&lt;br /&gt;
 cd .. &amp;amp;&amp;amp; rmdir poddery.com&lt;br /&gt;
&lt;br /&gt;
* [https://save.poddery.com Save Poddery] repo is maintained as a sub module in poddery.com repo. See this [https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ tutorial] for working with git submodules. &lt;br /&gt;
 # Clone save.poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public/save&lt;br /&gt;
 git submodule init&lt;br /&gt;
 git submodule update&lt;br /&gt;
&lt;br /&gt;
== Matrix ==&lt;br /&gt;
* See the [https://github.com/matrix-org/synapse/blob/master/INSTALL.md official installation guide] of Synapse for installing from source.&lt;br /&gt;
* Nginx is used as reverse proxy to send requests that has &amp;lt;code&amp;gt;/_matrix/*&amp;lt;/code&amp;gt; in URL to Synapse on port &amp;lt;code&amp;gt;8008&amp;lt;/code&amp;gt;. This is configured in &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Shamil&#039;s [https://git.fosscommunity.in/necessary129/synapse-diaspora-auth Synapse Diaspora Auth] script is used to authenticate Synapse with Diaspora database.&lt;br /&gt;
* Move PostgreSQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop postgresql&lt;br /&gt;
 systemctl disable postgresql&lt;br /&gt;
 mv /var/lib/postgres /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/postgres /var/lib/&lt;br /&gt;
 systemctl start postgresql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/synapse&lt;br /&gt;
 mv /var/lib/matrix-synapse/uploads /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/uploads /var/lib/matrix-synapse/&lt;br /&gt;
 mv /var/lib/matrix-synapse/media /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/media /var/lib/matrix-synapse/&lt;br /&gt;
 chown -R matrix-synapse: /var/lib/static/synapse&lt;br /&gt;
&lt;br /&gt;
* Install identity server &amp;lt;code&amp;gt;mxisd&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;deb&amp;lt;/code&amp;gt; package available [https://github.com/kamax-matrix/mxisd/blob/master/docs/install/debian.md here])&lt;br /&gt;
&lt;br /&gt;
=== Workers ===&lt;br /&gt;
* For scalability, Poddery is running [https://github.com/matrix-org/synapse/blob/master/docs/workers.rst workers]. Currently all workers specified in that page, expect &amp;lt;code&amp;gt;synapse.app.appservice&amp;lt;/code&amp;gt; is running on poddery.com&lt;br /&gt;
* A new service [https://gist.github.com/necessary129/5dfbb140e4727496b0ad2bf801c10fdc &amp;lt;code&amp;gt;matrix-synapse@.service&amp;lt;/code&amp;gt;] is installed for the workers (Save the &amp;lt;code&amp;gt;synape_worker&amp;lt;/code&amp;gt; file somewhere like &amp;lt;code&amp;gt;/usr/local/bin/&amp;lt;/code&amp;gt; or something).&lt;br /&gt;
* The worker config can be found at &amp;lt;code&amp;gt;/etc/matrix-synapse/workers&amp;lt;/code&amp;gt;&lt;br /&gt;
* Synapse needs to be put under a reverse proxy see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/matrix&amp;lt;/code&amp;gt;. A lot of &amp;lt;code&amp;gt;/_matrix/&amp;lt;/code&amp;gt; urls needs to be overridden too see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;&lt;br /&gt;
* These lines must be added to &amp;lt;code&amp;gt;homeserver.yaml&amp;lt;/code&amp;gt; as we are running &amp;lt;code&amp;gt;media_repository&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;federation_sender&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pusher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_dir&amp;lt;/code&amp;gt; workers respectively:&lt;br /&gt;
  enable_media_repo: False&lt;br /&gt;
  send_federation: False&lt;br /&gt;
  start_pushers: False&lt;br /&gt;
  update_user_directory: false&lt;br /&gt;
&lt;br /&gt;
* These services must be enabled:&lt;br /&gt;
&lt;br /&gt;
 matrix-synapse@synchrotron.service matrix-synapse@federation_reader.service matrix-synapse@event_creator.service matrix-synapse@federation_sender.service matrix-synapse@pusher.service matrix-synapse@user_dir.service matrix-synapse@media_repository.service matrix-synapse@frontend_proxy.service matrix-synapse@client_reader.service matrix-synapse@synchrotron_2.service&lt;br /&gt;
&lt;br /&gt;
To load balance between the 2 synchrotrons, We are running [https://github.com/Sorunome/matrix-synchrotron-balancer matrix-synchrotron-balancer]. It has a systemd file at &amp;lt;code&amp;gt;/etc/systemd/system/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;. The files are in &amp;lt;code&amp;gt;/opt/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Synapse Updation ===&lt;br /&gt;
* First check [https://github.com/matrix-org/synapse/blob/master/UPGRADE.rst synapse/UPGRADE.rst] to see if anything extra needs to be done. Then, just run &amp;lt;code&amp;gt;/root/upgrade-synapse&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Riot-web Updation === &lt;br /&gt;
* Just run the following (make sure to replace &amp;lt;code&amp;gt;&amp;lt;version&amp;gt;&amp;lt;/code&amp;gt; with a proper version number like &amp;lt;code&amp;gt;v1.0.0&amp;lt;/code&amp;gt;):&lt;br /&gt;
 /var/www/get-riot &amp;lt;version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chat/XMPP ==&lt;br /&gt;
* Steps for setting up Prosody is given at https://wiki.debian.org/Diaspora/XMPP&lt;br /&gt;
 # Follow steps 1 to 6 from https://wiki.debian.org/Diaspora/XMPP and then run the following:&lt;br /&gt;
 mysql -u root -p # Enter password from the access repo&lt;br /&gt;
 &lt;br /&gt;
 CREATE USER &#039;prosody&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;&amp;lt;passwd_in_repo&amp;gt;&#039;;&lt;br /&gt;
 GRANT ALL PRIVILEGES ON diaspora_production.* TO &#039;prosody&#039;@&#039;localhost&#039;;&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 &lt;br /&gt;
 systemctl restart prosody&lt;br /&gt;
&lt;br /&gt;
* Install plugins&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;mercurial&amp;lt;/code&amp;gt; is installed&lt;br /&gt;
 cd /etc &amp;amp;&amp;amp; hg clone https://hg.prosody.im/prosody-modules/ prosody-modules&lt;br /&gt;
&lt;br /&gt;
=== Set Nginx Conf for BOSH URLS ===&lt;br /&gt;
* Add the following in &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration file to enable the BOSH URL to make JSXC Working:&lt;br /&gt;
 upstream chat_cluster {&lt;br /&gt;
   server localhost:5280;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 location /http-bind {&lt;br /&gt;
   proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
   proxy_set_header Host $http_host;&lt;br /&gt;
   proxy_set_header X-Forwarded-Proto https;&lt;br /&gt;
   proxy_redirect off;&lt;br /&gt;
   proxy_connect_timeout 5;&lt;br /&gt;
   proxy_buffering       off;&lt;br /&gt;
   proxy_read_timeout    70;&lt;br /&gt;
   keepalive_timeout     70;&lt;br /&gt;
   send_timeout          70;&lt;br /&gt;
   client_max_body_size 4M;&lt;br /&gt;
   client_body_buffer_size 128K;&lt;br /&gt;
   proxy_pass http://chat_cluster;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.diasporafoundation.org/Integration/Chat#Nginx See here] for more details on &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration. Alternatively, &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; settings can be found [https://github.com/jsxc/jsxc/wiki/Prepare-apache here].&lt;br /&gt;
&lt;br /&gt;
== TLS ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;letsencrypt&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Ensure proper permissions are set for &amp;lt;code&amp;gt;/etc/letsencrypt&amp;lt;/code&amp;gt; and its contents.&lt;br /&gt;
 chown -R root:ssl-cert /etc/letsencrypt&lt;br /&gt;
 chmod g+r -R /etc/letsencrypt&lt;br /&gt;
 chmod g+x /etc/letsencrypt/{archive,live}&lt;br /&gt;
* Generate certificates. For more details see https://certbot.eff.org.&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;diaspora&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/diaspora/ssl&lt;br /&gt;
 &#039;&#039;total 0&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 47 Apr  2 22:47 poddery.com-bundle.pem -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 45 Apr  2 22:48 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/diaspora/ssl/poddery.com-bundle.pem&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/diaspora/ssl/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;prosody&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/prosody/certs/&lt;br /&gt;
 &#039;&#039;total 0&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 40 Mar 28 01:16 poddery.com.crt -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 33 Mar 28 01:16 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/prosody/certs/poddery.com.crt&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/prosody/certs/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Note- letsencrypt executable used below is actually a symlik to /usr/bin/certbot&lt;br /&gt;
* Cron jobs:&lt;br /&gt;
 crontab -e&lt;br /&gt;
 &#039;&#039;30 2 * * 1 letsencrypt renew  &amp;gt;&amp;gt; /var/log/le-renew.log&#039;&#039;&lt;br /&gt;
 &#039;&#039;32 2 * * 1 /etc/init.d/nginx reload&#039;&#039;&lt;br /&gt;
 &#039;&#039;34 2 * * 1 /etc/init.d/prosody reload&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Manually updating TLS certificate:&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos -w /usr/share/diaspora/public  -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save -d save.poddery.com -w /var/www/riot -d chat.poddery.com&lt;br /&gt;
* To include an additional subdomain such as fund.poddery.com use with --expand parameter as shown below&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos --expand -w /usr/share/diaspora/public -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save/ -d save.poddery.com -w /var/www/riot/ -d chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
==Backup==&lt;br /&gt;
&lt;br /&gt;
Backup server is provided by Manu (KVM virtual machine with 180 GB storage and 1 GB ram ). &lt;br /&gt;
&lt;br /&gt;
Debian Stetch was upgraded Debian Buster before database relication of synapse database. &lt;br /&gt;
&lt;br /&gt;
Documentation: https://www.percona.com/blog/2018/09/07/setting-up-streaming-replication-postgresql/&lt;br /&gt;
&lt;br /&gt;
Currently postgres database for matrix-synapse is backed up.&lt;br /&gt;
&lt;br /&gt;
Setup tinc vpn in the backup server&lt;br /&gt;
&lt;br /&gt;
 # apt install tinc&lt;br /&gt;
&lt;br /&gt;
Configure tinc by creating tinc.conf and host podderybackup under label fsci.&lt;br /&gt;
Add tinc-up and tinc-down scripts&lt;br /&gt;
Copy poddery host config to backup server and podderybackup host config to poddery.com server.&lt;br /&gt;
&lt;br /&gt;
Relaod tinc vpn servie at both poddery.com and backup servers&lt;br /&gt;
&lt;br /&gt;
 # systemctl reload tinc@fsci.service&lt;br /&gt;
&lt;br /&gt;
Enable tinc@fsci systemd service for autostart&lt;br /&gt;
&lt;br /&gt;
 # systemctl enable tinc@fsci.service&lt;br /&gt;
&lt;br /&gt;
===Postgresql (for synapse) Primary configuration===&lt;br /&gt;
&lt;br /&gt;
Create postgresql user for replication.&lt;br /&gt;
&lt;br /&gt;
 $ psql -c &amp;quot;CREATE USER replication REPLICATION LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD &#039;yourpassword&#039;;&amp;quot;&lt;br /&gt;
The password is in the access repo if you need it later.&lt;br /&gt;
&lt;br /&gt;
Allow standby to connect to primary using the user just created.&lt;br /&gt;
&lt;br /&gt;
 $ cd /etc/postgresql/11/main&lt;br /&gt;
&lt;br /&gt;
 $ nano pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Add below line to allow replication user to get access to the server&lt;br /&gt;
&lt;br /&gt;
 host    replication     replication     172.16.0.3/32   md5&lt;br /&gt;
&lt;br /&gt;
Next , open the postgres configuration file&lt;br /&gt;
&lt;br /&gt;
 nano postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Set the following configuration options in the postgresql.conf file&lt;br /&gt;
&lt;br /&gt;
 listen_addresses = &#039;localhost,172.16.0.2&#039;&lt;br /&gt;
 port=5432&lt;br /&gt;
 wal_level = replica&lt;br /&gt;
 max_wal_senders = 1&lt;br /&gt;
 wal_keep_segments = 64&lt;br /&gt;
 archive_mode = on&lt;br /&gt;
 archive_command = &#039;cd .&#039;&lt;br /&gt;
&lt;br /&gt;
You need to restart since postgresql.conf was edited and parameters changed,&lt;br /&gt;
&lt;br /&gt;
 # systemctl restart postgresql&lt;br /&gt;
&lt;br /&gt;
===Postgresql (for synapse) Standby configuration: Step 2===&lt;br /&gt;
&lt;br /&gt;
Install postgresql &lt;br /&gt;
&lt;br /&gt;
 # apt install postgresql&lt;br /&gt;
&lt;br /&gt;
Check postgresql server is running&lt;br /&gt;
&lt;br /&gt;
 # su postgres -c psql&lt;br /&gt;
&lt;br /&gt;
Make sure en_US.UTF-8 locale is available&lt;br /&gt;
&lt;br /&gt;
 # dpkg-reconfigure locales&lt;br /&gt;
&lt;br /&gt;
Stop postgresql before changing any configuration&lt;br /&gt;
&lt;br /&gt;
 #systemctl stop postgresql@11-main&lt;br /&gt;
&lt;br /&gt;
Switch to postgres user&lt;br /&gt;
&lt;br /&gt;
 # su - postgres&lt;br /&gt;
 $ cd /etc/postgresql/11/&lt;br /&gt;
&lt;br /&gt;
Open the postgres configuration file&lt;br /&gt;
&lt;br /&gt;
 $ nano postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Set the following configuration options in the postgresql.conf file&lt;br /&gt;
&lt;br /&gt;
 max_connections = 500&lt;br /&gt;
 max_worker_processes = 16&lt;br /&gt;
&lt;br /&gt;
Copy data from master and create recovery.conf&lt;br /&gt;
&lt;br /&gt;
 $ pg_basebackup -h git.fosscommunity.in -D /var/lib/postgresql/11/main/ -P -U rep --wal-method=fetch  -R&lt;br /&gt;
&lt;br /&gt;
Start the stopped postgresql service&lt;br /&gt;
&lt;br /&gt;
 # systemctl start postgresql@11-main&lt;br /&gt;
&lt;br /&gt;
===Postgresql (for synapse) Replication Status===&lt;br /&gt;
&lt;br /&gt;
On Primary,&lt;br /&gt;
&lt;br /&gt;
 $ ps -ef | grep sender&lt;br /&gt;
 $ psql -c &amp;quot;select * from pg_stat_activity where usename=&#039;rep&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
On Standby,&lt;br /&gt;
&lt;br /&gt;
 $ ps -ef | grep receiver&lt;br /&gt;
&lt;br /&gt;
= History =&lt;br /&gt;
* [[Poddery/Archive|See here]] for the archive of Poddery wiki page before the migration to Hetzner.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10876</id>
		<title>Poddery - Diaspora, Matrix and XMPP</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10876"/>
		<updated>2020-06-25T08:39:52Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We run decentralized and federated [https://diasporafoundation.org/ Diaspora] social netowrk, [https://xmpp.org/ XMPP] and [https://matrix.org Matrix] instant messaging services at [https://poddery.com poddery.com]. Along with Diaspora, Poddery username and password can be used to access XMPP and Matrix services as well. [https://chat.poddery.com chat.poddery.com] provides Riot client (accessed by a web browser), which can be used to connect to any Matrix server without installing a Riot app/client.&lt;br /&gt;
&lt;br /&gt;
= Environment =&lt;br /&gt;
== Hosting ==&lt;br /&gt;
Poddery is hosted at [https://www.hetzner.com Hetzner] with the following specs:&lt;br /&gt;
&lt;br /&gt;
* Intel Xeon E3-1246V3 Process - 4 Cores, 3.5GHz&lt;br /&gt;
* 4TB HDD&lt;br /&gt;
* 32GB DDR3 RAM&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
* Debian Buster&lt;br /&gt;
&lt;br /&gt;
== User Visible Services ==&lt;br /&gt;
=== Diaspora ===&lt;br /&gt;
* Currently installed version is 0.7.6.1 which is available in [https://packages.debian.org/buster/diaspora-installer Debian Buster contrib]&lt;br /&gt;
* For live statistics see https://poddery.com/statistics&lt;br /&gt;
&lt;br /&gt;
=== Chat/XMPP ===&lt;br /&gt;
* [https://prosody.im/ Prosody] is used as the XMPP server which is modern and lightweight.&lt;br /&gt;
* Currently installed version is 0.11.2 which is available in [https://packages.debian.org/buster/prosody Debian Buster].&lt;br /&gt;
* All XEPs are enabled which the [https://conversations.im/ Conversations app] support.&lt;br /&gt;
&lt;br /&gt;
=== Chat/Matrix ===&lt;br /&gt;
* [https://matrix.org/docs/projects/server/synapse.html Synapse] is used as the Matrix server.&lt;br /&gt;
* Synapse is currently installed directly from the [https://github.com/matrix-org/synapse official GitHub repo].&lt;br /&gt;
* Riot-web Matrix client is hosted at https://chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
=== Homepage ===&lt;br /&gt;
Homepage and other static pages are maintained in FSCI [https://git.fosscommunity.in GitLab instance]. &lt;br /&gt;
* poddery.com -&amp;gt; https://git.fosscommunity.in/community/poddery.com&lt;br /&gt;
* save.poddery.com -&amp;gt; https://git.fosscommunity.in/community/save.poddery.com&lt;br /&gt;
* fund.poddery.com -&amp;gt; https://git.fosscommunity.in/community/fund-poddery&lt;br /&gt;
&lt;br /&gt;
== Backend Services ==&lt;br /&gt;
=== Web Server / Reverse Proxy ===&lt;br /&gt;
* Nginx web server which also acts as front-end (reverse proxy) for Diaspora and Matrix.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
* PostgreSQL for Matrix&lt;br /&gt;
* MySQL for Diaspora&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;: Consider migrating to PostgreSQL to optimize resources (We can reduce one service and RAM usage).&lt;br /&gt;
&lt;br /&gt;
=== Email ===&lt;br /&gt;
* Exim&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS certificates ===&lt;br /&gt;
* Let&#039;s Encrypt&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
* UFW (Uncomplicated Firewall)&lt;br /&gt;
&lt;br /&gt;
=== Intrusion Prevention ===&lt;br /&gt;
* Fail2ban&lt;br /&gt;
&lt;br /&gt;
= Coordination =&lt;br /&gt;
* [https://www.loomio.org/g/2bjVXqAu/fosscommunity-in-poddery-com-maintainer-s-group Loomio group] - Mainly used for decision making&lt;br /&gt;
* Matrix room - [https://matrix.to/#/#poddery:poddery.com #poddery:poddery.com]&lt;br /&gt;
* [https://git.fosscommunity.in/community/poddery.com/issues Issue tracker] - Used for tracking progress of tasks&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
* Email: poddery at autistici.org (alias that reaches Akhilan, Abhijith Balan, Fayad, Balasankar, Julius, Praveen, Prasobh, Sruthi, Shirish, Vamsee and Manukrishnan)&lt;br /&gt;
* The following people have their GPG keys in the [[#Server_Access|access file]]:&lt;br /&gt;
** ID: 0xCE1F9C674512C22A - Praveen Arimbrathodiyil (piratepin)&lt;br /&gt;
** ID: 0xB77D2E2E23735427 - Balasankar C&lt;br /&gt;
** ID: 0x5D0064186AF037D9 - Manu Krishnan T V&lt;br /&gt;
** ID: 0x51C954405D432381 - Fayad Fami (fayad)&lt;br /&gt;
** ID: 0x863D4DF2ED9C28EF - Abhijith PA&lt;br /&gt;
** ID: 0x6EF48CCD865A1FFC - Syam G Krishnan (sgk)&lt;br /&gt;
** ID: 0xFD49D0BC6FEAECDA - Sagar Ippalpalli&lt;br /&gt;
** ID: 0x92FDAB42A95FF20C - Pirate Bady (piratesin)&lt;br /&gt;
** ID: 0x0B1955F40C691CCE - Kannan&lt;br /&gt;
** ID: 0x32FF6C6F5B7AE248 - Akhil Varkey&lt;br /&gt;
** ID: 0xFBB7061C27CB70C1 - Ranjith Siji&lt;br /&gt;
** ID: 0xEAAFE4A8F39DE34F - Kiran S Kunjumon (hacksk)&lt;br /&gt;
* It&#039;s recommended to setup [http://www.vim.org/scripts/script.php?script_id=3645 Vim GnuPG Plugin] for transparent editing. Those who are new to GPG can follow [https://www.madboa.com/geek/gpg-quickstart/ this guide].&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
Maintained in a private git repo at https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
= Configuration and Maintenance =&lt;br /&gt;
== Disk Partitioning ==&lt;br /&gt;
* RAID 1 setup on 2x2TB HDDs (&amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sdb&amp;lt;/code&amp;gt;).&lt;br /&gt;
 mdadm --verbose --create /dev/mdX --level=mirror --raid-devices=2 /dev/sdaY /dev/sdbY&lt;br /&gt;
* Separate partitions for swap (&amp;lt;code&amp;gt;md0&amp;lt;/code&amp;gt; - 16GB), boot (&amp;lt;code&amp;gt;md1&amp;lt;/code&amp;gt; - 512MB) and root (&amp;lt;code&amp;gt;md2&amp;lt;/code&amp;gt; - 50GB).&lt;br /&gt;
* LVM on Luks for separate encrypted data partitions for database, static files and logs.&lt;br /&gt;
 # Setup LUKS (make sure &amp;lt;code&amp;gt;lvm2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; packages are installed).&lt;br /&gt;
 cryptsetup luksFormat /dev/mdX&lt;br /&gt;
 # Give disk encryption password as specified in the [[#Server_Access|access repo]]&lt;br /&gt;
 cryptsetup luksOpen /dev/mdX poddery&lt;br /&gt;
 &lt;br /&gt;
 # LVM Setup&lt;br /&gt;
 # Create physical volume named &amp;lt;code&amp;gt;poddery&amp;lt;/code&amp;gt;&lt;br /&gt;
 pvcreate /dev/mapper/poddery&lt;br /&gt;
 # Create volume group named &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
 vgcreate data /dev/mapper/poddery&lt;br /&gt;
 # Create logical volumes named &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static&amp;lt;/code&amp;gt;&lt;br /&gt;
 lvcreate -n log /dev/data -L 50G&lt;br /&gt;
 lvcreate -n db /dev/data -L 500G&lt;br /&gt;
 # Assign remaining free space for static files&lt;br /&gt;
 lvcreate -n static /dev/data -l 100%FREE &lt;br /&gt;
 &lt;br /&gt;
 # Setup filesystem on the logical volumes&lt;br /&gt;
 mkfs.ext4 /dev/data/log&lt;br /&gt;
 mkfs.ext4 /dev/data/db&lt;br /&gt;
 mkfs.ext4 /dev/data/static&lt;br /&gt;
 &lt;br /&gt;
 # Create directories for mounting the encrypted partitions&lt;br /&gt;
 mkdir /var/lib/db /var/lib/static /var/log/poddery&lt;br /&gt;
 &lt;br /&gt;
 # Manually mount encrypted partitions. This is needed on each reboot as Hetzner doesn&#039;t provide a web console so that we can&#039;t decrypt the partitions during booting.&lt;br /&gt;
 mount /dev/data/db /var/lib/db&lt;br /&gt;
 mount /dev/data/static /var/lib/static&lt;br /&gt;
 mount /dev/data/log /var/log/poddery&lt;br /&gt;
&lt;br /&gt;
== Hardening checklist ==&lt;br /&gt;
* SSH password based login disabled (allow only key based logins)&lt;br /&gt;
* SSH login disabled for root user (use a normal user with sudo)&lt;br /&gt;
 # Check for the following settings in /etc/ssh/sshd_config:&lt;br /&gt;
 ...&lt;br /&gt;
 PermitRootLogin no&lt;br /&gt;
 ...&lt;br /&gt;
 PasswordAuthentication no&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; firewall enabled with only the ports that needs to be opened ([https://fxdata.cloud/tutorials/set-up-a-firewall-with-ufw-on-ubuntu-16-04 ufw tutorial]):&lt;br /&gt;
 ufw default deny incoming&lt;br /&gt;
 ufw default allow outgoing&lt;br /&gt;
 ufw allow ssh&lt;br /&gt;
 ufw allow http/tcp&lt;br /&gt;
 ufw allow https/tcp&lt;br /&gt;
 ufw allow Turnserver&lt;br /&gt;
 ufw allow XMPP&lt;br /&gt;
 ufw allow 8448&lt;br /&gt;
&lt;br /&gt;
 ufw enable&lt;br /&gt;
 &lt;br /&gt;
 # Verify everything is setup properly&lt;br /&gt;
 ufw status&lt;br /&gt;
 &lt;br /&gt;
 # Enable ufw logging with default mode low&lt;br /&gt;
 ufw logging on&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fail2ban&amp;lt;/code&amp;gt; configured against brute force attacks:&lt;br /&gt;
 # Check for the following line &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 LogLevel VERBOSE&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # Restart SSH and enable fail2ban&lt;br /&gt;
 systemctl restart ssh&lt;br /&gt;
 systemctl enable fail2ban&lt;br /&gt;
 systemctl start fail2ban&lt;br /&gt;
 &lt;br /&gt;
 # To unban an IP, first check &amp;lt;code&amp;gt;/var/log/fail2ban.log&amp;lt;/code&amp;gt; to get the banned IP and then run the following&lt;br /&gt;
 # Here &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; is the defaut jail name, change it if you are using a different jail&lt;br /&gt;
 fail2ban-client set sshd unbanip &amp;lt;banned_ip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Diaspora ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;diaspora-installer&amp;lt;/code&amp;gt; from Debian Buster contrib:&lt;br /&gt;
 apt install diaspora-installer&lt;br /&gt;
&lt;br /&gt;
* Move MySQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop mysql&lt;br /&gt;
 systemctl disable mysql&lt;br /&gt;
 mv /var/lib/mysql /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/mysql /var/lib/&lt;br /&gt;
 systemctl start mysql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/diaspora&lt;br /&gt;
 mv /usr/share/diaspora/public/uploads /var/lib/static/diaspora&lt;br /&gt;
 ln -s /var/lib/static/diaspora/uploads /usr/share/diaspora/public/&lt;br /&gt;
 chown -R diaspora: /var/lib/static/diaspora&lt;br /&gt;
&lt;br /&gt;
* Modify configuration files at &amp;lt;code&amp;gt;/etc/diaspora&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/diaspora.conf&amp;lt;/code&amp;gt; as needed (backup of the current configuration files are available in the [[#Server_Access|access repo]]).&lt;br /&gt;
* Homepage configuration:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;acl&amp;lt;/code&amp;gt; packages are installed&lt;br /&gt;
 # Grant &amp;lt;code&amp;gt;rwx&amp;lt;/code&amp;gt; permissions for the ssh user to &amp;lt;code&amp;gt;/usr/share/diaspora/public&amp;lt;/code&amp;gt;&lt;br /&gt;
 setfacl -m &amp;quot;u:&amp;lt;ssh_user&amp;gt;:rwx&amp;quot; /usr/share/diaspora/public&lt;br /&gt;
 &lt;br /&gt;
 # Clone poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public&lt;br /&gt;
 git clone https://git.fosscommunity.in/community/poddery.com.git&lt;br /&gt;
 cd poddery.com &amp;amp;&amp;amp; mv * .[^.]* .. #Give yes for all files when prompted&lt;br /&gt;
 cd .. &amp;amp;&amp;amp; rmdir poddery.com&lt;br /&gt;
&lt;br /&gt;
* [https://save.poddery.com Save Poddery] repo is maintained as a sub module in poddery.com repo. See this [https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ tutorial] for working with git submodules. &lt;br /&gt;
 # Clone save.poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public/save&lt;br /&gt;
 git submodule init&lt;br /&gt;
 git submodule update&lt;br /&gt;
&lt;br /&gt;
== Matrix ==&lt;br /&gt;
* See the [https://github.com/matrix-org/synapse/blob/master/INSTALL.md official installation guide] of Synapse for installing from source.&lt;br /&gt;
* Nginx is used as reverse proxy to send requests that has &amp;lt;code&amp;gt;/_matrix/*&amp;lt;/code&amp;gt; in URL to Synapse on port &amp;lt;code&amp;gt;8008&amp;lt;/code&amp;gt;. This is configured in &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Shamil&#039;s [https://git.fosscommunity.in/necessary129/synapse-diaspora-auth Synapse Diaspora Auth] script is used to authenticate Synapse with Diaspora database.&lt;br /&gt;
* Move PostgreSQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop postgresql&lt;br /&gt;
 systemctl disable postgresql&lt;br /&gt;
 mv /var/lib/postgres /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/postgres /var/lib/&lt;br /&gt;
 systemctl start postgresql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/synapse&lt;br /&gt;
 mv /var/lib/matrix-synapse/uploads /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/uploads /var/lib/matrix-synapse/&lt;br /&gt;
 mv /var/lib/matrix-synapse/media /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/media /var/lib/matrix-synapse/&lt;br /&gt;
 chown -R matrix-synapse: /var/lib/static/synapse&lt;br /&gt;
&lt;br /&gt;
* Install identity server &amp;lt;code&amp;gt;mxisd&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;deb&amp;lt;/code&amp;gt; package available [https://github.com/kamax-matrix/mxisd/blob/master/docs/install/debian.md here])&lt;br /&gt;
&lt;br /&gt;
=== Workers ===&lt;br /&gt;
* For scalability, Poddery is running [https://github.com/matrix-org/synapse/blob/master/docs/workers.rst workers]. Currently all workers specified in that page, expect &amp;lt;code&amp;gt;synapse.app.appservice&amp;lt;/code&amp;gt; is running on poddery.com&lt;br /&gt;
* A new service [https://gist.github.com/necessary129/5dfbb140e4727496b0ad2bf801c10fdc &amp;lt;code&amp;gt;matrix-synapse@.service&amp;lt;/code&amp;gt;] is installed for the workers (Save the &amp;lt;code&amp;gt;synape_worker&amp;lt;/code&amp;gt; file somewhere like &amp;lt;code&amp;gt;/usr/local/bin/&amp;lt;/code&amp;gt; or something).&lt;br /&gt;
* The worker config can be found at &amp;lt;code&amp;gt;/etc/matrix-synapse/workers&amp;lt;/code&amp;gt;&lt;br /&gt;
* Synapse needs to be put under a reverse proxy see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/matrix&amp;lt;/code&amp;gt;. A lot of &amp;lt;code&amp;gt;/_matrix/&amp;lt;/code&amp;gt; urls needs to be overridden too see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;&lt;br /&gt;
* These lines must be added to &amp;lt;code&amp;gt;homeserver.yaml&amp;lt;/code&amp;gt; as we are running &amp;lt;code&amp;gt;media_repository&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;federation_sender&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pusher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_dir&amp;lt;/code&amp;gt; workers respectively:&lt;br /&gt;
  enable_media_repo: False&lt;br /&gt;
  send_federation: False&lt;br /&gt;
  start_pushers: False&lt;br /&gt;
  update_user_directory: false&lt;br /&gt;
&lt;br /&gt;
* These services must be enabled:&lt;br /&gt;
&lt;br /&gt;
 matrix-synapse@synchrotron.service matrix-synapse@federation_reader.service matrix-synapse@event_creator.service matrix-synapse@federation_sender.service matrix-synapse@pusher.service matrix-synapse@user_dir.service matrix-synapse@media_repository.service matrix-synapse@frontend_proxy.service matrix-synapse@client_reader.service matrix-synapse@synchrotron_2.service&lt;br /&gt;
&lt;br /&gt;
To load balance between the 2 synchrotrons, We are running [https://github.com/Sorunome/matrix-synchrotron-balancer matrix-synchrotron-balancer]. It has a systemd file at &amp;lt;code&amp;gt;/etc/systemd/system/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;. The files are in &amp;lt;code&amp;gt;/opt/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Synapse Updation ===&lt;br /&gt;
* First check [https://github.com/matrix-org/synapse/blob/master/UPGRADE.rst synapse/UPGRADE.rst] to see if anything extra needs to be done. Then, just run &amp;lt;code&amp;gt;/root/upgrade-synapse&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Riot-web Updation === &lt;br /&gt;
* Just run the following (make sure to replace &amp;lt;code&amp;gt;&amp;lt;version&amp;gt;&amp;lt;/code&amp;gt; with a proper version number like &amp;lt;code&amp;gt;v1.0.0&amp;lt;/code&amp;gt;):&lt;br /&gt;
 /var/www/get-riot &amp;lt;version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chat/XMPP ==&lt;br /&gt;
* Steps for setting up Prosody is given at https://wiki.debian.org/Diaspora/XMPP&lt;br /&gt;
 # Follow steps 1 to 6 from https://wiki.debian.org/Diaspora/XMPP and then run the following:&lt;br /&gt;
 mysql -u root -p # Enter password from the access repo&lt;br /&gt;
 &lt;br /&gt;
 CREATE USER &#039;prosody&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;&amp;lt;passwd_in_repo&amp;gt;&#039;;&lt;br /&gt;
 GRANT ALL PRIVILEGES ON diaspora_production.* TO &#039;prosody&#039;@&#039;localhost&#039;;&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 &lt;br /&gt;
 systemctl restart prosody&lt;br /&gt;
&lt;br /&gt;
* Install plugins&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;mercurial&amp;lt;/code&amp;gt; is installed&lt;br /&gt;
 cd /etc &amp;amp;&amp;amp; hg clone https://hg.prosody.im/prosody-modules/ prosody-modules&lt;br /&gt;
&lt;br /&gt;
=== Set Nginx Conf for BOSH URLS ===&lt;br /&gt;
* Add the following in &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration file to enable the BOSH URL to make JSXC Working:&lt;br /&gt;
 upstream chat_cluster {&lt;br /&gt;
   server localhost:5280;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 location /http-bind {&lt;br /&gt;
   proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
   proxy_set_header Host $http_host;&lt;br /&gt;
   proxy_set_header X-Forwarded-Proto https;&lt;br /&gt;
   proxy_redirect off;&lt;br /&gt;
   proxy_connect_timeout 5;&lt;br /&gt;
   proxy_buffering       off;&lt;br /&gt;
   proxy_read_timeout    70;&lt;br /&gt;
   keepalive_timeout     70;&lt;br /&gt;
   send_timeout          70;&lt;br /&gt;
   client_max_body_size 4M;&lt;br /&gt;
   client_body_buffer_size 128K;&lt;br /&gt;
   proxy_pass http://chat_cluster;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.diasporafoundation.org/Integration/Chat#Nginx See here] for more details on &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration. Alternatively, &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; settings can be found [https://github.com/jsxc/jsxc/wiki/Prepare-apache here].&lt;br /&gt;
&lt;br /&gt;
== TLS ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;letsencrypt&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Ensure proper permissions are set for &amp;lt;code&amp;gt;/etc/letsencrypt&amp;lt;/code&amp;gt; and its contents.&lt;br /&gt;
 chown -R root:ssl-cert /etc/letsencrypt&lt;br /&gt;
 chmod g+r -R /etc/letsencrypt&lt;br /&gt;
 chmod g+x /etc/letsencrypt/{archive,live}&lt;br /&gt;
* Generate certificates. For more details see https://certbot.eff.org.&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;diaspora&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/diaspora/ssl&lt;br /&gt;
 &#039;&#039;total 0&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 47 Apr  2 22:47 poddery.com-bundle.pem -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 45 Apr  2 22:48 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/diaspora/ssl/poddery.com-bundle.pem&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/diaspora/ssl/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;prosody&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/prosody/certs/&lt;br /&gt;
 &#039;&#039;total 0&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 40 Mar 28 01:16 poddery.com.crt -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 33 Mar 28 01:16 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/prosody/certs/poddery.com.crt&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/prosody/certs/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Note- letsencrypt executable used below is actually a symlik to /usr/bin/certbot&lt;br /&gt;
* Cron jobs:&lt;br /&gt;
 crontab -e&lt;br /&gt;
 &#039;&#039;30 2 * * 1 letsencrypt renew  &amp;gt;&amp;gt; /var/log/le-renew.log&#039;&#039;&lt;br /&gt;
 &#039;&#039;32 2 * * 1 /etc/init.d/nginx reload&#039;&#039;&lt;br /&gt;
 &#039;&#039;34 2 * * 1 /etc/init.d/prosody reload&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Manually updating TLS certificate:&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos -w /usr/share/diaspora/public  -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save -d save.poddery.com -w /var/www/riot -d chat.poddery.com&lt;br /&gt;
* To include an additional subdomain such as fund.poddery.com use with --expand parameter as shown below&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos --expand -w /usr/share/diaspora/public -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save/ -d save.poddery.com -w /var/www/riot/ -d chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
==Backup==&lt;br /&gt;
&lt;br /&gt;
Backup server is provided by Manu (KVM virtual machine with 180 GB storage and 1 GB ram ). &lt;br /&gt;
&lt;br /&gt;
Debian Stetch was upgraded Debian Buster before database relication of synapse database. &lt;br /&gt;
&lt;br /&gt;
Documentation: https://www.percona.com/blog/2018/09/07/setting-up-streaming-replication-postgresql/&lt;br /&gt;
&lt;br /&gt;
Currently postgres database for matrix-synapse is backed up.&lt;br /&gt;
&lt;br /&gt;
Setup tinc vpn in the backup server&lt;br /&gt;
&lt;br /&gt;
 # apt install tinc&lt;br /&gt;
&lt;br /&gt;
Configure tinc by creating tinc.conf and host podderybackup under label fsci.&lt;br /&gt;
Add tinc-up and tinc-down scripts&lt;br /&gt;
Copy poddery host config to backup server and podderybackup host config to poddery.com server.&lt;br /&gt;
&lt;br /&gt;
Relaod tinc vpn servie at both poddery.com and backup servers&lt;br /&gt;
&lt;br /&gt;
 # systemctl reload tinc@fsci.service&lt;br /&gt;
&lt;br /&gt;
Enable tinc@fsci systemd service for autostart&lt;br /&gt;
&lt;br /&gt;
 # systemctl enable tinc@fsci.service&lt;br /&gt;
&lt;br /&gt;
===Postgresql (for synapse) Primary configuration===&lt;br /&gt;
&lt;br /&gt;
Create postgresql user for replication.&lt;br /&gt;
&lt;br /&gt;
 $ psql -c &amp;quot;CREATE USER replication REPLICATION LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD &#039;yourpassword&#039;;&amp;quot;&lt;br /&gt;
The password is in the access repo if you need it later.&lt;br /&gt;
&lt;br /&gt;
Allow standby to connect to primary using the user just created.&lt;br /&gt;
&lt;br /&gt;
 $ cd /etc/postgresql/11/main&lt;br /&gt;
&lt;br /&gt;
 $ nano pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Add below line to allow replication user to get access to the server&lt;br /&gt;
&lt;br /&gt;
 host    replication     replication     172.16.0.3/32   md5&lt;br /&gt;
&lt;br /&gt;
Next , open the postgres configuration file&lt;br /&gt;
&lt;br /&gt;
 nano postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Set the following configuration options in the postgresql.conf file&lt;br /&gt;
&lt;br /&gt;
 listen_addresses = &#039;localhost,172.16.0.2&#039;&lt;br /&gt;
 port=5432&lt;br /&gt;
 wal_level = replica&lt;br /&gt;
 max_wal_senders = 1&lt;br /&gt;
 wal_keep_segments = 64&lt;br /&gt;
 archive_mode = on&lt;br /&gt;
 archive_command = &#039;cd .&#039;&lt;br /&gt;
&lt;br /&gt;
You need to restart since postgresql.conf was edited and parameters changed,&lt;br /&gt;
&lt;br /&gt;
 # systemctl restart postgresql&lt;br /&gt;
&lt;br /&gt;
===Postgresql (for synapse) Standby configuration: Step 2===&lt;br /&gt;
&lt;br /&gt;
Install postgresql &lt;br /&gt;
&lt;br /&gt;
 # apt install postgresql&lt;br /&gt;
&lt;br /&gt;
Check postgresql server is running&lt;br /&gt;
&lt;br /&gt;
 # su postgres -c psql&lt;br /&gt;
&lt;br /&gt;
Make sure en_US.UTF-8 locale is available&lt;br /&gt;
&lt;br /&gt;
 # dpkg-reconfigure locales&lt;br /&gt;
&lt;br /&gt;
Stop postgresql before changing any configuration&lt;br /&gt;
&lt;br /&gt;
 #systemctl stop postgresql@11-main&lt;br /&gt;
&lt;br /&gt;
Switch to postgres user&lt;br /&gt;
&lt;br /&gt;
 # su - postgres&lt;br /&gt;
 $ cd /etc/postgresql/11/&lt;br /&gt;
&lt;br /&gt;
Open the postgres configuration file&lt;br /&gt;
&lt;br /&gt;
 $ nano postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Set the following configuration options in the postgresql.conf file&lt;br /&gt;
&lt;br /&gt;
 max_connections = 500&lt;br /&gt;
 max_worker_processes = 16&lt;br /&gt;
&lt;br /&gt;
Copy data from master and create recovery.conf&lt;br /&gt;
&lt;br /&gt;
 $ pg_basebackup -h git.fosscommunity.in -D /var/lib/postgresql/11/main/ -P -U rep --wal-method=fetch  -R&lt;br /&gt;
&lt;br /&gt;
Start the stopped postgresql service&lt;br /&gt;
&lt;br /&gt;
 # systemctl start postgresql@11-main&lt;br /&gt;
&lt;br /&gt;
===Replication Status===&lt;br /&gt;
&lt;br /&gt;
On Primary,&lt;br /&gt;
&lt;br /&gt;
 $ ps -ef | grep sender&lt;br /&gt;
 $ psql -c &amp;quot;select * from pg_stat_activity where usename=&#039;rep&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
On Standby,&lt;br /&gt;
&lt;br /&gt;
 $ ps -ef | grep receiver&lt;br /&gt;
&lt;br /&gt;
= History =&lt;br /&gt;
* [[Poddery/Archive|See here]] for the archive of Poddery wiki page before the migration to Hetzner.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10875</id>
		<title>Loomio/Archive 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10875"/>
		<updated>2020-05-04T17:02:45Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: AkhilVarkey moved page Loomio/archive 1 to Loomio/Archive 1 without leaving a redirect: Making the naming compatible with Poddery Archive and keeping standard procedure for moving pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.fsci.org.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals. &lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We were now on a [https://www.scaleway.com/virtual-cloud-servers START1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
We were on a [https://www.scaleway.com/virtual-cloud-servers VC1S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Flexible Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €2.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server.&lt;br /&gt;
&lt;br /&gt;
=== Loomio Deployment Reference ===&lt;br /&gt;
&lt;br /&gt;
Loomio was deployed and updated on codema.fsci.org.in using this official guide - https://github.com/loomio/loomio-deploy&lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10874</id>
		<title>Loomio/Archive 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10874"/>
		<updated>2020-05-04T16:59:44Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: AkhilVarkey moved page Loomio/archive/1 to Loomio/archive 1 without leaving a redirect: Archiving old loomio information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.fsci.org.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals. &lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We were now on a [https://www.scaleway.com/virtual-cloud-servers START1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
We were on a [https://www.scaleway.com/virtual-cloud-servers VC1S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Flexible Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €2.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server.&lt;br /&gt;
&lt;br /&gt;
=== Loomio Deployment Reference ===&lt;br /&gt;
&lt;br /&gt;
Loomio was deployed and updated on codema.fsci.org.in using this official guide - https://github.com/loomio/loomio-deploy&lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10873</id>
		<title>Loomio/Archive 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10873"/>
		<updated>2020-05-04T16:58:33Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: AkhilVarkey moved page Loomio to Loomio/archive/1 without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.fsci.org.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals. &lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We were now on a [https://www.scaleway.com/virtual-cloud-servers START1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
We were on a [https://www.scaleway.com/virtual-cloud-servers VC1S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Flexible Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €2.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server.&lt;br /&gt;
&lt;br /&gt;
=== Loomio Deployment Reference ===&lt;br /&gt;
&lt;br /&gt;
Loomio was deployed and updated on codema.fsci.org.in using this official guide - https://github.com/loomio/loomio-deploy&lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10872</id>
		<title>Poddery - Diaspora, Matrix and XMPP</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10872"/>
		<updated>2020-04-22T09:15:05Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We run decentralized and federated [https://diasporafoundation.org/ Diaspora] social netowrk, [https://xmpp.org/ XMPP] and [https://matrix.org Matrix] instant messaging services at [https://poddery.com poddery.com]. Along with Diaspora, Poddery username and password can be used to access XMPP and Matrix services as well. [https://chat.poddery.com chat.poddery.com] provides Riot client (accessed by a web browser), which can be used to connect to any Matrix server without installing a Riot app/client.&lt;br /&gt;
&lt;br /&gt;
= Environment =&lt;br /&gt;
== Hosting ==&lt;br /&gt;
Poddery is hosted at [https://www.hetzner.com Hetzner] with the following specs:&lt;br /&gt;
&lt;br /&gt;
* Intel Xeon E3-1246V3 Process - 4 Cores, 3.5GHz&lt;br /&gt;
* 4TB HDD&lt;br /&gt;
* 32GB DDR3 RAM&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
* Debian Buster&lt;br /&gt;
&lt;br /&gt;
== User Visible Services ==&lt;br /&gt;
=== Diaspora ===&lt;br /&gt;
* Currently installed version is 0.7.6.1 which is available in [https://packages.debian.org/buster/diaspora-installer Debian Buster contrib]&lt;br /&gt;
* For live statistics see https://poddery.com/statistics&lt;br /&gt;
&lt;br /&gt;
=== Chat/XMPP ===&lt;br /&gt;
* [https://prosody.im/ Prosody] is used as the XMPP server which is modern and lightweight.&lt;br /&gt;
* Currently installed version is 0.11.2 which is available in [https://packages.debian.org/buster/prosody Debian Buster].&lt;br /&gt;
* All XEPs are enabled which the [https://conversations.im/ Conversations app] support.&lt;br /&gt;
&lt;br /&gt;
=== Chat/Matrix ===&lt;br /&gt;
* [https://matrix.org/docs/projects/server/synapse.html Synapse] is used as the Matrix server.&lt;br /&gt;
* Synapse is currently installed directly from the [https://github.com/matrix-org/synapse official GitHub repo].&lt;br /&gt;
* Riot-web Matrix client is hosted at https://chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
=== Homepage ===&lt;br /&gt;
Homepage and other static pages are maintained in FSCI [https://git.fosscommunity.in GitLab instance]. &lt;br /&gt;
* poddery.com -&amp;gt; https://git.fosscommunity.in/community/poddery.com&lt;br /&gt;
* save.poddery.com -&amp;gt; https://git.fosscommunity.in/community/save.poddery.com&lt;br /&gt;
* fund.poddery.com -&amp;gt; https://git.fosscommunity.in/community/fund-poddery&lt;br /&gt;
&lt;br /&gt;
== Backend Services ==&lt;br /&gt;
=== Web Server / Reverse Proxy ===&lt;br /&gt;
* Nginx web server which also acts as front-end (reverse proxy) for Diaspora and Matrix.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
* PostgreSQL for Matrix&lt;br /&gt;
* MySQL for Diaspora&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;: Consider migrating to PostgreSQL to optimize resources (We can reduce one service and RAM usage).&lt;br /&gt;
&lt;br /&gt;
=== Email ===&lt;br /&gt;
* Exim&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS certificates ===&lt;br /&gt;
* Let&#039;s Encrypt&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
* UFW (Uncomplicated Firewall)&lt;br /&gt;
&lt;br /&gt;
=== Intrusion Prevention ===&lt;br /&gt;
* Fail2ban&lt;br /&gt;
&lt;br /&gt;
= Coordination =&lt;br /&gt;
* [https://www.loomio.org/g/2bjVXqAu/fosscommunity-in-poddery-com-maintainer-s-group Loomio group] - Mainly used for decision making&lt;br /&gt;
* Matrix room - [https://matrix.to/#/#poddery:poddery.com #poddery:poddery.com]&lt;br /&gt;
* [https://git.fosscommunity.in/community/poddery.com/issues Issue tracker] - Used for tracking progress of tasks&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
* Email: poddery at autistici.org (alias that reaches Akhilan, Abhijith Balan, Fayad, Balasankar, Julius, Praveen, Prasobh, Sruthi, Shirish, Vamsee and Manukrishnan)&lt;br /&gt;
* The following people have their GPG keys in the [[#Server_Access|access file]]:&lt;br /&gt;
** ID: 0xCE1F9C674512C22A - Praveen Arimbrathodiyil (piratepin)&lt;br /&gt;
** ID: 0xB77D2E2E23735427 - Balasankar C&lt;br /&gt;
** ID: 0x5D0064186AF037D9 - Manu Krishnan T V&lt;br /&gt;
** ID: 0x51C954405D432381 - Fayad Fami (fayad)&lt;br /&gt;
** ID: 0x863D4DF2ED9C28EF - Abhijith PA&lt;br /&gt;
** ID: 0x6EF48CCD865A1FFC - Syam G Krishnan (sgk)&lt;br /&gt;
** ID: 0xFD49D0BC6FEAECDA - Sagar Ippalpalli&lt;br /&gt;
** ID: 0x92FDAB42A95FF20C - Pirate Bady (piratesin)&lt;br /&gt;
** ID: 0x0B1955F40C691CCE - Kannan&lt;br /&gt;
** ID: 0x32FF6C6F5B7AE248 - Akhil Varkey&lt;br /&gt;
** ID: 0xFBB7061C27CB70C1 - Ranjith Siji&lt;br /&gt;
** ID: 0xEAAFE4A8F39DE34F - Kiran S Kunjumon (hacksk)&lt;br /&gt;
* It&#039;s recommended to setup [http://www.vim.org/scripts/script.php?script_id=3645 Vim GnuPG Plugin] for transparent editing. Those who are new to GPG can follow [https://www.madboa.com/geek/gpg-quickstart/ this guide].&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
Maintained in a private git repo at https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
= Configuration and Maintenance =&lt;br /&gt;
== Disk Partitioning ==&lt;br /&gt;
* RAID 1 setup on 2x2TB HDDs (&amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sdb&amp;lt;/code&amp;gt;).&lt;br /&gt;
 mdadm --verbose --create /dev/mdX --level=mirror --raid-devices=2 /dev/sdaY /dev/sdbY&lt;br /&gt;
* Separate partitions for swap (&amp;lt;code&amp;gt;md0&amp;lt;/code&amp;gt; - 16GB), boot (&amp;lt;code&amp;gt;md1&amp;lt;/code&amp;gt; - 512MB) and root (&amp;lt;code&amp;gt;md2&amp;lt;/code&amp;gt; - 50GB).&lt;br /&gt;
* LVM on Luks for separate encrypted data partitions for database, static files and logs.&lt;br /&gt;
 # Setup LUKS (make sure &amp;lt;code&amp;gt;lvm2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; packages are installed).&lt;br /&gt;
 cryptsetup luksFormat /dev/mdX&lt;br /&gt;
 # Give disk encryption password as specified in the [[#Server_Access|access repo]]&lt;br /&gt;
 cryptsetup luksOpen /dev/mdX poddery&lt;br /&gt;
 &lt;br /&gt;
 # LVM Setup&lt;br /&gt;
 # Create physical volume named &amp;lt;code&amp;gt;poddery&amp;lt;/code&amp;gt;&lt;br /&gt;
 pvcreate /dev/mapper/poddery&lt;br /&gt;
 # Create volume group named &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
 vgcreate data /dev/mapper/poddery&lt;br /&gt;
 # Create logical volumes named &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static&amp;lt;/code&amp;gt;&lt;br /&gt;
 lvcreate -n log /dev/data -L 50G&lt;br /&gt;
 lvcreate -n db /dev/data -L 500G&lt;br /&gt;
 # Assign remaining free space for static files&lt;br /&gt;
 lvcreate -n static /dev/data -l 100%FREE &lt;br /&gt;
 &lt;br /&gt;
 # Setup filesystem on the logical volumes&lt;br /&gt;
 mkfs.ext4 /dev/data/log&lt;br /&gt;
 mkfs.ext4 /dev/data/db&lt;br /&gt;
 mkfs.ext4 /dev/data/static&lt;br /&gt;
 &lt;br /&gt;
 # Create directories for mounting the encrypted partitions&lt;br /&gt;
 mkdir /var/lib/db /var/lib/static /var/log/poddery&lt;br /&gt;
 &lt;br /&gt;
 # Manually mount encrypted partitions. This is needed on each reboot as Hetzner doesn&#039;t provide a web console so that we can&#039;t decrypt the partitions during booting.&lt;br /&gt;
 mount /dev/data/db /var/lib/db&lt;br /&gt;
 mount /dev/data/static /var/lib/static&lt;br /&gt;
 mount /dev/data/log /var/log/poddery&lt;br /&gt;
&lt;br /&gt;
== Hardening checklist ==&lt;br /&gt;
* SSH password based login disabled (allow only key based logins)&lt;br /&gt;
* SSH login disabled for root user (use a normal user with sudo)&lt;br /&gt;
 # Check for the following settings in /etc/ssh/sshd_config:&lt;br /&gt;
 ...&lt;br /&gt;
 PermitRootLogin no&lt;br /&gt;
 ...&lt;br /&gt;
 PasswordAuthentication no&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; firewall enabled with only the ports that needs to be opened ([https://fxdata.cloud/tutorials/set-up-a-firewall-with-ufw-on-ubuntu-16-04 ufw tutorial]):&lt;br /&gt;
 ufw default deny incoming&lt;br /&gt;
 ufw default allow outgoing&lt;br /&gt;
 ufw allow ssh&lt;br /&gt;
 ufw allow http/tcp&lt;br /&gt;
 ufw allow https/tcp&lt;br /&gt;
 ufw allow Turnserver&lt;br /&gt;
 ufw allow XMPP&lt;br /&gt;
 ufw allow 8448&lt;br /&gt;
&lt;br /&gt;
 ufw enable&lt;br /&gt;
 &lt;br /&gt;
 # Verify everything is setup properly&lt;br /&gt;
 ufw status&lt;br /&gt;
 &lt;br /&gt;
 # Enable ufw logging with default mode low&lt;br /&gt;
 ufw logging on&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fail2ban&amp;lt;/code&amp;gt; configured against brute force attacks:&lt;br /&gt;
 # Check for the following line &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 LogLevel VERBOSE&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # Restart SSH and enable fail2ban&lt;br /&gt;
 systemctl restart ssh&lt;br /&gt;
 systemctl enable fail2ban&lt;br /&gt;
 systemctl start fail2ban&lt;br /&gt;
 &lt;br /&gt;
 # To unban an IP, first check &amp;lt;code&amp;gt;/var/log/fail2ban.log&amp;lt;/code&amp;gt; to get the banned IP and then run the following&lt;br /&gt;
 # Here &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; is the defaut jail name, change it if you are using a different jail&lt;br /&gt;
 fail2ban-client set sshd unbanip &amp;lt;banned_ip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Diaspora ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;diaspora-installer&amp;lt;/code&amp;gt; from Debian Buster contrib:&lt;br /&gt;
 apt install diaspora-installer&lt;br /&gt;
&lt;br /&gt;
* Move MySQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop mysql&lt;br /&gt;
 systemctl disable mysql&lt;br /&gt;
 mv /var/lib/mysql /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/mysql /var/lib/&lt;br /&gt;
 systemctl start mysql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/diaspora&lt;br /&gt;
 mv /usr/share/diaspora/public/uploads /var/lib/static/diaspora&lt;br /&gt;
 ln -s /var/lib/static/diaspora/uploads /usr/share/diaspora/public/&lt;br /&gt;
 chown -R diaspora: /var/lib/static/diaspora&lt;br /&gt;
&lt;br /&gt;
* Modify configuration files at &amp;lt;code&amp;gt;/etc/diaspora&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/diaspora.conf&amp;lt;/code&amp;gt; as needed (backup of the current configuration files are available in the [[#Server_Access|access repo]]).&lt;br /&gt;
* Homepage configuration:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;acl&amp;lt;/code&amp;gt; packages are installed&lt;br /&gt;
 # Grant &amp;lt;code&amp;gt;rwx&amp;lt;/code&amp;gt; permissions for the ssh user to &amp;lt;code&amp;gt;/usr/share/diaspora/public&amp;lt;/code&amp;gt;&lt;br /&gt;
 setfacl -m &amp;quot;u:&amp;lt;ssh_user&amp;gt;:rwx&amp;quot; /usr/share/diaspora/public&lt;br /&gt;
 &lt;br /&gt;
 # Clone poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public&lt;br /&gt;
 git clone https://git.fosscommunity.in/community/poddery.com.git&lt;br /&gt;
 cd poddery.com &amp;amp;&amp;amp; mv * .[^.]* .. #Give yes for all files when prompted&lt;br /&gt;
 cd .. &amp;amp;&amp;amp; rmdir poddery.com&lt;br /&gt;
&lt;br /&gt;
* [https://save.poddery.com Save Poddery] repo is maintained as a sub module in poddery.com repo. See this [https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ tutorial] for working with git submodules. &lt;br /&gt;
 # Clone save.poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public/save&lt;br /&gt;
 git submodule init&lt;br /&gt;
 git submodule update&lt;br /&gt;
&lt;br /&gt;
== Matrix ==&lt;br /&gt;
* See the [https://github.com/matrix-org/synapse/blob/master/INSTALL.md official installation guide] of Synapse for installing from source.&lt;br /&gt;
* Nginx is used as reverse proxy to send requests that has &amp;lt;code&amp;gt;/_matrix/*&amp;lt;/code&amp;gt; in URL to Synapse on port &amp;lt;code&amp;gt;8008&amp;lt;/code&amp;gt;. This is configured in &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Shamil&#039;s [https://git.fosscommunity.in/necessary129/synapse-diaspora-auth Synapse Diaspora Auth] script is used to authenticate Synapse with Diaspora database.&lt;br /&gt;
* Move PostgreSQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop postgresql&lt;br /&gt;
 systemctl disable postgresql&lt;br /&gt;
 mv /var/lib/postgres /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/postgres /var/lib/&lt;br /&gt;
 systemctl start postgresql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/synapse&lt;br /&gt;
 mv /var/lib/matrix-synapse/uploads /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/uploads /var/lib/matrix-synapse/&lt;br /&gt;
 mv /var/lib/matrix-synapse/media /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/media /var/lib/matrix-synapse/&lt;br /&gt;
 chown -R matrix-synapse: /var/lib/static/synapse&lt;br /&gt;
&lt;br /&gt;
* Install identity server &amp;lt;code&amp;gt;mxisd&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;deb&amp;lt;/code&amp;gt; package available [https://github.com/kamax-matrix/mxisd/blob/master/docs/install/debian.md here])&lt;br /&gt;
&lt;br /&gt;
=== Workers ===&lt;br /&gt;
* For scalability, Poddery is running [https://github.com/matrix-org/synapse/blob/master/docs/workers.rst workers]. Currently all workers specified in that page, expect &amp;lt;code&amp;gt;synapse.app.appservice&amp;lt;/code&amp;gt; is running on poddery.com&lt;br /&gt;
* A new service [https://gist.github.com/necessary129/5dfbb140e4727496b0ad2bf801c10fdc &amp;lt;code&amp;gt;matrix-synapse@.service&amp;lt;/code&amp;gt;] is installed for the workers (Save the &amp;lt;code&amp;gt;synape_worker&amp;lt;/code&amp;gt; file somewhere like &amp;lt;code&amp;gt;/usr/local/bin/&amp;lt;/code&amp;gt; or something).&lt;br /&gt;
* The worker config can be found at &amp;lt;code&amp;gt;/etc/matrix-synapse/workers&amp;lt;/code&amp;gt;&lt;br /&gt;
* Synapse needs to be put under a reverse proxy see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/matrix&amp;lt;/code&amp;gt;. A lot of &amp;lt;code&amp;gt;/_matrix/&amp;lt;/code&amp;gt; urls needs to be overridden too see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;&lt;br /&gt;
* These lines must be added to &amp;lt;code&amp;gt;homeserver.yaml&amp;lt;/code&amp;gt; as we are running &amp;lt;code&amp;gt;media_repository&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;federation_sender&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pusher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_dir&amp;lt;/code&amp;gt; workers respectively:&lt;br /&gt;
  enable_media_repo: False&lt;br /&gt;
  send_federation: False&lt;br /&gt;
  start_pushers: False&lt;br /&gt;
  update_user_directory: false&lt;br /&gt;
&lt;br /&gt;
* These services must be enabled:&lt;br /&gt;
&lt;br /&gt;
 matrix-synapse@synchrotron.service matrix-synapse@federation_reader.service matrix-synapse@event_creator.service matrix-synapse@federation_sender.service matrix-synapse@pusher.service matrix-synapse@user_dir.service matrix-synapse@media_repository.service matrix-synapse@frontend_proxy.service matrix-synapse@client_reader.service matrix-synapse@synchrotron_2.service&lt;br /&gt;
&lt;br /&gt;
To load balance between the 2 synchrotrons, We are running [https://github.com/Sorunome/matrix-synchrotron-balancer matrix-synchrotron-balancer]. It has a systemd file at &amp;lt;code&amp;gt;/etc/systemd/system/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;. The files are in &amp;lt;code&amp;gt;/opt/matrix-synchrotron-balancer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Synapse Updation ===&lt;br /&gt;
* First check [https://github.com/matrix-org/synapse/blob/master/UPGRADE.rst synapse/UPGRADE.rst] to see if anything extra needs to be done. Then, just run &amp;lt;code&amp;gt;/root/upgrade-synapse&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Riot-web Updation === &lt;br /&gt;
* Just run the following (make sure to replace &amp;lt;code&amp;gt;&amp;lt;version&amp;gt;&amp;lt;/code&amp;gt; with a proper version number like &amp;lt;code&amp;gt;v1.0.0&amp;lt;/code&amp;gt;):&lt;br /&gt;
 /var/www/get-riot &amp;lt;version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chat/XMPP ==&lt;br /&gt;
* Steps for setting up Prosody is given at https://wiki.debian.org/Diaspora/XMPP&lt;br /&gt;
 # Follow steps 1 to 6 from https://wiki.debian.org/Diaspora/XMPP and then run the following:&lt;br /&gt;
 mysql -u root -p # Enter password from the access repo&lt;br /&gt;
 &lt;br /&gt;
 CREATE USER &#039;prosody&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;&amp;lt;passwd_in_repo&amp;gt;&#039;;&lt;br /&gt;
 GRANT ALL PRIVILEGES ON diaspora_production.* TO &#039;prosody&#039;@&#039;localhost&#039;;&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 &lt;br /&gt;
 systemctl restart prosody&lt;br /&gt;
&lt;br /&gt;
* Install plugins&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;mercurial&amp;lt;/code&amp;gt; is installed&lt;br /&gt;
 cd /etc &amp;amp;&amp;amp; hg clone https://hg.prosody.im/prosody-modules/ prosody-modules&lt;br /&gt;
&lt;br /&gt;
=== Set Nginx Conf for BOSH URLS ===&lt;br /&gt;
* Add the following in &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration file to enable the BOSH URL to make JSXC Working:&lt;br /&gt;
 upstream chat_cluster {&lt;br /&gt;
   server localhost:5280;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 location /http-bind {&lt;br /&gt;
   proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
   proxy_set_header Host $http_host;&lt;br /&gt;
   proxy_set_header X-Forwarded-Proto https;&lt;br /&gt;
   proxy_redirect off;&lt;br /&gt;
   proxy_connect_timeout 5;&lt;br /&gt;
   proxy_buffering       off;&lt;br /&gt;
   proxy_read_timeout    70;&lt;br /&gt;
   keepalive_timeout     70;&lt;br /&gt;
   send_timeout          70;&lt;br /&gt;
   client_max_body_size 4M;&lt;br /&gt;
   client_body_buffer_size 128K;&lt;br /&gt;
   proxy_pass http://chat_cluster;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.diasporafoundation.org/Integration/Chat#Nginx See here] for more details on &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration. Alternatively, &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; settings can be found [https://github.com/jsxc/jsxc/wiki/Prepare-apache here].&lt;br /&gt;
&lt;br /&gt;
== TLS ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;letsencrypt&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Ensure proper permissions are set for &amp;lt;code&amp;gt;/etc/letsencrypt&amp;lt;/code&amp;gt; and its contents.&lt;br /&gt;
 chown -R root:ssl-cert /etc/letsencrypt&lt;br /&gt;
 chmod g+r -R /etc/letsencrypt&lt;br /&gt;
 chmod g+x /etc/letsencrypt/{archive,live}&lt;br /&gt;
* Generate certificates. For more details see https://certbot.eff.org.&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;diaspora&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/diaspora/ssl&lt;br /&gt;
 &#039;&#039;total 0&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 47 Apr  2 22:47 poddery.com-bundle.pem -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 45 Apr  2 22:48 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/diaspora/ssl/poddery.com-bundle.pem&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/diaspora/ssl/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;prosody&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/prosody/certs/&lt;br /&gt;
 &#039;&#039;total 0&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 40 Mar 28 01:16 poddery.com.crt -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 33 Mar 28 01:16 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/prosody/certs/poddery.com.crt&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/prosody/certs/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Note- letsencrypt executable used below is actually a symlik to /usr/bin/certbot&lt;br /&gt;
* Cron jobs:&lt;br /&gt;
 crontab -e&lt;br /&gt;
 &#039;&#039;30 2 * * 1 letsencrypt renew  &amp;gt;&amp;gt; /var/log/le-renew.log&#039;&#039;&lt;br /&gt;
 &#039;&#039;32 2 * * 1 /etc/init.d/nginx reload&#039;&#039;&lt;br /&gt;
 &#039;&#039;34 2 * * 1 /etc/init.d/prosody reload&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Manually updating TLS certificate:&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos -w /usr/share/diaspora/public  -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save -d save.poddery.com -w /var/www/riot -d chat.poddery.com&lt;br /&gt;
* To include an additional subdomain such as fund.poddery.com use with --expand parameter as shown below&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos --expand -w /usr/share/diaspora/public -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save/ -d save.poddery.com -w /var/www/riot/ -d chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
= History =&lt;br /&gt;
* [[Poddery/Archive|See here]] for the archive of Poddery wiki page before the migration to Hetzner.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10807</id>
		<title>Poddery - Diaspora, Matrix and XMPP</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10807"/>
		<updated>2019-05-02T09:54:50Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: /* TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We run decentralized and federated [https://diasporafoundation.org/ Diaspora] social netowrk, [https://xmpp.org/ XMPP] and [https://matrix.org Matrix] instant messaging services at [https://poddery.com poddery.com]. Along with Diaspora, Poddery username and password can be used to access XMPP and Matrix services as well. [https://chat.poddery.com chat.poddery.com] provides Riot client (accessed by a web browser), which can be used to connect to any Matrix server without installing a Riot app/client.&lt;br /&gt;
&lt;br /&gt;
= Environment =&lt;br /&gt;
== Hosting ==&lt;br /&gt;
Poddery is hosted at [https://www.hetzner.com Hetzner] with the following specs:&lt;br /&gt;
&lt;br /&gt;
* Intel Xeon E3-1246V3 Process - 4 Cores, 3.5GHz&lt;br /&gt;
* 4TB HDD&lt;br /&gt;
* 32GB DDR3 RAM&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
* Debian Buster&lt;br /&gt;
&lt;br /&gt;
== User Visible Services ==&lt;br /&gt;
=== Diaspora ===&lt;br /&gt;
* Currently installed version is 0.7.6.1 which is available in [https://packages.debian.org/buster/diaspora-installer Debian Buster contrib]&lt;br /&gt;
* For live statistics see https://poddery.com/statistics&lt;br /&gt;
&lt;br /&gt;
=== Chat/XMPP ===&lt;br /&gt;
* [https://prosody.im/ Prosody] is used as the XMPP server which is modern and lightweight.&lt;br /&gt;
* Currently installed version is 0.11.2 which is available in [https://packages.debian.org/buster/prosody Debian Buster].&lt;br /&gt;
* All XEPs are enabled which the [https://conversations.im/ Conversations app] support.&lt;br /&gt;
&lt;br /&gt;
=== Chat/Matrix ===&lt;br /&gt;
* [https://matrix.org/docs/projects/server/synapse.html Synapse] is used as the Matrix server.&lt;br /&gt;
* Synapse is currently installed directly from the [https://github.com/matrix-org/synapse official GitHub repo].&lt;br /&gt;
&lt;br /&gt;
=== Homepage ===&lt;br /&gt;
Homepage and other static pages are maintained in FSCI [https://git.fosscommunity.in GitLab instance]. &lt;br /&gt;
* poddery.com -&amp;gt; https://git.fosscommunity.in/community/poddery.com&lt;br /&gt;
* save.poddery.com -&amp;gt; https://git.fosscommunity.in/community/save.poddery.com&lt;br /&gt;
* fund.poddery.com -&amp;gt; https://git.fosscommunity.in/community/fund-poddery&lt;br /&gt;
&lt;br /&gt;
== Backend Services ==&lt;br /&gt;
=== Web Server / Reverse Proxy ===&lt;br /&gt;
* Nginx web server which also acts as front-end (reverse proxy) for Diaspora and Matrix.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
* PostgreSQL for Matrix&lt;br /&gt;
* MySQL for Diaspora&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;: Consider migrating to PostgreSQL to optimize resources (We can reduce one service and RAM usage).&lt;br /&gt;
&lt;br /&gt;
=== Email ===&lt;br /&gt;
* Exim&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS certificates ===&lt;br /&gt;
* Let&#039;s Encrypt&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
* UFW (Uncomplicated Firewall)&lt;br /&gt;
&lt;br /&gt;
=== Intrusion Prevention ===&lt;br /&gt;
* Fail2ban&lt;br /&gt;
&lt;br /&gt;
= Coordination =&lt;br /&gt;
* [https://www.loomio.org/g/2bjVXqAu/fosscommunity-in-poddery-com-maintainer-s-group Loomio group] - Mainly used for decision making&lt;br /&gt;
* Matrix room - [https://matrix.to/#/#poddery:poddery.com #poddery:poddery.com]&lt;br /&gt;
* [https://git.fosscommunity.in/community/poddery.com/issues Issue tracker] - Used for tracking progress of tasks&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
* Email: poddery at autistici.org (alias that reaches Akhilan, Abhijith Balan, Fayad, Balasankar, Julius, Praveen, Prasobh, Sruthi, Shirish, Vamsee and Manukrishnan)&lt;br /&gt;
* The following people have their GPG keys in the [[#Server_Access|access file]]:&lt;br /&gt;
** ID: 0xCE1F9C674512C22A - Praveen Arimbrathodiyil (piratepin)&lt;br /&gt;
** ID: 0xB77D2E2E23735427 - Balasankar C&lt;br /&gt;
** ID: 0x5D0064186AF037D9 - Manu Krishnan T V&lt;br /&gt;
** ID: 0x51C954405D432381 - Fayad Fami (fayad)&lt;br /&gt;
** ID: 0x863D4DF2ED9C28EF - Abhijith PA&lt;br /&gt;
** ID: 0x6EF48CCD865A1FFC - Syam G Krishnan (sgk)&lt;br /&gt;
** ID: 0xFD49D0BC6FEAECDA - Sagar Ippalpalli&lt;br /&gt;
** ID: 0x92FDAB42A95FF20C - Pirate Bady (piratesin)&lt;br /&gt;
** ID: 0x0B1955F40C691CCE - Kannan&lt;br /&gt;
** ID: 0x32FF6C6F5B7AE248 - Akhil Varkey&lt;br /&gt;
** ID: 0xFBB7061C27CB70C1 - Ranjith Siji&lt;br /&gt;
** ID: 0xEAAFE4A8F39DE34F - Kiran S Kunjumon (hacksk)&lt;br /&gt;
* It&#039;s recommended to setup [http://www.vim.org/scripts/script.php?script_id=3645 Vim GnuPG Plugin] for transparent editing. Those who are new to GPG can follow [https://www.madboa.com/geek/gpg-quickstart/ this guide].&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
Maintained in a private git repo at https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
= Configuration and Maintenance =&lt;br /&gt;
== Disk Partitioning ==&lt;br /&gt;
* RAID 1 setup on 2x2TB HDDs (&amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sdb&amp;lt;/code&amp;gt;).&lt;br /&gt;
 mdadm --verbose --create /dev/mdX --level=mirror --raid-devices=2 /dev/sdaY /dev/sdbY&lt;br /&gt;
* Separate partitions for swap (&amp;lt;code&amp;gt;md0&amp;lt;/code&amp;gt; - 16GB), boot (&amp;lt;code&amp;gt;md1&amp;lt;/code&amp;gt; - 512MB) and root (&amp;lt;code&amp;gt;md2&amp;lt;/code&amp;gt; - 50GB).&lt;br /&gt;
* LVM on Luks for separate encrypted data partitions for database, static files and logs.&lt;br /&gt;
 # Setup LUKS (make sure &amp;lt;code&amp;gt;lvm2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; packages are installed).&lt;br /&gt;
 cryptsetup luksFormat /dev/mdX&lt;br /&gt;
 # Give disk encryption password as specified in the [[#Server_Access|access repo]]&lt;br /&gt;
 cryptsetup luksOpen /dev/mdX poddery&lt;br /&gt;
 &lt;br /&gt;
 # LVM Setup&lt;br /&gt;
 # Create physical volume named &amp;lt;code&amp;gt;poddery&amp;lt;/code&amp;gt;&lt;br /&gt;
 pvcreate /dev/mapper/poddery&lt;br /&gt;
 # Create volume group named &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
 vgcreate data /dev/mapper/poddery&lt;br /&gt;
 # Create logical volumes named &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static&amp;lt;/code&amp;gt;&lt;br /&gt;
 lvcreate -n log /dev/data -L 50G&lt;br /&gt;
 lvcreate -n db /dev/data -L 500G&lt;br /&gt;
 # Assign remaining free space for static files&lt;br /&gt;
 lvcreate -n static /dev/data -l 100%FREE &lt;br /&gt;
 &lt;br /&gt;
 # Setup filesystem on the logical volumes&lt;br /&gt;
 mkfs.ext4 /dev/data/log&lt;br /&gt;
 mkfs.ext4 /dev/data/db&lt;br /&gt;
 mkfs.ext4 /dev/data/static&lt;br /&gt;
 &lt;br /&gt;
 # Create directories for mounting the encrypted partitions&lt;br /&gt;
 mkdir /var/lib/db /var/lib/static /var/log/poddery&lt;br /&gt;
 &lt;br /&gt;
 # Manually mount encrypted partitions. This is needed on each reboot as Hetzner doesn&#039;t provide a web console so that we can&#039;t decrypt the partitions during booting.&lt;br /&gt;
 mount /dev/data/db /var/lib/db&lt;br /&gt;
 mount /dev/data/static /var/lib/static&lt;br /&gt;
 mount /dev/data/log /var/log/poddery&lt;br /&gt;
&lt;br /&gt;
== Hardening checklist ==&lt;br /&gt;
* SSH password based login disabled (allow only key based logins)&lt;br /&gt;
* SSH login disabled for root user (use a normal user with sudo)&lt;br /&gt;
 # Check for the following settings in /etc/ssh/sshd_config:&lt;br /&gt;
 ...&lt;br /&gt;
 PermitRootLogin no&lt;br /&gt;
 ...&lt;br /&gt;
 PasswordAuthentication no&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; firewall enabled with only the ports that needs to be opened ([https://fxdata.cloud/tutorials/set-up-a-firewall-with-ufw-on-ubuntu-16-04 ufw tutorial]):&lt;br /&gt;
 ufw default deny incoming&lt;br /&gt;
 ufw default allow outgoing&lt;br /&gt;
 ufw allow ssh&lt;br /&gt;
 ufw allow http/tcp&lt;br /&gt;
 ufw allow https/tcp&lt;br /&gt;
 ufw allow Turnserver&lt;br /&gt;
 ufw allow XMPP&lt;br /&gt;
 ufw allow 8448&lt;br /&gt;
&lt;br /&gt;
 ufw enable&lt;br /&gt;
 &lt;br /&gt;
 # Verify everything is setup properly&lt;br /&gt;
 ufw status&lt;br /&gt;
 &lt;br /&gt;
 # Enable ufw logging with default mode low&lt;br /&gt;
 ufw logging on&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fail2ban&amp;lt;/code&amp;gt; configured against brute force attacks:&lt;br /&gt;
 # Check for the following line &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 LogLevel VERBOSE&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # Restart SSH and enable fail2ban&lt;br /&gt;
 systemctl restart ssh&lt;br /&gt;
 systemctl enable fail2ban&lt;br /&gt;
 systemctl start fail2ban&lt;br /&gt;
 &lt;br /&gt;
 # To unban an IP, first check &amp;lt;code&amp;gt;/var/log/fail2ban.log&amp;lt;/code&amp;gt; to get the banned IP and then run the following&lt;br /&gt;
 # Here &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; is the defaut jail name, change it if you are using a different jail&lt;br /&gt;
 fail2ban-client set sshd unbanip &amp;lt;banned_ip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Diaspora ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;diaspora-installer&amp;lt;/code&amp;gt; from Debian Buster contrib:&lt;br /&gt;
 apt install diaspora-installer&lt;br /&gt;
&lt;br /&gt;
* Move MySQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop mysql&lt;br /&gt;
 systemctl disable mysql&lt;br /&gt;
 mv /var/lib/mysql /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/mysql /var/lib/&lt;br /&gt;
 systemctl start mysql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/diaspora&lt;br /&gt;
 mv /usr/share/diaspora/public/uploads /var/lib/static/diaspora&lt;br /&gt;
 ln -s /var/lib/static/diaspora/uploads /usr/share/diaspora/public/&lt;br /&gt;
 chown -R diaspora: /var/lib/static/diaspora&lt;br /&gt;
&lt;br /&gt;
* Modify configuration files at &amp;lt;code&amp;gt;/etc/diaspora&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/diaspora.conf&amp;lt;/code&amp;gt; as needed (backup of the current configuration files are available in the [[#Server_Access|access repo]]).&lt;br /&gt;
* Homepage configuration:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;acl&amp;lt;/code&amp;gt; packages are installed&lt;br /&gt;
 # Grant &amp;lt;code&amp;gt;rwx&amp;lt;/code&amp;gt; permissions for the ssh user to &amp;lt;code&amp;gt;/usr/share/diaspora/public&amp;lt;/code&amp;gt;&lt;br /&gt;
 setfacl -m &amp;quot;u:&amp;lt;ssh_user&amp;gt;:rwx&amp;quot; /usr/share/diaspora/public&lt;br /&gt;
 &lt;br /&gt;
 # Clone poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public&lt;br /&gt;
 git clone https://git.fosscommunity.in/community/poddery.com.git&lt;br /&gt;
 cd poddery.com &amp;amp;&amp;amp; mv * .[^.]* .. #Give yes for all files when prompted&lt;br /&gt;
 cd .. &amp;amp;&amp;amp; rmdir poddery.com&lt;br /&gt;
&lt;br /&gt;
* [https://save.poddery.com Save Poddery] repo is maintained as a sub module in poddery.com repo. See this [https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ tutorial] for working with git submodules. &lt;br /&gt;
 # Clone save.poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public/save&lt;br /&gt;
 git submodule init&lt;br /&gt;
 git submodule update&lt;br /&gt;
&lt;br /&gt;
== Matrix ==&lt;br /&gt;
* See the [https://github.com/matrix-org/synapse/blob/master/INSTALL.md official installation guide] of Synapse for installing from source.&lt;br /&gt;
* Nginx is used as reverse proxy to send requests that has &amp;lt;code&amp;gt;/_matrix/*&amp;lt;/code&amp;gt; in URL to Synapse on port &amp;lt;code&amp;gt;8008&amp;lt;/code&amp;gt;. This is configured in &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Shamil&#039;s [https://git.fosscommunity.in/necessary129/synapse-diaspora-auth Synapse Diaspora Auth] script is used to authenticate Synapse with Diaspora database.&lt;br /&gt;
* Move PostgreSQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop postgresql&lt;br /&gt;
 systemctl disable postgresql&lt;br /&gt;
 mv /var/lib/postgres /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/postgres /var/lib/&lt;br /&gt;
 systemctl start postgresql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/synapse&lt;br /&gt;
 mv /var/lib/matrix-synapse/uploads /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/uploads /var/lib/matrix-synapse/&lt;br /&gt;
 mv /var/lib/matrix-synapse/media /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/media /var/lib/matrix-synapse/&lt;br /&gt;
 chown -R matrix-synapse: /var/lib/static/synapse&lt;br /&gt;
&lt;br /&gt;
* Install identity server &amp;lt;code&amp;gt;mxisd&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;deb&amp;lt;/code&amp;gt; package available [https://github.com/kamax-matrix/mxisd/blob/master/docs/install/debian.md here])&lt;br /&gt;
&lt;br /&gt;
=== Workers ===&lt;br /&gt;
* For scalability, Poddery running [https://github.com/matrix-org/synapse/blob/master/docs/workers.rst workers]. Currently all workers specified in that page, expect &amp;lt;code&amp;gt;synapse.app.appservice&amp;lt;/code&amp;gt; is running on poddery.com&lt;br /&gt;
* A new service [https://gist.github.com/necessary129/5dfbb140e4727496b0ad2bf801c10fdc &amp;lt;code&amp;gt;matrix-synapse@.service&amp;lt;/code&amp;gt;] is installed for the workers (Save the &amp;lt;code&amp;gt;synape_worker&amp;lt;/code&amp;gt; file somewhere like &amp;lt;code&amp;gt;/usr/local/bin/&amp;lt;/code&amp;gt; or something).&lt;br /&gt;
* The worker config can be found at &amp;lt;code&amp;gt;/etc/matrix-synapse/workers&amp;lt;/code&amp;gt;&lt;br /&gt;
* Synapse needs to be put under a reverse proxy see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/matrix&amp;lt;/code&amp;gt;. A lot of &amp;lt;code&amp;gt;/_matrix/&amp;lt;/code&amp;gt; urls needs to be overridden too see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;&lt;br /&gt;
* These lines must be added to &amp;lt;code&amp;gt;homeserver.yaml&amp;lt;/code&amp;gt; as we are running &amp;lt;code&amp;gt;media_repository&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;federation_sender&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pusher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_dir&amp;lt;/code&amp;gt; workers respectively:&lt;br /&gt;
  enable_media_repo: False&lt;br /&gt;
  send_federation: False&lt;br /&gt;
  start_pushers: False&lt;br /&gt;
  update_user_directory: false&lt;br /&gt;
&lt;br /&gt;
* These services must be enabled, and added to &amp;lt;code&amp;gt;Requires&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Before&amp;lt;/code&amp;gt; sections of the original &amp;lt;code&amp;gt;matrix-synapse.service&amp;lt;/code&amp;gt;:&lt;br /&gt;
 matrix-synapse@synchrotron.service matrix-synapse@federation_reader.service matrix-synapse@event_creator.service matrix-synapse@federation_sender.service matrix-synapse@pusher.service matrix-synapse@user_dir.service matrix-synapse@media_repository.service matrix-synapse@frontend_proxy.service matrix-synapse@client_reader.service&lt;br /&gt;
&lt;br /&gt;
=== Synapse Updation ===&lt;br /&gt;
* First check [https://github.com/matrix-org/synapse/blob/master/UPGRADE.rst synapse/UPGRADE.rst] to see if anything extra needs to be done. Then, just run &amp;lt;code&amp;gt;/root/upgrade-synapse&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Riot-web Updation === &lt;br /&gt;
* Just run &amp;lt;code&amp;gt;/var/www/get-riot&amp;lt;/code&amp;gt; and reload &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chat/XMPP ==&lt;br /&gt;
* Steps for setting up Prosody is given at https://wiki.debian.org/Diaspora/XMPP&lt;br /&gt;
 # Follow steps 1 to 6 from https://wiki.debian.org/Diaspora/XMPP and then run the following:&lt;br /&gt;
 mysql -u root -p # Enter password from the access repo&lt;br /&gt;
 &lt;br /&gt;
 CREATE USER &#039;prosody&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;&amp;lt;passwd_in_repo&amp;gt;&#039;;&lt;br /&gt;
 GRANT ALL PRIVILEGES ON diaspora_production.* TO &#039;prosody&#039;@&#039;localhost&#039;;&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 &lt;br /&gt;
 systemctl restart prosody&lt;br /&gt;
&lt;br /&gt;
* Install plugins&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;mercurial&amp;lt;/code&amp;gt; is installed&lt;br /&gt;
 cd /etc &amp;amp;&amp;amp; hg clone https://hg.prosody.im/prosody-modules/ prosody-modules&lt;br /&gt;
&lt;br /&gt;
=== Set Nginx Conf for BOSH URLS ===&lt;br /&gt;
* Add the following in &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration file to enable the BOSH URL to make JSXC Working:&lt;br /&gt;
 upstream chat_cluster {&lt;br /&gt;
   server localhost:5280;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 location /http-bind {&lt;br /&gt;
   proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
   proxy_set_header Host $http_host;&lt;br /&gt;
   proxy_set_header X-Forwarded-Proto https;&lt;br /&gt;
   proxy_redirect off;&lt;br /&gt;
   proxy_connect_timeout 5;&lt;br /&gt;
   proxy_buffering       off;&lt;br /&gt;
   proxy_read_timeout    70;&lt;br /&gt;
   keepalive_timeout     70;&lt;br /&gt;
   send_timeout          70;&lt;br /&gt;
   client_max_body_size 4M;&lt;br /&gt;
   client_body_buffer_size 128K;&lt;br /&gt;
   proxy_pass http://chat_cluster;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.diasporafoundation.org/Integration/Chat#Nginx See here] for more details on &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration. Alternatively, &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; settings can be found [https://github.com/jsxc/jsxc/wiki/Prepare-apache here].&lt;br /&gt;
&lt;br /&gt;
== TLS ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;letsencrypt&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Ensure proper permissions are set for &amp;lt;code&amp;gt;/etc/letsencrypt&amp;lt;/code&amp;gt; and its contents.&lt;br /&gt;
 chown -R root:ssl-cert /etc/letsencrypt&lt;br /&gt;
 chmod g+r -R /etc/letsencrypt&lt;br /&gt;
 chmod g+x /etc/letsencrypt/{archive,live}&lt;br /&gt;
* Generate certificates. For more details see https://certbot.eff.org.&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;diaspora&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/diaspora/ssl&lt;br /&gt;
 &#039;&#039;total 0&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 47 Apr  2 22:47 poddery.com-bundle.pem -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 45 Apr  2 22:48 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/diaspora/ssl/poddery.com-bundle.pem&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/diaspora/ssl/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;prosody&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/prosody/certs/&lt;br /&gt;
 &#039;&#039;total 0&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 40 Mar 28 01:16 poddery.com.crt -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 33 Mar 28 01:16 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/prosody/certs/poddery.com.crt&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/prosody/certs/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Note- letsencrypt executable used below is actually a symlik to /usr/bin/certbot&lt;br /&gt;
* Cron jobs:&lt;br /&gt;
 crontab -e&lt;br /&gt;
 &#039;&#039;30 2 * * 1 letsencrypt renew  &amp;gt;&amp;gt; /var/log/le-renew.log&#039;&#039;&lt;br /&gt;
 &#039;&#039;32 2 * * 1 /etc/init.d/nginx reload&#039;&#039;&lt;br /&gt;
 &#039;&#039;34 2 * * 1 /etc/init.d/prosody reload&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Manually updating TLS certificate:&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos -w /usr/share/diaspora/public  -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save -d save.poddery.com -w /var/www/riot -d chat.poddery.com&lt;br /&gt;
* To include an additional subdomain such as fund.poddery.com use with --expand parameter as shown below&lt;br /&gt;
 letsencrypt certonly --webroot --agree-tos -w /usr/share/diaspora/public --expand -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save/ -d save.poddery.com -w /var/www/riot/ -d chat.poddery.com&lt;br /&gt;
&lt;br /&gt;
= History =&lt;br /&gt;
* [[Poddery/Archive|See here]] for the archive of Poddery wiki page before the migration to Hetzner.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10806</id>
		<title>Poddery - Diaspora, Matrix and XMPP</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Poddery_-_Diaspora,_Matrix_and_XMPP&amp;diff=10806"/>
		<updated>2019-05-02T09:47:22Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: /* Hardening checklist */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We run decentralized and federated [https://diasporafoundation.org/ Diaspora] social netowrk, [https://xmpp.org/ XMPP] and [https://matrix.org Matrix] instant messaging services at [https://poddery.com poddery.com]. Along with Diaspora, Poddery username and password can be used to access XMPP and Matrix services as well. [https://chat.poddery.com chat.poddery.com] provides Riot client (accessed by a web browser), which can be used to connect to any Matrix server without installing a Riot app/client.&lt;br /&gt;
&lt;br /&gt;
= Environment =&lt;br /&gt;
== Hosting ==&lt;br /&gt;
Poddery is hosted at [https://www.hetzner.com Hetzner] with the following specs:&lt;br /&gt;
&lt;br /&gt;
* Intel Xeon E3-1246V3 Process - 4 Cores, 3.5GHz&lt;br /&gt;
* 4TB HDD&lt;br /&gt;
* 32GB DDR3 RAM&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
* Debian Buster&lt;br /&gt;
&lt;br /&gt;
== User Visible Services ==&lt;br /&gt;
=== Diaspora ===&lt;br /&gt;
* Currently installed version is 0.7.6.1 which is available in [https://packages.debian.org/buster/diaspora-installer Debian Buster contrib]&lt;br /&gt;
* For live statistics see https://poddery.com/statistics&lt;br /&gt;
&lt;br /&gt;
=== Chat/XMPP ===&lt;br /&gt;
* [https://prosody.im/ Prosody] is used as the XMPP server which is modern and lightweight.&lt;br /&gt;
* Currently installed version is 0.11.2 which is available in [https://packages.debian.org/buster/prosody Debian Buster].&lt;br /&gt;
* All XEPs are enabled which the [https://conversations.im/ Conversations app] support.&lt;br /&gt;
&lt;br /&gt;
=== Chat/Matrix ===&lt;br /&gt;
* [https://matrix.org/docs/projects/server/synapse.html Synapse] is used as the Matrix server.&lt;br /&gt;
* Synapse is currently installed directly from the [https://github.com/matrix-org/synapse official GitHub repo].&lt;br /&gt;
&lt;br /&gt;
=== Homepage ===&lt;br /&gt;
Homepage and other static pages are maintained in FSCI [https://git.fosscommunity.in GitLab instance]. &lt;br /&gt;
* poddery.com -&amp;gt; https://git.fosscommunity.in/community/poddery.com&lt;br /&gt;
* save.poddery.com -&amp;gt; https://git.fosscommunity.in/community/save.poddery.com&lt;br /&gt;
* fund.poddery.com -&amp;gt; https://git.fosscommunity.in/community/fund-poddery&lt;br /&gt;
&lt;br /&gt;
== Backend Services ==&lt;br /&gt;
=== Web Server / Reverse Proxy ===&lt;br /&gt;
* Nginx web server which also acts as front-end (reverse proxy) for Diaspora and Matrix.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
* PostgreSQL for Matrix&lt;br /&gt;
* MySQL for Diaspora&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;: Consider migrating to PostgreSQL to optimize resources (We can reduce one service and RAM usage).&lt;br /&gt;
&lt;br /&gt;
=== Email ===&lt;br /&gt;
* Exim&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS certificates ===&lt;br /&gt;
* Let&#039;s Encrypt&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
* UFW (Uncomplicated Firewall)&lt;br /&gt;
&lt;br /&gt;
=== Intrusion Prevention ===&lt;br /&gt;
* Fail2ban&lt;br /&gt;
&lt;br /&gt;
= Coordination =&lt;br /&gt;
* [https://www.loomio.org/g/2bjVXqAu/fosscommunity-in-poddery-com-maintainer-s-group Loomio group] - Mainly used for decision making&lt;br /&gt;
* Matrix room - [https://matrix.to/#/#poddery:poddery.com #poddery:poddery.com]&lt;br /&gt;
* [https://git.fosscommunity.in/community/poddery.com/issues Issue tracker] - Used for tracking progress of tasks&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
* Email: poddery at autistici.org (alias that reaches Akhilan, Abhijith Balan, Fayad, Balasankar, Julius, Praveen, Prasobh, Sruthi, Shirish, Vamsee and Manukrishnan)&lt;br /&gt;
* The following people have their GPG keys in the [[#Server_Access|access file]]:&lt;br /&gt;
** ID: 0xCE1F9C674512C22A - Praveen Arimbrathodiyil (piratepin)&lt;br /&gt;
** ID: 0xB77D2E2E23735427 - Balasankar C&lt;br /&gt;
** ID: 0x5D0064186AF037D9 - Manu Krishnan T V&lt;br /&gt;
** ID: 0x51C954405D432381 - Fayad Fami (fayad)&lt;br /&gt;
** ID: 0x863D4DF2ED9C28EF - Abhijith PA&lt;br /&gt;
** ID: 0x6EF48CCD865A1FFC - Syam G Krishnan (sgk)&lt;br /&gt;
** ID: 0xFD49D0BC6FEAECDA - Sagar Ippalpalli&lt;br /&gt;
** ID: 0x92FDAB42A95FF20C - Pirate Bady (piratesin)&lt;br /&gt;
** ID: 0x0B1955F40C691CCE - Kannan&lt;br /&gt;
** ID: 0x32FF6C6F5B7AE248 - Akhil Varkey&lt;br /&gt;
** ID: 0xFBB7061C27CB70C1 - Ranjith Siji&lt;br /&gt;
** ID: 0xEAAFE4A8F39DE34F - Kiran S Kunjumon (hacksk)&lt;br /&gt;
* It&#039;s recommended to setup [http://www.vim.org/scripts/script.php?script_id=3645 Vim GnuPG Plugin] for transparent editing. Those who are new to GPG can follow [https://www.madboa.com/geek/gpg-quickstart/ this guide].&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
Maintained in a private git repo at https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
= Configuration and Maintenance =&lt;br /&gt;
== Disk Partitioning ==&lt;br /&gt;
* RAID 1 setup on 2x2TB HDDs (&amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sdb&amp;lt;/code&amp;gt;).&lt;br /&gt;
 mdadm --verbose --create /dev/mdX --level=mirror --raid-devices=2 /dev/sdaY /dev/sdbY&lt;br /&gt;
* Separate partitions for swap (&amp;lt;code&amp;gt;md0&amp;lt;/code&amp;gt; - 16GB), boot (&amp;lt;code&amp;gt;md1&amp;lt;/code&amp;gt; - 512MB) and root (&amp;lt;code&amp;gt;md2&amp;lt;/code&amp;gt; - 50GB).&lt;br /&gt;
* LVM on Luks for separate encrypted data partitions for database, static files and logs.&lt;br /&gt;
 # Setup LUKS (make sure &amp;lt;code&amp;gt;lvm2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; packages are installed).&lt;br /&gt;
 cryptsetup luksFormat /dev/mdX&lt;br /&gt;
 # Give disk encryption password as specified in the [[#Server_Access|access repo]]&lt;br /&gt;
 cryptsetup luksOpen /dev/mdX poddery&lt;br /&gt;
 &lt;br /&gt;
 # LVM Setup&lt;br /&gt;
 # Create physical volume named &amp;lt;code&amp;gt;poddery&amp;lt;/code&amp;gt;&lt;br /&gt;
 pvcreate /dev/mapper/poddery&lt;br /&gt;
 # Create volume group named &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
 vgcreate data /dev/mapper/poddery&lt;br /&gt;
 # Create logical volumes named &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;static&amp;lt;/code&amp;gt;&lt;br /&gt;
 lvcreate -n log /dev/data -L 50G&lt;br /&gt;
 lvcreate -n db /dev/data -L 500G&lt;br /&gt;
 # Assign remaining free space for static files&lt;br /&gt;
 lvcreate -n static /dev/data -l 100%FREE &lt;br /&gt;
 &lt;br /&gt;
 # Setup filesystem on the logical volumes&lt;br /&gt;
 mkfs.ext4 /dev/data/log&lt;br /&gt;
 mkfs.ext4 /dev/data/db&lt;br /&gt;
 mkfs.ext4 /dev/data/static&lt;br /&gt;
 &lt;br /&gt;
 # Create directories for mounting the encrypted partitions&lt;br /&gt;
 mkdir /var/lib/db /var/lib/static /var/log/poddery&lt;br /&gt;
 &lt;br /&gt;
 # Manually mount encrypted partitions. This is needed on each reboot as Hetzner doesn&#039;t provide a web console so that we can&#039;t decrypt the partitions during booting.&lt;br /&gt;
 mount /dev/data/db /var/lib/db&lt;br /&gt;
 mount /dev/data/static /var/lib/static&lt;br /&gt;
 mount /dev/data/log /var/log/poddery&lt;br /&gt;
&lt;br /&gt;
== Hardening checklist ==&lt;br /&gt;
* SSH password based login disabled (allow only key based logins)&lt;br /&gt;
* SSH login disabled for root user (use a normal user with sudo)&lt;br /&gt;
 # Check for the following settings in /etc/ssh/sshd_config:&lt;br /&gt;
 ...&lt;br /&gt;
 PermitRootLogin no&lt;br /&gt;
 ...&lt;br /&gt;
 PasswordAuthentication no&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; firewall enabled with only the ports that needs to be opened ([https://fxdata.cloud/tutorials/set-up-a-firewall-with-ufw-on-ubuntu-16-04 ufw tutorial]):&lt;br /&gt;
 ufw default deny incoming&lt;br /&gt;
 ufw default allow outgoing&lt;br /&gt;
 ufw allow ssh&lt;br /&gt;
 ufw allow http/tcp&lt;br /&gt;
 ufw allow https/tcp&lt;br /&gt;
 ufw allow Turnserver&lt;br /&gt;
 ufw allow XMPP&lt;br /&gt;
 ufw allow 8448&lt;br /&gt;
&lt;br /&gt;
 ufw enable&lt;br /&gt;
 &lt;br /&gt;
 # Verify everything is setup properly&lt;br /&gt;
 ufw status&lt;br /&gt;
 &lt;br /&gt;
 # Enable ufw logging with default mode low&lt;br /&gt;
 ufw logging on&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fail2ban&amp;lt;/code&amp;gt; configured against brute force attacks:&lt;br /&gt;
 # Check for the following line &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 LogLevel VERBOSE&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 # Restart SSH and enable fail2ban&lt;br /&gt;
 systemctl restart ssh&lt;br /&gt;
 systemctl enable fail2ban&lt;br /&gt;
 systemctl start fail2ban&lt;br /&gt;
 &lt;br /&gt;
 # To unban an IP, first check &amp;lt;code&amp;gt;/var/log/fail2ban.log&amp;lt;/code&amp;gt; to get the banned IP and then run the following&lt;br /&gt;
 # Here &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; is the defaut jail name, change it if you are using a different jail&lt;br /&gt;
 fail2ban-client set sshd unbanip &amp;lt;banned_ip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Diaspora ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;diaspora-installer&amp;lt;/code&amp;gt; from Debian Buster contrib:&lt;br /&gt;
 apt install diaspora-installer&lt;br /&gt;
&lt;br /&gt;
* Move MySQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop mysql&lt;br /&gt;
 systemctl disable mysql&lt;br /&gt;
 mv /var/lib/mysql /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/mysql /var/lib/&lt;br /&gt;
 systemctl start mysql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/diaspora&lt;br /&gt;
 mv /usr/share/diaspora/public/uploads /var/lib/static/diaspora&lt;br /&gt;
 ln -s /var/lib/static/diaspora/uploads /usr/share/diaspora/public/&lt;br /&gt;
 chown -R diaspora: /var/lib/static/diaspora&lt;br /&gt;
&lt;br /&gt;
* Modify configuration files at &amp;lt;code&amp;gt;/etc/diaspora&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/diaspora.conf&amp;lt;/code&amp;gt; as needed (backup of the current configuration files are available in the [[#Server_Access|access repo]]).&lt;br /&gt;
* Homepage configuration:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;acl&amp;lt;/code&amp;gt; packages are installed&lt;br /&gt;
 # Grant &amp;lt;code&amp;gt;rwx&amp;lt;/code&amp;gt; permissions for the ssh user to &amp;lt;code&amp;gt;/usr/share/diaspora/public&amp;lt;/code&amp;gt;&lt;br /&gt;
 setfacl -m &amp;quot;u:&amp;lt;ssh_user&amp;gt;:rwx&amp;quot; /usr/share/diaspora/public&lt;br /&gt;
 &lt;br /&gt;
 # Clone poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public&lt;br /&gt;
 git clone https://git.fosscommunity.in/community/poddery.com.git&lt;br /&gt;
 cd poddery.com &amp;amp;&amp;amp; mv * .[^.]* .. #Give yes for all files when prompted&lt;br /&gt;
 cd .. &amp;amp;&amp;amp; rmdir poddery.com&lt;br /&gt;
&lt;br /&gt;
* [https://save.poddery.com Save Poddery] repo is maintained as a sub module in poddery.com repo. See this [https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ tutorial] for working with git submodules. &lt;br /&gt;
 # Clone save.poddery.com repo&lt;br /&gt;
 cd /usr/share/diaspora/public/save&lt;br /&gt;
 git submodule init&lt;br /&gt;
 git submodule update&lt;br /&gt;
&lt;br /&gt;
== Matrix ==&lt;br /&gt;
* See the [https://github.com/matrix-org/synapse/blob/master/INSTALL.md official installation guide] of Synapse for installing from source.&lt;br /&gt;
* Nginx is used as reverse proxy to send requests that has &amp;lt;code&amp;gt;/_matrix/*&amp;lt;/code&amp;gt; in URL to Synapse on port &amp;lt;code&amp;gt;8008&amp;lt;/code&amp;gt;. This is configured in &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Shamil&#039;s [https://git.fosscommunity.in/necessary129/synapse-diaspora-auth Synapse Diaspora Auth] script is used to authenticate Synapse with Diaspora database.&lt;br /&gt;
* Move PostgreSQL data to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/db&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/db&amp;lt;/code&amp;gt;&lt;br /&gt;
 systemctl stop postgresql&lt;br /&gt;
 systemctl disable postgresql&lt;br /&gt;
 mv /var/lib/postgres /var/lib/db/&lt;br /&gt;
 ln -s /var/lib/db/postgres /var/lib/&lt;br /&gt;
 systemctl start postgresql&lt;br /&gt;
&lt;br /&gt;
* Move static files to encrypted partition:&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;/dev/data/static&amp;lt;/code&amp;gt; is mounted to &amp;lt;code&amp;gt;/var/lib/static&amp;lt;/code&amp;gt;&lt;br /&gt;
 mkdir /var/lib/static/synapse&lt;br /&gt;
 mv /var/lib/matrix-synapse/uploads /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/uploads /var/lib/matrix-synapse/&lt;br /&gt;
 mv /var/lib/matrix-synapse/media /var/lib/static/synapse/&lt;br /&gt;
 ln -s /var/lib/static/synapse/media /var/lib/matrix-synapse/&lt;br /&gt;
 chown -R matrix-synapse: /var/lib/static/synapse&lt;br /&gt;
&lt;br /&gt;
* Install identity server &amp;lt;code&amp;gt;mxisd&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;deb&amp;lt;/code&amp;gt; package available [https://github.com/kamax-matrix/mxisd/blob/master/docs/install/debian.md here])&lt;br /&gt;
&lt;br /&gt;
=== Workers ===&lt;br /&gt;
* For scalability, Poddery running [https://github.com/matrix-org/synapse/blob/master/docs/workers.rst workers]. Currently all workers specified in that page, expect &amp;lt;code&amp;gt;synapse.app.appservice&amp;lt;/code&amp;gt; is running on poddery.com&lt;br /&gt;
* A new service [https://gist.github.com/necessary129/5dfbb140e4727496b0ad2bf801c10fdc &amp;lt;code&amp;gt;matrix-synapse@.service&amp;lt;/code&amp;gt;] is installed for the workers (Save the &amp;lt;code&amp;gt;synape_worker&amp;lt;/code&amp;gt; file somewhere like &amp;lt;code&amp;gt;/usr/local/bin/&amp;lt;/code&amp;gt; or something).&lt;br /&gt;
* The worker config can be found at &amp;lt;code&amp;gt;/etc/matrix-synapse/workers&amp;lt;/code&amp;gt;&lt;br /&gt;
* Synapse needs to be put under a reverse proxy see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/matrix&amp;lt;/code&amp;gt;. A lot of &amp;lt;code&amp;gt;/_matrix/&amp;lt;/code&amp;gt; urls needs to be overridden too see &amp;lt;code&amp;gt;/etc/nginx/sites-enabled/diaspora&amp;lt;/code&amp;gt;&lt;br /&gt;
* These lines must be added to &amp;lt;code&amp;gt;homeserver.yaml&amp;lt;/code&amp;gt; as we are running &amp;lt;code&amp;gt;media_repository&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;federation_sender&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pusher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_dir&amp;lt;/code&amp;gt; workers respectively:&lt;br /&gt;
  enable_media_repo: False&lt;br /&gt;
  send_federation: False&lt;br /&gt;
  start_pushers: False&lt;br /&gt;
  update_user_directory: false&lt;br /&gt;
&lt;br /&gt;
* These services must be enabled, and added to &amp;lt;code&amp;gt;Requires&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Before&amp;lt;/code&amp;gt; sections of the original &amp;lt;code&amp;gt;matrix-synapse.service&amp;lt;/code&amp;gt;:&lt;br /&gt;
 matrix-synapse@synchrotron.service matrix-synapse@federation_reader.service matrix-synapse@event_creator.service matrix-synapse@federation_sender.service matrix-synapse@pusher.service matrix-synapse@user_dir.service matrix-synapse@media_repository.service matrix-synapse@frontend_proxy.service matrix-synapse@client_reader.service&lt;br /&gt;
&lt;br /&gt;
=== Synapse Updation ===&lt;br /&gt;
* First check [https://github.com/matrix-org/synapse/blob/master/UPGRADE.rst synapse/UPGRADE.rst] to see if anything extra needs to be done. Then, just run &amp;lt;code&amp;gt;/root/upgrade-synapse&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Riot-web Updation === &lt;br /&gt;
* Just run &amp;lt;code&amp;gt;/var/www/get-riot&amp;lt;/code&amp;gt; and reload &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chat/XMPP ==&lt;br /&gt;
* Steps for setting up Prosody is given at https://wiki.debian.org/Diaspora/XMPP&lt;br /&gt;
 # Follow steps 1 to 6 from https://wiki.debian.org/Diaspora/XMPP and then run the following:&lt;br /&gt;
 mysql -u root -p # Enter password from the access repo&lt;br /&gt;
 &lt;br /&gt;
 CREATE USER &#039;prosody&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;&amp;lt;passwd_in_repo&amp;gt;&#039;;&lt;br /&gt;
 GRANT ALL PRIVILEGES ON diaspora_production.* TO &#039;prosody&#039;@&#039;localhost&#039;;&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 &lt;br /&gt;
 systemctl restart prosody&lt;br /&gt;
&lt;br /&gt;
* Install plugins&lt;br /&gt;
 # Make sure &amp;lt;code&amp;gt;mercurial&amp;lt;/code&amp;gt; is installed&lt;br /&gt;
 cd /etc &amp;amp;&amp;amp; hg clone https://hg.prosody.im/prosody-modules/ prosody-modules&lt;br /&gt;
&lt;br /&gt;
=== Set Nginx Conf for BOSH URLS ===&lt;br /&gt;
* Add the following in &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration file to enable the BOSH URL to make JSXC Working:&lt;br /&gt;
 upstream chat_cluster {&lt;br /&gt;
   server localhost:5280;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 location /http-bind {&lt;br /&gt;
   proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
   proxy_set_header Host $http_host;&lt;br /&gt;
   proxy_set_header X-Forwarded-Proto https;&lt;br /&gt;
   proxy_redirect off;&lt;br /&gt;
   proxy_connect_timeout 5;&lt;br /&gt;
   proxy_buffering       off;&lt;br /&gt;
   proxy_read_timeout    70;&lt;br /&gt;
   keepalive_timeout     70;&lt;br /&gt;
   send_timeout          70;&lt;br /&gt;
   client_max_body_size 4M;&lt;br /&gt;
   client_body_buffer_size 128K;&lt;br /&gt;
   proxy_pass http://chat_cluster;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.diasporafoundation.org/Integration/Chat#Nginx See here] for more details on &amp;lt;code&amp;gt;nginx&amp;lt;/code&amp;gt; configuration. Alternatively, &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; settings can be found [https://github.com/jsxc/jsxc/wiki/Prepare-apache here].&lt;br /&gt;
&lt;br /&gt;
== TLS ==&lt;br /&gt;
* Install &amp;lt;code&amp;gt;letsencrypt&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Ensure proper permissions are set for &amp;lt;code&amp;gt;/etc/letsencrypt&amp;lt;/code&amp;gt; and its contents.&lt;br /&gt;
 chown -R root:ssl-cert /etc/letsencrypt&lt;br /&gt;
 chmod g+r -R /etc/letsencrypt&lt;br /&gt;
 chmod g+x /etc/letsencrypt/{archive,live}&lt;br /&gt;
* Generate certificates. For more details see https://certbot.eff.org.&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;diaspora&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/diaspora/ssl&lt;br /&gt;
 &#039;&#039;total 0&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 47 Apr  2 22:47 poddery.com-bundle.pem -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 45 Apr  2 22:48 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/diaspora/ssl/poddery.com-bundle.pem&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/diaspora/ssl/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Make sure the certificates used by &amp;lt;code&amp;gt;prosody&amp;lt;/code&amp;gt; are symbolic links to letsencrypt default location:&lt;br /&gt;
 ls -l /etc/prosody/certs/&lt;br /&gt;
 &#039;&#039;total 0&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 40 Mar 28 01:16 poddery.com.crt -&amp;gt; /etc/letsencrypt/live/poddery.com/fullchain.pem&#039;&#039;&lt;br /&gt;
 &#039;&#039;lrwxrwxrwx 1 root root 33 Mar 28 01:16 poddery.com.key -&amp;gt; /etc/letsencrypt/live/poddery.com/privkey.pem&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 # If you don&#039;t get the above output, then run the following:&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/fullchain.pem /etc/prosody/certs/poddery.com.crt&lt;br /&gt;
 cp -L /etc/letsencrypt/live/poddery.com/privkey.pem /etc/prosody/certs/poddery.com.key&lt;br /&gt;
&lt;br /&gt;
* Cron jobs:&lt;br /&gt;
 crontab -e&lt;br /&gt;
 &#039;&#039;30 2 * * 1 letsencrypt renew  &amp;gt;&amp;gt; /var/log/le-renew.log&#039;&#039;&lt;br /&gt;
 &#039;&#039;32 2 * * 1 /etc/init.d/nginx reload&#039;&#039;&lt;br /&gt;
 &#039;&#039;34 2 * * 1 /etc/init.d/prosody reload&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Manually updating TLS certificate:&lt;br /&gt;
 letsencrypt certonly --webroot -w /usr/share/diaspora/public  -d poddery.com -d www.poddery.com -d test.poddery.com -d groups.poddery.com -d fund.poddery.com -w /usr/share/diaspora/public/save -d save.poddery.com -w /var/www/riot -d chat.poddery.com &lt;br /&gt;
&lt;br /&gt;
= History =&lt;br /&gt;
* [[Poddery/Archive|See here]] for the archive of Poddery wiki page before the migration to Hetzner.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10786</id>
		<title>Loomio/Archive 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10786"/>
		<updated>2019-03-24T14:56:03Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: /* Loomio Deployment Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.fsci.org.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals. &lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We were now on a [https://www.scaleway.com/virtual-cloud-servers START1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
We were on a [https://www.scaleway.com/virtual-cloud-servers VC1S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Flexible Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €2.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server.&lt;br /&gt;
&lt;br /&gt;
=== Loomio Deployment Reference ===&lt;br /&gt;
&lt;br /&gt;
Loomio was deployed and updated on codema.fsci.org.in using this official guide - https://github.com/loomio/loomio-deploy&lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10785</id>
		<title>Loomio/Archive 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10785"/>
		<updated>2019-03-24T14:55:07Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.fsci.org.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals. &lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We were now on a [https://www.scaleway.com/virtual-cloud-servers START1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
We were on a [https://www.scaleway.com/virtual-cloud-servers VC1S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Flexible Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €2.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server.&lt;br /&gt;
&lt;br /&gt;
=== Loomio Deployment Reference ===&lt;br /&gt;
&lt;br /&gt;
Loomio was deployed and updated on codema.fsci.org.in after following this Loomio Deployment Reference - https://github.com/loomio/loomio-deploy&lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10784</id>
		<title>Loomio/Archive 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Loomio/Archive_1&amp;diff=10784"/>
		<updated>2019-03-24T14:53:06Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: /* History */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://freesoftwareindia.org/ Loomio] instance at https://codema.fsci.org.in. Loomio is a &#039;&#039;&#039;co&#039;&#039;&#039;llaborative &#039;&#039;&#039;de&#039;&#039;&#039;cision-&#039;&#039;&#039;ma&#039;&#039;&#039;king platform (hence we&#039;re using the name &#039;&#039;&#039;codema&#039;&#039;&#039;) where users can initiate discussions and put up proposals. &lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
We were now on a [https://www.scaleway.com/virtual-cloud-servers START1-S instance] virtual cloud server with the following specs:&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2 GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 200 Mbit/s Bandwidth&lt;br /&gt;
* 1 Reserved IP (v4)&lt;br /&gt;
* €3.99/Month&lt;br /&gt;
&lt;br /&gt;
== Coordination ==&lt;br /&gt;
&lt;br /&gt;
* Hangout with us in our Matrix room [https://matrix.to/#/#codema:poddery.com #codema:poddery.com]&lt;br /&gt;
&lt;br /&gt;
=== Server Access ===&lt;br /&gt;
&lt;br /&gt;
Maintained in a private git repo at -&amp;gt; https://git.fosscommunity.in/community/access&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
We were on a [https://www.scaleway.com/virtual-cloud-servers VC1S instance] virtual cloud server with the following specs until 31/01/2019.&lt;br /&gt;
&lt;br /&gt;
* 2 x86-64 bit Cores&lt;br /&gt;
* 2GB Memory&lt;br /&gt;
* 50GB SSD Disk&lt;br /&gt;
* 1 Flexible Public IPv4&lt;br /&gt;
* 200Mbit/s Unmetered bandwidth&lt;br /&gt;
* €2.99/Month&lt;br /&gt;
&lt;br /&gt;
On 01/02/2019 our server was taken down by [https://scaleway.com Scaleway] quoting payment issues. Payment was failing even after updating the credit card details and following that our server got deleted without proper notifications from Scaleway&#039;s side. Screenshot of the email from Scaleway attached below. Fortunately we were provided with a snapshot of the server from which we were able to recover codema to a new server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Codema recovery process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Here&#039;s a brief description of how codema was recovered after the server take down on 01/01/2019:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Under &#039;Snapshots&#039; tab in the Scaleway dashboard we were provided with the snapshot (backup) of our codema server. A system image was created from this snapshot and it was used to create a new server with similar specifications. We lost our public IP along with the old server, so a new IP was assigned to the server and then updated the DNS A record of codema.fsci.org.in to point to this new IP. Once the server was up loomio was restarted using the following commands from the loomio installation directory:&lt;br /&gt;
&lt;br /&gt;
  docker-compose down&lt;br /&gt;
  docker-compose up -d&lt;br /&gt;
&lt;br /&gt;
The logs were checked for errors using the following command:&lt;br /&gt;
&lt;br /&gt;
  docker-compose logs -f&lt;br /&gt;
&lt;br /&gt;
Loomio wasn&#039;t getting started saying the port 25 was already in use. So the application using that port (which was exim4 in this case) was killed and loomio was restarted again.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Infrastructure&amp;diff=10783</id>
		<title>Infrastructure</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Infrastructure&amp;diff=10783"/>
		<updated>2019-03-23T14:24:17Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: /* Our machines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Our machines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Host name&lt;br /&gt;
! Domain &lt;br /&gt;
! Purpose&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
|mahishasura&lt;br /&gt;
|http://mahishasura.pxq.in&lt;br /&gt;
|Test machine&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Poddery_-_Diaspora,_Matrix_and_XMPP|poddery]]&lt;br /&gt;
|https://poddery.com&lt;br /&gt;
|diaspora pod, matrix homeserver and xmpp server (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|lists&lt;br /&gt;
|https://lists.fsci.org.in&lt;br /&gt;
|Mailing list service (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Loomio&lt;br /&gt;
|https://codema.fsci.org.in&lt;br /&gt;
|Loomio service&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|git&lt;br /&gt;
|https://git.fosscommunity.in&lt;br /&gt;
|Gitlab instance (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Wikimedia&lt;br /&gt;
|https://wiki.fsci.org.in/index.php&lt;br /&gt;
|Wikimedia instance (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Peer tube&lt;br /&gt;
|https://videos.fsci.org.in&lt;br /&gt;
|Peer tube instance&lt;br /&gt;
|Currently down&lt;br /&gt;
|-&lt;br /&gt;
|Monitor&lt;br /&gt;
|https://monitor.fsci.org.in&lt;br /&gt;
|For monitoring various services, (grafana)&lt;br /&gt;
|Currently down&lt;br /&gt;
|-&lt;br /&gt;
|Open Source Event Manager&lt;br /&gt;
|https://events.fsci.org.in&lt;br /&gt;
|Event management service (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mayasura&lt;br /&gt;
|62.210.83.200 ssh:19022&lt;br /&gt;
|Backup server for diasp.in&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|bhasmasura&lt;br /&gt;
|62.210.83.200 ssh:12022 postgres:12432&lt;br /&gt;
|Backup server for git.fosscommunity.in&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|banasura&lt;br /&gt;
|62.210.83.200 ssh:11022 mysql:&lt;br /&gt;
|Backup server for poddery.com&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other services endorsed by FSCI ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Host name&lt;br /&gt;
! Domain &lt;br /&gt;
! Purpose&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
|Discourse&lt;br /&gt;
|https://freesoftwareindia.org/&lt;br /&gt;
|Discourse instance&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon&lt;br /&gt;
|https://social.masto.host/&lt;br /&gt;
|Mastodon instance&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|libre infra&lt;br /&gt;
|https://libreinfra.org&lt;br /&gt;
|Email, Next Cloud services&lt;br /&gt;
|Public registration is closed&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Infrastructure&amp;diff=10782</id>
		<title>Infrastructure</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Infrastructure&amp;diff=10782"/>
		<updated>2019-03-23T14:10:17Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Our machines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Host name&lt;br /&gt;
! Domain &lt;br /&gt;
! Purpose&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
|mahishasura&lt;br /&gt;
|http://mahishasura.pxq.in&lt;br /&gt;
|Test machine&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Poddery_-_Diaspora,_Matrix_and_XMPP|poddery]]&lt;br /&gt;
|https://poddery.com&lt;br /&gt;
|diaspora pod, matrix homeserver and xmpp server (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|lists&lt;br /&gt;
|https://lists.fsci.org.in&lt;br /&gt;
|Mailing list service (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Loomio&lt;br /&gt;
|https://codema.fsci.org.in&lt;br /&gt;
|Loomio service&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|git&lt;br /&gt;
|https://git.fosscommunity.in&lt;br /&gt;
|Gitlab instance (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Wikimedia&lt;br /&gt;
|https://wiki.fsci.org.in/index.php&lt;br /&gt;
|Wikimedia instance (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Peer tube&lt;br /&gt;
|https://videos.fsci.org.in&lt;br /&gt;
|Peer tube instance&lt;br /&gt;
|Currently down&lt;br /&gt;
|-&lt;br /&gt;
|Monitor&lt;br /&gt;
|https://monitor.fsci.org.in&lt;br /&gt;
|For monitoring various services, (grafana)&lt;br /&gt;
|Currently down&lt;br /&gt;
|-&lt;br /&gt;
|Open Source Event Manager&lt;br /&gt;
|https://events.fsci.org.in&lt;br /&gt;
|Event management service (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mayasura&lt;br /&gt;
|62.210.83.200 ssh: &lt;br /&gt;
|Backup server for diasp.in&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|bhasmasura&lt;br /&gt;
|62.210.83.200 ssh:12022 postgres:12432&lt;br /&gt;
|Backup server for git.fosscommunity.in&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|banasura&lt;br /&gt;
|62.210.83.200 ssh:11022 mysql:&lt;br /&gt;
|Backup server for poddery.com&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other services endorsed by FSCI ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Host name&lt;br /&gt;
! Domain &lt;br /&gt;
! Purpose&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
|Discourse&lt;br /&gt;
|https://freesoftwareindia.org/&lt;br /&gt;
|Discourse instance&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon&lt;br /&gt;
|https://social.masto.host/&lt;br /&gt;
|Mastodon instance&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|libre infra&lt;br /&gt;
|https://libreinfra.org&lt;br /&gt;
|Email, Next Cloud services&lt;br /&gt;
|Public registration is closed&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
	<entry>
		<id>https://wiki.fsci.in/index.php?title=Infrastructure&amp;diff=10780</id>
		<title>Infrastructure</title>
		<link rel="alternate" type="text/html" href="https://wiki.fsci.in/index.php?title=Infrastructure&amp;diff=10780"/>
		<updated>2019-03-23T13:57:52Z</updated>

		<summary type="html">&lt;p&gt;AkhilVarkey: /* Our machines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Our machines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Host name&lt;br /&gt;
! Domain &lt;br /&gt;
! Purpose&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
|mahishasura&lt;br /&gt;
|http://mahishasura.pxq.in&lt;br /&gt;
|Test machine&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Poddery&lt;br /&gt;
|https://poddery.com&lt;br /&gt;
|diaspora pod, matrix homeserver and xmpp server (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|lists&lt;br /&gt;
|https://lists.fsci.org.in&lt;br /&gt;
|Mailing list service (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Loomio&lt;br /&gt;
|https://codema.fsci.org.in&lt;br /&gt;
|Loomio service&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|git&lt;br /&gt;
|https://git.fosscommunity.in&lt;br /&gt;
|Gitlab instance (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Wikimedia&lt;br /&gt;
|https://wiki.fsci.org.in/index.php&lt;br /&gt;
|Wikimedia instance (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Peer tube&lt;br /&gt;
|https://videos.fsci.org.in&lt;br /&gt;
|Peer tube instance&lt;br /&gt;
|Currently down&lt;br /&gt;
|-&lt;br /&gt;
|Monitor&lt;br /&gt;
|https://monitor.fsci.org.in&lt;br /&gt;
|For monitoring various services, (grafana)&lt;br /&gt;
|Currently down&lt;br /&gt;
|-&lt;br /&gt;
|Open Source Event Manager&lt;br /&gt;
|https://events.fsci.org.in&lt;br /&gt;
|Event management service (production)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|banasura&lt;br /&gt;
|62.210.83.200&lt;br /&gt;
|Backup server for poddery.com&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|bhasmasura&lt;br /&gt;
|62.210.83.200 ssh:12022 postgres:12432&lt;br /&gt;
|Backup server for git.fosscommunity.in&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mayasura&lt;br /&gt;
|62.210.83.200 ssh: &lt;br /&gt;
|Backup server for diasp.in&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other services endorsed by FSCI ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Host name&lt;br /&gt;
! Domain &lt;br /&gt;
! Purpose&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
|Discourse&lt;br /&gt;
|https://freesoftwareindia.org/&lt;br /&gt;
|Discourse instance&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon&lt;br /&gt;
|https://social.masto.host/&lt;br /&gt;
|Mastodon instance&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|libre infra&lt;br /&gt;
|https://libreinfra.org&lt;br /&gt;
|Email, Next Cloud services&lt;br /&gt;
|Public registration is closed&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>AkhilVarkey</name></author>
	</entry>
</feed>