From 57431819c064628dd4d3b99f833e3c7758c789b4 Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Thu, 23 Jan 2025 19:33:59 +0200 Subject: [PATCH 1/4] nextcloud: fix ixvolume storage with deprecated layout --- ix-dev/stable/nextcloud/app.yaml | 4 +- .../nextcloud/templates/docker-compose.yaml | 20 +++-- .../{base_v2_1_9 => base_v2_1_13}/__init__.py | 0 .../{base_v2_1_9 => base_v2_1_13}/configs.py | 0 .../library/base_v2_1_13}/container.py | 0 .../{base_v2_1_9 => base_v2_1_13}/depends.py | 0 .../{base_v2_1_9 => base_v2_1_13}/deploy.py | 0 .../{base_v2_1_9 => base_v2_1_13}/deps.py | 0 .../deps_mariadb.py | 0 .../deps_perms.py | 0 .../deps_postgres.py | 0 .../deps_redis.py | 0 .../{base_v2_1_9 => base_v2_1_13}/device.py | 0 .../base_v2_1_13}/device_cgroup_rules.py | 0 .../{base_v2_1_9 => base_v2_1_13}/devices.py | 0 .../{base_v2_1_9 => base_v2_1_13}/dns.py | 0 .../environment.py | 0 .../{base_v2_1_9 => base_v2_1_13}/error.py | 0 .../{base_v2_1_9 => base_v2_1_13}/expose.py | 0 .../library/base_v2_1_13}/extra_hosts.py | 0 .../formatter.py | 0 .../functions.py | 0 .../healthcheck.py | 0 .../{base_v2_1_9 => base_v2_1_13}/labels.py | 0 .../{base_v2_1_9 => base_v2_1_13}/notes.py | 0 .../{base_v2_1_9 => base_v2_1_13}/portal.py | 0 .../{base_v2_1_9 => base_v2_1_13}/portals.py | 0 .../{base_v2_1_9 => base_v2_1_13}/ports.py | 0 .../{base_v2_1_9 => base_v2_1_13}/render.py | 0 .../resources.py | 0 .../{base_v2_1_9 => base_v2_1_13}/restart.py | 0 .../{base_v2_1_9 => base_v2_1_13}/storage.py | 0 .../{base_v2_1_9 => base_v2_1_13}/sysctls.py | 0 .../tests/__init__.py | 0 .../tests/test_build_image.py | 0 .../tests/test_configs.py | 0 .../base_v2_1_13}/tests/test_container.py | 0 .../tests/test_depends.py | 0 .../tests/test_deps.py | 0 .../tests/test_device.py | 0 .../tests/test_device_cgroup_rules.py | 0 .../tests/test_dns.py | 0 .../tests/test_environment.py | 0 .../tests/test_expose.py | 0 .../base_v2_1_13}/tests/test_extra_hosts.py | 0 .../tests/test_formatter.py | 0 .../tests/test_functions.py | 0 .../tests/test_healthcheck.py | 0 .../tests/test_labels.py | 0 .../tests/test_notes.py | 0 .../tests/test_portal.py | 0 .../tests/test_ports.py | 0 .../tests/test_render.py | 0 .../tests/test_resources.py | 0 .../tests/test_restart.py | 0 .../tests/test_sysctls.py | 0 .../tests/test_validations.py | 0 .../tests/test_volumes.py | 0 .../library/base_v2_1_13}/validations.py | 0 .../volume_mount.py | 0 .../volume_mount_types.py | 0 .../volume_sources.py | 4 +- .../volume_types.py | 0 .../{base_v2_1_9 => base_v2_1_13}/volumes.py | 0 .../test_values/same-vol-values.yaml | 14 ++-- library/{2.1.12 => 2.1.13}/__init__.py | 0 library/{2.1.12 => 2.1.13}/configs.py | 0 .../2.1.13}/container.py | 35 +++++++- library/{2.1.12 => 2.1.13}/depends.py | 0 library/{2.1.12 => 2.1.13}/deploy.py | 0 library/{2.1.12 => 2.1.13}/deps.py | 0 library/{2.1.12 => 2.1.13}/deps_mariadb.py | 0 library/{2.1.12 => 2.1.13}/deps_perms.py | 0 library/{2.1.12 => 2.1.13}/deps_postgres.py | 0 library/{2.1.12 => 2.1.13}/deps_redis.py | 0 library/{2.1.12 => 2.1.13}/device.py | 0 library/2.1.13/device_cgroup_rules.py | 54 +++++++++++++ library/{2.1.12 => 2.1.13}/devices.py | 0 library/{2.1.12 => 2.1.13}/dns.py | 0 library/{2.1.12 => 2.1.13}/environment.py | 0 library/{2.1.12 => 2.1.13}/error.py | 0 library/{2.1.12 => 2.1.13}/expose.py | 0 library/2.1.13/extra_hosts.py | 33 ++++++++ library/{2.1.12 => 2.1.13}/formatter.py | 0 library/{2.1.12 => 2.1.13}/functions.py | 0 library/{2.1.12 => 2.1.13}/healthcheck.py | 0 library/{2.1.12 => 2.1.13}/labels.py | 0 library/{2.1.12 => 2.1.13}/notes.py | 0 library/{2.1.12 => 2.1.13}/portal.py | 0 library/{2.1.12 => 2.1.13}/portals.py | 0 library/{2.1.12 => 2.1.13}/ports.py | 0 library/{2.1.12 => 2.1.13}/render.py | 0 library/{2.1.12 => 2.1.13}/resources.py | 0 library/{2.1.12 => 2.1.13}/restart.py | 0 library/{2.1.12 => 2.1.13}/storage.py | 0 library/{2.1.12 => 2.1.13}/sysctls.py | 0 library/{2.1.12 => 2.1.13}/tests/__init__.py | 0 .../tests/test_build_image.py | 0 .../{2.1.12 => 2.1.13}/tests/test_configs.py | 0 .../2.1.13}/tests/test_container.py | 45 +++++++++++ .../{2.1.12 => 2.1.13}/tests/test_depends.py | 0 library/{2.1.12 => 2.1.13}/tests/test_deps.py | 0 .../{2.1.12 => 2.1.13}/tests/test_device.py | 0 .../2.1.13/tests/test_device_cgroup_rules.py | 79 +++++++++++++++++++ library/{2.1.12 => 2.1.13}/tests/test_dns.py | 0 .../tests/test_environment.py | 0 .../{2.1.12 => 2.1.13}/tests/test_expose.py | 0 library/2.1.13/tests/test_extra_hosts.py | 57 +++++++++++++ .../tests/test_formatter.py | 0 .../tests/test_functions.py | 0 .../tests/test_healthcheck.py | 0 .../{2.1.12 => 2.1.13}/tests/test_labels.py | 0 .../{2.1.12 => 2.1.13}/tests/test_notes.py | 0 .../{2.1.12 => 2.1.13}/tests/test_portal.py | 0 .../{2.1.12 => 2.1.13}/tests/test_ports.py | 0 .../{2.1.12 => 2.1.13}/tests/test_render.py | 0 .../tests/test_resources.py | 0 .../{2.1.12 => 2.1.13}/tests/test_restart.py | 0 .../{2.1.12 => 2.1.13}/tests/test_sysctls.py | 0 .../tests/test_validations.py | 0 .../{2.1.12 => 2.1.13}/tests/test_volumes.py | 0 .../2.1.13}/validations.py | 38 +++++++++ library/{2.1.12 => 2.1.13}/volume_mount.py | 0 .../{2.1.12 => 2.1.13}/volume_mount_types.py | 0 library/{2.1.12 => 2.1.13}/volume_sources.py | 4 +- library/{2.1.12 => 2.1.13}/volume_types.py | 0 library/{2.1.12 => 2.1.13}/volumes.py | 0 library/hashes.yaml | 2 +- 128 files changed, 366 insertions(+), 23 deletions(-) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/__init__.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/configs.py (100%) rename {library/2.1.12 => ix-dev/stable/nextcloud/templates/library/base_v2_1_13}/container.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/depends.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/deploy.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/deps.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/deps_mariadb.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/deps_perms.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/deps_postgres.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/deps_redis.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/device.py (100%) rename {library/2.1.12 => ix-dev/stable/nextcloud/templates/library/base_v2_1_13}/device_cgroup_rules.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/devices.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/dns.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/environment.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/error.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/expose.py (100%) rename {library/2.1.12 => ix-dev/stable/nextcloud/templates/library/base_v2_1_13}/extra_hosts.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/formatter.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/functions.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/healthcheck.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/labels.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/notes.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/portal.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/portals.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/ports.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/render.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/resources.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/restart.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/storage.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/sysctls.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/__init__.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_build_image.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_configs.py (100%) rename {library/2.1.12 => ix-dev/stable/nextcloud/templates/library/base_v2_1_13}/tests/test_container.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_depends.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_deps.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_device.py (100%) rename {library/2.1.12 => ix-dev/stable/nextcloud/templates/library/base_v2_1_13}/tests/test_device_cgroup_rules.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_dns.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_environment.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_expose.py (100%) rename {library/2.1.12 => ix-dev/stable/nextcloud/templates/library/base_v2_1_13}/tests/test_extra_hosts.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_formatter.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_functions.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_healthcheck.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_labels.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_notes.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_portal.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_ports.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_render.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_resources.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_restart.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_sysctls.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_validations.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/tests/test_volumes.py (100%) rename {library/2.1.12 => ix-dev/stable/nextcloud/templates/library/base_v2_1_13}/validations.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/volume_mount.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/volume_mount_types.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/volume_sources.py (93%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/volume_types.py (100%) rename ix-dev/stable/nextcloud/templates/library/{base_v2_1_9 => base_v2_1_13}/volumes.py (100%) rename library/{2.1.12 => 2.1.13}/__init__.py (100%) rename library/{2.1.12 => 2.1.13}/configs.py (100%) rename {ix-dev/stable/nextcloud/templates/library/base_v2_1_9 => library/2.1.13}/container.py (92%) rename library/{2.1.12 => 2.1.13}/depends.py (100%) rename library/{2.1.12 => 2.1.13}/deploy.py (100%) rename library/{2.1.12 => 2.1.13}/deps.py (100%) rename library/{2.1.12 => 2.1.13}/deps_mariadb.py (100%) rename library/{2.1.12 => 2.1.13}/deps_perms.py (100%) rename library/{2.1.12 => 2.1.13}/deps_postgres.py (100%) rename library/{2.1.12 => 2.1.13}/deps_redis.py (100%) rename library/{2.1.12 => 2.1.13}/device.py (100%) create mode 100644 library/2.1.13/device_cgroup_rules.py rename library/{2.1.12 => 2.1.13}/devices.py (100%) rename library/{2.1.12 => 2.1.13}/dns.py (100%) rename library/{2.1.12 => 2.1.13}/environment.py (100%) rename library/{2.1.12 => 2.1.13}/error.py (100%) rename library/{2.1.12 => 2.1.13}/expose.py (100%) create mode 100644 library/2.1.13/extra_hosts.py rename library/{2.1.12 => 2.1.13}/formatter.py (100%) rename library/{2.1.12 => 2.1.13}/functions.py (100%) rename library/{2.1.12 => 2.1.13}/healthcheck.py (100%) rename library/{2.1.12 => 2.1.13}/labels.py (100%) rename library/{2.1.12 => 2.1.13}/notes.py (100%) rename library/{2.1.12 => 2.1.13}/portal.py (100%) rename library/{2.1.12 => 2.1.13}/portals.py (100%) rename library/{2.1.12 => 2.1.13}/ports.py (100%) rename library/{2.1.12 => 2.1.13}/render.py (100%) rename library/{2.1.12 => 2.1.13}/resources.py (100%) rename library/{2.1.12 => 2.1.13}/restart.py (100%) rename library/{2.1.12 => 2.1.13}/storage.py (100%) rename library/{2.1.12 => 2.1.13}/sysctls.py (100%) rename library/{2.1.12 => 2.1.13}/tests/__init__.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_build_image.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_configs.py (100%) rename {ix-dev/stable/nextcloud/templates/library/base_v2_1_9 => library/2.1.13}/tests/test_container.py (88%) rename library/{2.1.12 => 2.1.13}/tests/test_depends.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_deps.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_device.py (100%) create mode 100644 library/2.1.13/tests/test_device_cgroup_rules.py rename library/{2.1.12 => 2.1.13}/tests/test_dns.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_environment.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_expose.py (100%) create mode 100644 library/2.1.13/tests/test_extra_hosts.py rename library/{2.1.12 => 2.1.13}/tests/test_formatter.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_functions.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_healthcheck.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_labels.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_notes.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_portal.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_ports.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_render.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_resources.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_restart.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_sysctls.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_validations.py (100%) rename library/{2.1.12 => 2.1.13}/tests/test_volumes.py (100%) rename {ix-dev/stable/nextcloud/templates/library/base_v2_1_9 => library/2.1.13}/validations.py (85%) rename library/{2.1.12 => 2.1.13}/volume_mount.py (100%) rename library/{2.1.12 => 2.1.13}/volume_mount_types.py (100%) rename library/{2.1.12 => 2.1.13}/volume_sources.py (93%) rename library/{2.1.12 => 2.1.13}/volume_types.py (100%) rename library/{2.1.12 => 2.1.13}/volumes.py (100%) diff --git a/ix-dev/stable/nextcloud/app.yaml b/ix-dev/stable/nextcloud/app.yaml index 2449534df2..c1ca4941cd 100644 --- a/ix-dev/stable/nextcloud/app.yaml +++ b/ix-dev/stable/nextcloud/app.yaml @@ -28,8 +28,8 @@ keywords: - http - web - php -lib_version: 2.1.9 -lib_version_hash: 6bd4d433db7dce2d4b8cc456a0f7874b45d52a6e2b145d5a1f48f327654a7125 +lib_version: 2.1.13 +lib_version_hash: 19a001bec1a3bede7f6f55a757b4088b81e31e92a48e8e89d23d064b059a65d0 maintainers: - email: dev@ixsystems.com name: truenas diff --git a/ix-dev/stable/nextcloud/templates/docker-compose.yaml b/ix-dev/stable/nextcloud/templates/docker-compose.yaml index 0e60dad0d9..3b15aa25cc 100644 --- a/ix-dev/stable/nextcloud/templates/docker-compose.yaml +++ b/ix-dev/stable/nextcloud/templates/docker-compose.yaml @@ -1,6 +1,8 @@ {% from "macros/nc.jinja.sh" import occ, hosts_update, trusted_domains_update %} {% from "macros/nc.jinja.conf" import opcache, php, limit_request_body, nginx_conf %} + + {% set tpl = ix_lib.base.render.Render(values) %} {% set nc_custom_image = namespace(x=[]) %} @@ -70,15 +72,17 @@ ]) %} {% if values.storage.is_data_in_the_same_volume %} {% do tpl.notes.add_warning(values.consts.deprecation_warning) %} - {% set data_host_path = values.storage.data.get("host_path_config", {}).get("acl", {}).get("path", "") or values.storage.data.get("host_path_config", {}).get("path", "") %} - {% set html_host_path = values.storage.html.get("host_path_config", {}).get("acl", {}).get("path", "") or values.storage.html.get("host_path_config", {}).get("path", "") %} - {% set html_create_host_path = values.storage.html.get("host_path_config", {}).get("create_host_path", False) %} + {% set data_host_path = tpl.funcs.get_host_path(values.storage.data) %} {% set data_create_host_path = values.storage.data.get("host_path_config", {}).get("create_host_path", False) %} - {% do nc_storage.x.append((values.nextcloud.data_dir_path, dict(values.storage.data, **{"host_path_config": {"path": "%s/data"|format(data_host_path), "create_host_path": data_create_host_path}} ))) %} - {% do nc_storage.x.append(("/var/www/html", dict(values.storage.html, **{"host_path_config": {"path": "%s/html"|format(html_host_path), "create_host_path": html_create_host_path}} ))) %} - {% do nc_storage.x.append(("/var/www/html/config", dict(values.storage.html, **{"host_path_config": {"path": "%s/config"|format(html_host_path), "create_host_path": html_create_host_path}} ))) %} - {% do nc_storage.x.append(("/var/www/html/custom_apps", dict(values.storage.html, **{"host_path_config": {"path": "%s/custom_apps"|format(html_host_path), "create_host_path": html_create_host_path}} ))) %} - {% do nc_storage.x.append(("/var/www/html/themes", dict(values.storage.html, **{"host_path_config": {"path": "%s/themes"|format(html_host_path), "create_host_path": html_create_host_path}} ))) %} + + {% set html_host_path = tpl.funcs.get_host_path(values.storage.html) %} + {% set html_create_host_path = values.storage.html.get("host_path_config", {}).get("create_host_path", False) %} + + {% do nc_storage.x.append((values.nextcloud.data_dir_path, dict(values.storage.data, **{"type": "host_path", "host_path_config": {"path": "%s/data"|format(data_host_path), "create_host_path": data_create_host_path, "allow_unsafe_ix_volume": true}} ))) %} + {% do nc_storage.x.append(("/var/www/html", dict(values.storage.html, **{"type": "host_path", "host_path_config": {"path": "%s/html"|format(html_host_path), "create_host_path": html_create_host_path, "allow_unsafe_ix_volume": true}} ))) %} + {% do nc_storage.x.append(("/var/www/html/config", dict(values.storage.html, **{"type": "host_path", "host_path_config": {"path": "%s/config"|format(html_host_path), "create_host_path": html_create_host_path, "allow_unsafe_ix_volume": true}} ))) %} + {% do nc_storage.x.append(("/var/www/html/custom_apps", dict(values.storage.html, **{"type": "host_path", "host_path_config": {"path": "%s/custom_apps"|format(html_host_path), "create_host_path": html_create_host_path, "allow_unsafe_ix_volume": true}} ))) %} + {% do nc_storage.x.append(("/var/www/html/themes", dict(values.storage.html, **{"type": "host_path", "host_path_config": {"path": "%s/themes"|format(html_host_path), "create_host_path": html_create_host_path, "allow_unsafe_ix_volume": true}} ))) %} {% else %} {% do nc_storage.x.append(("/var/www/html", values.storage.html)) %} {% do nc_storage.x.append((values.nextcloud.data_dir_path, values.storage.data)) %} diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/__init__.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/__init__.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/__init__.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/__init__.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/configs.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/configs.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/configs.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/configs.py diff --git a/library/2.1.12/container.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/container.py similarity index 100% rename from library/2.1.12/container.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/container.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/depends.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/depends.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/depends.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/depends.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deploy.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deploy.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deploy.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deploy.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_mariadb.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_mariadb.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_mariadb.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_mariadb.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_perms.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_perms.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_perms.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_perms.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_postgres.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_postgres.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_postgres.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_postgres.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_redis.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_redis.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/deps_redis.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/deps_redis.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/device.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/device.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/device.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/device.py diff --git a/library/2.1.12/device_cgroup_rules.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/device_cgroup_rules.py similarity index 100% rename from library/2.1.12/device_cgroup_rules.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/device_cgroup_rules.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/devices.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/devices.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/devices.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/devices.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/dns.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/dns.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/dns.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/dns.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/environment.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/environment.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/environment.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/environment.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/error.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/error.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/error.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/error.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/expose.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/expose.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/expose.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/expose.py diff --git a/library/2.1.12/extra_hosts.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/extra_hosts.py similarity index 100% rename from library/2.1.12/extra_hosts.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/extra_hosts.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/formatter.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/formatter.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/formatter.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/formatter.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/functions.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/functions.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/functions.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/functions.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/healthcheck.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/healthcheck.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/healthcheck.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/healthcheck.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/labels.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/labels.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/labels.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/labels.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/notes.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/notes.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/notes.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/notes.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/portal.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/portal.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/portal.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/portal.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/portals.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/portals.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/portals.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/portals.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/ports.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/ports.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/ports.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/ports.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/render.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/render.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/render.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/render.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/resources.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/resources.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/resources.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/resources.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/restart.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/restart.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/restart.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/restart.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/storage.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/storage.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/storage.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/storage.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/sysctls.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/sysctls.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/sysctls.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/sysctls.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/__init__.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/__init__.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/__init__.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/__init__.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_build_image.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_build_image.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_build_image.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_build_image.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_configs.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_configs.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_configs.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_configs.py diff --git a/library/2.1.12/tests/test_container.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_container.py similarity index 100% rename from library/2.1.12/tests/test_container.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_container.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_depends.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_depends.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_depends.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_depends.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_deps.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_deps.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_deps.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_deps.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_device.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_device.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_device.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_device.py diff --git a/library/2.1.12/tests/test_device_cgroup_rules.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_device_cgroup_rules.py similarity index 100% rename from library/2.1.12/tests/test_device_cgroup_rules.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_device_cgroup_rules.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_dns.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_dns.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_dns.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_dns.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_environment.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_environment.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_environment.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_environment.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_expose.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_expose.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_expose.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_expose.py diff --git a/library/2.1.12/tests/test_extra_hosts.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_extra_hosts.py similarity index 100% rename from library/2.1.12/tests/test_extra_hosts.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_extra_hosts.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_formatter.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_formatter.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_formatter.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_formatter.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_functions.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_functions.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_functions.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_functions.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_healthcheck.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_healthcheck.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_healthcheck.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_healthcheck.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_labels.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_labels.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_labels.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_labels.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_notes.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_notes.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_notes.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_notes.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_portal.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_portal.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_portal.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_portal.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_ports.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_ports.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_ports.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_ports.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_render.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_render.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_render.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_render.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_resources.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_resources.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_resources.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_resources.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_restart.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_restart.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_restart.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_restart.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_sysctls.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_sysctls.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_sysctls.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_sysctls.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_validations.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_validations.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_validations.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_validations.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_volumes.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_volumes.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_volumes.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/tests/test_volumes.py diff --git a/library/2.1.12/validations.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/validations.py similarity index 100% rename from library/2.1.12/validations.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/validations.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_mount.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_mount.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_mount.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_mount.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_mount_types.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_mount_types.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_mount_types.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_mount_types.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_sources.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_sources.py similarity index 93% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_sources.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_sources.py index dcfce44b75..6aba23df23 100644 --- a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_sources.py +++ b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_sources.py @@ -32,7 +32,9 @@ def __init__(self, render_instance: "Render", config: "IxStorageHostPathConfig") path = valid_fs_path_or_raise(config.get("path", "")) path = path.rstrip("/") - self.source = allowed_fs_host_path_or_raise(path) + # TODO: Hack for Nextcloud deprecated config. Remove once we remove support for it + allow_unsafe_ix_volume = config.get("allow_unsafe_ix_volume", False) + self.source = allowed_fs_host_path_or_raise(path, allow_unsafe_ix_volume) def get(self): return self.source diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_types.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_types.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volume_types.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volume_types.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volumes.py b/ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volumes.py similarity index 100% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/volumes.py rename to ix-dev/stable/nextcloud/templates/library/base_v2_1_13/volumes.py diff --git a/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml b/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml index 9e0905d727..633876fedb 100644 --- a/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml +++ b/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml @@ -32,18 +32,20 @@ network: ix_volumes: postgres_data: /opt/tests/mnt/postgres_data + data: /opt/tests/mnt/data + html: /opt/tests/mnt/html storage: is_data_in_the_same_volume: true data: - type: host_path - host_path_config: - path: /opt/tests/mnt/host_nc + type: ix_volume + ix_volume_config: + dataset_name: data create_host_path: true html: - type: host_path - host_path_config: - path: /opt/tests/mnt/host_nc + type: ix_volume + ix_volume_config: + dataset_name: html create_host_path: true postgres_data: type: ix_volume diff --git a/library/2.1.12/__init__.py b/library/2.1.13/__init__.py similarity index 100% rename from library/2.1.12/__init__.py rename to library/2.1.13/__init__.py diff --git a/library/2.1.12/configs.py b/library/2.1.13/configs.py similarity index 100% rename from library/2.1.12/configs.py rename to library/2.1.13/configs.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/container.py b/library/2.1.13/container.py similarity index 92% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/container.py rename to library/2.1.13/container.py index d0abd6edc7..c16aa1e6b7 100644 --- a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/container.py +++ b/library/2.1.13/container.py @@ -8,21 +8,24 @@ from .configs import ContainerConfigs from .depends import Depends from .deploy import Deploy + from .device_cgroup_rules import DeviceCGroupRules from .devices import Devices from .dns import Dns from .environment import Environment from .error import RenderError from .expose import Expose + from .extra_hosts import ExtraHosts from .formatter import escape_dollar, get_image_with_hashed_data from .healthcheck import Healthcheck from .labels import Labels from .ports import Ports from .restart import RestartPolicy from .validations import ( - valid_network_mode_or_raise, valid_cap_or_raise, - valid_pull_policy_or_raise, + valid_ipc_mode_or_raise, + valid_network_mode_or_raise, valid_port_bind_mode_or_raise, + valid_pull_policy_or_raise, ) from .storage import Storage from .sysctls import Sysctls @@ -30,21 +33,24 @@ from configs import ContainerConfigs from depends import Depends from deploy import Deploy + from device_cgroup_rules import DeviceCGroupRules from devices import Devices from dns import Dns from environment import Environment from error import RenderError from expose import Expose + from extra_hosts import ExtraHosts from formatter import escape_dollar, get_image_with_hashed_data from healthcheck import Healthcheck from labels import Labels from ports import Ports from restart import RestartPolicy from validations import ( - valid_network_mode_or_raise, valid_cap_or_raise, - valid_pull_policy_or_raise, + valid_ipc_mode_or_raise, + valid_network_mode_or_raise, valid_port_bind_mode_or_raise, + valid_pull_policy_or_raise, ) from storage import Storage from sysctls import Sysctls @@ -63,6 +69,7 @@ def __init__(self, render_instance: "Render", name: str, image: str): self._stdin_open: bool = False self._init: bool | None = None self._read_only: bool | None = None + self._extra_hosts: ExtraHosts = ExtraHosts(self._render_instance) self._hostname: str = "" self._cap_drop: set[str] = set(["ALL"]) # Drop all capabilities by default and add caps granularly self._cap_add: set[str] = set() @@ -75,6 +82,8 @@ def __init__(self, render_instance: "Render", name: str, image: str): self._grace_period: int | None = None self._shm_size: int | None = None self._storage: Storage = Storage(self._render_instance) + self._ipc_mode: str | None = None + self._device_cgroup_rules: DeviceCGroupRules = DeviceCGroupRules(self._render_instance) self.sysctls: Sysctls = Sysctls(self._render_instance, self) self.configs: ContainerConfigs = ContainerConfigs(self._render_instance, self._render_instance.configs) self.deploy: Deploy = Deploy(self._render_instance) @@ -154,6 +163,9 @@ def set_user(self, user: int, group: int): raise RenderError(f"User/Group [{i}] is not valid") self._user = f"{user}:{group}" + def add_extra_host(self, host: str, ip: str): + self._extra_hosts.add_host(host, ip) + def add_group(self, group: int | str): if isinstance(group, str): group = str(group).strip() @@ -182,6 +194,12 @@ def set_tty(self, enabled: bool = False): def set_stdin(self, enabled: bool = False): self._stdin_open = enabled + def set_ipc_mode(self, ipc_mode: str): + self._ipc_mode = valid_ipc_mode_or_raise(ipc_mode, self._render_instance.container_names()) + + def add_device_cgroup_rule(self, dev_grp_rule: str): + self._device_cgroup_rules.add_rule(dev_grp_rule) + def set_init(self, enabled: bool = False): self._init = enabled @@ -309,6 +327,15 @@ def render(self) -> dict[str, Any]: if self.configs.has_configs(): result["configs"] = self.configs.render() + if self._ipc_mode is not None: + result["ipc"] = self._ipc_mode + + if self._device_cgroup_rules.has_rules(): + result["device_cgroup_rules"] = self._device_cgroup_rules.render() + + if self._extra_hosts.has_hosts(): + result["extra_hosts"] = self._extra_hosts.render() + if self._init is not None: result["init"] = self._init diff --git a/library/2.1.12/depends.py b/library/2.1.13/depends.py similarity index 100% rename from library/2.1.12/depends.py rename to library/2.1.13/depends.py diff --git a/library/2.1.12/deploy.py b/library/2.1.13/deploy.py similarity index 100% rename from library/2.1.12/deploy.py rename to library/2.1.13/deploy.py diff --git a/library/2.1.12/deps.py b/library/2.1.13/deps.py similarity index 100% rename from library/2.1.12/deps.py rename to library/2.1.13/deps.py diff --git a/library/2.1.12/deps_mariadb.py b/library/2.1.13/deps_mariadb.py similarity index 100% rename from library/2.1.12/deps_mariadb.py rename to library/2.1.13/deps_mariadb.py diff --git a/library/2.1.12/deps_perms.py b/library/2.1.13/deps_perms.py similarity index 100% rename from library/2.1.12/deps_perms.py rename to library/2.1.13/deps_perms.py diff --git a/library/2.1.12/deps_postgres.py b/library/2.1.13/deps_postgres.py similarity index 100% rename from library/2.1.12/deps_postgres.py rename to library/2.1.13/deps_postgres.py diff --git a/library/2.1.12/deps_redis.py b/library/2.1.13/deps_redis.py similarity index 100% rename from library/2.1.12/deps_redis.py rename to library/2.1.13/deps_redis.py diff --git a/library/2.1.12/device.py b/library/2.1.13/device.py similarity index 100% rename from library/2.1.12/device.py rename to library/2.1.13/device.py diff --git a/library/2.1.13/device_cgroup_rules.py b/library/2.1.13/device_cgroup_rules.py new file mode 100644 index 0000000000..dcccfee773 --- /dev/null +++ b/library/2.1.13/device_cgroup_rules.py @@ -0,0 +1,54 @@ +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from render import Render + +try: + from .error import RenderError + from .validations import valid_device_cgroup_rule_or_raise +except ImportError: + from error import RenderError + from validations import valid_device_cgroup_rule_or_raise + + +class DeviceCGroupRule: + def __init__(self, rule: str): + rule = valid_device_cgroup_rule_or_raise(rule) + parts = rule.split(" ") + major, minor = parts[1].split(":") + + self._type = parts[0] + self._major = major + self._minor = minor + self._permissions = parts[2] + + def get_key(self): + return f"{self._type}_{self._major}_{self._minor}" + + def render(self): + return f"{self._type} {self._major}:{self._minor} {self._permissions}" + + +class DeviceCGroupRules: + def __init__(self, render_instance: "Render"): + self._render_instance = render_instance + self._rules: set[DeviceCGroupRule] = set() + self._track_rule_combos: set[str] = set() + + def add_rule(self, rule: str): + dev_group_rule = DeviceCGroupRule(rule) + if dev_group_rule in self._rules: + raise RenderError(f"Device Group Rule [{rule}] already added") + + rule_key = dev_group_rule.get_key() + if rule_key in self._track_rule_combos: + raise RenderError(f"Device Group Rule [{rule}] has already been added for this device group") + + self._rules.add(dev_group_rule) + self._track_rule_combos.add(rule_key) + + def has_rules(self): + return len(self._rules) > 0 + + def render(self): + return sorted([rule.render() for rule in self._rules]) diff --git a/library/2.1.12/devices.py b/library/2.1.13/devices.py similarity index 100% rename from library/2.1.12/devices.py rename to library/2.1.13/devices.py diff --git a/library/2.1.12/dns.py b/library/2.1.13/dns.py similarity index 100% rename from library/2.1.12/dns.py rename to library/2.1.13/dns.py diff --git a/library/2.1.12/environment.py b/library/2.1.13/environment.py similarity index 100% rename from library/2.1.12/environment.py rename to library/2.1.13/environment.py diff --git a/library/2.1.12/error.py b/library/2.1.13/error.py similarity index 100% rename from library/2.1.12/error.py rename to library/2.1.13/error.py diff --git a/library/2.1.12/expose.py b/library/2.1.13/expose.py similarity index 100% rename from library/2.1.12/expose.py rename to library/2.1.13/expose.py diff --git a/library/2.1.13/extra_hosts.py b/library/2.1.13/extra_hosts.py new file mode 100644 index 0000000000..eaad3bed26 --- /dev/null +++ b/library/2.1.13/extra_hosts.py @@ -0,0 +1,33 @@ +import ipaddress +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from render import Render + +try: + from .error import RenderError +except ImportError: + from error import RenderError + + +class ExtraHosts: + def __init__(self, render_instance: "Render"): + self._render_instance = render_instance + self._extra_hosts: dict[str, str] = {} + + def add_host(self, host: str, ip: str): + if not ip == "host-gateway": + try: + ipaddress.ip_address(ip) + except ValueError: + raise RenderError(f"Invalid IP address [{ip}] for host [{host}]") + + if host in self._extra_hosts: + raise RenderError(f"Host [{host}] already added with [{self._extra_hosts[host]}]") + self._extra_hosts[host] = ip + + def has_hosts(self): + return len(self._extra_hosts) > 0 + + def render(self): + return {host: ip for host, ip in self._extra_hosts.items()} diff --git a/library/2.1.12/formatter.py b/library/2.1.13/formatter.py similarity index 100% rename from library/2.1.12/formatter.py rename to library/2.1.13/formatter.py diff --git a/library/2.1.12/functions.py b/library/2.1.13/functions.py similarity index 100% rename from library/2.1.12/functions.py rename to library/2.1.13/functions.py diff --git a/library/2.1.12/healthcheck.py b/library/2.1.13/healthcheck.py similarity index 100% rename from library/2.1.12/healthcheck.py rename to library/2.1.13/healthcheck.py diff --git a/library/2.1.12/labels.py b/library/2.1.13/labels.py similarity index 100% rename from library/2.1.12/labels.py rename to library/2.1.13/labels.py diff --git a/library/2.1.12/notes.py b/library/2.1.13/notes.py similarity index 100% rename from library/2.1.12/notes.py rename to library/2.1.13/notes.py diff --git a/library/2.1.12/portal.py b/library/2.1.13/portal.py similarity index 100% rename from library/2.1.12/portal.py rename to library/2.1.13/portal.py diff --git a/library/2.1.12/portals.py b/library/2.1.13/portals.py similarity index 100% rename from library/2.1.12/portals.py rename to library/2.1.13/portals.py diff --git a/library/2.1.12/ports.py b/library/2.1.13/ports.py similarity index 100% rename from library/2.1.12/ports.py rename to library/2.1.13/ports.py diff --git a/library/2.1.12/render.py b/library/2.1.13/render.py similarity index 100% rename from library/2.1.12/render.py rename to library/2.1.13/render.py diff --git a/library/2.1.12/resources.py b/library/2.1.13/resources.py similarity index 100% rename from library/2.1.12/resources.py rename to library/2.1.13/resources.py diff --git a/library/2.1.12/restart.py b/library/2.1.13/restart.py similarity index 100% rename from library/2.1.12/restart.py rename to library/2.1.13/restart.py diff --git a/library/2.1.12/storage.py b/library/2.1.13/storage.py similarity index 100% rename from library/2.1.12/storage.py rename to library/2.1.13/storage.py diff --git a/library/2.1.12/sysctls.py b/library/2.1.13/sysctls.py similarity index 100% rename from library/2.1.12/sysctls.py rename to library/2.1.13/sysctls.py diff --git a/library/2.1.12/tests/__init__.py b/library/2.1.13/tests/__init__.py similarity index 100% rename from library/2.1.12/tests/__init__.py rename to library/2.1.13/tests/__init__.py diff --git a/library/2.1.12/tests/test_build_image.py b/library/2.1.13/tests/test_build_image.py similarity index 100% rename from library/2.1.12/tests/test_build_image.py rename to library/2.1.13/tests/test_build_image.py diff --git a/library/2.1.12/tests/test_configs.py b/library/2.1.13/tests/test_configs.py similarity index 100% rename from library/2.1.12/tests/test_configs.py rename to library/2.1.13/tests/test_configs.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_container.py b/library/2.1.13/tests/test_container.py similarity index 88% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_container.py rename to library/2.1.13/tests/test_container.py index bb3d98dffc..1f4530203e 100644 --- a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/tests/test_container.py +++ b/library/2.1.13/tests/test_container.py @@ -367,3 +367,48 @@ def test_add_ports_with_invalid_host_ips(mock_values): c1.healthcheck.disable() with pytest.raises(Exception): c1.add_port({"port_number": 8081, "container_port": 8080, "bind_mode": "published", "host_ips": "invalid"}) + + +def test_set_ipc_mode(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.set_ipc_mode("host") + output = render.render() + assert output["services"]["test_container"]["ipc"] == "host" + + +def test_set_ipc_empty_mode(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.set_ipc_mode("") + output = render.render() + assert output["services"]["test_container"]["ipc"] == "" + + +def test_set_ipc_mode_with_invalid_ipc_mode(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + with pytest.raises(Exception): + c1.set_ipc_mode("invalid") + + +def test_set_ipc_mode_with_container_ipc_mode(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c2 = render.add_container("test_container2", "test_image") + c2.healthcheck.disable() + c1.set_ipc_mode("container:test_container2") + output = render.render() + assert output["services"]["test_container"]["ipc"] == "container:test_container2" + + +def test_set_ipc_mode_with_container_ipc_mode_and_invalid_container(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + with pytest.raises(Exception): + c1.set_ipc_mode("container:invalid") diff --git a/library/2.1.12/tests/test_depends.py b/library/2.1.13/tests/test_depends.py similarity index 100% rename from library/2.1.12/tests/test_depends.py rename to library/2.1.13/tests/test_depends.py diff --git a/library/2.1.12/tests/test_deps.py b/library/2.1.13/tests/test_deps.py similarity index 100% rename from library/2.1.12/tests/test_deps.py rename to library/2.1.13/tests/test_deps.py diff --git a/library/2.1.12/tests/test_device.py b/library/2.1.13/tests/test_device.py similarity index 100% rename from library/2.1.12/tests/test_device.py rename to library/2.1.13/tests/test_device.py diff --git a/library/2.1.13/tests/test_device_cgroup_rules.py b/library/2.1.13/tests/test_device_cgroup_rules.py new file mode 100644 index 0000000000..581fe82017 --- /dev/null +++ b/library/2.1.13/tests/test_device_cgroup_rules.py @@ -0,0 +1,79 @@ +import pytest + + +from render import Render + + +@pytest.fixture +def mock_values(): + return { + "images": { + "test_image": { + "repository": "nginx", + "tag": "latest", + } + }, + } + + +def test_device_cgroup_rule(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.add_device_cgroup_rule("c 13:* rwm") + c1.add_device_cgroup_rule("b 10:20 rwm") + output = render.render() + assert output["services"]["test_container"]["device_cgroup_rules"] == [ + "b 10:20 rwm", + "c 13:* rwm", + ] + + +def test_device_cgroup_rule_duplicate(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.add_device_cgroup_rule("c 13:* rwm") + with pytest.raises(Exception): + c1.add_device_cgroup_rule("c 13:* rwm") + + +def test_device_cgroup_rule_duplicate_group(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.add_device_cgroup_rule("c 13:* rwm") + with pytest.raises(Exception): + c1.add_device_cgroup_rule("c 13:* rm") + + +def test_device_cgroup_rule_invalid_device(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + with pytest.raises(Exception): + c1.add_device_cgroup_rule("d 10:20 rwm") + + +def test_device_cgroup_rule_invalid_perm(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + with pytest.raises(Exception): + c1.add_device_cgroup_rule("a 10:20 rwd") + + +def test_device_cgroup_rule_invalid_format(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + with pytest.raises(Exception): + c1.add_device_cgroup_rule("a 10 20 rwd") + + +def test_device_cgroup_rule_invalid_format_missing_major(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + with pytest.raises(Exception): + c1.add_device_cgroup_rule("a 10 rwd") diff --git a/library/2.1.12/tests/test_dns.py b/library/2.1.13/tests/test_dns.py similarity index 100% rename from library/2.1.12/tests/test_dns.py rename to library/2.1.13/tests/test_dns.py diff --git a/library/2.1.12/tests/test_environment.py b/library/2.1.13/tests/test_environment.py similarity index 100% rename from library/2.1.12/tests/test_environment.py rename to library/2.1.13/tests/test_environment.py diff --git a/library/2.1.12/tests/test_expose.py b/library/2.1.13/tests/test_expose.py similarity index 100% rename from library/2.1.12/tests/test_expose.py rename to library/2.1.13/tests/test_expose.py diff --git a/library/2.1.13/tests/test_extra_hosts.py b/library/2.1.13/tests/test_extra_hosts.py new file mode 100644 index 0000000000..35230be16e --- /dev/null +++ b/library/2.1.13/tests/test_extra_hosts.py @@ -0,0 +1,57 @@ +import pytest + + +from render import Render + + +@pytest.fixture +def mock_values(): + return { + "images": { + "test_image": { + "repository": "nginx", + "tag": "latest", + } + }, + } + + +def test_add_extra_host(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.add_extra_host("test_host", "127.0.0.1") + c1.add_extra_host("test_host2", "127.0.0.2") + c1.add_extra_host("host.docker.internal", "host-gateway") + output = render.render() + assert output["services"]["test_container"]["extra_hosts"] == { + "host.docker.internal": "host-gateway", + "test_host": "127.0.0.1", + "test_host2": "127.0.0.2", + } + + +def test_add_duplicate_extra_host(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.add_extra_host("test_host", "127.0.0.1") + with pytest.raises(Exception): + c1.add_extra_host("test_host", "127.0.0.2") + + +def test_add_extra_host_with_ipv6(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + c1.add_extra_host("test_host", "::1") + output = render.render() + assert output["services"]["test_container"]["extra_hosts"] == {"test_host": "::1"} + + +def test_add_extra_host_with_invalid_ip(mock_values): + render = Render(mock_values) + c1 = render.add_container("test_container", "test_image") + c1.healthcheck.disable() + with pytest.raises(Exception): + c1.add_extra_host("test_host", "invalid_ip") diff --git a/library/2.1.12/tests/test_formatter.py b/library/2.1.13/tests/test_formatter.py similarity index 100% rename from library/2.1.12/tests/test_formatter.py rename to library/2.1.13/tests/test_formatter.py diff --git a/library/2.1.12/tests/test_functions.py b/library/2.1.13/tests/test_functions.py similarity index 100% rename from library/2.1.12/tests/test_functions.py rename to library/2.1.13/tests/test_functions.py diff --git a/library/2.1.12/tests/test_healthcheck.py b/library/2.1.13/tests/test_healthcheck.py similarity index 100% rename from library/2.1.12/tests/test_healthcheck.py rename to library/2.1.13/tests/test_healthcheck.py diff --git a/library/2.1.12/tests/test_labels.py b/library/2.1.13/tests/test_labels.py similarity index 100% rename from library/2.1.12/tests/test_labels.py rename to library/2.1.13/tests/test_labels.py diff --git a/library/2.1.12/tests/test_notes.py b/library/2.1.13/tests/test_notes.py similarity index 100% rename from library/2.1.12/tests/test_notes.py rename to library/2.1.13/tests/test_notes.py diff --git a/library/2.1.12/tests/test_portal.py b/library/2.1.13/tests/test_portal.py similarity index 100% rename from library/2.1.12/tests/test_portal.py rename to library/2.1.13/tests/test_portal.py diff --git a/library/2.1.12/tests/test_ports.py b/library/2.1.13/tests/test_ports.py similarity index 100% rename from library/2.1.12/tests/test_ports.py rename to library/2.1.13/tests/test_ports.py diff --git a/library/2.1.12/tests/test_render.py b/library/2.1.13/tests/test_render.py similarity index 100% rename from library/2.1.12/tests/test_render.py rename to library/2.1.13/tests/test_render.py diff --git a/library/2.1.12/tests/test_resources.py b/library/2.1.13/tests/test_resources.py similarity index 100% rename from library/2.1.12/tests/test_resources.py rename to library/2.1.13/tests/test_resources.py diff --git a/library/2.1.12/tests/test_restart.py b/library/2.1.13/tests/test_restart.py similarity index 100% rename from library/2.1.12/tests/test_restart.py rename to library/2.1.13/tests/test_restart.py diff --git a/library/2.1.12/tests/test_sysctls.py b/library/2.1.13/tests/test_sysctls.py similarity index 100% rename from library/2.1.12/tests/test_sysctls.py rename to library/2.1.13/tests/test_sysctls.py diff --git a/library/2.1.12/tests/test_validations.py b/library/2.1.13/tests/test_validations.py similarity index 100% rename from library/2.1.12/tests/test_validations.py rename to library/2.1.13/tests/test_validations.py diff --git a/library/2.1.12/tests/test_volumes.py b/library/2.1.13/tests/test_volumes.py similarity index 100% rename from library/2.1.12/tests/test_volumes.py rename to library/2.1.13/tests/test_volumes.py diff --git a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/validations.py b/library/2.1.13/validations.py similarity index 85% rename from ix-dev/stable/nextcloud/templates/library/base_v2_1_9/validations.py rename to library/2.1.13/validations.py index 3b0722afbc..d4aa633006 100644 --- a/ix-dev/stable/nextcloud/templates/library/base_v2_1_9/validations.py +++ b/library/2.1.13/validations.py @@ -38,6 +38,17 @@ def valid_pull_policy_or_raise(pull_policy: str): return pull_policy +def valid_ipc_mode_or_raise(ipc_mode: str, containers: list[str]): + valid_modes = ("", "host", "private", "shareable", "none") + if ipc_mode in valid_modes: + return ipc_mode + if ipc_mode.startswith("container:"): + if ipc_mode[10:] not in containers: + raise RenderError(f"IPC mode [{ipc_mode}] is not valid. Container [{ipc_mode[10:]}] does not exist") + return ipc_mode + raise RenderError(f"IPC mode [{ipc_mode}] is not valid. Valid options are: [{', '.join(valid_modes)}]") + + def valid_sysctl_or_raise(sysctl: str, host_network: bool): if not sysctl: raise RenderError("Sysctl cannot be empty") @@ -136,6 +147,33 @@ def valid_cgroup_perm_or_raise(cgroup_perm: str): return cgroup_perm +def valid_device_cgroup_rule_or_raise(dev_grp_rule: str): + parts = dev_grp_rule.split(" ") + if len(parts) != 3: + raise RenderError( + f"Device Group Rule [{dev_grp_rule}] is not valid. Expected format is [ : ]" + ) + + valid_types = ("a", "b", "c") + if parts[0] not in valid_types: + raise RenderError( + f"Device Group Rule [{dev_grp_rule}] is not valid. Expected type to be one of [{', '.join(valid_types)}]" + f" but got [{parts[0]}]" + ) + + major, minor = parts[1].split(":") + for part in (major, minor): + if part != "*" and not part.isdigit(): + raise RenderError( + f"Device Group Rule [{dev_grp_rule}] is not valid. Expected major and minor to be digits" + f" or [*] but got [{major}] and [{minor}]" + ) + + valid_cgroup_perm_or_raise(parts[2]) + + return dev_grp_rule + + def allowed_dns_opt_or_raise(dns_opt: str): disallowed_dns_opts = [] if dns_opt in disallowed_dns_opts: diff --git a/library/2.1.12/volume_mount.py b/library/2.1.13/volume_mount.py similarity index 100% rename from library/2.1.12/volume_mount.py rename to library/2.1.13/volume_mount.py diff --git a/library/2.1.12/volume_mount_types.py b/library/2.1.13/volume_mount_types.py similarity index 100% rename from library/2.1.12/volume_mount_types.py rename to library/2.1.13/volume_mount_types.py diff --git a/library/2.1.12/volume_sources.py b/library/2.1.13/volume_sources.py similarity index 93% rename from library/2.1.12/volume_sources.py rename to library/2.1.13/volume_sources.py index dcfce44b75..6aba23df23 100644 --- a/library/2.1.12/volume_sources.py +++ b/library/2.1.13/volume_sources.py @@ -32,7 +32,9 @@ def __init__(self, render_instance: "Render", config: "IxStorageHostPathConfig") path = valid_fs_path_or_raise(config.get("path", "")) path = path.rstrip("/") - self.source = allowed_fs_host_path_or_raise(path) + # TODO: Hack for Nextcloud deprecated config. Remove once we remove support for it + allow_unsafe_ix_volume = config.get("allow_unsafe_ix_volume", False) + self.source = allowed_fs_host_path_or_raise(path, allow_unsafe_ix_volume) def get(self): return self.source diff --git a/library/2.1.12/volume_types.py b/library/2.1.13/volume_types.py similarity index 100% rename from library/2.1.12/volume_types.py rename to library/2.1.13/volume_types.py diff --git a/library/2.1.12/volumes.py b/library/2.1.13/volumes.py similarity index 100% rename from library/2.1.12/volumes.py rename to library/2.1.13/volumes.py diff --git a/library/hashes.yaml b/library/hashes.yaml index 3b0a4dcfb0..291e8ff735 100644 --- a/library/hashes.yaml +++ b/library/hashes.yaml @@ -1,2 +1,2 @@ 0.0.1: f074617a82a86d2a6cc78a4c8a4296fc9d168e456f12713e50c696557b302133 -2.1.12: 1c0685d2da774d59013f2c3842d2ae192f1913428e5b7bf5ad0d804f35643e8f +2.1.13: 19a001bec1a3bede7f6f55a757b4088b81e31e92a48e8e89d23d064b059a65d0 From 08b860b8e836ba707d909f854bd9bc1b5e1dd7cc Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Thu, 23 Jan 2025 19:36:00 +0200 Subject: [PATCH 2/4] empty space --- ix-dev/stable/nextcloud/templates/docker-compose.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/ix-dev/stable/nextcloud/templates/docker-compose.yaml b/ix-dev/stable/nextcloud/templates/docker-compose.yaml index 3b15aa25cc..40cd35e1fb 100644 --- a/ix-dev/stable/nextcloud/templates/docker-compose.yaml +++ b/ix-dev/stable/nextcloud/templates/docker-compose.yaml @@ -1,8 +1,6 @@ {% from "macros/nc.jinja.sh" import occ, hosts_update, trusted_domains_update %} {% from "macros/nc.jinja.conf" import opcache, php, limit_request_body, nginx_conf %} - - {% set tpl = ix_lib.base.render.Render(values) %} {% set nc_custom_image = namespace(x=[]) %} From ad698634fc2320330c9f3f120529891f12942a37 Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Thu, 23 Jan 2025 19:39:16 +0200 Subject: [PATCH 3/4] bump --- ix-dev/stable/nextcloud/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ix-dev/stable/nextcloud/app.yaml b/ix-dev/stable/nextcloud/app.yaml index c1ca4941cd..b85b6b4d57 100644 --- a/ix-dev/stable/nextcloud/app.yaml +++ b/ix-dev/stable/nextcloud/app.yaml @@ -66,4 +66,4 @@ sources: - https://github.com/truenas/charts/tree/master/charts/nextcloud title: Nextcloud train: stable -version: 1.5.14 +version: 1.5.15 From d0721ab4ca0430eeae059c4ff133d69d5a7ece14 Mon Sep 17 00:00:00 2001 From: Stavros Kois Date: Thu, 23 Jan 2025 19:43:50 +0200 Subject: [PATCH 4/4] reset test file --- .../templates/test_values/same-vol-values.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml b/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml index 633876fedb..9e0905d727 100644 --- a/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml +++ b/ix-dev/stable/nextcloud/templates/test_values/same-vol-values.yaml @@ -32,20 +32,18 @@ network: ix_volumes: postgres_data: /opt/tests/mnt/postgres_data - data: /opt/tests/mnt/data - html: /opt/tests/mnt/html storage: is_data_in_the_same_volume: true data: - type: ix_volume - ix_volume_config: - dataset_name: data + type: host_path + host_path_config: + path: /opt/tests/mnt/host_nc create_host_path: true html: - type: ix_volume - ix_volume_config: - dataset_name: html + type: host_path + host_path_config: + path: /opt/tests/mnt/host_nc create_host_path: true postgres_data: type: ix_volume