From 35c5079d8f27ed0922ece392008303c5a9a90e11 Mon Sep 17 00:00:00 2001 From: "Rasmus \"Pez\" Wejlgaard" Date: Sat, 25 Apr 2026 17:46:17 +0100 Subject: [PATCH] fix: remove cloud and TWDNE and add energy dashboard for grafana (#71) --- ansible/services/caddy/Caddyfile | 15 - .../services/grafana/dashboards/energy.json | 762 ++++++++++++++++++ ansible/services/nextcloud-aio/README.md | 10 - .../services/nextcloud-aio/docker-compose.yml | 33 - .../thiswebsitedoesnotexist.service | 17 - 5 files changed, 762 insertions(+), 75 deletions(-) create mode 100644 ansible/services/grafana/dashboards/energy.json delete mode 100644 ansible/services/nextcloud-aio/README.md delete mode 100644 ansible/services/nextcloud-aio/docker-compose.yml delete mode 100644 ansible/services/thiswebsitedoesnotexist/thiswebsitedoesnotexist.service diff --git a/ansible/services/caddy/Caddyfile b/ansible/services/caddy/Caddyfile index 0fcd497..1e4dae5 100644 --- a/ansible/services/caddy/Caddyfile +++ b/ansible/services/caddy/Caddyfile @@ -117,10 +117,6 @@ jellyfin-requests.pez.solutions, jellyfin-requests.pez.sh { reverse_proxy 100.84.65.101:5056 } -https://cloud.pez.sh:443 { - reverse_proxy 100.84.65.101:11000 # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below -} - music.pez.sh { reverse_proxy 100.84.65.101:4533 } @@ -172,12 +168,6 @@ pez.solutions { file_server } -# Pez.solutions -cloud.pez.solutions { - root * /srv/cloud.pez.solutions - file_server -} - # Pez.sh pez.sh { root * /srv/pez.sh @@ -219,8 +209,3 @@ git.pez.sh { reverse_proxy localhost:3000 } - -# This Website Does Not Exist -thiswebsitedoesnotexist.pez.sh { - reverse_proxy localhost:3721 -} diff --git a/ansible/services/grafana/dashboards/energy.json b/ansible/services/grafana/dashboards/energy.json new file mode 100644 index 0000000..146c8c7 --- /dev/null +++ b/ansible/services/grafana/dashboards/energy.json @@ -0,0 +1,762 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 10, + "links": [], + "liveNow": true, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "#EAB839", + "value": 1000 + }, + { + "color": "red", + "value": 2000 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "avg_over_time(octopus_electricity_demand_watts{}[30m])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "30m", + "title": "Average (30 min)", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "#EAB839", + "value": 1000 + }, + { + "color": "red", + "value": 2000 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "avg_over_time(octopus_electricity_demand_watts{}[6h])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "6h", + "title": "Average (6 hours)", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "#EAB839", + "value": 1000 + }, + { + "color": "red", + "value": 2000 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 4, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "avg_over_time(octopus_electricity_demand_watts{}[24h])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "1d", + "title": "Average (1 day)", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "#EAB839", + "value": 1000 + }, + { + "color": "red", + "value": 2000 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 5, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "avg_over_time(octopus_electricity_demand_watts{}[7d])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "7d", + "title": "Average (7 days)", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 18, + "x": 0, + "y": 6 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "editorMode": "builder", + "expr": "octopus_electricity_demand_watts", + "legendFormat": "Watts", + "range": true, + "refId": "A" + } + ], + "title": "Wattage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 5000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "yellow", + "value": 1000 + }, + { + "color": "red", + "value": 2000 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 18, + "y": 6 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "builder", + "exemplar": false, + "expr": "octopus_electricity_demand_watts", + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "Current Watts", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "currencyGBP" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 13 + }, + "id": 7, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "sum_over_time((octopus_electricity_consumption_kwh * on() octopus_electricity_unit_rate_pence)[$__range:30m]) / 100", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "1h", + "title": "Price", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "currencyGBP" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 6, + "y": 13 + }, + "id": 8, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "sum_over_time((octopus_electricity_consumption_kwh * on() octopus_electricity_unit_rate_pence)[$__range:30m]) / 100", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "1d", + "title": "Price", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "currencyGBP" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 12, + "y": 13 + }, + "id": 9, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "sum_over_time((octopus_electricity_consumption_kwh * on() octopus_electricity_unit_rate_pence)[$__range:30m]) / 100", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "1w", + "title": "Price", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "bezqqznn81wqof" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "currencyGBP" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 18, + "y": 13 + }, + "id": 10, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "inverted", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": true, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.3.3", + "targets": [ + { + "editorMode": "code", + "expr": "sum_over_time((octopus_electricity_consumption_kwh * on() octopus_electricity_unit_rate_pence)[$__range:30m]) / 100", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "30d", + "title": "Price", + "type": "stat" + } + ], + "preload": false, + "refresh": "1m", + "schemaVersion": 42, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Energy", + "uid": "5101a7c4-e5cd-4178-8acf-320588a7a25e", + "version": 5 +} diff --git a/ansible/services/nextcloud-aio/README.md b/ansible/services/nextcloud-aio/README.md deleted file mode 100644 index 6e4ffef..0000000 --- a/ansible/services/nextcloud-aio/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Nextcloud AIO - -All-in-one Nextcloud deployment (self-managed containers). - -- **Host:** london-b -- **URL:** https://cloud.pez.sh -- **Admin port:** 8080 (mastercontainer management UI) -- **Apache port:** 11000 (proxied by Caddy on helsinki-a) -- **Data:** Docker volume (`nextcloud_aio_mastercontainer`) -- **Note:** The mastercontainer spawns and manages its own sub-containers (database, redis, apache, etc.) diff --git a/ansible/services/nextcloud-aio/docker-compose.yml b/ansible/services/nextcloud-aio/docker-compose.yml deleted file mode 100644 index c5b7a18..0000000 --- a/ansible/services/nextcloud-aio/docker-compose.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# Nextcloud AIO - All-in-one Nextcloud deployment -# Host: london-b (100.84.65.101) -# Data: Docker volume (nextcloud_aio_mastercontainer) -# Access: https://cloud.pez.sh (via Caddy reverse proxy on helsinki-a) -# -# Note: Nextcloud AIO manages its own sub-containers (apache, database, -# redis, etc.) via the mastercontainer. This compose file only defines -# the mastercontainer itself. - -services: - nextcloud-aio-mastercontainer: - image: ghcr.io/nextcloud-releases/all-in-one:latest - container_name: nextcloud-aio-mastercontainer - restart: always - ports: - - "8080:8080" - environment: - SKIP_DOMAIN_VALIDATION: "false" - APACHE_PORT: 11000 - APACHE_IP_BINDING: "0.0.0.0" - volumes: - - nextcloud_aio_mastercontainer:/mnt/docker-aio-config - - /var/run/docker.sock:/var/run/docker.sock:ro - networks: - - nextcloud-aio - -networks: - nextcloud-aio: - driver: bridge - -volumes: - nextcloud_aio_mastercontainer: diff --git a/ansible/services/thiswebsitedoesnotexist/thiswebsitedoesnotexist.service b/ansible/services/thiswebsitedoesnotexist/thiswebsitedoesnotexist.service deleted file mode 100644 index c6baf77..0000000 --- a/ansible/services/thiswebsitedoesnotexist/thiswebsitedoesnotexist.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=This Website Does Not Exist -After=network.target - -[Service] -Type=simple -User=root -WorkingDirectory=/opt/thiswebsitedoesnotexist -ExecStart=/usr/bin/node app.js -Restart=always -RestartSec=5 -Environment=NODE_ENV=production -Environment=PORT=3721 -EnvironmentFile=/opt/thiswebsitedoesnotexist/.env - -[Install] -WantedBy=multi-user.target