diff --git a/.gitattributes b/.gitattributes index d688e0f..1a9fc77 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,4 @@ /secrets/** filter=git-crypt diff=git-crypt /newinfra/secrets-git-crypt/** filter=git-crypt diff=git-crypt +/secrets-git-crypt/** filter=git-crypt diff=git-crypt diff --git a/README.md b/README.md index fd16598..4093fce 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,30 @@ -# Infra setup +# new infra -## TODOS +New infra based on more servers and more shit. -There are many todos here. First, grep this codebase for `todo`. In addition to that: +All servers have their hostname as their name here and are reachable via `$hostname.infra.noratrieb.dev`. +They will have different firewall configurations depending on their roles. -- backups -- data replication across the two servers. i have two servers, let's use that power. maybe rsync or something like that? -## server?? +## DNS -Each VPS has a caddy running _on the host_, not inside docker. It's the entrypoint to the stuff. -Everything else runs in a docker container via docker compose. +Two [knot-dns](https://www.knot-dns.cz/) nameservers (`dns1`, `dns2`). +All records are fully static, generated in the NixOS config. -## extra setup +## HTTP(S) -every app needs some secrets in places. +stuff. -there are also "global secrets" used for the docker-compose, for example -for env vars. those should be placed in `/apps/.env`. +## provisioning -Right now the global secrets are +NixOS is provisioned by running [nixos-infect](https://github.com/elitak/nixos-infect) over a default image. + +> Contabo sets the hostname to something like vmi######.contaboserver.net, Nixos only allows RFC 1035 compliant hostnames (see here). +> Run `hostname something_without_dots` before running the script. +> If you run the script before changing the hostname - remove the /etc/nixos/configuration.nix so it's regenerated with the new hostname. ``` -KILLUA_BOT_TOKEN= -HUGO_CHAT_DB_PASSWORD= +hostname tmp +curl -LO https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect +bash nixos-infect ``` - -## things that shall not be forgotten - -there once was some custom k8s cluster setup in `./k8s-cluster`. it was incomplete and pretty cursed. - -also some kubernetes config in `./kube`. why. - -gloriously not great docker configs in `./docker`. - -`nginx`, `registry` with config for the two. - -`run_scripts` with not good scripts for starting containers. diff --git a/newinfra/README.md b/newinfra/README.md deleted file mode 100644 index 4093fce..0000000 --- a/newinfra/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# new infra - -New infra based on more servers and more shit. - -All servers have their hostname as their name here and are reachable via `$hostname.infra.noratrieb.dev`. -They will have different firewall configurations depending on their roles. - - -## DNS - -Two [knot-dns](https://www.knot-dns.cz/) nameservers (`dns1`, `dns2`). -All records are fully static, generated in the NixOS config. - -## HTTP(S) - -stuff. - -## provisioning - -NixOS is provisioned by running [nixos-infect](https://github.com/elitak/nixos-infect) over a default image. - -> Contabo sets the hostname to something like vmi######.contaboserver.net, Nixos only allows RFC 1035 compliant hostnames (see here). -> Run `hostname something_without_dots` before running the script. -> If you run the script before changing the hostname - remove the /etc/nixos/configuration.nix so it's regenerated with the new hostname. - -``` -hostname tmp -curl -LO https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect -bash nixos-infect -``` diff --git a/newinfra/nix/apps/openolat/extra-properties.properties b/newinfra/nix/apps/openolat/extra-properties.properties deleted file mode 100644 index 17343fa..0000000 --- a/newinfra/nix/apps/openolat/extra-properties.properties +++ /dev/null @@ -1 +0,0 @@ -enforce.utf8.filesystem=false diff --git a/newinfra/secrets-git-crypt/openolat_db_password b/newinfra/secrets-git-crypt/openolat_db_password deleted file mode 100644 index fc78ce3..0000000 Binary files a/newinfra/secrets-git-crypt/openolat_db_password and /dev/null differ diff --git a/newinfra/nix/apps/cargo-bisect-rustc-service/default.nix b/nix/apps/cargo-bisect-rustc-service/default.nix similarity index 100% rename from newinfra/nix/apps/cargo-bisect-rustc-service/default.nix rename to nix/apps/cargo-bisect-rustc-service/default.nix diff --git a/newinfra/nix/apps/does-it-build/default.nix b/nix/apps/does-it-build/default.nix similarity index 100% rename from newinfra/nix/apps/does-it-build/default.nix rename to nix/apps/does-it-build/default.nix diff --git a/newinfra/nix/apps/forgejo/default.nix b/nix/apps/forgejo/default.nix similarity index 100% rename from newinfra/nix/apps/forgejo/default.nix rename to nix/apps/forgejo/default.nix diff --git a/newinfra/nix/apps/hugo-chat/default.nix b/nix/apps/hugo-chat/default.nix similarity index 100% rename from newinfra/nix/apps/hugo-chat/default.nix rename to nix/apps/hugo-chat/default.nix diff --git a/newinfra/nix/apps/killua/default.nix b/nix/apps/killua/default.nix similarity index 100% rename from newinfra/nix/apps/killua/default.nix rename to nix/apps/killua/default.nix diff --git a/newinfra/nix/apps/openolat/default.nix b/nix/apps/openolat/default.nix similarity index 100% rename from newinfra/nix/apps/openolat/default.nix rename to nix/apps/openolat/default.nix diff --git a/apps/openolat/extra-properties.properties b/nix/apps/openolat/extra-properties.properties similarity index 100% rename from apps/openolat/extra-properties.properties rename to nix/apps/openolat/extra-properties.properties diff --git a/newinfra/nix/apps/upload-files/default.nix b/nix/apps/upload-files/default.nix similarity index 100% rename from newinfra/nix/apps/upload-files/default.nix rename to nix/apps/upload-files/default.nix diff --git a/newinfra/nix/apps/uptime/default.nix b/nix/apps/uptime/default.nix similarity index 100% rename from newinfra/nix/apps/uptime/default.nix rename to nix/apps/uptime/default.nix diff --git a/newinfra/nix/apps/uptime/uptime.json b/nix/apps/uptime/uptime.json similarity index 100% rename from newinfra/nix/apps/uptime/uptime.json rename to nix/apps/uptime/uptime.json diff --git a/newinfra/nix/apps/widetom/default.nix b/nix/apps/widetom/default.nix similarity index 100% rename from newinfra/nix/apps/widetom/default.nix rename to nix/apps/widetom/default.nix diff --git a/newinfra/nix/deploy/deploy-dns.sh b/nix/deploy/deploy-dns.sh similarity index 100% rename from newinfra/nix/deploy/deploy-dns.sh rename to nix/deploy/deploy-dns.sh diff --git a/newinfra/nix/deploy/smoke-tests.sh b/nix/deploy/smoke-tests.sh similarity index 100% rename from newinfra/nix/deploy/smoke-tests.sh rename to nix/deploy/smoke-tests.sh diff --git a/newinfra/nix/hive.nix b/nix/hive.nix similarity index 100% rename from newinfra/nix/hive.nix rename to nix/hive.nix diff --git a/newinfra/nix/modules/backup/backup.sh b/nix/modules/backup/backup.sh similarity index 100% rename from newinfra/nix/modules/backup/backup.sh rename to nix/modules/backup/backup.sh diff --git a/newinfra/nix/modules/backup/default.nix b/nix/modules/backup/default.nix similarity index 100% rename from newinfra/nix/modules/backup/default.nix rename to nix/modules/backup/default.nix diff --git a/newinfra/nix/modules/caddy/base.Caddyfile b/nix/modules/caddy/base.Caddyfile similarity index 100% rename from newinfra/nix/modules/caddy/base.Caddyfile rename to nix/modules/caddy/base.Caddyfile diff --git a/newinfra/nix/modules/caddy/caddy-build.nix b/nix/modules/caddy/caddy-build.nix similarity index 100% rename from newinfra/nix/modules/caddy/caddy-build.nix rename to nix/modules/caddy/caddy-build.nix diff --git a/newinfra/nix/modules/caddy/caddy-static-prepare/default.nix b/nix/modules/caddy/caddy-static-prepare/default.nix similarity index 100% rename from newinfra/nix/modules/caddy/caddy-static-prepare/default.nix rename to nix/modules/caddy/caddy-static-prepare/default.nix diff --git a/newinfra/nix/modules/caddy/caddy-static-prepare/prepare.py b/nix/modules/caddy/caddy-static-prepare/prepare.py similarity index 100% rename from newinfra/nix/modules/caddy/caddy-static-prepare/prepare.py rename to nix/modules/caddy/caddy-static-prepare/prepare.py diff --git a/newinfra/nix/modules/caddy/debugging-page/index.html b/nix/modules/caddy/debugging-page/index.html similarity index 100% rename from newinfra/nix/modules/caddy/debugging-page/index.html rename to nix/modules/caddy/debugging-page/index.html diff --git a/newinfra/nix/modules/caddy/default.nix b/nix/modules/caddy/default.nix similarity index 100% rename from newinfra/nix/modules/caddy/default.nix rename to nix/modules/caddy/default.nix diff --git a/newinfra/nix/modules/caddy/vps1.Caddyfile b/nix/modules/caddy/vps1.Caddyfile similarity index 100% rename from newinfra/nix/modules/caddy/vps1.Caddyfile rename to nix/modules/caddy/vps1.Caddyfile diff --git a/newinfra/nix/modules/caddy/vps3.Caddyfile b/nix/modules/caddy/vps3.Caddyfile similarity index 100% rename from newinfra/nix/modules/caddy/vps3.Caddyfile rename to nix/modules/caddy/vps3.Caddyfile diff --git a/newinfra/nix/modules/caddy/vps4.Caddyfile b/nix/modules/caddy/vps4.Caddyfile similarity index 100% rename from newinfra/nix/modules/caddy/vps4.Caddyfile rename to nix/modules/caddy/vps4.Caddyfile diff --git a/newinfra/nix/modules/contabo/default.nix b/nix/modules/contabo/default.nix similarity index 100% rename from newinfra/nix/modules/contabo/default.nix rename to nix/modules/contabo/default.nix diff --git a/newinfra/nix/modules/default/default.nix b/nix/modules/default/default.nix similarity index 100% rename from newinfra/nix/modules/default/default.nix rename to nix/modules/default/default.nix diff --git a/newinfra/nix/modules/dns/default.nix b/nix/modules/dns/default.nix similarity index 100% rename from newinfra/nix/modules/dns/default.nix rename to nix/modules/dns/default.nix diff --git a/newinfra/nix/modules/dns/nilstrieb.dev.nix b/nix/modules/dns/nilstrieb.dev.nix similarity index 100% rename from newinfra/nix/modules/dns/nilstrieb.dev.nix rename to nix/modules/dns/nilstrieb.dev.nix diff --git a/newinfra/nix/modules/dns/noratrieb.dev.nix b/nix/modules/dns/noratrieb.dev.nix similarity index 100% rename from newinfra/nix/modules/dns/noratrieb.dev.nix rename to nix/modules/dns/noratrieb.dev.nix diff --git a/newinfra/nix/modules/garage/README.md b/nix/modules/garage/README.md similarity index 100% rename from newinfra/nix/modules/garage/README.md rename to nix/modules/garage/README.md diff --git a/newinfra/nix/modules/garage/default.nix b/nix/modules/garage/default.nix similarity index 100% rename from newinfra/nix/modules/garage/default.nix rename to nix/modules/garage/default.nix diff --git a/newinfra/nix/modules/podman/default.nix b/nix/modules/podman/default.nix similarity index 100% rename from newinfra/nix/modules/podman/default.nix rename to nix/modules/podman/default.nix diff --git a/newinfra/nix/modules/prometheus/default.nix b/nix/modules/prometheus/default.nix similarity index 100% rename from newinfra/nix/modules/prometheus/default.nix rename to nix/modules/prometheus/default.nix diff --git a/newinfra/nix/modules/registry/default.nix b/nix/modules/registry/default.nix similarity index 100% rename from newinfra/nix/modules/registry/default.nix rename to nix/modules/registry/default.nix diff --git a/newinfra/nix/modules/wg-mesh/default.nix b/nix/modules/wg-mesh/default.nix similarity index 100% rename from newinfra/nix/modules/wg-mesh/default.nix rename to nix/modules/wg-mesh/default.nix diff --git a/newinfra/nix/my-projects.json b/nix/my-projects.json similarity index 100% rename from newinfra/nix/my-projects.json rename to nix/my-projects.json diff --git a/newinfra/nix/secrets/backup_s3_secret.age b/nix/secrets/backup_s3_secret.age similarity index 100% rename from newinfra/nix/secrets/backup_s3_secret.age rename to nix/secrets/backup_s3_secret.age diff --git a/newinfra/nix/secrets/caddy_s3_key_secret.age b/nix/secrets/caddy_s3_key_secret.age similarity index 100% rename from newinfra/nix/secrets/caddy_s3_key_secret.age rename to nix/secrets/caddy_s3_key_secret.age diff --git a/newinfra/nix/secrets/docker_registry_password.age b/nix/secrets/docker_registry_password.age similarity index 100% rename from newinfra/nix/secrets/docker_registry_password.age rename to nix/secrets/docker_registry_password.age diff --git a/newinfra/nix/secrets/encrypt.sh b/nix/secrets/encrypt.sh similarity index 100% rename from newinfra/nix/secrets/encrypt.sh rename to nix/secrets/encrypt.sh diff --git a/newinfra/nix/secrets/forgejo_s3_key_secret.age b/nix/secrets/forgejo_s3_key_secret.age similarity index 100% rename from newinfra/nix/secrets/forgejo_s3_key_secret.age rename to nix/secrets/forgejo_s3_key_secret.age diff --git a/newinfra/nix/secrets/garage_secrets.age b/nix/secrets/garage_secrets.age similarity index 100% rename from newinfra/nix/secrets/garage_secrets.age rename to nix/secrets/garage_secrets.age diff --git a/newinfra/nix/secrets/grafana_admin_password.age b/nix/secrets/grafana_admin_password.age similarity index 100% rename from newinfra/nix/secrets/grafana_admin_password.age rename to nix/secrets/grafana_admin_password.age diff --git a/newinfra/nix/secrets/hugochat_db_password.age b/nix/secrets/hugochat_db_password.age similarity index 100% rename from newinfra/nix/secrets/hugochat_db_password.age rename to nix/secrets/hugochat_db_password.age diff --git a/newinfra/nix/secrets/killua_env.age b/nix/secrets/killua_env.age similarity index 100% rename from newinfra/nix/secrets/killua_env.age rename to nix/secrets/killua_env.age diff --git a/newinfra/nix/secrets/loki_env.age b/nix/secrets/loki_env.age similarity index 100% rename from newinfra/nix/secrets/loki_env.age rename to nix/secrets/loki_env.age diff --git a/newinfra/nix/secrets/minio_env_file.age b/nix/secrets/minio_env_file.age similarity index 100% rename from newinfra/nix/secrets/minio_env_file.age rename to nix/secrets/minio_env_file.age diff --git a/newinfra/nix/secrets/openolat_db_password.age b/nix/secrets/openolat_db_password.age similarity index 100% rename from newinfra/nix/secrets/openolat_db_password.age rename to nix/secrets/openolat_db_password.age diff --git a/newinfra/nix/secrets/registry_htpasswd.age b/nix/secrets/registry_htpasswd.age similarity index 100% rename from newinfra/nix/secrets/registry_htpasswd.age rename to nix/secrets/registry_htpasswd.age diff --git a/newinfra/nix/secrets/registry_s3_key_secret.age b/nix/secrets/registry_s3_key_secret.age similarity index 100% rename from newinfra/nix/secrets/registry_s3_key_secret.age rename to nix/secrets/registry_s3_key_secret.age diff --git a/newinfra/nix/secrets/s3_mc_admin_client.age b/nix/secrets/s3_mc_admin_client.age similarity index 100% rename from newinfra/nix/secrets/s3_mc_admin_client.age rename to nix/secrets/s3_mc_admin_client.age diff --git a/newinfra/nix/secrets/secrets.nix b/nix/secrets/secrets.nix similarity index 100% rename from newinfra/nix/secrets/secrets.nix rename to nix/secrets/secrets.nix diff --git a/newinfra/nix/secrets/upload_files_s3_secret.age b/nix/secrets/upload_files_s3_secret.age similarity index 100% rename from newinfra/nix/secrets/upload_files_s3_secret.age rename to nix/secrets/upload_files_s3_secret.age diff --git a/newinfra/nix/secrets/wg_private_dns1.age b/nix/secrets/wg_private_dns1.age similarity index 100% rename from newinfra/nix/secrets/wg_private_dns1.age rename to nix/secrets/wg_private_dns1.age diff --git a/newinfra/nix/secrets/wg_private_dns2.age b/nix/secrets/wg_private_dns2.age similarity index 100% rename from newinfra/nix/secrets/wg_private_dns2.age rename to nix/secrets/wg_private_dns2.age diff --git a/newinfra/nix/secrets/wg_private_vps1.age b/nix/secrets/wg_private_vps1.age similarity index 100% rename from newinfra/nix/secrets/wg_private_vps1.age rename to nix/secrets/wg_private_vps1.age diff --git a/newinfra/nix/secrets/wg_private_vps2.age b/nix/secrets/wg_private_vps2.age similarity index 100% rename from newinfra/nix/secrets/wg_private_vps2.age rename to nix/secrets/wg_private_vps2.age diff --git a/newinfra/nix/secrets/wg_private_vps3.age b/nix/secrets/wg_private_vps3.age similarity index 100% rename from newinfra/nix/secrets/wg_private_vps3.age rename to nix/secrets/wg_private_vps3.age diff --git a/newinfra/nix/secrets/wg_private_vps4.age b/nix/secrets/wg_private_vps4.age similarity index 100% rename from newinfra/nix/secrets/wg_private_vps4.age rename to nix/secrets/wg_private_vps4.age diff --git a/newinfra/nix/secrets/wg_private_vps5.age b/nix/secrets/wg_private_vps5.age similarity index 100% rename from newinfra/nix/secrets/wg_private_vps5.age rename to nix/secrets/wg_private_vps5.age diff --git a/newinfra/nix/secrets/widetom_bot_token.age b/nix/secrets/widetom_bot_token.age similarity index 100% rename from newinfra/nix/secrets/widetom_bot_token.age rename to nix/secrets/widetom_bot_token.age diff --git a/newinfra/nix/secrets/widetom_config_toml.age b/nix/secrets/widetom_config_toml.age similarity index 100% rename from newinfra/nix/secrets/widetom_config_toml.age rename to nix/secrets/widetom_config_toml.age diff --git a/newinfra/secrets-git-crypt/backup_s3_secret b/secrets-git-crypt/backup_s3_secret similarity index 100% rename from newinfra/secrets-git-crypt/backup_s3_secret rename to secrets-git-crypt/backup_s3_secret diff --git a/newinfra/secrets-git-crypt/caddy_s3_key_secret b/secrets-git-crypt/caddy_s3_key_secret similarity index 100% rename from newinfra/secrets-git-crypt/caddy_s3_key_secret rename to secrets-git-crypt/caddy_s3_key_secret diff --git a/newinfra/secrets-git-crypt/docker_registry_password b/secrets-git-crypt/docker_registry_password similarity index 100% rename from newinfra/secrets-git-crypt/docker_registry_password rename to secrets-git-crypt/docker_registry_password diff --git a/newinfra/secrets-git-crypt/forgejo_s3_key_secret b/secrets-git-crypt/forgejo_s3_key_secret similarity index 100% rename from newinfra/secrets-git-crypt/forgejo_s3_key_secret rename to secrets-git-crypt/forgejo_s3_key_secret diff --git a/newinfra/secrets-git-crypt/garage_secrets b/secrets-git-crypt/garage_secrets similarity index 100% rename from newinfra/secrets-git-crypt/garage_secrets rename to secrets-git-crypt/garage_secrets diff --git a/newinfra/secrets-git-crypt/grafana_admin_password b/secrets-git-crypt/grafana_admin_password similarity index 100% rename from newinfra/secrets-git-crypt/grafana_admin_password rename to secrets-git-crypt/grafana_admin_password diff --git a/newinfra/secrets-git-crypt/hugochat_db_password b/secrets-git-crypt/hugochat_db_password similarity index 100% rename from newinfra/secrets-git-crypt/hugochat_db_password rename to secrets-git-crypt/hugochat_db_password diff --git a/newinfra/secrets-git-crypt/killua_env b/secrets-git-crypt/killua_env similarity index 100% rename from newinfra/secrets-git-crypt/killua_env rename to secrets-git-crypt/killua_env diff --git a/newinfra/secrets-git-crypt/loki_env b/secrets-git-crypt/loki_env similarity index 100% rename from newinfra/secrets-git-crypt/loki_env rename to secrets-git-crypt/loki_env diff --git a/newinfra/secrets-git-crypt/minio_env_file b/secrets-git-crypt/minio_env_file similarity index 100% rename from newinfra/secrets-git-crypt/minio_env_file rename to secrets-git-crypt/minio_env_file diff --git a/newinfra/secrets-git-crypt/registry_htpasswd b/secrets-git-crypt/registry_htpasswd similarity index 100% rename from newinfra/secrets-git-crypt/registry_htpasswd rename to secrets-git-crypt/registry_htpasswd diff --git a/newinfra/secrets-git-crypt/registry_s3_key_secret b/secrets-git-crypt/registry_s3_key_secret similarity index 100% rename from newinfra/secrets-git-crypt/registry_s3_key_secret rename to secrets-git-crypt/registry_s3_key_secret diff --git a/newinfra/secrets-git-crypt/s3_mc_admin_client b/secrets-git-crypt/s3_mc_admin_client similarity index 100% rename from newinfra/secrets-git-crypt/s3_mc_admin_client rename to secrets-git-crypt/s3_mc_admin_client diff --git a/newinfra/secrets-git-crypt/upload_files_s3_secret b/secrets-git-crypt/upload_files_s3_secret similarity index 100% rename from newinfra/secrets-git-crypt/upload_files_s3_secret rename to secrets-git-crypt/upload_files_s3_secret diff --git a/newinfra/secrets-git-crypt/wg_private_dns1 b/secrets-git-crypt/wg_private_dns1 similarity index 100% rename from newinfra/secrets-git-crypt/wg_private_dns1 rename to secrets-git-crypt/wg_private_dns1 diff --git a/newinfra/secrets-git-crypt/wg_private_dns2 b/secrets-git-crypt/wg_private_dns2 similarity index 100% rename from newinfra/secrets-git-crypt/wg_private_dns2 rename to secrets-git-crypt/wg_private_dns2 diff --git a/newinfra/secrets-git-crypt/wg_private_vps1 b/secrets-git-crypt/wg_private_vps1 similarity index 100% rename from newinfra/secrets-git-crypt/wg_private_vps1 rename to secrets-git-crypt/wg_private_vps1 diff --git a/newinfra/secrets-git-crypt/wg_private_vps2 b/secrets-git-crypt/wg_private_vps2 similarity index 100% rename from newinfra/secrets-git-crypt/wg_private_vps2 rename to secrets-git-crypt/wg_private_vps2 diff --git a/newinfra/secrets-git-crypt/wg_private_vps3 b/secrets-git-crypt/wg_private_vps3 similarity index 100% rename from newinfra/secrets-git-crypt/wg_private_vps3 rename to secrets-git-crypt/wg_private_vps3 diff --git a/newinfra/secrets-git-crypt/wg_private_vps4 b/secrets-git-crypt/wg_private_vps4 similarity index 100% rename from newinfra/secrets-git-crypt/wg_private_vps4 rename to secrets-git-crypt/wg_private_vps4 diff --git a/newinfra/secrets-git-crypt/wg_private_vps5 b/secrets-git-crypt/wg_private_vps5 similarity index 100% rename from newinfra/secrets-git-crypt/wg_private_vps5 rename to secrets-git-crypt/wg_private_vps5 diff --git a/newinfra/secrets-git-crypt/widetom_bot_token b/secrets-git-crypt/widetom_bot_token similarity index 100% rename from newinfra/secrets-git-crypt/widetom_bot_token rename to secrets-git-crypt/widetom_bot_token diff --git a/newinfra/secrets-git-crypt/widetom_config.toml b/secrets-git-crypt/widetom_config.toml similarity index 100% rename from newinfra/secrets-git-crypt/widetom_config.toml rename to secrets-git-crypt/widetom_config.toml diff --git a/newinfra/update-my-projects.mjs b/update-my-projects.mjs similarity index 100% rename from newinfra/update-my-projects.mjs rename to update-my-projects.mjs