From d925b4783ecf77a1a1772a7c56ed51977b74a488 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 26 Jul 2024 21:35:45 +0200 Subject: [PATCH] updates --- newinfra/nix/hive.nix | 38 --------------------- newinfra/nix/modules/dns/nilstrieb.dev.nix | 22 ++++++------ newinfra/nix/modules/dns/noratrieb.dev.nix | 2 +- newinfra/nix/modules/ingress/default.nix | 1 + playbooks/vps1.yml | 5 --- playbooks/vps2.yml | 5 +++ vps1/Caddyfile | 5 --- vps2/Caddyfile | 5 +++ {vps1 => vps2}/nora/index.html | 0 {vps1 => vps2}/nora/nora.png | Bin {vps1 => vps2}/nora/theme.css | 0 11 files changed, 23 insertions(+), 60 deletions(-) create mode 100644 newinfra/nix/modules/ingress/default.nix rename {vps1 => vps2}/nora/index.html (100%) rename {vps1 => vps2}/nora/nora.png (100%) rename {vps1 => vps2}/nora/theme.css (100%) diff --git a/newinfra/nix/hive.nix b/newinfra/nix/hive.nix index 11c900e..81d34ba 100644 --- a/newinfra/nix/hive.nix +++ b/newinfra/nix/hive.nix @@ -34,16 +34,6 @@ zramSwap.enable = true; services.openssh.enable = true; - - # By default, Colmena will replace unknown remote profile - # (unknown means the profile isn't in the nix store on the - # host running Colmena) during apply (with the default goal, - # boot, and switch). - # If you share a hive with others, or use multiple machines, - # and are not careful to always commit/push/pull changes - # you can accidentaly overwrite a remote profile so in those - # scenarios you might want to change this default to false. - # deployment.replaceUnknownProfiles = true; }; dns1 = { name, nodes, modulesPath, ... }: { @@ -112,32 +102,4 @@ ATTR{address}=="96:00:03:91:16:47", NAME="eth0" ''; }; - - /*host-b = { - # Like NixOps and Morph, Colmena will attempt to connect to - # the remote host using the attribute name by default. You - # can override it like: - deployment.targetHost = "dns2.infra.noratrieb.dev"; - - # It's also possible to override the target SSH port. - # For further customization, use the SSH_CONFIG_FILE - # environment variable to specify a ssh_config file. - deployment.targetPort = 1234; - - # Override the default for this target host - deployment.replaceUnknownProfiles = false; - - # You can filter hosts by tags with --on @tag-a,@tag-b. - # In this example, you can deploy to hosts with the "web" tag using: - # colmena apply --on @web - # You can use globs in tag matching as well: - # colmena apply --on '@infra-*' - deployment.tags = [ "dns" "eu" ]; - - boot.loader.grub.device = "/dev/sda"; - fileSystems."/" = { - device = "/dev/sda1"; - fsType = "ext4"; - }; - };*/ } diff --git a/newinfra/nix/modules/dns/nilstrieb.dev.nix b/newinfra/nix/modules/dns/nilstrieb.dev.nix index 2967962..34cc39d 100644 --- a/newinfra/nix/modules/dns/nilstrieb.dev.nix +++ b/newinfra/nix/modules/dns/nilstrieb.dev.nix @@ -6,8 +6,8 @@ let dns1 = host "154.38.163.74" null; dns2 = host "128.140.3.7" "2a01:4f8:c2c:d616::"; - vps1 = host "184.174.32.252" null; - vps2 = host "161.97.165.1" null; + vps1 = host "161.97.165.1" null; + vps2 = host "184.174.32.252" null; in { SOA = { @@ -47,20 +47,20 @@ let ]; subdomains = { - www = vps1; + www = vps2; blog.CNAME = [ (cname "nilstrieb.github.io") ]; # apps - bisect-rustc = vps1; - cors-school = vps1 // { - subdomains.api = vps1; + bisect-rustc = vps2; + cors-school = vps2 // { + subdomains.api = vps2; }; - docker = vps1; - hugo-chat = vps1 // { - subdomains.api = vps1; + docker = vps2; + hugo-chat = vps2 // { + subdomains.api = vps2; }; - olat = vps1; - uptime = vps1; + olat = vps2; + uptime = vps2; localhost.A = [ (a "127.0.0.1") ]; diff --git a/newinfra/nix/modules/dns/noratrieb.dev.nix b/newinfra/nix/modules/dns/noratrieb.dev.nix index 31ac84a..4d628db 100644 --- a/newinfra/nix/modules/dns/noratrieb.dev.nix +++ b/newinfra/nix/modules/dns/noratrieb.dev.nix @@ -18,7 +18,7 @@ let "ns2.noratrieb.dev" ]; - A = [ (a "161.97.165.1") ]; + A = [ (a "184.174.32.252") ]; AAAA = [ ]; subdomains = { diff --git a/newinfra/nix/modules/ingress/default.nix b/newinfra/nix/modules/ingress/default.nix new file mode 100644 index 0000000..c915eb0 --- /dev/null +++ b/newinfra/nix/modules/ingress/default.nix @@ -0,0 +1 @@ +{ ... }: { } diff --git a/playbooks/vps1.yml b/playbooks/vps1.yml index 0f8bfca..05c3ffb 100644 --- a/playbooks/vps1.yml +++ b/playbooks/vps1.yml @@ -3,11 +3,6 @@ hosts: vps1 gather_facts: false tasks: - - name: Copy over some fun files - ansible.builtin.copy: - dest: /var/www/html/nora/ - src: "../vps1/nora/" - mode: "u=rw,g=r,o=r" ##### # END: docker compose up! ##### diff --git a/playbooks/vps2.yml b/playbooks/vps2.yml index 967361c..ef71895 100644 --- a/playbooks/vps2.yml +++ b/playbooks/vps2.yml @@ -14,6 +14,11 @@ minute: "5" hour: "7" job: "/apps/backup.sh" + - name: Copy over some fun files + ansible.builtin.copy: + dest: /var/www/html/nora/ + src: "../vps2/nora/" + mode: "u=rw,g=r,o=r" ##### # APP: prometheus, /apps/prometheus - name: Create /apps/prometheus diff --git a/vps1/Caddyfile b/vps1/Caddyfile index 90c18ea..d26f23c 100644 --- a/vps1/Caddyfile +++ b/vps1/Caddyfile @@ -32,8 +32,3 @@ vps1.nilstrieb.dev { root * /var/www/html/debug file_server } - -noratrieb.dev { - root * /var/www/html/nora - file_server -} diff --git a/vps2/Caddyfile b/vps2/Caddyfile index c6641b0..199e69f 100644 --- a/vps2/Caddyfile +++ b/vps2/Caddyfile @@ -78,3 +78,8 @@ olat.nilstrieb.dev:8088 { uptime.nilstrieb.dev { reverse_proxy * localhost:5010 } + +noratrieb.dev { + root * /var/www/html/nora + file_server +} diff --git a/vps1/nora/index.html b/vps2/nora/index.html similarity index 100% rename from vps1/nora/index.html rename to vps2/nora/index.html diff --git a/vps1/nora/nora.png b/vps2/nora/nora.png similarity index 100% rename from vps1/nora/nora.png rename to vps2/nora/nora.png diff --git a/vps1/nora/theme.css b/vps2/nora/theme.css similarity index 100% rename from vps1/nora/theme.css rename to vps2/nora/theme.css