summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-01-10Ensure rsync is installed to xmpp serversMatthew Fennell
This enables delta backups, reducing bandwidth sent off the server.
2026-01-10Tag all DNS stepsMatthew Fennell
There are some cases where I do not want to run DNS-related steps. For instance, when setting up a new server, which should replace an existing one, it is necessary to skip the DNS steps until the server has been fully migrated and I am ready to switch the hot/cold sides. Therefore, tag all DNS steps. This allows them to be skipped during ansible playbook execution using --skip-tags dns.
2026-01-03Enable invites_register_web moduleMatthew Fennell
This allows users who are registering using the invite webpage to register an account directly online, in case their desired client is not listed. I doubt this will ever be used, but without this module, the register manually link is broken in the invite page, and on the off chance it is used, I want to provide a good experience.
2026-01-03Serve invite pages under virtual hostMatthew Fennell
While ensuring that all hosts are deployed to the chat subdomain, I applied the same logic to the invite pages too. However, this broke invites as prosody's HTTP module has a check which ensures that the page being served is on the same domain as the virtual host, meaning that invite pages hosted under the chat subdomain would receive a 404. So, serve invite pages from the domain itself (which is the default config in prosody). To do this, we must direct such requests from nginx too.
2026-01-02Reset invite token expiry to default of seven daysMatthew Fennell
A year is a little excessive.
2026-01-02Replace deSEC with Mythic Beasts as DNS providerMatthew Fennell
I have now moved all servers' nameservers to Mythic Beasts. Replace the old deSEC requests to ones to Mythic Beasts.
2026-01-02Store stdout as DANE hash instead of full commandMatthew Fennell
I only want to store the actual hash in dane_hash and not a full python object corresponding to the execution of the command.
2026-01-02Remove turn_server definition from inventoryMatthew Fennell
My current deployment of non-transport servers looks like this: xmpp-prod host: chat.fennell.dev chat.koyo.haus prod turn server xmpp-nonprod host: chat.continuous.nonprod.fennell.dev chat.continuous.nonprod.koyo.haus nonprod turn server So, for each environment, there are two XMPP servers and only a single turn server. Therefore, within each environment, all XMPP servers need to point to the same turn server. I decided arbitrarily that that server would be defined for the koyo.haus domain. I used to have a variable defined for each host to manually point the turn server to that domain. However, we can prevent some duplication of information in the playbook if we just define the turn_domain (i.e. koyo.haus) in the inventory, and then derive the full path for that environment from that.
2026-01-02Derive is_transport_server from transport countMatthew Fennell
I have two different kinds of servers - transport servers (which connect to legacy networks and have s2s disabled) and non-transport servers (which are XMPP-only and have s2s enabled). I previously had an is_transport_server boolean defined for each host in the inventory - however, this is duplicated information that can be derived from the length of the transports value (which lists the legacy networks to transport to). Transport servers have a non-empty transports list, while non-transport servers do not define the variable at all. So, handle this case in the playbook by deriving an empty list if the value is not present.
2026-01-02Define all hosts in a single inventoryMatthew Fennell
I previously had separate inventories for each environment: prod, transport and staging, with each inventory having a single xmpp_server group. I want to start adopting group_vars so that I can share common variables between hosts, so I've moved all hosts into a common hosts.yaml file with groups for each environment. This means there is no longer an xmpp_server group, and all hosts are in a single inventory. Adjust the playbook to account for this.
2026-01-02Enforce chat delegate prefix across all hostsMatthew Fennell
I use the playbook to deploy to three different domains. Before this commit, some instances were deployed to the root domain (e.g. example.org) and others were deployed to a subdomain (e.g. chat.example.org), so that other services/hosts could easily live at the root. I would now like to enforce that all instances live under the chat. subdomain. There is no real benefit to having this difference in deployments, having more consistency will make reasoning about the different instances easier and allow me to delete some extra variables, and it will also allow me to deploy separate services to the root domains in the future if needed.
2026-01-02Create script for Mythic Beasts DNS API requestsMatthew Fennell
I am moving DNS provider from deSEC to Mythic Beasts. As part of this change, I need to use Mythic Beast's DNS API [1] in the playbook. I want to reduce the number of operations that are made by grouping several records together. To do this, I can use the "Identifying records to replace" method from their DNS tutorial. [2] This provides a way to specify which records should be replaced by the new records that you PUT onto the endpoint. To use this, you specify the records via a url-encoded series of select queries. Then, you can combine them into a disjunction of conjunctions like so: ?select=type%3DA%26host%3Dchat&select=type%3DAAAA This gets split into two separate queries which are then decoded into: type=A&host=chat type=AAAA Then, these records are replaced by whichever records are specified in the PUT request. It's painful to write these by hand, so write a script to generate them automatically. Then, they should be pasted into the playbook when the desired records update. If this happens often, we should make the playbook call the script to get the values directly. As an additional benefit, the script definitively states which records are "owned" by the playbook. This is because the records specified in the script are the ones that will be replaced each time the playbook is run. Finally, since we've now added python to the playbook for the first time, add the black linter to keep the code style in check. [1] https://www.mythic-beasts.com/support/api/dnsv2 [2] https://www.mythic-beasts.com/support/api/dnsv2/tutorial
2026-01-02Remove staging-fresh and prod-fresh targetsMatthew Fennell
I initially created these targets so that I could easily redeploy a full server from the terminal, including creating the necessary VPSs using my libcloud helper repository. However, a couple of years in, I have never done a -fresh deploy. While I am planning to migrate to a different hosting provider soon, it doesn't have a libcloud backend, so it turns out that this -fresh idea was overengineered and unecessary. I already have a runbook for transferring VPSs, so I can gradually automate that instead if it becomes necessary.
2026-01-02Change license to AGPL-3.0-or-laterMatthew Fennell
When I first made this playbook, I was a little sceptical of -or-later licenses. However, I've come around to the idea over time.
2026-01-02Remove READMEMatthew Fennell
As far as I know, this playbook is only used by me. I'm failing to update the README, and I don't think it really serves any benefit.
2025-12-31Explicitly install unattended-upgradesMatthew Fennell
All hosts I previously used had unattended-upgrades already installed, but a standard debian install doesn't have it installed by default. So, make sure it is installed.
2025-12-31Use explicitly defined admins from inventoryMatthew Fennell
I used to have separate admin@ and abuse@ accounts for each virtual host. I don't really need that separation, though, as I am the only admin, and no-one has ever contacted them anyway. So, set all admin accounts to the account I actually use and check every day anyway.
2025-10-28Entitle transports to upload filesMatthew Fennell
This is needed as the transports are by default treated as guests by prosody, and therefore unable to upload files without explicit permission.
2025-09-27Add separators in privileged_entities listMatthew Fennell
The template worked fine for singleton lists, but it fails when adding another entry since there is no separator between the elements! Thankfully Lua has some nice syntax allowing you to use a semicolon as a separator, which doesn't by itself imply more than one element.
2025-09-21Create privileged transport componentsMatthew Fennell
This commit allows transport servers to define the relevant components on the XMPP server. Transports are configured by adding the following config to the inventory's variables: transports: - subdomain: a-example-legacy-network secret: a-long-randomly-generated-secret - subdomain: another-example-legacy-network secret: another-long-randomly-generated-secret These are iterated over and a privileged component is created for each.
2025-09-21Add transport make targetMatthew Fennell
This change allows targeted deployments just to transport servers, or deployments to all prod servers (including transport) at once.
2025-09-21Ensure lua-unbound is manually installedMatthew Fennell
Prosody falls back to a legacy DNS module and also logs warnings if lua-unbound is not installed.
2025-09-21Move section header comments inside if blocksMatthew Fennell
If a section is not enabled on a particular server, that section's header comment should not be visible.
2025-09-21Enable websocket moduleMatthew Fennell
This provides a more performant alternative to BOSH for clients wishing to access the server over HTTP.
2025-09-21Configure proxy65Matthew Fennell
This configuration allows me to remove the proxy DNS records, and keep the configuration internal to prosody.
2025-09-21Place s2s modules behind a flagMatthew Fennell
We do not need s2s modules or config for a single-user transport oriented server. Likewise, we do not need admin or abuse contacts if s2s is disabled. No messages can escape, and it would be impossible to contact them regardless!
2025-09-21Remove config restating defaultsMatthew Fennell
According to mod_tls documentation, c2s_require_encryption and s2s_require_encryption already default to true. Therefore, they can be removed. Likewise, the default for authentication is internal_hashed, and the certs are already in the "certs" subdirectory relative to the prosody config file.
2025-09-21Remove unused dialback moduleMatthew Fennell
I have s2s_secure_auth enabled, which disables dialback. Therefore, this module is not needed.
2025-09-21Reformat prosody config filesMatthew Fennell
Use consistent 4-space indentation. Do not allow new scopes to be opened and closed on the same line. This allows me to more easily add jinja if statements without having to make formatting changes at the same time.
2025-09-21Place anti-spam modules behind a flagMatthew Fennell
There will be no s2s connections on the transport server, so anti-spam modules won't provide much benefit.
2025-09-21Place invites behind a flagMatthew Fennell
Invites are not needed on a single-user transport-only server. Therefore, place this functionality behind a flag.
2025-09-21Place invites behind a flagMatthew Fennell
I am planning on deploying a new single-user server, without s2s connections or other features, specifically for transports. This necessiates splitting off some functionality behind a flag, so that it is only enabled for non-transport ("standard") servers.
2025-09-21Do not require python3-pexepct to be installedMatthew Fennell
I added python3-pexpect to the dependency list in de867dadbcc3c69d97acf96bf3e86d11295eea39, to use the pexpect ansible module for a reason that is lost to the sands of time. This module is no longer used, so the dependency can be removed.
2025-08-11Add some extra statistics modulesMatthew Fennell
While looking through the list of available prosody-modules, these seemed useful.
2025-08-11Add some extra antispam modulesMatthew Fennell
While looking through the list of available prosody-modules, these two seemed useful.
2025-08-11Add spam checkingMatthew Fennell
Thankfully the servers I manage have not seen any spam, nevertheless, I'd rather set up some kind of mitigation now, before it becomes a problem.
2025-08-11Do not explicitly load component moduleMatthew Fennell
Whoops! mod_component is not supposed to be loaded directly, instead it gets indirectly loaded as a result of the relevant component definitions.
2025-08-11Enable extra modules available in prosody 13Matthew Fennell
I took the opportunity to look through the module list and add some extra ones that were missing before.
2025-08-11Enable sasl2 modulesMatthew Fennell
These are newly available in Trixie. I believe Monal will start loudly warning if they are not used in the near future.
2025-08-11Remove unused mod_posixMatthew Fennell
According to prosodyctl check, this module is no longer used or needed.
2025-08-11Remove deprecated vcard_muc moduleMatthew Fennell
This is not available in prosody-modules 0.0~hg20250402.f315edc39f3d+dfsg-2.
2025-08-11Document domain_with_ds and ds_subnameMatthew Fennell
I found these variables a bit confusing after having to interact with them again. It is useful to have some context now I have forgotten all about the DS record setup!
2025-08-11Add whitespace between variable definitionsMatthew Fennell
It is useful to jump to diferent variables using the {} keys in vim, and the rest of the playbook has similar whitespace.
2025-08-11Set domain_with_ds to "" if no parent domainMatthew Fennell
domain_with_ds is checked against the empty string when checking whether we should define ds_subname. When no parent_domain was found, we setting domain_with_ds to None, which in Ansible 10 was (correctly) failing the domain_with_ds != "" check. However, in Ansible 12, it now fails that check, meaning that Ansible tried to evaluate ds_subname even when domain_with_ds was None, resulting in a type conversion failure. Therefore, make sure that domain_with_ds is always a string, even if parent_domain is undefined, and use the empty string to represent this, as expected in the playbook itself.
2025-08-10Set hostname in playbookMatthew Fennell
Some services, such as munin, read the hostname from the system, and don't allow "virtual host" configuration like prosody. For such services, we want to make sure the hostname is set correctly.
2025-08-10Disable cloud-initMatthew Fennell
I want ansible to take full control of managing /etc/hosts, hostname etc. I think it is most convenient to disable cloud-init entirely, to prevent contention between ansible and cloud-init.
2025-08-10Replace deprecated postgres parametersMatthew Fennell
db and database have been deprecated, and replaced with login_db.
2025-08-10Use discovered python interpreter without warningMatthew Fennell
I don't need to specify the exact interpreter through ansible, as I can do this from the host itself.
2025-08-10Set pipefail when retrieving DANE hashMatthew Fennell
This is now enforced by ansible-lint.
2025-07-19Bump per-upload limit to 300 MiBMatthew Fennell
There's no need to jump back to 2 GiB yet, but I was finding 10 MiB too restrictive.