Update lib (#142)

* dont check if its empty on temp dirs

* add safety check

* fix the cleanup as well

* update lib

* update library

* adjust some test files

* fix tautulli
This commit is contained in:
Stavros Kois
2024-08-24 01:41:59 +03:00
committed by GitHub
parent 8b4e7faa63
commit 423caca958
259 changed files with 2861 additions and 1440 deletions

View File

@@ -11,7 +11,7 @@ keywords:
- finance
- budget
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -33,4 +33,4 @@ sources:
- https://hub.docker.com/r/actualbudget/actual-server
title: Actual Budget
train: community
version: 1.0.4
version: 1.0.5

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -19,7 +19,7 @@ keywords:
- dns
- adblock
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
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.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -10,7 +10,7 @@ keywords:
- media
- audiobook
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -33,4 +33,4 @@ sources:
- https://github.com/advplyr/audiobookshelf
title: Audiobookshelf
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -11,7 +11,7 @@ keywords:
- torrent
- usenet
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -31,4 +31,4 @@ sources:
- https://github.com/autobrr/autobrr
title: Autobrr
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -11,7 +11,7 @@ keywords:
- media
- subtitles
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -31,4 +31,4 @@ sources:
- https://github.com/morpheus65535/bazarr
title: Bazarr
train: community
version: 1.0.7
version: 1.0.8

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -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: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -35,4 +35,4 @@ sources:
- https://docs.briefkastenhq.com/
title: Briefkasten
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -1,34 +1,33 @@
app_version: 2.4.2
capabilities: []
categories:
- financial
description:
Chia is a modern cryptocurrency built from scratch, designed to be efficient,
- financial
description: Chia is a modern cryptocurrency built from scratch, designed to be efficient,
decentralized, and secure.
home: https://www.chia.net/
host_mounts: []
icon: https://media.sys.truenas.net/apps/chia/icons/icon.svg
keywords:
- blockchain
- hard-drive
- chia
- blockchain
- hard-drive
- chia
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
url: https://www.truenas.com/
- email: dev@ixsystems.com
name: truenas
url: https://www.truenas.com/
name: chia
run_as_context:
- description: Chia runs as root user.
gid: 0
group_name: root
uid: 0
user_name: root
- description: Chia runs as root user.
gid: 0
group_name: root
uid: 0
user_name: root
screenshots: []
sources:
- https://github.com/Chia-Network/chia-docker
- https://www.chia.net/
- https://github.com/Chia-Network/chia-docker
- https://www.chia.net/
title: Chia
train: community
version: 1.0.1
version: 1.0.2

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -20,7 +20,7 @@ keywords:
- anti-virus
- clamav
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -38,4 +38,4 @@ sources:
- https://www.clamav.net/
title: ClamAV
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -12,7 +12,7 @@ keywords:
- cloudflare
- tunnel
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
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.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -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: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -29,4 +29,4 @@ sources:
- https://github.com/lissy93/dashy
title: Dashy
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -10,7 +10,7 @@ keywords:
- ddns-updater
- ddns
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
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.6
version: 1.0.7

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -1,686 +0,0 @@
from base_v1_0_0 import utils
import json
valid_ip_dns_providers = [
"all",
"cloudflare",
"opendns",
]
valid_ip_http_providers = [
"all",
"custom",
"ipify",
"ifconfig",
"ipinfo",
"google",
"spdyn",
"ipleak",
"icanhazip",
"ident",
"nnev",
"wtfismyip",
"seeip",
"changeip",
]
valid_ipv4_http_providers = [
"all",
"ipleak",
"ipify",
"icanhazip",
"ident",
"nnev",
"wtfismyip",
"seeip",
]
valid_ipv6_http_providers = [
"all",
"ipleak",
"ipify",
"icanhazip",
"ident",
"nnev",
"wtfismyip",
"seeip",
]
valid_ip_fetchers = [
"all",
"http",
"dns",
]
valid_ip_versions = ["", "ipv4", "ipv6"]
def validate_public_ip_providers(items=[], valid=[], category="", allow_custom=False):
for item in items:
if not item.get("provider"):
utils.throw_error(f"Expected [provider] to be set for [{category}]")
if item["provider"] == "custom":
if not allow_custom:
utils.throw_error(f"Custom provider is not supported for [{category}]")
else:
if not item.get("custom"):
utils.throw_error(
f"Expected [custom] to be set when public ip provider is [custom] for [{category}]"
)
if not item["custom"].startswith("url:"):
utils.throw_error(
f"Expected [custom] to start with [url:] for [{category}]"
)
if item["provider"] == "all":
if len(items) > 1:
utils.throw_error(
f"Expected only 1 item in [{category}] with [provider] set to [all], got [{len(items)}]"
)
if item["provider"] not in valid:
utils.throw_error(
f"Expected [provider] to be one of [{', '.join(valid)}], got [{item['provider']}] for [{category}]"
)
def get_public_ip_providers(category: str, items=[]):
result = []
if category == "PUBLICIP_DNS_PROVIDERS":
validate_public_ip_providers(
items,
valid=valid_ip_dns_providers,
category="Public IP DNS Providers",
allow_custom=True,
)
elif category == "PUBLICIP_HTTP_PROVIDERS":
validate_public_ip_providers(
items,
valid=valid_ip_http_providers,
category="Public IP HTTP Providers",
allow_custom=True,
)
elif category == "PUBLICIPV4_HTTP_PROVIDERS":
validate_public_ip_providers(
items,
valid=valid_ipv4_http_providers,
category="Public IPv4 HTTP Providers",
allow_custom=True,
)
elif category == "PUBLICIPV6_HTTP_PROVIDERS":
validate_public_ip_providers(
items,
valid=valid_ipv6_http_providers,
category="Public IPv6 HTTP Providers",
allow_custom=True,
)
elif category == "PUBLICIP_FETCHERS":
validate_public_ip_providers(
items,
valid=valid_ip_fetchers,
category="Public IP Fetchers",
allow_custom=True,
)
for item in items:
if item["provider"] == "custom":
result.append(item["custom"])
else:
result.append(item["provider"])
return ",".join(result)
def get_providers_config(items=[]):
result = []
for item in items:
if item["provider"] not in providers_schema.keys():
utils.throw_error(
f"Expected [provider] to be one of [{', '.join(providers_schema.keys())}], got [{item['provider']}]"
)
if not item.get("host", ""):
utils.throw_error(
f"Expected [host] to be set for provider [{item['provider']}]"
)
if not item.get("domain", ""):
utils.throw_error(
f"Expected [domain] to be set for provider [{item['provider']}]"
)
if not item.get("ip_version", "") in valid_ip_versions:
utils.throw_error(
f"Expected [ip_version] to be one of [{', '.join(valid_ip_versions)}], got [{item['ip_version']}]"
)
result.append(
{
"provider": item["provider"],
"host": item["host"],
"domain": item["domain"],
"ip_version": item.get("ip_version", ""),
**get_provider_config(item),
}
)
return {"settings": result}
def required_key(item={}, key=""):
if not item.get(key):
utils.throw_error(f"Expected [{key}] to be set for [{item['provider']}]")
return item[key]
providers_schema = {
"aliyun": {
"required": [
{"provider_key": "access_key_id", "ui_key": "aliyun_access_key"},
{"provider_key": "access_secret", "ui_key": "aliyun_secret_key"},
],
"optional": [],
},
"allinkl": {
"required": [
{"provider_key": "username", "ui_key": "allinkl_username"},
{"provider_key": "password", "ui_key": "allinkl_password"},
],
"optional": [],
},
"cloudflare": {
"required": [
{"provider_key": "zone_identifier", "ui_key": "cloudflare_zone_id"},
{"provider_key": "ttl", "ui_key": "cloudflare_ttl"},
],
"optional": [{"provider_key": "proxied", "ui_key": "cloudflare_proxied"}],
"combos": [
{
"required": [{"provider_key": "token", "ui_key": "cloudflare_token"}],
"optional": [],
},
{
"required": [
{
"provider_key": "user_service_key",
"ui_key": "cloudflare_user_service_key",
}
],
"optional": [],
},
{
"required": [
{"provider_key": "email", "ui_key": "cloudflare_email"},
{"provider_key": "key", "ui_key": "cloudflare_api_key"},
],
"optional": [],
},
],
},
"dd24": {
"required": [{"provider_key": "password", "ui_key": "dd24_password"}],
"optional": [],
"combos": [],
},
"ddnss": {
"required": [
{"provider_key": "username", "ui_key": "ddnss_username"},
{"provider_key": "password", "ui_key": "ddnss_password"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "ddnss_provider_ip",
"default": False,
},
{
"provider_key": "dual_stack",
"ui_key": "ddnss_dual_stack",
"default": False,
},
],
},
"desec": {
"required": [{"provider_key": "token", "ui_key": "desec_token"}],
"optional": [],
"combos": [],
},
"digitalocean": {
"required": [{"provider_key": "token", "ui_key": "digital_ocean_token"}],
"optional": [],
"combos": [],
},
"dnsomatic": {
"required": [
{"provider_key": "username", "ui_key": "dnsomatic_username"},
{"provider_key": "password", "ui_key": "dnsomatic_password"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "dnsomatic_provider_ip",
"default": False,
}
],
},
"dnspod": {
"required": [{"provider_key": "token", "ui_key": "dnspod_token"}],
"optional": [],
"combos": [],
},
"dondominio": {
"required": [
{"provider_key": "username", "ui_key": "dondominio_username"},
{"provider_key": "password", "ui_key": "dondominio_password"},
{"provider_key": "name", "ui_key": "dondominio_name"},
],
"optional": [],
"combos": [],
},
"dreamhost": {
"required": [{"provider_key": "key", "ui_key": "dreamhost_key"}],
"optional": [],
"combos": [],
},
"duckdns": {
"required": [{"provider_key": "token", "ui_key": "duckdns_token"}],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "duckdns_provider_ip",
"default": False,
}
],
"combos": [],
},
"dyn": {
"required": [
{"provider_key": "client_key", "ui_key": "dyn_client_key"},
{"provider_key": "username", "ui_key": "dyn_username"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "dyn_provider_ip",
"default": False,
}
],
"combos": [],
},
"dynu": {
"required": [
{"provider_key": "username", "ui_key": "dynu_username"},
{"provider_key": "password", "ui_key": "dynu_password"},
],
"optional": [
{"provider_key": "group", "ui_key": "dynu_group"},
{
"provider_key": "provider_ip",
"ui_key": "dynu_provider_ip",
"default": False,
},
],
},
"dynv6": {
"required": [{"provider_key": "token", "ui_key": "dynv6_token"}],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "dynv6_provider_ip",
"default": False,
}
],
"combos": [],
},
"easydns": {
"required": [
{"provider_key": "username", "ui_key": "easydns_username"},
{"provider_key": "token", "ui_key": "easydns_token"},
],
"optional": [],
},
"freedns": {
"required": [{"provider_key": "token", "ui_key": "freedns_token"}],
"optional": [],
},
"gandi": {
"required": [
{"provider_key": "key", "ui_key": "gandi_key"},
{"provider_key": "ttl", "ui_key": "gandi_ttl"},
],
"optional": [],
"combos": [],
},
"gcp": {
"required": [
{"provider_key": "project", "ui_key": "gcp_project"},
{"provider_key": "zone", "ui_key": "gcp_zone"},
{
"provider_key": "credentials",
"ui_key": "gcp_credentials",
"func": lambda x: json.loads(x),
},
],
"optional": [],
},
"godaddy": {
"required": [
{"provider_key": "key", "ui_key": "godaddy_key"},
{"provider_key": "secret", "ui_key": "godaddy_secret"},
],
"optional": [],
"combos": [],
},
"goip": {
"required": [
{"provider_key": "username", "ui_key": "goip_username"},
{"provider_key": "password", "ui_key": "goip_password"},
],
"optional": [],
"combos": [],
},
"he": {
"required": [{"provider_key": "password", "ui_key": "he_password"}],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "he_provider_ip",
"default": False,
}
],
},
"hetzner": {
"required": [
{"provider_key": "token", "ui_key": "hetzner_token"},
{"provider_key": "zone_identifier", "ui_key": "hetzner_zone_identifier"},
],
"optional": [{"provider_key": "ttl", "ui_key": "hetzner_ttl"}],
},
"infomaniak": {
"required": [
{"provider_key": "username", "ui_key": "infomaniak_username"},
{"provider_key": "password", "ui_key": "infomaniak_password"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "infomaniak_provider_ip",
"default": False,
}
],
},
"inwx": {
"required": [
{"provider_key": "username", "ui_key": "inwx_username"},
{"provider_key": "password", "ui_key": "inwx_password"},
],
"optional": [],
},
"ionos": {
"required": [{"provider_key": "api_key", "ui_key": "ionos_api_key"}],
"optional": [],
},
"linode": {
"required": [{"provider_key": "token", "ui_key": "linode_token"}],
"optional": [],
},
"luadns": {
"required": [
{"provider_key": "token", "ui_key": "luadns_token"},
{"provider_key": "email", "ui_key": "luadns_email"},
],
"optional": [],
},
"namecheap": {
"required": [{"provider_key": "password", "ui_key": "namecheap_password"}],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "namecheap_provider_ip",
"default": False,
}
],
},
"name.com": {
"required": [
{"provider_key": "token", "ui_key": "namecom_token"},
{"provider_key": "username", "ui_key": "namecom_username"},
{"provider_key": "ttl", "ui_key": "namecom_ttl"},
],
"optional": [],
},
"netcup": {
"required": [
{"provider_key": "api_key", "ui_key": "netcup_api_key"},
{"provider_key": "password", "ui_key": "netcup_password"},
{"provider_key": "customer_number", "ui_key": "netcup_customer_number"},
],
"optional": [],
},
"njalla": {
"required": [{"provider_key": "key", "ui_key": "njalla_key"}],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "njalla_provider_ip",
"default": False,
}
],
},
"noip": {
"required": [
{"provider_key": "username", "ui_key": "noip_username"},
{"provider_key": "password", "ui_key": "noip_password"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "noip_provider_ip",
"default": False,
}
],
},
"nowdns": {
"required": [
{"provider_key": "username", "ui_key": "nowdns_username"},
{"provider_key": "password", "ui_key": "nowdns_password"},
],
"optional": [],
},
"opendns": {
"required": [
{"provider_key": "username", "ui_key": "opendns_username"},
{"provider_key": "password", "ui_key": "opendns_password"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "opendns_provider_ip",
"default": False,
}
],
},
"ovh": {
"required": [{"provider_key": "mode", "ui_key": "ovh_mode"}],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "ovh_provider_ip",
"default": False,
}
],
"combos": [
{
"required": [
{"provider_key": "username", "ui_key": "ovh_username"},
{"provider_key": "password", "ui_key": "ovh_password"},
],
"optional": [],
},
{
"required": [
{"provider_key": "api_endpoint", "ui_key": "ovh_api_endpoint"},
{"provider_key": "app_key", "ui_key": "ovh_app_key"},
{"provider_key": "app_secret", "ui_key": "ovh_app_secret"},
{"provider_key": "consumer_key", "ui_key": "ovh_consumer_key"},
],
"optional": [],
},
],
},
"porkbun": {
"required": [
{"provider_key": "api_key", "ui_key": "porkbun_api_key"},
{"provider_key": "secret_api_key", "ui_key": "porkbun_secret_api_key"},
],
"optional": [{"provider_key": "ttl", "ui_key": "porkbun_ttl"}],
},
"selfhost.de": {
"required": [
{"provider_key": "username", "ui_key": "selfhostde_username"},
{"provider_key": "password", "ui_key": "selfhostde_password"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "selfhostde_provider_ip",
"default": False,
}
],
},
"servercow": {
"required": [
{"provider_key": "username", "ui_key": "servercow_username"},
{"provider_key": "password", "ui_key": "servercow_password"},
{"provider_key": "ttl", "ui_key": "servercow_ttl"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "servercow_provider_ip",
"default": False,
}
],
},
"spdyn": {
"required": [],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "spdyn_provider_ip",
"default": False,
}
],
"combos": [
{
"required": [{"provider_key": "token", "ui_key": "spdyn_token"}],
"optional": [],
},
{
"required": [
{"provider_key": "user", "ui_key": "spdyn_username"},
{"provider_key": "password", "ui_key": "spdyn_password"},
],
"optional": [],
},
],
},
"strato": {
"required": [{"provider_key": "password", "ui_key": "strato_password"}],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "strato_provider_ip",
"default": False,
}
],
},
"variomedia": {
"required": [
{"provider_key": "password", "ui_key": "variomedia_password"},
{"provider_key": "email", "ui_key": "variomedia_email"},
],
"optional": [
{
"provider_key": "provider_ip",
"ui_key": "variomedia_provider_ip",
"default": False,
}
],
},
"zoneedit": {
"required": [
{"provider_key": "username", "ui_key": "zoneedit_username"},
{"provider_key": "token", "ui_key": "zoneedit_token"},
],
"optional": [],
},
}
def get_provider_config(item={}):
if item["provider"] not in providers_schema:
utils.throw_error(
f"Expected [provider] to be one of [{', '.join(providers_schema.keys())}], got [{item['provider']}]"
)
result = {}
provider_data = providers_schema[item["provider"]]
for required in provider_data["required"]:
if required.get("func"):
result[required["provider_key"]] = required["func"](
required_key(item, required["ui_key"])
)
else:
result[required["provider_key"]] = required_key(item, required["ui_key"])
result.update(get_optional_data(item, provider_data))
combo_data = {}
for combo in provider_data.get("combos", []):
if combo_data:
break
combo_data = get_combo_data(item, combo)
# Go to next combo
if not combo_data:
continue
result.update(combo_data)
result.update(get_optional_data(item, combo))
if not combo_data and provider_data.get("combos", []):
utils.throw_error(
f"Expected provider [{item['provider']}] to have at least one of the following combinations: "
+ f"{', '.join(get_combos_printout(provider_data['combos']))}"
)
return result
def get_combo_data(item={}, combo={}):
result = {}
for required in combo["required"]:
if required["ui_key"] not in item:
return {}
if required.get("func"):
result[required["provider_key"]] = required["func"](
required_key(item, required["ui_key"])
)
else:
result[required["provider_key"]] = required_key(item, required["ui_key"])
return result
def get_optional_data(item={}, data={}):
result = {}
for optional in data["optional"]:
if optional["ui_key"] in item:
if optional.get("func"):
result[optional["provider_key"]] = optional["func"](
item[optional["ui_key"]]
)
else:
result[optional["provider_key"]] = item[optional["ui_key"]]
elif optional.get("default") is not None:
result[optional["provider_key"]] = optional["default"]
return result
def get_combos_printout(combos=[]):
result = []
for combo in combos:
result.append(f"[{', '.join([r['key'] for r in combo['required']])}]")

View File

@@ -20,7 +20,7 @@ keywords:
- torrent
- download
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -38,4 +38,4 @@ sources:
- https://deluge-torrent.org/
title: Deluge
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -11,7 +11,7 @@ keywords:
- registry
- container
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -30,4 +30,4 @@ sources:
- https://github.com/distribution/distribution
title: Distribution
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -29,7 +29,7 @@ keywords:
- docker
- compose
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -48,4 +48,4 @@ sources:
- https://github.com/louislam/dockge
title: Dockge
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -10,7 +10,7 @@ keywords:
- diagram
- whiteboard
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
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.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -11,7 +11,7 @@ keywords:
- files
- browser
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
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.5
version: 1.0.6

View File

@@ -6,8 +6,8 @@ images:
consts:
data_path: /data
config_path: /config
ssl_cert_path: /config/certs/tls.crt
ssl_key_path: /config/certs/tls.key
ssl_cert_path: /certs/tls.crt
ssl_key_path: /certs/tls.key
filebrowser_container_name: filebrowser
init_container_name: init
perms_container_name: permissions

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -20,7 +20,7 @@ icon: https://media.sys.truenas.net/apps/firefly-iii/icons/icon.png
keywords:
- finance
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -57,4 +57,4 @@ sources:
- https://github.com/firefly-iii/firefly-iii
title: Firefly III
train: community
version: 1.0.2
version: 1.0.3

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -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: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -34,4 +34,4 @@ sources:
- https://github.com/pawelmalak/flame
title: Flame
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -16,7 +16,7 @@ keywords:
- rss
- news
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -41,4 +41,4 @@ sources:
- https://hub.docker.com/r/freshrss/freshrss
title: FreshRSS
train: community
version: 1.0.3
version: 1.0.4

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -11,7 +11,7 @@ keywords:
- index
- crawler
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -30,4 +30,4 @@ sources:
- https://fscrawler.readthedocs.io/
title: FSCrawler
train: community
version: 1.0.4
version: 1.0.5

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -13,7 +13,7 @@ keywords:
- metrics
- dashboards
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -34,4 +34,4 @@ sources:
- https://github.com/grafana
title: Grafana
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -29,7 +29,7 @@ keywords:
- video
- transcoder
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
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.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -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: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -31,4 +31,4 @@ sources:
- https://github.com/ajnart/homarr
title: Homarr
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -15,11 +15,18 @@ run_as:
user: 568
group: 568
ix_volumes:
homarr-configs: /mnt/pool/sonarr-config
ix_context:
dev_mode: true
storage:
configs:
type: volume
auto_permissions: true
type: ix_volume
volume_name: homarr-configs
ix_volume_config:
dataset_name: homarr-configs
data:
type: volume
auto_permissions: true

View File

@@ -17,11 +17,18 @@ run_as:
user: 568
group: 568
ix_volumes:
homarr-configs: /mnt/pool/sonarr-config
ix_context:
dev_mode: true
storage:
configs:
type: volume
auto_permissions: true
type: ix_volume
volume_name: homarr-configs
ix_volume_config:
dataset_name: homarr-configs
data:
type: volume
auto_permissions: true

View File

@@ -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: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -33,4 +33,4 @@ sources:
- https://github.com/benphelps/homepage
title: Homepage
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -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: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -30,4 +30,4 @@ tags:
- homepage
title: Homer
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -14,11 +14,18 @@ run_as:
user: 568
group: 568
ix_volumes:
homer-assets: /mnt/pool/homer-assets
ix_context:
dev_mode: true
storage:
assets:
type: volume
auto_permissions: true
type: ix_volume
volume_name: homer-assets
ix_volume_config:
dataset_name: homer-assets
additional_storage:
- type: anonymous
mount_path: /scratchpad

View File

@@ -14,11 +14,18 @@ run_as:
user: 568
group: 568
ix_volumes:
homer-assets: /mnt/pool/homer-assets
ix_context:
dev_mode: true
storage:
assets:
type: volume
auto_permissions: true
type: ix_volume
volume_name: homer-assets
ix_volume_config:
dataset_name: homer-assets
additional_storage:
- type: anonymous
mount_path: /scratchpad

View File

@@ -17,7 +17,7 @@ keywords:
- photos
- backup
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -45,4 +45,4 @@ sources:
- https://github.com/immich-app/immich
title: Immich
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -13,7 +13,7 @@ keywords:
- file-sharing
- kubo
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -33,4 +33,4 @@ sources:
- https://ipfs.tech/
title: IPFS
train: community
version: 1.0.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -15,7 +15,7 @@ keywords:
- media
- streaming
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -35,4 +35,4 @@ sources:
- https://jellyfin.org/
title: Jellyfin
train: community
version: 1.0.10
version: 1.0.11

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -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: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
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.5
version: 1.0.6

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

View File

@@ -37,7 +37,7 @@ def vol_mount(data, values=None):
"read_only": data.get("read_only", False),
}
if vol_type == "bind": # Default create_host_path is true in short-syntax
volume.update(_get_bind_vol_config(data, ix_volumes))
volume.update(_get_bind_vol_config(data, values, ix_volumes))
elif vol_type == "volume":
volume.update(_get_volume_vol_config(data))
elif vol_type == "tmpfs":
@@ -67,15 +67,14 @@ def storage_item(data, values=None, perm_opts=None):
def perms_item(data, values=None, opts=None):
opts = opts or {}
values = values or {}
ix_context = values.get("ix_context") or {}
vol_type = data.get("type", "")
# Temp volumes are always auto permissions
if vol_type == "temporary":
data.update({"auto_permissions": True})
# If its ix_volume and we are installing, we need to set auto permissions
if vol_type == "ix_volume" and ix_context.get("is_install", False):
# If its ix_volume, we need to set auto permissions
if vol_type == "ix_volume":
data.update({"auto_permissions": True})
if not data.get("auto_permissions"):
@@ -109,7 +108,23 @@ def perms_item(data, values=None, opts=None):
}
def _get_bind_vol_config(data, ix_volumes=None):
def create_host_path_default(values):
"""
By default, do not create host path for bind mounts if it does not exist.
If the ix_context is missing, we are either in local dev or CI.
We should create the host path by default there to ease development.
The _magic_ "dev_mode" flag is added so we can also toggle this behavior
in CI, while we are also using ix_context for other tests.
"""
ix_ctx = values.get("ix_context", {})
if not ix_ctx:
return True
if "dev_mode" in ix_ctx:
return ix_ctx["dev_mode"]
return False
def _get_bind_vol_config(data, values, ix_volumes=None):
ix_volumes = ix_volumes or []
path = host_path(data, ix_volumes)
if data.get("propagation", "rprivate") not in PROPAGATION_TYPES:
@@ -122,7 +137,7 @@ def _get_bind_vol_config(data, ix_volumes=None):
"source": path,
"bind": {
"create_host_path": data.get("host_path_config", {}).get(
"create_host_path", True
"create_host_path", create_host_path_default(values)
),
"propagation": _get_valid_propagation(data),
},

View File

@@ -15,11 +15,18 @@ run_as:
user: 568
group: 568
ix_volumes:
jellyseer-configs: /mnt/pool/jellyseer-configs
ix_context:
dev_mode: true
storage:
config:
type: volume
auto_permissions: true
volume_name: jellyseerr-config
type: ix_volume
volume_name: jellyseer-configs
ix_volume_config:
dataset_name: jellyseer-configs
additional_storage:
- type: anonymous
mount_path: /scratchpad

View File

@@ -10,7 +10,7 @@ keywords:
- automation
- ci/cd
lib_version: 1.0.0
lib_version_hash: 05f656cd1f0f034c1e239ca58f5f235eddd6e8676f54435b975dc4b0d3a9f974
lib_version_hash: 66ead85a4b23fec4388da34e481b2041aa26171deaa90b5229f112a7ec519f2b
maintainers:
- email: dev@ixsystems.com
name: truenas
@@ -31,4 +31,4 @@ sources:
- https://www.jenkins.io/
title: Jenkins
train: community
version: 1.0.0
version: 1.0.1

View File

@@ -11,7 +11,7 @@ consts:
run_as_group: 1000
keystore_path: /var/jenkins_home/ix-keystore
keystore_name: keystore.jks
temp_certs_path: /tmp/ix-certs
temp_certs_path: /tmp/ix-safe/ix-certs
key_name: ix.key
crt_name: ix.crt
notes_body: |

View File

@@ -57,8 +57,6 @@
{% do ix_lib.base.utils.throw_error("Expected [jenkins.additional_opts] to not contain duplicate keys [%s]"|format(user_opts.items|join(", "))) %}
{% endif %}
{# TODO: cert container #}
{% set restricted_java_opts = ["jenkins.model.Jenkins.slaveAgentPortEnforce", "jenkins.model.Jenkins.slaveAgentPort"] %}
{% set user_java_opts = namespace(items=[]) %}
{% for jopt in values.jenkins.additional_java_opts %}
@@ -106,7 +104,7 @@ services:
entrypoint: "/bin/sh"
healthcheck:
disable: true
{% if values.network.certificate_id %}
{% if perms_dirs.items %}
depends_on:
{{ values.consts.perms_container_name }}:
condition: service_completed_successfully

View File

@@ -68,6 +68,11 @@ function process_dir() {
local fix_owner="false"
local fix_perms="false"
if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
fi
if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
@@ -75,7 +80,13 @@ function process_dir() {
if [ "$$is_temporary" = "true" ]; then
echo "Path [$$dir] is a temporary directory, ensuring it is empty..."
rm -rf "$$dir/{*,.*}"
# Exclude the safe directory, where we can use to mount files temporarily
find "$$dir" -mindepth 1 -maxdepth 1 ! -name "ix-safe" -exec rm -rf {} +
fi
if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
fi
echo "Current Ownership and Permissions on [$$dir]:"

Some files were not shown because too many files have changed in this diff Show More