From 3bd3700f52a5fa295c45f0348cfbfad6be1aa4ab Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:59:03 +0300 Subject: [PATCH] sync latest library changes (#95) * sort and dedupe cspell * sync latest library changes * bump versions * remove debug key * make executable * make executable --- cspell.config.yaml | 105 +++++++++--------- ix-dev/community/adguard-home/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/audiobookshelf/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/autobrr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/bazarr/app.yaml | 4 +- .../bazarr/migrations/migrate_from_kubernetes | 0 .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/briefkasten/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/clamav/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/cloudflared/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/dashy/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/ddns-updater/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- .../{v1_0_0 => v1_0_1}/__init__.py | 0 .../ddns-updater/{v1_0_0 => v1_0_1}/config.py | 0 ix-dev/community/deluge/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/distribution/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/dockge/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/drawio/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/filebrowser/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/flame/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/grafana/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/handbrake/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/homarr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/homepage/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/homer/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/immich/app.yaml | 2 +- ix-dev/community/ipfs/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/jellyfin/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/jellyseerr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/kavita/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/komga/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/lidarr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/logseq/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/metube/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/mineos/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/mumble/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/navidrome/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/netbootxyz/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/nginx-proxy-manager/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/node-red/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/omada-controller/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/organizr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/overseerr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/palworld/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/prowlarr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/qbittorrent/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/radarr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/readarr/app.yaml | 4 +- .../migrations/migrate_from_kubernetes | 0 .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/sonarr/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/tailscale/app.yaml | 4 +- .../tailscale/templates/docker-compose.yaml | 2 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- .../tailscale/{v1_0_4 => v1_0_5}/util.py | 0 ix-dev/community/tautulli/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/community/unifi-controller/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/collabora/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/elastic-search/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/emby/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/minio/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/netdata/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/photoprism/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/pihole/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/plex/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/prometheus/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- ix-dev/stable/syncthing/app.yaml | 4 +- .../library/base_v1_0_0/healthchecks.py | 10 ++ .../templates/library/base_v1_0_0/postgres.py | 2 +- .../templates/library/base_v1_0_0/redis.py | 49 ++++++++ .../templates/library/base_v1_0_0/storage.py | 2 +- 288 files changed, 3585 insertions(+), 276 deletions(-) create mode 100644 ix-dev/community/adguard-home/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/autobrr/templates/library/base_v1_0_0/redis.py mode change 100644 => 100755 ix-dev/community/bazarr/migrations/migrate_from_kubernetes create mode 100644 ix-dev/community/bazarr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/briefkasten/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/clamav/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/cloudflared/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/dashy/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/ddns-updater/templates/library/base_v1_0_0/redis.py rename ix-dev/community/ddns-updater/templates/library/community/ddns-updater/{v1_0_0 => v1_0_1}/__init__.py (100%) rename ix-dev/community/ddns-updater/templates/library/community/ddns-updater/{v1_0_0 => v1_0_1}/config.py (100%) create mode 100644 ix-dev/community/deluge/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/distribution/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/dockge/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/drawio/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/filebrowser/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/flame/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/grafana/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/handbrake/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/homarr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/homepage/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/homer/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/ipfs/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/jellyfin/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/jellyseerr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/kavita/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/komga/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/lidarr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/logseq/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/metube/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/mineos/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/mumble/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/navidrome/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/netbootxyz/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/node-red/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/omada-controller/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/organizr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/overseerr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/palworld/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/prowlarr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/qbittorrent/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/radarr/templates/library/base_v1_0_0/redis.py mode change 100644 => 100755 ix-dev/community/readarr/migrations/migrate_from_kubernetes create mode 100644 ix-dev/community/readarr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/sonarr/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/tailscale/templates/library/base_v1_0_0/redis.py rename ix-dev/community/tailscale/templates/library/community/tailscale/{v1_0_4 => v1_0_5}/util.py (100%) create mode 100644 ix-dev/community/tautulli/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/community/unifi-controller/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/collabora/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/elastic-search/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/emby/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/minio/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/netdata/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/photoprism/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/pihole/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/plex/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/prometheus/templates/library/base_v1_0_0/redis.py create mode 100644 ix-dev/stable/syncthing/templates/library/base_v1_0_0/redis.py diff --git a/cspell.config.yaml b/cspell.config.yaml index d49fb85838..172bc9fc6b 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -1,9 +1,15 @@ words: + - adguard + - aliyun + - allinkl + - altran - audiobook + - audiobookshelf - autobrr - bazarr - - altran - bitnami + - briefkasten + - changeip - cifs - clamav - clamd @@ -20,124 +26,123 @@ words: - immich - ipaddr - cloudflared - - filebrowser - - ipfs - - dockge - - audiobookshelf - collabora - - adguard + - consts - cooldown + - cpus + - cuda - ddns - - aliyun - - allinkl - - changeip - ddnss - desec + - dnsmasq - dnsomatic - dnspod + - dockge - dominio - dondominio + - drawio - dreamhost - duckdns - dynu - dynv - easydns + - emby + - filebrowser - freedns + - freshclamd - gandi - godaddy - goip - goipde - hetzner + - hexparrot + - homarr + - hostable + - htpasswd - icanhazip + - immich - inkl - inwx - ionos + - ipaddr + - ipfs - ipify - ipinfo - ipleak - - drawio - - emby - - briefkasten - isready - itzg - jellyfin + - jellyseerr + - kavita + - komga - lidarr - logsearch - logseq + - luadns + - mangas - mebibytes - - mineos - metube - - kavita - - lidarr - - lidarr - - jellyseerr - - logsearch - - mebibytes - milterd - - luadns - - komga - - mangas + - mineos - minio - - nextauth - - nocopy - - netdata - - netboot - - netbootxyz - namecheap - namecom + - navidrome + - netboot + - netbootxyz - netcup + - netdata + - nextauth + - nextcloud - njalla - nnev - - navidrome - nocopy + - noip + - nowdns - openj - omada - - prowlarr - - sonarr + - opendns - openvino + - organizr + - overseerr + - palworld - pgvecto + - photoprism - pihole - plexinc - plexpass + - porkbun - prowlarr + - proxied + - publicip + - publicipv - qbittorrent - radarr - rcon - readarr - - sonarr - - startpage - scandir - - sigdb - - syncthing - - tailscale - - tailscaled - - palworld - - photoprism - - tensorchord - - organizr - - noip - - nowdns - - opendns - - porkbun - - proxied - - publicip - - publicipv - seeip - selfhost - selfhost.de - selfhostde - servercow - shoutrrr + - sigdb + - sonarr - spdyn + - startpage - strato - - overseerr + - syncthing + - tailscale + - tailscaled - tautulli + - tensorchord - tmpfs - tracebacklimit - truenas - - userspace - unifi + - userspace - variomedia + - whiteboarding - wtfismyip - zoneedit - - whiteboarding diff --git a/ix-dev/community/adguard-home/app.yaml b/ix-dev/community/adguard-home/app.yaml index 8d05b058c9..3fddfe1cb2 100644 --- a/ix-dev/community/adguard-home/app.yaml +++ b/ix-dev/community/adguard-home/app.yaml @@ -19,7 +19,7 @@ keywords: - dns - adblock lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -40,4 +40,4 @@ sources: - https://hub.docker.com/r/adguard/adguardhome title: AdGuard Home train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/adguard-home/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/adguard-home/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/adguard-home/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/adguard-home/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/adguard-home/templates/library/base_v1_0_0/redis.py b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/adguard-home/templates/library/base_v1_0_0/storage.py b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/adguard-home/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/adguard-home/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/audiobookshelf/app.yaml b/ix-dev/community/audiobookshelf/app.yaml index 8f2dcc367f..a3473e0e52 100644 --- a/ix-dev/community/audiobookshelf/app.yaml +++ b/ix-dev/community/audiobookshelf/app.yaml @@ -10,7 +10,7 @@ keywords: - media - audiobook lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -33,4 +33,4 @@ sources: - https://github.com/advplyr/audiobookshelf title: Audiobookshelf train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/redis.py b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/storage.py b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/audiobookshelf/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/autobrr/app.yaml b/ix-dev/community/autobrr/app.yaml index 87b09b858a..2b16436c01 100644 --- a/ix-dev/community/autobrr/app.yaml +++ b/ix-dev/community/autobrr/app.yaml @@ -11,7 +11,7 @@ keywords: - torrent - usenet lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://github.com/autobrr/autobrr title: Autobrr train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/autobrr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/autobrr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/autobrr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/autobrr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/autobrr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/autobrr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/autobrr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/autobrr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/autobrr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/autobrr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/autobrr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/autobrr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/autobrr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/autobrr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/autobrr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/bazarr/app.yaml b/ix-dev/community/bazarr/app.yaml index 59b37f599a..6a46cff85e 100644 --- a/ix-dev/community/bazarr/app.yaml +++ b/ix-dev/community/bazarr/app.yaml @@ -11,7 +11,7 @@ keywords: - media - subtitles lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://github.com/morpheus65535/bazarr title: Bazarr train: community -version: 1.0.1 +version: 1.0.2 diff --git a/ix-dev/community/bazarr/migrations/migrate_from_kubernetes b/ix-dev/community/bazarr/migrations/migrate_from_kubernetes old mode 100644 new mode 100755 diff --git a/ix-dev/community/bazarr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/bazarr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/bazarr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/bazarr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/bazarr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/bazarr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/bazarr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/bazarr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/bazarr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/bazarr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/bazarr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/bazarr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/bazarr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/bazarr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/bazarr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/briefkasten/app.yaml b/ix-dev/community/briefkasten/app.yaml index 0bd1f60487..6338c5c4d1 100644 --- a/ix-dev/community/briefkasten/app.yaml +++ b/ix-dev/community/briefkasten/app.yaml @@ -9,7 +9,7 @@ icon: https://media.sys.truenas.net/apps/briefkasten/icons/icon.svg keywords: - bookmark lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -35,4 +35,4 @@ sources: - https://docs.briefkastenhq.com/ title: Briefkasten train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/briefkasten/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/briefkasten/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/briefkasten/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/briefkasten/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/briefkasten/templates/library/base_v1_0_0/redis.py b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/briefkasten/templates/library/base_v1_0_0/storage.py b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/briefkasten/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/briefkasten/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/clamav/app.yaml b/ix-dev/community/clamav/app.yaml index 9892b75b11..3dfb79db35 100644 --- a/ix-dev/community/clamav/app.yaml +++ b/ix-dev/community/clamav/app.yaml @@ -20,7 +20,7 @@ keywords: - anti-virus - clamav lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -38,4 +38,4 @@ sources: - https://www.clamav.net/ title: ClamAV train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/clamav/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/clamav/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/clamav/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/clamav/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/clamav/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/clamav/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/clamav/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/clamav/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/clamav/templates/library/base_v1_0_0/redis.py b/ix-dev/community/clamav/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/clamav/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/clamav/templates/library/base_v1_0_0/storage.py b/ix-dev/community/clamav/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/clamav/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/clamav/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/cloudflared/app.yaml b/ix-dev/community/cloudflared/app.yaml index b185b1dee6..c9bc3eb277 100644 --- a/ix-dev/community/cloudflared/app.yaml +++ b/ix-dev/community/cloudflared/app.yaml @@ -12,7 +12,7 @@ keywords: - cloudflare - tunnel lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ sources: - https://hub.docker.com/r/cloudflare/cloudflared title: Cloudflared train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/cloudflared/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/cloudflared/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/cloudflared/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/cloudflared/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/cloudflared/templates/library/base_v1_0_0/redis.py b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/cloudflared/templates/library/base_v1_0_0/storage.py b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/cloudflared/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/cloudflared/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/dashy/app.yaml b/ix-dev/community/dashy/app.yaml index 7ea07992b4..b66e27e0fa 100644 --- a/ix-dev/community/dashy/app.yaml +++ b/ix-dev/community/dashy/app.yaml @@ -9,7 +9,7 @@ icon: https://media.sys.truenas.net/apps/dashy/icons/icon.png keywords: - dashboard lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -29,4 +29,4 @@ sources: - https://github.com/lissy93/dashy title: Dashy train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/dashy/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/dashy/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/dashy/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/dashy/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/dashy/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/dashy/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/dashy/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/dashy/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/dashy/templates/library/base_v1_0_0/redis.py b/ix-dev/community/dashy/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/dashy/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/dashy/templates/library/base_v1_0_0/storage.py b/ix-dev/community/dashy/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/dashy/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/dashy/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/ddns-updater/app.yaml b/ix-dev/community/ddns-updater/app.yaml index 9bf9c21921..8dc954f170 100644 --- a/ix-dev/community/ddns-updater/app.yaml +++ b/ix-dev/community/ddns-updater/app.yaml @@ -10,7 +10,7 @@ keywords: - ddns-updater - ddns lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ sources: - https://hub.docker.com/r/qmcgaw/ddns-updater title: DDNS Updater train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/redis.py b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/storage.py b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/ddns-updater/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_0/__init__.py b/ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_1/__init__.py similarity index 100% rename from ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_0/__init__.py rename to ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_1/__init__.py diff --git a/ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_0/config.py b/ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_1/config.py similarity index 100% rename from ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_0/config.py rename to ix-dev/community/ddns-updater/templates/library/community/ddns-updater/v1_0_1/config.py diff --git a/ix-dev/community/deluge/app.yaml b/ix-dev/community/deluge/app.yaml index 082bef09fb..35a8d44188 100644 --- a/ix-dev/community/deluge/app.yaml +++ b/ix-dev/community/deluge/app.yaml @@ -20,7 +20,7 @@ keywords: - torrent - download lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -38,4 +38,4 @@ sources: - https://deluge-torrent.org/ title: Deluge train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/deluge/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/deluge/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/deluge/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/deluge/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/deluge/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/deluge/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/deluge/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/deluge/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/deluge/templates/library/base_v1_0_0/redis.py b/ix-dev/community/deluge/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/deluge/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/deluge/templates/library/base_v1_0_0/storage.py b/ix-dev/community/deluge/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/deluge/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/deluge/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/distribution/app.yaml b/ix-dev/community/distribution/app.yaml index 01fd7eba08..9fb5c2ae21 100644 --- a/ix-dev/community/distribution/app.yaml +++ b/ix-dev/community/distribution/app.yaml @@ -11,7 +11,7 @@ keywords: - registry - container lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ sources: - https://github.com/distribution/distribution title: Distribution train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/distribution/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/distribution/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/distribution/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/distribution/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/distribution/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/distribution/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/distribution/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/distribution/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/distribution/templates/library/base_v1_0_0/redis.py b/ix-dev/community/distribution/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/distribution/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/distribution/templates/library/base_v1_0_0/storage.py b/ix-dev/community/distribution/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/distribution/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/distribution/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/dockge/app.yaml b/ix-dev/community/dockge/app.yaml index 55fbc2cbb3..658163c305 100644 --- a/ix-dev/community/dockge/app.yaml +++ b/ix-dev/community/dockge/app.yaml @@ -29,7 +29,7 @@ keywords: - docker - compose lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -48,4 +48,4 @@ sources: - https://github.com/louislam/dockge title: Dockge train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/dockge/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/dockge/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/dockge/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/dockge/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/dockge/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/dockge/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/dockge/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/dockge/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/dockge/templates/library/base_v1_0_0/redis.py b/ix-dev/community/dockge/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/dockge/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/dockge/templates/library/base_v1_0_0/storage.py b/ix-dev/community/dockge/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/dockge/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/dockge/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/drawio/app.yaml b/ix-dev/community/drawio/app.yaml index ed63436d64..d372e5997c 100644 --- a/ix-dev/community/drawio/app.yaml +++ b/ix-dev/community/drawio/app.yaml @@ -10,7 +10,7 @@ keywords: - diagram - whiteboard lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -32,4 +32,4 @@ sources: - https://github.com/jgraph/drawio title: Draw.io train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/drawio/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/drawio/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/drawio/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/drawio/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/drawio/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/drawio/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/drawio/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/drawio/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/drawio/templates/library/base_v1_0_0/redis.py b/ix-dev/community/drawio/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/drawio/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/drawio/templates/library/base_v1_0_0/storage.py b/ix-dev/community/drawio/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/drawio/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/drawio/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/filebrowser/app.yaml b/ix-dev/community/filebrowser/app.yaml index 2df9bfca2d..c588be9d67 100644 --- a/ix-dev/community/filebrowser/app.yaml +++ b/ix-dev/community/filebrowser/app.yaml @@ -11,7 +11,7 @@ keywords: - files - browser lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -33,4 +33,4 @@ sources: - https://hub.docker.com/r/filebrowser/filebrowser title: File Browser train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/filebrowser/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/filebrowser/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/filebrowser/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/filebrowser/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/filebrowser/templates/library/base_v1_0_0/redis.py b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/filebrowser/templates/library/base_v1_0_0/storage.py b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/filebrowser/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/filebrowser/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/flame/app.yaml b/ix-dev/community/flame/app.yaml index 7837b56512..c6b010d5d8 100644 --- a/ix-dev/community/flame/app.yaml +++ b/ix-dev/community/flame/app.yaml @@ -15,7 +15,7 @@ icon: https://media.sys.truenas.net/apps/flame/icons/icon.png keywords: - startpage lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -34,4 +34,4 @@ sources: - https://github.com/pawelmalak/flame title: Flame train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/flame/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/flame/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/flame/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/flame/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/flame/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/flame/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/flame/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/flame/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/flame/templates/library/base_v1_0_0/redis.py b/ix-dev/community/flame/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/flame/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/flame/templates/library/base_v1_0_0/storage.py b/ix-dev/community/flame/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/flame/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/flame/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/grafana/app.yaml b/ix-dev/community/grafana/app.yaml index 01bfc9b375..e9ee0d085a 100644 --- a/ix-dev/community/grafana/app.yaml +++ b/ix-dev/community/grafana/app.yaml @@ -13,7 +13,7 @@ keywords: - metrics - dashboards lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -34,4 +34,4 @@ sources: - https://github.com/grafana title: Grafana train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/grafana/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/grafana/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/grafana/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/grafana/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/grafana/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/grafana/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/grafana/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/grafana/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/grafana/templates/library/base_v1_0_0/redis.py b/ix-dev/community/grafana/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/grafana/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/grafana/templates/library/base_v1_0_0/storage.py b/ix-dev/community/grafana/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/grafana/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/grafana/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/handbrake/app.yaml b/ix-dev/community/handbrake/app.yaml index f5e4b432ff..4a86ff5bf2 100644 --- a/ix-dev/community/handbrake/app.yaml +++ b/ix-dev/community/handbrake/app.yaml @@ -29,7 +29,7 @@ keywords: - video - transcoder lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -47,4 +47,4 @@ sources: - https://hub.docker.com/r/jlesage/handbrake title: Handbrake train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/handbrake/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/handbrake/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/handbrake/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/handbrake/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/handbrake/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/handbrake/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/handbrake/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/handbrake/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/handbrake/templates/library/base_v1_0_0/redis.py b/ix-dev/community/handbrake/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/handbrake/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/handbrake/templates/library/base_v1_0_0/storage.py b/ix-dev/community/handbrake/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/handbrake/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/handbrake/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/homarr/app.yaml b/ix-dev/community/homarr/app.yaml index 08d5079901..6320b6c27d 100644 --- a/ix-dev/community/homarr/app.yaml +++ b/ix-dev/community/homarr/app.yaml @@ -10,7 +10,7 @@ icon: https://media.sys.truenas.net/apps/homarr/icons/icon.svg keywords: - dashboard lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://github.com/ajnart/homarr title: Homarr train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/homarr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/homarr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/homarr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/homarr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/homarr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/homarr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/homarr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/homarr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/homarr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/homarr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/homarr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/homarr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/homarr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/homarr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/homarr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/homepage/app.yaml b/ix-dev/community/homepage/app.yaml index 874dca9a07..b737000566 100644 --- a/ix-dev/community/homepage/app.yaml +++ b/ix-dev/community/homepage/app.yaml @@ -9,7 +9,7 @@ icon: https://media.sys.truenas.net/apps/homepage/icons/icon.png keywords: - dashboard lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -33,4 +33,4 @@ sources: - https://github.com/benphelps/homepage title: Homepage train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/homepage/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/homepage/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/homepage/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/homepage/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/homepage/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/homepage/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/homepage/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/homepage/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/homepage/templates/library/base_v1_0_0/redis.py b/ix-dev/community/homepage/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/homepage/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/homepage/templates/library/base_v1_0_0/storage.py b/ix-dev/community/homepage/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/homepage/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/homepage/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/homer/app.yaml b/ix-dev/community/homer/app.yaml index c43ceaaed8..7197602f89 100644 --- a/ix-dev/community/homer/app.yaml +++ b/ix-dev/community/homer/app.yaml @@ -8,7 +8,7 @@ home: https://github.com/bastienwirtz/homer host_mounts: [] icon: https://media.sys.truenas.net/apps/homer/icons/icon.png lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ tags: - homepage title: Homer train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/homer/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/homer/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/homer/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/homer/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/homer/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/homer/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/homer/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/homer/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/homer/templates/library/base_v1_0_0/redis.py b/ix-dev/community/homer/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/homer/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/homer/templates/library/base_v1_0_0/storage.py b/ix-dev/community/homer/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/homer/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/homer/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/immich/app.yaml b/ix-dev/community/immich/app.yaml index 5d3a5ad105..083795d4aa 100644 --- a/ix-dev/community/immich/app.yaml +++ b/ix-dev/community/immich/app.yaml @@ -45,4 +45,4 @@ sources: - https://github.com/immich-app/immich title: Immich train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/ipfs/app.yaml b/ix-dev/community/ipfs/app.yaml index 8c7c17b861..38145ed98e 100644 --- a/ix-dev/community/ipfs/app.yaml +++ b/ix-dev/community/ipfs/app.yaml @@ -13,7 +13,7 @@ keywords: - file-sharing - kubo lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -33,4 +33,4 @@ sources: - https://ipfs.tech/ title: IPFS train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/ipfs/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/ipfs/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/ipfs/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/ipfs/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/ipfs/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/ipfs/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/ipfs/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/ipfs/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/ipfs/templates/library/base_v1_0_0/redis.py b/ix-dev/community/ipfs/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/ipfs/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/ipfs/templates/library/base_v1_0_0/storage.py b/ix-dev/community/ipfs/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/ipfs/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/ipfs/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/jellyfin/app.yaml b/ix-dev/community/jellyfin/app.yaml index 2897fa38aa..5311364157 100644 --- a/ix-dev/community/jellyfin/app.yaml +++ b/ix-dev/community/jellyfin/app.yaml @@ -15,7 +15,7 @@ keywords: - media - streaming lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -35,4 +35,4 @@ sources: - https://jellyfin.org/ title: Jellyfin train: community -version: 1.0.3 +version: 1.0.5 diff --git a/ix-dev/community/jellyfin/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/jellyfin/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/jellyfin/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/jellyfin/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/jellyfin/templates/library/base_v1_0_0/redis.py b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/jellyfin/templates/library/base_v1_0_0/storage.py b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/jellyfin/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/jellyfin/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/jellyseerr/app.yaml b/ix-dev/community/jellyseerr/app.yaml index e7a5b2e101..7fd5ec91b4 100644 --- a/ix-dev/community/jellyseerr/app.yaml +++ b/ix-dev/community/jellyseerr/app.yaml @@ -10,7 +10,7 @@ icon: https://media.sys.truenas.net/apps/jellyseerr/icons/icon.svg keywords: - media lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -29,4 +29,4 @@ sources: - https://hub.docker.com/r/fallenbagel/jellyseerr title: Jellyseerr train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/jellyseerr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/kavita/app.yaml b/ix-dev/community/kavita/app.yaml index 0fb2507b24..3c08cc3a29 100644 --- a/ix-dev/community/kavita/app.yaml +++ b/ix-dev/community/kavita/app.yaml @@ -21,7 +21,7 @@ keywords: - ebook - manga lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -44,4 +44,4 @@ sources: - https://www.kavitareader.com title: Kavita train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/kavita/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/kavita/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/kavita/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/kavita/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/kavita/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/kavita/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/kavita/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/kavita/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/kavita/templates/library/base_v1_0_0/redis.py b/ix-dev/community/kavita/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/kavita/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/kavita/templates/library/base_v1_0_0/storage.py b/ix-dev/community/kavita/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/kavita/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/kavita/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/komga/app.yaml b/ix-dev/community/komga/app.yaml index 153e028cd8..45af44c32f 100644 --- a/ix-dev/community/komga/app.yaml +++ b/ix-dev/community/komga/app.yaml @@ -11,7 +11,7 @@ keywords: - comics - mangas lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://hub.docker.com/r/gotson/komga title: Komga train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/komga/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/komga/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/komga/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/komga/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/komga/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/komga/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/komga/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/komga/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/komga/templates/library/base_v1_0_0/redis.py b/ix-dev/community/komga/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/komga/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/komga/templates/library/base_v1_0_0/storage.py b/ix-dev/community/komga/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/komga/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/komga/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/lidarr/app.yaml b/ix-dev/community/lidarr/app.yaml index b012936d56..16c706917b 100644 --- a/ix-dev/community/lidarr/app.yaml +++ b/ix-dev/community/lidarr/app.yaml @@ -10,7 +10,7 @@ keywords: - media - music lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://github.com/Lidarr/Lidarr title: Lidarr train: community -version: 1.0.1 +version: 1.0.2 diff --git a/ix-dev/community/lidarr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/lidarr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/lidarr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/lidarr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/lidarr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/lidarr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/lidarr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/lidarr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/lidarr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/lidarr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/lidarr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/lidarr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/lidarr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/lidarr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/lidarr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/logseq/app.yaml b/ix-dev/community/logseq/app.yaml index 8a07cb3446..1db6fc343b 100644 --- a/ix-dev/community/logseq/app.yaml +++ b/ix-dev/community/logseq/app.yaml @@ -11,7 +11,7 @@ keywords: - knowledge - management lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -28,4 +28,4 @@ sources: - https://github.com/logseq/logseq title: Logseq train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/logseq/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/logseq/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/logseq/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/logseq/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/logseq/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/logseq/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/logseq/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/logseq/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/logseq/templates/library/base_v1_0_0/redis.py b/ix-dev/community/logseq/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/logseq/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/logseq/templates/library/base_v1_0_0/storage.py b/ix-dev/community/logseq/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/logseq/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/logseq/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/metube/app.yaml b/ix-dev/community/metube/app.yaml index cda20577f0..2037568474 100644 --- a/ix-dev/community/metube/app.yaml +++ b/ix-dev/community/metube/app.yaml @@ -11,7 +11,7 @@ keywords: - youtube-dl - yt-dlp lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ sources: - https://github.com/alexta69/metube title: MeTube train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/metube/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/metube/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/metube/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/metube/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/metube/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/metube/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/metube/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/metube/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/metube/templates/library/base_v1_0_0/redis.py b/ix-dev/community/metube/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/metube/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/metube/templates/library/base_v1_0_0/storage.py b/ix-dev/community/metube/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/metube/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/metube/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/mineos/app.yaml b/ix-dev/community/mineos/app.yaml index 9c40c3b554..3c3c24af18 100644 --- a/ix-dev/community/mineos/app.yaml +++ b/ix-dev/community/mineos/app.yaml @@ -20,7 +20,7 @@ icon: https://media.sys.truenas.net/apps/mineos/icons/icon.png keywords: - minecraft lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -39,4 +39,4 @@ sources: - https://github.com/hexparrot/mineos-node title: MineOS train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/mineos/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/mineos/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/mineos/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/mineos/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/mineos/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/mineos/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/mineos/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/mineos/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/mineos/templates/library/base_v1_0_0/redis.py b/ix-dev/community/mineos/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/mineos/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/mineos/templates/library/base_v1_0_0/storage.py b/ix-dev/community/mineos/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/mineos/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/mineos/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/mumble/app.yaml b/ix-dev/community/mumble/app.yaml index dcbb27a150..26c6c46c40 100644 --- a/ix-dev/community/mumble/app.yaml +++ b/ix-dev/community/mumble/app.yaml @@ -9,7 +9,7 @@ icon: https://media.sys.truenas.net/apps/mumble/icons/icon.svg keywords: - voice lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -27,4 +27,4 @@ sources: - https://www.mumble.info/ title: Mumble train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/mumble/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/mumble/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/mumble/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/mumble/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/mumble/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/mumble/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/mumble/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/mumble/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/mumble/templates/library/base_v1_0_0/redis.py b/ix-dev/community/mumble/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/mumble/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/mumble/templates/library/base_v1_0_0/storage.py b/ix-dev/community/mumble/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/mumble/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/mumble/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/navidrome/app.yaml b/ix-dev/community/navidrome/app.yaml index caecf1cb55..655ce11347 100644 --- a/ix-dev/community/navidrome/app.yaml +++ b/ix-dev/community/navidrome/app.yaml @@ -12,7 +12,7 @@ keywords: - media - music lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -32,4 +32,4 @@ sources: - https://github.com/navidrome/navidrome/ title: Navidrome train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/navidrome/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/navidrome/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/navidrome/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/navidrome/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/navidrome/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/navidrome/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/navidrome/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/navidrome/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/navidrome/templates/library/base_v1_0_0/redis.py b/ix-dev/community/navidrome/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/navidrome/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/navidrome/templates/library/base_v1_0_0/storage.py b/ix-dev/community/navidrome/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/navidrome/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/navidrome/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/netbootxyz/app.yaml b/ix-dev/community/netbootxyz/app.yaml index 9e49793469..fc0cf921a2 100644 --- a/ix-dev/community/netbootxyz/app.yaml +++ b/ix-dev/community/netbootxyz/app.yaml @@ -31,7 +31,7 @@ keywords: - netbootxyz - netboot.xyz lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -50,4 +50,4 @@ sources: - https://netboot.xyz title: Netboot.xyz train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/redis.py b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/storage.py b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/netbootxyz/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/nginx-proxy-manager/app.yaml b/ix-dev/community/nginx-proxy-manager/app.yaml index 5b2652d4c4..6495b1307f 100644 --- a/ix-dev/community/nginx-proxy-manager/app.yaml +++ b/ix-dev/community/nginx-proxy-manager/app.yaml @@ -23,7 +23,7 @@ keywords: - nginx - proxy lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -44,4 +44,4 @@ sources: - https://hub.docker.com/r/jc21/nginx-proxy-manager title: Nginx Proxy Manager train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/redis.py b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/storage.py b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/nginx-proxy-manager/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/node-red/app.yaml b/ix-dev/community/node-red/app.yaml index d0e973fdfe..6506257197 100644 --- a/ix-dev/community/node-red/app.yaml +++ b/ix-dev/community/node-red/app.yaml @@ -10,7 +10,7 @@ icon: https://media.sys.truenas.net/apps/node-red/icons/icon.png keywords: - automation lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -29,4 +29,4 @@ sources: - https://github.com/node-red/node-red-docker title: Node-RED train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/node-red/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/node-red/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/node-red/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/node-red/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/node-red/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/node-red/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/node-red/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/node-red/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/node-red/templates/library/base_v1_0_0/redis.py b/ix-dev/community/node-red/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/node-red/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/node-red/templates/library/base_v1_0_0/storage.py b/ix-dev/community/node-red/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/node-red/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/node-red/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/omada-controller/app.yaml b/ix-dev/community/omada-controller/app.yaml index 4bf4e6bd6f..5cb4e759dd 100644 --- a/ix-dev/community/omada-controller/app.yaml +++ b/ix-dev/community/omada-controller/app.yaml @@ -24,7 +24,7 @@ keywords: - omada - tp-link lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -42,4 +42,4 @@ sources: - https://hub.docker.com/r/mbentley/omada-controller title: Bazarr train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/omada-controller/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/omada-controller/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/omada-controller/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/omada-controller/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/omada-controller/templates/library/base_v1_0_0/redis.py b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/omada-controller/templates/library/base_v1_0_0/storage.py b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/omada-controller/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/omada-controller/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/organizr/app.yaml b/ix-dev/community/organizr/app.yaml index e8f67fe1e0..fb1ef3ccab 100644 --- a/ix-dev/community/organizr/app.yaml +++ b/ix-dev/community/organizr/app.yaml @@ -20,7 +20,7 @@ keywords: - dashboard - organizr lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -40,4 +40,4 @@ sources: - https://github.com/causefx/Organizr title: Organizr train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/organizr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/organizr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/organizr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/organizr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/organizr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/organizr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/organizr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/organizr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/organizr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/organizr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/organizr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/organizr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/organizr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/organizr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/organizr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/overseerr/app.yaml b/ix-dev/community/overseerr/app.yaml index e678bbcd04..671ae548f7 100644 --- a/ix-dev/community/overseerr/app.yaml +++ b/ix-dev/community/overseerr/app.yaml @@ -10,7 +10,7 @@ icon: https://media.sys.truenas.net/apps/overseerr/icons/icon.svg keywords: - media lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -28,4 +28,4 @@ sources: - https://github.com/sct/overseerr title: Overseerr train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/overseerr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/overseerr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/overseerr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/overseerr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/overseerr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/overseerr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/overseerr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/overseerr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/overseerr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/overseerr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/overseerr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/overseerr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/overseerr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/overseerr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/overseerr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/palworld/app.yaml b/ix-dev/community/palworld/app.yaml index 4ccf833789..57d5152b11 100644 --- a/ix-dev/community/palworld/app.yaml +++ b/ix-dev/community/palworld/app.yaml @@ -29,7 +29,7 @@ keywords: - game - palworld lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -47,4 +47,4 @@ sources: - https://github.com/ich777/docker-steamcmd-server/tree/palworld title: Palworld train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/palworld/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/palworld/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/palworld/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/palworld/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/palworld/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/palworld/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/palworld/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/palworld/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/palworld/templates/library/base_v1_0_0/redis.py b/ix-dev/community/palworld/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/palworld/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/palworld/templates/library/base_v1_0_0/storage.py b/ix-dev/community/palworld/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/palworld/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/palworld/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/prowlarr/app.yaml b/ix-dev/community/prowlarr/app.yaml index 21b76006ea..b6f8284603 100644 --- a/ix-dev/community/prowlarr/app.yaml +++ b/ix-dev/community/prowlarr/app.yaml @@ -10,7 +10,7 @@ icon: https://media.sys.truenas.net/apps/prowlarr/icons/icon.png keywords: - indexer lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -29,4 +29,4 @@ sources: - https://prowlarr.com title: Prowlarr train: community -version: 1.0.1 +version: 1.0.2 diff --git a/ix-dev/community/prowlarr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/prowlarr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/prowlarr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/prowlarr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/prowlarr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/prowlarr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/prowlarr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/prowlarr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/qbittorrent/app.yaml b/ix-dev/community/qbittorrent/app.yaml index e694b29948..9a5cf0ad28 100644 --- a/ix-dev/community/qbittorrent/app.yaml +++ b/ix-dev/community/qbittorrent/app.yaml @@ -12,7 +12,7 @@ keywords: - torrent - download lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://www.qbittorrent.org/ title: qBittorrent train: community -version: 1.0.3 +version: 1.0.5 diff --git a/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/redis.py b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/storage.py b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/qbittorrent/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/radarr/app.yaml b/ix-dev/community/radarr/app.yaml index b2944fb402..7a07b53700 100644 --- a/ix-dev/community/radarr/app.yaml +++ b/ix-dev/community/radarr/app.yaml @@ -10,7 +10,7 @@ keywords: - media - movies lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -32,4 +32,4 @@ sources: - https://github.com/Radarr/Radarr title: Radarr train: community -version: 1.0.3 +version: 1.0.5 diff --git a/ix-dev/community/radarr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/radarr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/radarr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/radarr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/radarr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/radarr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/radarr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/radarr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/radarr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/radarr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/radarr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/radarr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/radarr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/radarr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/radarr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/readarr/app.yaml b/ix-dev/community/readarr/app.yaml index 9db46e4b85..25c90833b4 100644 --- a/ix-dev/community/readarr/app.yaml +++ b/ix-dev/community/readarr/app.yaml @@ -12,7 +12,7 @@ keywords: - ebook - audiobook lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -33,4 +33,4 @@ sources: - https://github.com/Readarr/Readarr title: Readarr train: community -version: 1.0.1 +version: 1.0.2 diff --git a/ix-dev/community/readarr/migrations/migrate_from_kubernetes b/ix-dev/community/readarr/migrations/migrate_from_kubernetes old mode 100644 new mode 100755 diff --git a/ix-dev/community/readarr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/readarr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/readarr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/readarr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/readarr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/readarr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/readarr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/readarr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/readarr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/readarr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/readarr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/readarr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/readarr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/readarr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/readarr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/sonarr/app.yaml b/ix-dev/community/sonarr/app.yaml index 008b68746c..76fdfcab7a 100644 --- a/ix-dev/community/sonarr/app.yaml +++ b/ix-dev/community/sonarr/app.yaml @@ -10,7 +10,7 @@ keywords: - media - series lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://github.com/Sonarr/Sonarr title: Sonarr train: community -version: 1.0.1 +version: 1.0.2 diff --git a/ix-dev/community/sonarr/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/sonarr/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/sonarr/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/sonarr/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/sonarr/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/sonarr/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/sonarr/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/sonarr/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/sonarr/templates/library/base_v1_0_0/redis.py b/ix-dev/community/sonarr/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/sonarr/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/sonarr/templates/library/base_v1_0_0/storage.py b/ix-dev/community/sonarr/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/sonarr/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/sonarr/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/tailscale/app.yaml b/ix-dev/community/tailscale/app.yaml index 1723243e0d..84288fd16e 100644 --- a/ix-dev/community/tailscale/app.yaml +++ b/ix-dev/community/tailscale/app.yaml @@ -24,7 +24,7 @@ keywords: - vpn - tailscale lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -42,4 +42,4 @@ sources: - https://hub.docker.com/r/tailscale/tailscale title: Tailscale train: community -version: 1.0.4 +version: 1.0.5 diff --git a/ix-dev/community/tailscale/templates/docker-compose.yaml b/ix-dev/community/tailscale/templates/docker-compose.yaml index f69ba0d890..c4fede3fb2 100644 --- a/ix-dev/community/tailscale/templates/docker-compose.yaml +++ b/ix-dev/community/tailscale/templates/docker-compose.yaml @@ -35,7 +35,7 @@ {% if item.vol_mount and volume_mounts.items.append(item.vol_mount) %}{% endif %} {% if item.perms_item and (perms_dirs.items.append(item.perms_item.perm_dir), perms_mounts.items.append(item.perms_item.vol_mount)) %}{% endif %} {% endfor %} -x-tas: {{ values.tailscale | tojson }} + {# Containers #} services: {{ values.consts.tailscale_container_name }}: diff --git a/ix-dev/community/tailscale/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/tailscale/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/tailscale/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/tailscale/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/tailscale/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/tailscale/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/tailscale/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/tailscale/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/tailscale/templates/library/base_v1_0_0/redis.py b/ix-dev/community/tailscale/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/tailscale/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/tailscale/templates/library/base_v1_0_0/storage.py b/ix-dev/community/tailscale/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/tailscale/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/tailscale/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/tailscale/templates/library/community/tailscale/v1_0_4/util.py b/ix-dev/community/tailscale/templates/library/community/tailscale/v1_0_5/util.py similarity index 100% rename from ix-dev/community/tailscale/templates/library/community/tailscale/v1_0_4/util.py rename to ix-dev/community/tailscale/templates/library/community/tailscale/v1_0_5/util.py diff --git a/ix-dev/community/tautulli/app.yaml b/ix-dev/community/tautulli/app.yaml index d7528e605f..0f004797de 100644 --- a/ix-dev/community/tautulli/app.yaml +++ b/ix-dev/community/tautulli/app.yaml @@ -12,7 +12,7 @@ keywords: - analytics - notifications lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -34,4 +34,4 @@ sources: - https://github.com/Tautulli/Tautulli title: Tautulli train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/tautulli/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/tautulli/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/tautulli/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/tautulli/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/tautulli/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/tautulli/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/tautulli/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/tautulli/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/tautulli/templates/library/base_v1_0_0/redis.py b/ix-dev/community/tautulli/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/tautulli/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/tautulli/templates/library/base_v1_0_0/storage.py b/ix-dev/community/tautulli/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/tautulli/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/tautulli/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/community/unifi-controller/app.yaml b/ix-dev/community/unifi-controller/app.yaml index 877291926a..765e26d89b 100644 --- a/ix-dev/community/unifi-controller/app.yaml +++ b/ix-dev/community/unifi-controller/app.yaml @@ -11,7 +11,7 @@ keywords: - unifi - network lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ sources: - https://hub.docker.com/r/goofball222/unifi title: Unifi Controller train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/postgres.py b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/redis.py b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/storage.py b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/community/unifi-controller/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/collabora/app.yaml b/ix-dev/stable/collabora/app.yaml index 8c669b2ae0..2927187b35 100644 --- a/ix-dev/stable/collabora/app.yaml +++ b/ix-dev/stable/collabora/app.yaml @@ -28,7 +28,7 @@ keywords: - documents - productivity lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -53,4 +53,4 @@ sources: - https://hub.docker.com/r/collabora/code title: Collabora train: stable -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/stable/collabora/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/collabora/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/collabora/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/collabora/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/collabora/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/collabora/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/collabora/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/collabora/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/collabora/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/collabora/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/collabora/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/collabora/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/collabora/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/collabora/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/collabora/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/elastic-search/app.yaml b/ix-dev/stable/elastic-search/app.yaml index b7644ace25..ec3ad9cc98 100644 --- a/ix-dev/stable/elastic-search/app.yaml +++ b/ix-dev/stable/elastic-search/app.yaml @@ -11,7 +11,7 @@ keywords: - search - elastic lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ sources: - https://www.elastic.co/guide/en/elasticsearch/reference/master/docker.html#docker-configuration-methods title: Elastic Search train: stable -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/elastic-search/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/emby/app.yaml b/ix-dev/stable/emby/app.yaml index c124fa9456..056a4756b4 100644 --- a/ix-dev/stable/emby/app.yaml +++ b/ix-dev/stable/emby/app.yaml @@ -28,7 +28,7 @@ keywords: - tv - streaming lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -49,4 +49,4 @@ sources: - https://github.com/truenas/charts/tree/master/charts/emby title: Emby train: stable -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/stable/emby/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/emby/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/emby/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/emby/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/emby/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/emby/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/emby/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/emby/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/emby/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/emby/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/emby/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/emby/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/emby/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/emby/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/emby/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/minio/app.yaml b/ix-dev/stable/minio/app.yaml index d33b06e975..64227b8f90 100644 --- a/ix-dev/stable/minio/app.yaml +++ b/ix-dev/stable/minio/app.yaml @@ -11,7 +11,7 @@ keywords: - object-storage - S3 lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -31,4 +31,4 @@ sources: - https://github.com/minio/minio title: MinIO train: stable -version: 1.0.1 +version: 1.0.2 diff --git a/ix-dev/stable/minio/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/minio/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/minio/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/minio/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/minio/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/minio/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/minio/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/minio/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/minio/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/minio/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/minio/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/minio/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/minio/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/minio/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/minio/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/netdata/app.yaml b/ix-dev/stable/netdata/app.yaml index 370f93cb68..f5ec1c40d3 100644 --- a/ix-dev/stable/netdata/app.yaml +++ b/ix-dev/stable/netdata/app.yaml @@ -35,7 +35,7 @@ keywords: - metric - monitoring lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -58,4 +58,4 @@ sources: - https://github.com/netdata/netdata title: Netdata train: stable -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/stable/netdata/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/netdata/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/netdata/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/netdata/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/netdata/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/netdata/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/netdata/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/netdata/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/netdata/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/netdata/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/netdata/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/netdata/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/netdata/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/netdata/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/netdata/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/photoprism/app.yaml b/ix-dev/stable/photoprism/app.yaml index 0a964e7cdc..ceb0323003 100644 --- a/ix-dev/stable/photoprism/app.yaml +++ b/ix-dev/stable/photoprism/app.yaml @@ -23,7 +23,7 @@ keywords: - photos - image lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -42,4 +42,4 @@ sources: - https://photoprism.app/ title: Photoprism train: stable -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/stable/photoprism/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/photoprism/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/photoprism/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/photoprism/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/photoprism/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/photoprism/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/photoprism/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/photoprism/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/pihole/app.yaml b/ix-dev/stable/pihole/app.yaml index c5ac12fec8..594cfd8c4e 100644 --- a/ix-dev/stable/pihole/app.yaml +++ b/ix-dev/stable/pihole/app.yaml @@ -34,7 +34,7 @@ keywords: - networking - dns lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -53,4 +53,4 @@ sources: - https://github.com/truenas/charts/tree/master/charts/pihole title: Pi-hole train: stable -version: 1.0.3 +version: 1.0.5 diff --git a/ix-dev/stable/pihole/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/pihole/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/pihole/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/pihole/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/pihole/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/pihole/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/pihole/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/pihole/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/pihole/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/pihole/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/pihole/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/pihole/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/pihole/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/pihole/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/pihole/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/plex/app.yaml b/ix-dev/stable/plex/app.yaml index 5f1dd74456..b86f4a3b50 100644 --- a/ix-dev/stable/plex/app.yaml +++ b/ix-dev/stable/plex/app.yaml @@ -28,7 +28,7 @@ keywords: - tv - streaming lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -48,4 +48,4 @@ sources: - https://hub.docker.com/r/plexinc/pms-docker title: Plex train: stable -version: 1.0.4 +version: 1.0.5 diff --git a/ix-dev/stable/plex/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/plex/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/plex/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/plex/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/plex/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/plex/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/plex/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/plex/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/plex/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/plex/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/plex/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/plex/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/plex/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/plex/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/plex/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/prometheus/app.yaml b/ix-dev/stable/prometheus/app.yaml index c0f3d64eab..6cd9a5c505 100644 --- a/ix-dev/stable/prometheus/app.yaml +++ b/ix-dev/stable/prometheus/app.yaml @@ -10,7 +10,7 @@ keywords: - metrics - prometheus lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -30,4 +30,4 @@ sources: - https://prometheus.io title: Prometheus train: stable -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/stable/prometheus/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/prometheus/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/prometheus/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/prometheus/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/prometheus/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/prometheus/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/prometheus/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/prometheus/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]}) diff --git a/ix-dev/stable/syncthing/app.yaml b/ix-dev/stable/syncthing/app.yaml index 2332649b38..1142d132e4 100644 --- a/ix-dev/stable/syncthing/app.yaml +++ b/ix-dev/stable/syncthing/app.yaml @@ -27,7 +27,7 @@ keywords: - file-sharing - backup lib_version: 1.0.0 -lib_version_hash: 66c98111180da566a3bcc9ee1d1be4f673356f453b5d97ee7c784c9a38ee9999 +lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e maintainers: - email: dev@ixsystems.com name: truenas @@ -50,4 +50,4 @@ sources: - https://hub.docker.com/r/syncthing/syncthing title: Syncthing train: stable -version: 1.0.4 +version: 1.0.6 diff --git a/ix-dev/stable/syncthing/templates/library/base_v1_0_0/healthchecks.py b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/healthchecks.py index a8afbffe2b..afe9bfded1 100644 --- a/ix-dev/stable/syncthing/templates/library/base_v1_0_0/healthchecks.py +++ b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/healthchecks.py @@ -25,6 +25,16 @@ def pg_test(user, db, config=None): return f"pg_isready -h {host} -p {port} -d {db} -U {user}" +def redis_test(config=None): + config = config or {} + + host = config.get("host", "127.0.0.1") + port = config.get("port", 6379) + password = "$$REDIS_PASSWORD" + + return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG" + + def curl_test(port, path, config=None): config = config or {} if not port or not path: diff --git a/ix-dev/stable/syncthing/templates/library/base_v1_0_0/postgres.py b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/postgres.py index 692fcdf3fa..4dc7e32344 100644 --- a/ix-dev/stable/syncthing/templates/library/base_v1_0_0/postgres.py +++ b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/postgres.py @@ -63,7 +63,7 @@ def pg_container(data={}): "restart": "unless-stopped", "cap_drop": get_caps()["drop"], "security_opt": get_sec_opts(), - **({"dns_opt": dns_opts(data["dns_opt"])} if data.get("dns_opt") else {}), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), "healthcheck": check_health(pg_test(user=pg_user, db=pg_dbname)), "environment": pg_env( user=pg_user, diff --git a/ix-dev/stable/syncthing/templates/library/base_v1_0_0/redis.py b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/redis.py new file mode 100644 index 0000000000..2de75eda8a --- /dev/null +++ b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/redis.py @@ -0,0 +1,49 @@ +from . import utils +from .security import get_caps, get_sec_opts +from .network import dns_opts +from .healthchecks import redis_test, check_health +from .resources import resources + + +def redis_container(data={}): + req_keys = ["password", "volumes", "resources"] + for key in req_keys: + if not data.get(key): + utils.throw_error(f"Expected [{key}] to be set for postgres") + + redis_password = data["password"] + redis_port = data.get("port", 6379) + depends = data.get("depends_on", {}) + depends_on = {} + for key in depends: + depends_on[key] = { + "condition": depends[key].get("condition", "service_completed_successfully") + } + + return { + "image": f"{data.get('image', 'bitnami/redis:7.0.11')}", + "user": f"{data.get('user', '1001')}:{data.get('group', '0')}", + "restart": "unless-stopped", + "cap_drop": get_caps()["drop"], + "security_opt": get_sec_opts(), + **({"dns_opts": dns_opts(data["dns_opts"])} if data.get("dns_opts") else {}), + "healthcheck": check_health(redis_test(config={"port": redis_port})), + "environment": redis_env( + password=redis_password, + port=redis_port, + ), + "volumes": data["volumes"], + "depends_on": depends_on, + "deploy": {"resources": resources(data["resources"])}, + } + + +def redis_env(password, port=6379): + if not password: + utils.throw_error("Expected [password] to be set for redis") + + return { + "ALLOW_EMPTY_PASSWORD": "no", + "REDIS_PASSWORD": password, + "REDIS_PORT_NUMBER": port, + } diff --git a/ix-dev/stable/syncthing/templates/library/base_v1_0_0/storage.py b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/storage.py index 15c6cf19ec..c73b3e4b50 100644 --- a/ix-dev/stable/syncthing/templates/library/base_v1_0_0/storage.py +++ b/ix-dev/stable/syncthing/templates/library/base_v1_0_0/storage.py @@ -88,7 +88,7 @@ def perms_item(data, values=None, opts=None): req_keys = ["mount_path", "mode", "uid", "gid"] for key in req_keys: - if not opts.get(key): + if opts.get(key, None) is None: utils.throw_error(f"Expected opts passed to [perms_item] to have [{key}] key") data.update({"mount_path": opts["mount_path"]})