From 49f124c68d01dfeb4fc1fa35d8ceab2a9a34bee9 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Tue, 24 Sep 2024 15:33:35 +0300 Subject: [PATCH 1/3] add home-assistant migration --- README.md | 2 +- ix-dev/stable/home-assistant/app.yaml | 2 +- .../migrations/migrate_from_kubernetes | 62 +++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100755 ix-dev/stable/home-assistant/migrations/migrate_from_kubernetes diff --git a/README.md b/README.md index f30ad89d2d..28464bcc8b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Thank you for your understanding. | diskoverdata | charts | ✅ | ✅ | | elastic-search | charts | ✅ | - | | emby | charts | ✅ | - | -| home-assistant | charts | ✅ | - | +| home-assistant | charts | ✅ | ✅ | | ix-chart | charts | ✅ | ✅ | | minio | charts | ✅ | ✅ | | netdata | charts | ✅ | - | diff --git a/ix-dev/stable/home-assistant/app.yaml b/ix-dev/stable/home-assistant/app.yaml index c7e6a6ceeb..52873cc07e 100644 --- a/ix-dev/stable/home-assistant/app.yaml +++ b/ix-dev/stable/home-assistant/app.yaml @@ -45,4 +45,4 @@ sources: - https://github.com/truenas/charts/tree/master/charts/home-assistant title: Home Assistant train: stable -version: 1.2.11 +version: 1.2.12 diff --git a/ix-dev/stable/home-assistant/migrations/migrate_from_kubernetes b/ix-dev/stable/home-assistant/migrations/migrate_from_kubernetes new file mode 100755 index 0000000000..af5f2c33de --- /dev/null +++ b/ix-dev/stable/home-assistant/migrations/migrate_from_kubernetes @@ -0,0 +1,62 @@ +#!/usr/bin/python3 + +import os +import sys +import yaml + +from migration_helpers.resources import migrate_resources +from migration_helpers.storage import migrate_storage_item +from migration_helpers.dns_config import migrate_dns_config +from migration_helpers.kubernetes_secrets import get_value_from_secret + + +def migrate(values): + config = values.get("helm_secret", {}).get("config", {}) + k8s_secrets = values.get("release_secrets", {}) + if not config: + raise ValueError("No config found in values") + + new_values = { + "TZ": config["TZ"], + "home_assistant": { + "additional_envs": config["haConfig"].get("additionalEnvs", []), + "db_password": get_value_from_secret( + k8s_secrets, "postgres-creds", "POSTGRES_PASSWORD" + ), + "db_user": get_value_from_secret( + k8s_secrets, "postgres-creds", "POSTGRES_USER" + ), + "db_name": get_value_from_secret( + k8s_secrets, "postgres-creds", "POSTGRES_DB" + ), + }, + "run_as": { + "user": config["haID"].get("user", 568), + "group": config["haID"].get("group", 568), + }, + "network": { + "dns_opts": migrate_dns_config(config["podOptions"].get("dnsConfig", {})), + "web_port": config["haNetwork"]["webPort"], + }, + "storage": { + "config": migrate_storage_item(config["haStorage"]["config"]), + "media": migrate_storage_item(config["haStorage"]["media"]), + "postgres_data": migrate_storage_item(config["haStorage"]["pgData"]), + "additional_storage": [ + migrate_storage_item(item, include_read_only=True) + for item in config["haStorage"]["additionalStorages"] + ], + }, + "resources": migrate_resources(config["resources"]), + } + + return new_values + + +if __name__ == "__main__": + if len(sys.argv) != 2: + exit(1) + + if os.path.exists(sys.argv[1]): + with open(sys.argv[1], "r") as f: + print(yaml.dump(migrate(yaml.safe_load(f.read())))) From 3e369036d5b2ba817f83ef172332cddb422dfad4 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Tue, 24 Sep 2024 15:36:10 +0300 Subject: [PATCH 2/3] add link for manual steps --- README.md | 224 +++++++++++++++++++++++++++--------------------------- 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index 28464bcc8b..4511f74916 100644 --- a/README.md +++ b/README.md @@ -10,118 +10,118 @@ Thank you for your understanding. ## Parity Status with truenas/charts -| App | Train | Added | Migrated | -| -------------------- | ---------- | ----- | -------- | -| collabora | charts | ✅ | ✅ | -| diskoverdata | charts | ✅ | ✅ | -| elastic-search | charts | ✅ | - | -| emby | charts | ✅ | - | -| home-assistant | charts | ✅ | ✅ | -| ix-chart | charts | ✅ | ✅ | -| minio | charts | ✅ | ✅ | -| netdata | charts | ✅ | - | -| nextcloud | charts | ✅ | ✅ | -| photoprism | charts | ✅ | - | -| plex | charts | ✅ | ✅ | -| pihole | charts | ✅ | ✅ | -| prometheus | charts | ✅ | - | -| storj | charts | ✅ | ✅ | -| syncthing | charts | ✅ | ✅ | -| wg-easy | charts | ✅ | ✅ | -| actual-budget | community | ✅ | - | -| adguard-home | community | ✅ | - | -| audiobookshelf | community | ✅ | - | -| autobrr | community | ✅ | - | -| bazarr | community | ✅ | ✅ | -| briefkasten | community | ✅ | - | -| castopod | community | ✅ | ✅ | -| chia | community | ✅ | - | -| clamav | community | ✅ | - | -| cloudflared | community | ✅ | - | -| dashy | community | ✅ | - | -| deluge | community | ✅ | - | -| ddns-updater | community | ✅ | - | -| distribution | community | ✅ | - | -| drawio | community | ✅ | - | -| filebrowser | community | ✅ | - | -| firefly-iii | community | ✅ | - | -| flame | community | ✅ | - | -| freshrss | community | ✅ | - | -| frigate | community | ✅ | ✅ | -| fscrawler | community | ✅ | - | -| gitea | community | ✅ | ✅ | -| handbrake | community | ✅ | - | -| grafana | community | ✅ | - | -| homarr | community | ✅ | - | -| homer | community | ✅ | - | -| homepage | community | ✅ | - | -| immich | community | ✅ | ✅ | -| invidious | community | ✅ | ✅ | -| ipfs | community | ✅ | - | -| jellyfin | community | ✅ | ✅ | -| jellyseerr | community | ✅ | - | -| jenkins | community | ✅ | - | -| joplin | community | ✅ | - | -| kapowarr | community | ✅ | - | -| kavita | community | ✅ | - | -| komga | community | ✅ | - | -| lidarr | community | ✅ | ✅ | -| linkding | community | ✅ | ✅ | -| listmonk | community | ✅ | ✅ | -| logseq | community | ✅ | - | -| mealie | community | ✅ | - | -| metube | community | ✅ | - | -| minecraft | community | ✅ | - | -| mineos | community | ✅ | - | -| mumble | community | ✅ | - | -| n8n | community | ✅ | - | -| navidrome | community | ✅ | - | -| nginx-proxy-manager | community | ✅ | - | -| netbootxyz | community | ✅ | - | -| node-red | community | ✅ | - | -| odoo | community | ✅ | ✅ | -| omada-controller | community | ✅ | - | -| organizr | community | ✅ | - | -| overseerr | community | ✅ | - | -| palworld | community | ✅ | - | -| paperless-ngx | community | ✅ | ✅ | -| passbolt | community | ✅ | ✅ | -| pgadmin | community | ✅ | ✅ | -| pigallery2 | community | ✅ | ✅ | -| piwigo | community | ✅ | ✅ | -| planka | community | ✅ | ✅ | -| plex-auto-languages | community | ✅ | - | -| prowlarr | community | ✅ | ✅ | -| radarr | community | ✅ | ✅ | -| qbittorrent | community | ✅ | ✅ | -| readarr | community | ✅ | ✅ | -| recyclarr | community | ✅ | ✅ | -| redis | community | ✅ | ✅ | -| roundcube | community | ✅ | ✅ | -| rsyncd | community | ✅ | ✅ | -| rust-desk | community | ✅ | ✅ | -| sabnzbd | community | ✅ | ✅ | -| searxng | community | ✅ | ✅ | -| sftpgo | community | ✅ | ✅ | -| sonarr | community | ✅ | ✅ | -| tailscale | community | ✅ | ✅ | -| tautulli | community | ✅ | - | -| tdarr | community | ✅ | ✅ | -| terraria | community | ✅ | ✅ | -| tftpd-hpa | community | ✅ | ✅ | -| tiny-media-manager | community | ✅ | ✅ | -| transmission | community | ✅ | ✅ | -| twofactor-auth | community | ✅ | ✅ | -| unifi-controller | community | ✅ | - | -| unifi-protect-backup | community | ✅ | - | -| vaultwarden | community | ✅ | ✅ | -| vikunja | community | ✅ | - | -| webdav | community | ✅ | ✅ | -| whoogle | community | ✅ | - | -| wordpress | community | ✅ | ✅ | -| zerotier | community | ✅ | - | -| minio | enterprise | ✅ | ✅ | -| syncthing | enterprise | ✅ | ✅ | +| App | Train | Added | Migrated | +| -------------------- | ---------- | ----- | -------------------------------------------------------------------- | +| collabora | charts | ✅ | ✅ | +| diskoverdata | charts | ✅ | ✅ | +| elastic-search | charts | ✅ | - | +| emby | charts | ✅ | - | +| home-assistant | charts | ✅ | ✅ - [Manual steps needed](https://github.com/truenas/apps/pull/492) | +| ix-chart | charts | ✅ | ✅ | +| minio | charts | ✅ | ✅ | +| netdata | charts | ✅ | - | +| nextcloud | charts | ✅ | ✅ | +| photoprism | charts | ✅ | - | +| plex | charts | ✅ | ✅ | +| pihole | charts | ✅ | ✅ | +| prometheus | charts | ✅ | - | +| storj | charts | ✅ | ✅ | +| syncthing | charts | ✅ | ✅ | +| wg-easy | charts | ✅ | ✅ | +| actual-budget | community | ✅ | - | +| adguard-home | community | ✅ | - | +| audiobookshelf | community | ✅ | - | +| autobrr | community | ✅ | - | +| bazarr | community | ✅ | ✅ | +| briefkasten | community | ✅ | - | +| castopod | community | ✅ | ✅ | +| chia | community | ✅ | - | +| clamav | community | ✅ | - | +| cloudflared | community | ✅ | - | +| dashy | community | ✅ | - | +| deluge | community | ✅ | - | +| ddns-updater | community | ✅ | - | +| distribution | community | ✅ | - | +| drawio | community | ✅ | - | +| filebrowser | community | ✅ | - | +| firefly-iii | community | ✅ | - | +| flame | community | ✅ | - | +| freshrss | community | ✅ | - | +| frigate | community | ✅ | ✅ | +| fscrawler | community | ✅ | - | +| gitea | community | ✅ | ✅ | +| handbrake | community | ✅ | - | +| grafana | community | ✅ | - | +| homarr | community | ✅ | - | +| homer | community | ✅ | - | +| homepage | community | ✅ | - | +| immich | community | ✅ | ✅ | +| invidious | community | ✅ | ✅ | +| ipfs | community | ✅ | - | +| jellyfin | community | ✅ | ✅ | +| jellyseerr | community | ✅ | - | +| jenkins | community | ✅ | - | +| joplin | community | ✅ | - | +| kapowarr | community | ✅ | - | +| kavita | community | ✅ | - | +| komga | community | ✅ | - | +| lidarr | community | ✅ | ✅ | +| linkding | community | ✅ | ✅ | +| listmonk | community | ✅ | ✅ | +| logseq | community | ✅ | - | +| mealie | community | ✅ | - | +| metube | community | ✅ | - | +| minecraft | community | ✅ | - | +| mineos | community | ✅ | - | +| mumble | community | ✅ | - | +| n8n | community | ✅ | - | +| navidrome | community | ✅ | - | +| nginx-proxy-manager | community | ✅ | - | +| netbootxyz | community | ✅ | - | +| node-red | community | ✅ | - | +| odoo | community | ✅ | ✅ | +| omada-controller | community | ✅ | - | +| organizr | community | ✅ | - | +| overseerr | community | ✅ | - | +| palworld | community | ✅ | - | +| paperless-ngx | community | ✅ | ✅ | +| passbolt | community | ✅ | ✅ | +| pgadmin | community | ✅ | ✅ | +| pigallery2 | community | ✅ | ✅ | +| piwigo | community | ✅ | ✅ | +| planka | community | ✅ | ✅ | +| plex-auto-languages | community | ✅ | - | +| prowlarr | community | ✅ | ✅ | +| radarr | community | ✅ | ✅ | +| qbittorrent | community | ✅ | ✅ | +| readarr | community | ✅ | ✅ | +| recyclarr | community | ✅ | ✅ | +| redis | community | ✅ | ✅ | +| roundcube | community | ✅ | ✅ | +| rsyncd | community | ✅ | ✅ | +| rust-desk | community | ✅ | ✅ | +| sabnzbd | community | ✅ | ✅ | +| searxng | community | ✅ | ✅ | +| sftpgo | community | ✅ | ✅ | +| sonarr | community | ✅ | ✅ | +| tailscale | community | ✅ | ✅ | +| tautulli | community | ✅ | - | +| tdarr | community | ✅ | ✅ | +| terraria | community | ✅ | ✅ | +| tftpd-hpa | community | ✅ | ✅ | +| tiny-media-manager | community | ✅ | ✅ | +| transmission | community | ✅ | ✅ | +| twofactor-auth | community | ✅ | ✅ | +| unifi-controller | community | ✅ | - | +| unifi-protect-backup | community | ✅ | - | +| vaultwarden | community | ✅ | ✅ | +| vikunja | community | ✅ | - | +| webdav | community | ✅ | ✅ | +| whoogle | community | ✅ | - | +| wordpress | community | ✅ | ✅ | +| zerotier | community | ✅ | - | +| minio | enterprise | ✅ | ✅ | +| syncthing | enterprise | ✅ | ✅ | ## New Apps From 5821824b6af9bdc7b4364a78855827070de5a864 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:31:17 +0300 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4511f74916..07c513258b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Thank you for your understanding. | collabora | charts | ✅ | ✅ | | diskoverdata | charts | ✅ | ✅ | | elastic-search | charts | ✅ | - | -| emby | charts | ✅ | - | +| emby | charts | ✅ | ✅ | | home-assistant | charts | ✅ | ✅ - [Manual steps needed](https://github.com/truenas/apps/pull/492) | | ix-chart | charts | ✅ | ✅ | | minio | charts | ✅ | ✅ |