From f717c1be78f32f1404cb15fd69a9b7d85fd759db Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 7 Jul 2024 15:56:29 +0100 Subject: [PATCH] Decommission dokku I don't use it, still. I have a better plan for doing this in future anyway... --- ansible/ansible.cfg | 2 - ansible/galaxy-requirements.yml | 2 - ansible/group_vars/all/pve.yml | 4 -- ansible/host_vars/pve-docker/main.yml | 1 - ansible/host_vars/pve-dokku/main.yml | 5 -- ansible/host_vars/pve-dokku/vault.yml | 9 --- ansible/hosts | 1 - ansible/main.yml | 7 --- ansible/roles/dokku/files/nginx.conf | 12 ---- ansible/roles/dokku/handlers/main.yml | 5 -- ansible/roles/dokku/tasks/main.yml | 63 ------------------- ansible/roles/dokku/vars/main.yml | 9 --- ansible/roles/traefik/defaults/main.yml | 1 - .../traefik/files/file-provider-dokku.yml | 10 --- ansible/roles/traefik/files/traefik.yml | 4 -- ansible/roles/traefik/tasks/main.yml | 12 +--- terraform/theorangeone.net.tf | 16 ----- 17 files changed, 1 insertion(+), 162 deletions(-) delete mode 100644 ansible/host_vars/pve-dokku/main.yml delete mode 100644 ansible/host_vars/pve-dokku/vault.yml delete mode 100644 ansible/roles/dokku/files/nginx.conf delete mode 100644 ansible/roles/dokku/handlers/main.yml delete mode 100644 ansible/roles/dokku/tasks/main.yml delete mode 100644 ansible/roles/dokku/vars/main.yml delete mode 100644 ansible/roles/traefik/files/file-provider-dokku.yml diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index f298ea0..be908ea 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -7,8 +7,6 @@ collections_path = $PWD/galaxy_collections inventory = ./hosts become_ask_pass = True interpreter_python = auto_silent -# HACK: Force Ansible to find dokku plugins -library = $PWD/galaxy_roles/dokku_bot.ansible_dokku/library [ssh_connection] pipelining = True diff --git a/ansible/galaxy-requirements.yml b/ansible/galaxy-requirements.yml index d4d5c92..b5848b3 100644 --- a/ansible/galaxy-requirements.yml +++ b/ansible/galaxy-requirements.yml @@ -16,8 +16,6 @@ roles: version: 1.0.2 - src: ironicbadger.snapraid version: 1.0.0 - - src: dokku_bot.ansible_dokku - version: v2024.4.11 - src: geerlingguy.certbot version: 5.1.0 - src: artis3n.tailscale diff --git a/ansible/group_vars/all/pve.yml b/ansible/group_vars/all/pve.yml index 291fe2c..d97e106 100644 --- a/ansible/group_vars/all/pve.yml +++ b/ansible/group_vars/all/pve.yml @@ -11,8 +11,6 @@ pve_hosts: ipv6: fde3:15e9:e883::103 jellyfin: ip: 10.23.1.101 - dokku: - ip: 10.23.1.102 docker: ip: 10.23.1.103 ipv6: fde3:15e9:e883::203 @@ -29,5 +27,3 @@ pve_hosts: ip: 10.23.1.110 gitea_runner: ip: 10.23.1.114 - pve_dokku: - ip: 10.23.1.102 diff --git a/ansible/host_vars/pve-docker/main.yml b/ansible/host_vars/pve-docker/main.yml index bfa890c..cb5971d 100644 --- a/ansible/host_vars/pve-docker/main.yml +++ b/ansible/host_vars/pve-docker/main.yml @@ -3,7 +3,6 @@ private_ip: "{{ pve_hosts.docker.ip }}" traefik_provider_jellyfin: true traefik_provider_homeassistant: true traefik_provider_grafana: true -traefik_provider_dokku: true traefik_provider_uptime_kuma: true with_fail2ban: true diff --git a/ansible/host_vars/pve-dokku/main.yml b/ansible/host_vars/pve-dokku/main.yml deleted file mode 100644 index bc770f9..0000000 --- a/ansible/host_vars/pve-dokku/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -ssh_extra_allowed_users: dokku - -db_backups_dir: /mnt/tank/files/db-backups - -private_ip: "{{ pve_hosts.pve_dokku.ip }}" diff --git a/ansible/host_vars/pve-dokku/vault.yml b/ansible/host_vars/pve-dokku/vault.yml deleted file mode 100644 index 7623de9..0000000 --- a/ansible/host_vars/pve-dokku/vault.yml +++ /dev/null @@ -1,9 +0,0 @@ -$ANSIBLE_VAULT;1.1;AES256 -38396636313062623661613537386337356130353839303930346333313062383935353932336230 -6637666434356666346361663131343962663963333638630a376631313531633865396566643032 -31323866386236356639306333393765616630363734326662366632656430323739306439366634 -3364666662623764630a353532373433616365383862633935373332663933386561316262633662 -37366233326439336535623339366565653732646434386639336533386261306238306630396638 -30633433636365663538656338303066353830626137613038323462353137326234356533323335 -39643832636466643864663737316239626161653833343633306435363636663264303165303334 -36383661316566316630 diff --git a/ansible/hosts b/ansible/hosts index b11ed33..16dd130 100644 --- a/ansible/hosts +++ b/ansible/hosts @@ -13,4 +13,3 @@ qbittorrent restic renovate gitea-runner -pve-dokku diff --git a/ansible/main.yml b/ansible/main.yml index 2bc70a9..175f3ad 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -38,7 +38,6 @@ - walker - renovate - gitea-runner - - pve-dokku roles: - role: geerlingguy.docker become: true @@ -53,7 +52,6 @@ - pve-docker - forrest - walker - - pve-dokku roles: - db_auto_backup @@ -146,8 +144,3 @@ - role: prometheus.prometheus.node_exporter become: true - restic - -- hosts: pve-dokku - roles: - - nginx - - dokku diff --git a/ansible/roles/dokku/files/nginx.conf b/ansible/roles/dokku/files/nginx.conf deleted file mode 100644 index 89e4e55..0000000 --- a/ansible/roles/dokku/files/nginx.conf +++ /dev/null @@ -1,12 +0,0 @@ - # Block requests which don't have an explicit handler -server { - listen 80 default_server; - listen [::]:80 default_server; - - server_name _; - access_log off; - return 418; -} - -# Load configuration files for the default server block (this directory is used by dokku). -include /etc/nginx/conf.d/*.conf; diff --git a/ansible/roles/dokku/handlers/main.yml b/ansible/roles/dokku/handlers/main.yml deleted file mode 100644 index d5b7b4c..0000000 --- a/ansible/roles/dokku/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: reload nginx - service: - name: nginx - state: reloaded - become: true diff --git a/ansible/roles/dokku/tasks/main.yml b/ansible/roles/dokku/tasks/main.yml deleted file mode 100644 index 30d646e..0000000 --- a/ansible/roles/dokku/tasks/main.yml +++ /dev/null @@ -1,63 +0,0 @@ -# HACK: Fake include some tasks from `ansible_dokku`, so its library plugins can be used below -- name: Run role without running any tasks - include_role: - name: dokku_bot.ansible_dokku - tasks_from: init.yml - apply: - when: false - -- name: Install Dokku - package: - name: dokku - become: true - -- name: List dokku plugins - command: dokku plugin:list - changed_when: false - register: installed_dokku_plugins - -- name: Install Dokku plugins - command: dokku plugin:install {{ item.url }} --name {{ item.name }} - when: installed_dokku_plugins.stdout.find(item.name) == -1 - loop: "{{ dokku_plugins }}" - loop_control: - label: "{{ item.name }}" - become: true - -- name: Automatically update Dokku plugins - cron: - name: dokku plugin:update {{ item.name }} - minute: 0 - hour: 12 - user: root - job: /usr/bin/chronic /usr/bin/dokku plugin:update {{ item.name }} - cron_file: dokku-plugin-update-{{ item.name }} - loop: "{{ dokku_plugins }}" - loop_control: - label: "{{ item.name }}" - become: true - -- name: Set up global domain - dokku_domains: - global: true - domains: d.theorangeone.net - become: true - -- name: Install nginx config - template: - src: files/nginx.conf - dest: /etc/nginx/http.d/dokku.conf - mode: "644" - notify: reload nginx - become: true - -# https://dokku.com/docs/advanced-usage/backup-recovery/ -- name: Sync data to app-data - cron: - name: clean up docker containers - hour: "*/6" - minute: 0 - user: root - job: rsync --archive --progress -h /var/lib/dokku/{config,data,services} /home/dokku --exclude '/home/dokku/**/cache/*' /mnt/tank/app-data/dokku/ - cron_file: dokku-data-sync - become: true diff --git a/ansible/roles/dokku/vars/main.yml b/ansible/roles/dokku/vars/main.yml deleted file mode 100644 index c3c9836..0000000 --- a/ansible/roles/dokku/vars/main.yml +++ /dev/null @@ -1,9 +0,0 @@ -dokku_plugins: - - name: postgres - url: https://github.com/dokku/dokku-postgres.git - - name: redis - url: https://github.com/dokku/dokku-redis.git - - name: redirect - url: https://github.com/dokku/dokku-redirect.git - - name: http-auth - url: https://github.com/dokku/dokku-http-auth.git diff --git a/ansible/roles/traefik/defaults/main.yml b/ansible/roles/traefik/defaults/main.yml index 2827db6..f52564d 100644 --- a/ansible/roles/traefik/defaults/main.yml +++ b/ansible/roles/traefik/defaults/main.yml @@ -1,7 +1,6 @@ traefik_provider_jellyfin: false traefik_provider_homeassistant: false traefik_provider_grafana: false -traefik_provider_dokku: false traefik_provider_uptime_kuma: false with_fail2ban: false diff --git a/ansible/roles/traefik/files/file-provider-dokku.yml b/ansible/roles/traefik/files/file-provider-dokku.yml deleted file mode 100644 index 9112fa7..0000000 --- a/ansible/roles/traefik/files/file-provider-dokku.yml +++ /dev/null @@ -1,10 +0,0 @@ -http: - routers: - router-dokku: - rule: HostRegexp(`{subdomain:[a-z]+}.d.theorangeone.net`) - service: service-dokku - services: - service-dokku: - loadBalancer: - servers: - - url: http://{{ pve_hosts.dokku.ip }} diff --git a/ansible/roles/traefik/files/traefik.yml b/ansible/roles/traefik/files/traefik.yml index b1a5a33..31da3a7 100644 --- a/ansible/roles/traefik/files/traefik.yml +++ b/ansible/roles/traefik/files/traefik.yml @@ -25,10 +25,6 @@ entryPoints: sans: "*.theorangeone.net" - main: jakehoward.tech sans: "*.jakehoward.tech" - {% if traefik_provider_dokku %} - - main: d.theorangeone.net - sans: "*.d.theorangeone.net" - {% endif %} proxyProtocol: trustedIPs: - "{{ pve_hosts.ingress.ip }}/32" diff --git a/ansible/roles/traefik/tasks/main.yml b/ansible/roles/traefik/tasks/main.yml index 11ff184..cb3aa8f 100644 --- a/ansible/roles/traefik/tasks/main.yml +++ b/ansible/roles/traefik/tasks/main.yml @@ -91,17 +91,7 @@ when: traefik_provider_grafana become: true -- name: Install dokku provider - template: - src: files/file-provider-dokku.yml - dest: /opt/traefik/traefik/conf/dokku.yml - mode: "{{ docker_compose_file_mask }}" - owner: "{{ docker_user.name }}" - notify: restart traefik - when: traefik_provider_dokku - become: true - -- name: Install dokku provider +- name: Install uptime-kuma provider template: src: files/file-provider-uptime-kuma.yml dest: /opt/traefik/traefik/conf/uptime-kuma.yml diff --git a/terraform/theorangeone.net.tf b/terraform/theorangeone.net.tf index a73ac75..edb75c1 100644 --- a/terraform/theorangeone.net.tf +++ b/terraform/theorangeone.net.tf @@ -173,22 +173,6 @@ resource "cloudflare_record" "theorangeonenet_privatebin" { ttl = 1 } -resource "cloudflare_record" "theorangeonenet_dokku" { - zone_id = cloudflare_zone.theorangeonenet.id - name = "d" - value = cloudflare_record.sys_domain_pve.hostname - type = "CNAME" - ttl = 1 -} - -resource "cloudflare_record" "theorangeonenet_dokku_wildcard" { - zone_id = cloudflare_zone.theorangeonenet.id - name = "*.d" - value = cloudflare_record.theorangeonenet_dokku.hostname - type = "CNAME" - ttl = 1 -} - resource "cloudflare_record" "theorangeonenet_google_site_verification" { zone_id = cloudflare_zone.theorangeonenet.id name = "@"