diff --git a/README.md b/README.md index 9b23b5f..1169c52 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,10 @@ -# Operational notes - -## Postgres upgrade - -1. Stop services that use postgres -```bash -systemctl stop matrix-synapse grafana -``` -2. Login as postgres user -```bash -sudo -su postgres -old=16 -cd /var/lib/postgresql/ -pg_old=$(nix-build --no-out-link -A postgresql_${old:?} '') -pg_new=$(nix-build --no-out-link -A postgresql_$((old+1)) '') -``` -3. Initialize new data directory -```bash -$pg_new/bin/initdb --encoding=UTF8 --locale=C $((old+1)) -``` -4. Run check -```bash -$pg_new/bin/pg_upgrade \ - --old-bindir=$pg_old/bin \ - --new-bindir=$pg_new/bin \ - --old-datadir=/var/lib/postgresql/${old:?} \ - --new-datadir=/var/lib/postgresql/$((old+1)) \ - -j16 \ - --clone \ - --check -``` -5. Stop the old Postgres -```bash -systemctl stop postgresql -``` -6. Run the migration -```bash -$pg_new/bin/pg_upgrade \ - --old-bindir=$pg_old/bin \ - --new-bindir=$pg_new/bin \ - --old-datadir=/var/lib/postgresql/${old:?} \ - --new-datadir=/var/lib/postgresql/$((old+1)) \ - -j16 \ - --clone -``` -7. Start the new Postgres -```bash -services.postgres.packages = pkgs.postgresql_17; -nixos-rebuild switch -``` - -Cleanup (after a few days): - -```bash -sudo -su postgres -vacuumdb --all --analyze-in-stages -cd /var/lib/postgresql/ -./delete_old_cluster.sh -rm -v delete_old_cluster.sh -``` - # Tarball ```bash -nix build .#nixosConfigurations..config.system.build.image +nix build .#nixosConfigurations.matrix.config.system.build.image ``` -# Matrix - -## HTTP +# HTTP Configure `berlin.ccc.de` web server to send federation traffic to the matrix server: @@ -87,7 +24,7 @@ server { } ``` -## DNS +# DNS ```dns _matrix-fed._tcp.berlin.ccc.de. IN SRV 10 0 443 matrix.berlin.ccc.de. @@ -102,7 +39,7 @@ matrix.berlin.ccc.de. IN SSHFP 4 1 62d10fa57f8a1aa7469cd9b00621e4ce8 matrix.berlin.ccc.de. IN SSHFP 4 2 ca80a6685984da140ac850e4951fa31e70b616e87f62f46437af3bfd215af887 ``` -## Bots +# Bots ```bash register_new_matrix_user \ @@ -112,7 +49,7 @@ register_new_matrix_user \ --password ``` -## Draupnir +# Draupnir Remove rate limit for account: diff --git a/hosts/matrix.nix b/configuration.nix similarity index 75% rename from hosts/matrix.nix rename to configuration.nix index ca2942d..0f7677a 100644 --- a/hosts/matrix.nix +++ b/configuration.nix @@ -74,8 +74,6 @@ nameservers = [ "2606:4700:4700::1111#one.one.one.one" "2620:fe::fe#dns.quad9.net" - "1.1.1.1#one.one.one.one" - "9.9.9.9#dns.quad9.net" ]; useDHCP = false; useNetworkd = true; @@ -97,23 +95,40 @@ }; time.timeZone = "Europe/Berlin"; - i18n.defaultLocale = "en_GB.UTF-8"; + i18n.defaultLocale = "en_US.UTF-8"; console.font = "Lat2-Terminus16"; services = { fstrim.enable = false; # Let Proxmox host handle fstrim - openssh.banner = '' - __ __ - /\ \__ __ /\ \ - ___ ___ __ \ \ ,_\ _ __ /\_\ __ _ ___ ___ ___\ \ \____ - /' __` __`\ /'__`\ \ \ \/ /\`'__\/\ \ /\ \/'\ /'___\ /'___\ /'___\ \ '__`\ - /\ \/\ \/\ \/\ \L\.\_\ \ \_\ \ \/ \ \ \\/>