mirror of
https://github.com/MAGICGrants/truenas-apps.git
synced 2026-01-09 20:47:58 -05:00
bump library (#515)
This commit is contained in:
@@ -10,8 +10,8 @@ icon: https://media.sys.truenas.net/apps/actual-budget/icons/icon.png
|
||||
keywords:
|
||||
- finance
|
||||
- budget
|
||||
lib_version: 1.1.1
|
||||
lib_version_hash: 607cf1a2041e87acb12d5c9b9eb447f22ad77f63666e8a7e3ea034da2c124076
|
||||
lib_version: 1.1.2
|
||||
lib_version_hash: 3bf14311f7547731c94dbd4059f7aca95272210409631acbc5603a06223921e4
|
||||
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.1.7
|
||||
version: 1.1.8
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=10, retries=5, start_period=30):
|
||||
def check_health(test, interval=10, timeout=5, retries=30, start_period=10):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
@@ -18,8 +18,8 @@ icon: https://media.sys.truenas.net/apps/adguard-home/icons/icon.svg
|
||||
keywords:
|
||||
- dns
|
||||
- adblock
|
||||
lib_version: 1.1.1
|
||||
lib_version_hash: 607cf1a2041e87acb12d5c9b9eb447f22ad77f63666e8a7e3ea034da2c124076
|
||||
lib_version: 1.1.2
|
||||
lib_version_hash: 3bf14311f7547731c94dbd4059f7aca95272210409631acbc5603a06223921e4
|
||||
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.15
|
||||
version: 1.0.16
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=10, retries=5, start_period=30):
|
||||
def check_health(test, interval=10, timeout=5, retries=30, start_period=10):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
@@ -9,8 +9,8 @@ icon: https://media.sys.truenas.net/apps/audiobookshelf/icons/icon.svg
|
||||
keywords:
|
||||
- media
|
||||
- audiobook
|
||||
lib_version: 1.1.1
|
||||
lib_version_hash: 607cf1a2041e87acb12d5c9b9eb447f22ad77f63666e8a7e3ea034da2c124076
|
||||
lib_version: 1.1.2
|
||||
lib_version_hash: 3bf14311f7547731c94dbd4059f7aca95272210409631acbc5603a06223921e4
|
||||
maintainers:
|
||||
- email: dev@ixsystems.com
|
||||
name: truenas
|
||||
@@ -33,4 +33,4 @@ sources:
|
||||
- https://github.com/advplyr/audiobookshelf
|
||||
title: Audiobookshelf
|
||||
train: community
|
||||
version: 1.2.8
|
||||
version: 1.2.9
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=10, retries=5, start_period=30):
|
||||
def check_health(test, interval=10, timeout=5, retries=30, start_period=10):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
@@ -10,8 +10,8 @@ keywords:
|
||||
- media
|
||||
- torrent
|
||||
- usenet
|
||||
lib_version: 1.1.1
|
||||
lib_version_hash: 607cf1a2041e87acb12d5c9b9eb447f22ad77f63666e8a7e3ea034da2c124076
|
||||
lib_version: 1.1.2
|
||||
lib_version_hash: 3bf14311f7547731c94dbd4059f7aca95272210409631acbc5603a06223921e4
|
||||
maintainers:
|
||||
- email: dev@ixsystems.com
|
||||
name: truenas
|
||||
@@ -31,4 +31,4 @@ sources:
|
||||
- https://github.com/autobrr/autobrr
|
||||
title: Autobrr
|
||||
train: community
|
||||
version: 1.1.8
|
||||
version: 1.1.9
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=10, retries=5, start_period=30):
|
||||
def check_health(test, interval=10, timeout=5, retries=30, start_period=10):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
@@ -10,8 +10,8 @@ icon: https://media.sys.truenas.net/apps/bazarr/icons/icon.png
|
||||
keywords:
|
||||
- media
|
||||
- subtitles
|
||||
lib_version: 1.1.1
|
||||
lib_version_hash: 607cf1a2041e87acb12d5c9b9eb447f22ad77f63666e8a7e3ea034da2c124076
|
||||
lib_version: 1.1.2
|
||||
lib_version_hash: 3bf14311f7547731c94dbd4059f7aca95272210409631acbc5603a06223921e4
|
||||
maintainers:
|
||||
- email: dev@ixsystems.com
|
||||
name: truenas
|
||||
@@ -31,4 +31,4 @@ sources:
|
||||
- https://github.com/morpheus65535/bazarr
|
||||
title: Bazarr
|
||||
train: community
|
||||
version: 1.0.16
|
||||
version: 1.0.17
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=10, retries=5, start_period=30):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
return {
|
||||
"test": test,
|
||||
"interval": f"{interval}s",
|
||||
"timeout": f"{timeout}s",
|
||||
"retries": retries,
|
||||
"start_period": f"{start_period}s",
|
||||
}
|
||||
|
||||
|
||||
def mariadb_test(db, config=None):
|
||||
config = config or {}
|
||||
if not db:
|
||||
utils.throw_error("MariaDB container: [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 3306)
|
||||
|
||||
return f"mariadb-admin --user=root --host={host} --port={port} --password=$$MARIADB_ROOT_PASSWORD ping"
|
||||
|
||||
|
||||
def pg_test(user, db, config=None):
|
||||
config = config or {}
|
||||
if not user or not db:
|
||||
utils.throw_error("Postgres container: [user] and [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 5432)
|
||||
|
||||
return f"pg_isready -h {host} -p {port} -d {db} -U {user}"
|
||||
|
||||
|
||||
def redis_test(config=None):
|
||||
config = config or {}
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 6379)
|
||||
password = "$$REDIS_PASSWORD"
|
||||
|
||||
return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG"
|
||||
|
||||
|
||||
def curl_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--insecure")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"curl --silent --output /dev/null --show-error --fail {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def wget_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--no-check-certificate")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"wget --spider --quiet {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def http_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return (
|
||||
f"/bin/bash -c 'exec {{health_check_fd}}<>/dev/tcp/{host}/{port} && echo -e \"GET {path} HTTP/1.1\\r\\nHost: "
|
||||
+ f"{host}\\r\\nConnection: close\\r\\n\\r\\n\" >&$${{health_check_fd}} && cat <&$${{health_check_fd}}'"
|
||||
)
|
||||
|
||||
|
||||
def netcat_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"nc -z -w 1 {host} {port}"
|
||||
|
||||
|
||||
def tcp_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"timeout 1 bash -c 'cat < /dev/null > /dev/tcp/{host}/{port}'"
|
||||
@@ -0,0 +1,121 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=5, retries=30, start_period=10):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
return {
|
||||
"test": test,
|
||||
"interval": f"{interval}s",
|
||||
"timeout": f"{timeout}s",
|
||||
"retries": retries,
|
||||
"start_period": f"{start_period}s",
|
||||
}
|
||||
|
||||
|
||||
def mariadb_test(db, config=None):
|
||||
config = config or {}
|
||||
if not db:
|
||||
utils.throw_error("MariaDB container: [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 3306)
|
||||
|
||||
return f"mariadb-admin --user=root --host={host} --port={port} --password=$$MARIADB_ROOT_PASSWORD ping"
|
||||
|
||||
|
||||
def pg_test(user, db, config=None):
|
||||
config = config or {}
|
||||
if not user or not db:
|
||||
utils.throw_error("Postgres container: [user] and [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 5432)
|
||||
|
||||
return f"pg_isready -h {host} -p {port} -d {db} -U {user}"
|
||||
|
||||
|
||||
def redis_test(config=None):
|
||||
config = config or {}
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 6379)
|
||||
password = "$$REDIS_PASSWORD"
|
||||
|
||||
return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG"
|
||||
|
||||
|
||||
def curl_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--insecure")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"curl --silent --output /dev/null --show-error --fail {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def wget_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--no-check-certificate")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"wget --spider --quiet {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def http_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return (
|
||||
f"/bin/bash -c 'exec {{health_check_fd}}<>/dev/tcp/{host}/{port} && echo -e \"GET {path} HTTP/1.1\\r\\nHost: "
|
||||
+ f"{host}\\r\\nConnection: close\\r\\n\\r\\n\" >&$${{health_check_fd}} && cat <&$${{health_check_fd}}'"
|
||||
)
|
||||
|
||||
|
||||
def netcat_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"nc -z -w 1 {host} {port}"
|
||||
|
||||
|
||||
def tcp_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"timeout 1 bash -c 'cat < /dev/null > /dev/tcp/{host}/{port}'"
|
||||
@@ -8,8 +8,8 @@ host_mounts: []
|
||||
icon: https://media.sys.truenas.net/apps/briefkasten/icons/icon.svg
|
||||
keywords:
|
||||
- bookmark
|
||||
lib_version: 1.1.1
|
||||
lib_version_hash: 607cf1a2041e87acb12d5c9b9eb447f22ad77f63666e8a7e3ea034da2c124076
|
||||
lib_version: 1.1.2
|
||||
lib_version_hash: 3bf14311f7547731c94dbd4059f7aca95272210409631acbc5603a06223921e4
|
||||
maintainers:
|
||||
- email: dev@ixsystems.com
|
||||
name: truenas
|
||||
@@ -35,4 +35,4 @@ sources:
|
||||
- https://docs.briefkastenhq.com/
|
||||
title: Briefkasten
|
||||
train: community
|
||||
version: 1.0.15
|
||||
version: 1.0.16
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=10, retries=5, start_period=30):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
return {
|
||||
"test": test,
|
||||
"interval": f"{interval}s",
|
||||
"timeout": f"{timeout}s",
|
||||
"retries": retries,
|
||||
"start_period": f"{start_period}s",
|
||||
}
|
||||
|
||||
|
||||
def mariadb_test(db, config=None):
|
||||
config = config or {}
|
||||
if not db:
|
||||
utils.throw_error("MariaDB container: [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 3306)
|
||||
|
||||
return f"mariadb-admin --user=root --host={host} --port={port} --password=$$MARIADB_ROOT_PASSWORD ping"
|
||||
|
||||
|
||||
def pg_test(user, db, config=None):
|
||||
config = config or {}
|
||||
if not user or not db:
|
||||
utils.throw_error("Postgres container: [user] and [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 5432)
|
||||
|
||||
return f"pg_isready -h {host} -p {port} -d {db} -U {user}"
|
||||
|
||||
|
||||
def redis_test(config=None):
|
||||
config = config or {}
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 6379)
|
||||
password = "$$REDIS_PASSWORD"
|
||||
|
||||
return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG"
|
||||
|
||||
|
||||
def curl_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--insecure")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"curl --silent --output /dev/null --show-error --fail {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def wget_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--no-check-certificate")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"wget --spider --quiet {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def http_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return (
|
||||
f"/bin/bash -c 'exec {{health_check_fd}}<>/dev/tcp/{host}/{port} && echo -e \"GET {path} HTTP/1.1\\r\\nHost: "
|
||||
+ f"{host}\\r\\nConnection: close\\r\\n\\r\\n\" >&$${{health_check_fd}} && cat <&$${{health_check_fd}}'"
|
||||
)
|
||||
|
||||
|
||||
def netcat_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"nc -z -w 1 {host} {port}"
|
||||
|
||||
|
||||
def tcp_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"timeout 1 bash -c 'cat < /dev/null > /dev/tcp/{host}/{port}'"
|
||||
@@ -0,0 +1,121 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=5, retries=30, start_period=10):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
return {
|
||||
"test": test,
|
||||
"interval": f"{interval}s",
|
||||
"timeout": f"{timeout}s",
|
||||
"retries": retries,
|
||||
"start_period": f"{start_period}s",
|
||||
}
|
||||
|
||||
|
||||
def mariadb_test(db, config=None):
|
||||
config = config or {}
|
||||
if not db:
|
||||
utils.throw_error("MariaDB container: [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 3306)
|
||||
|
||||
return f"mariadb-admin --user=root --host={host} --port={port} --password=$$MARIADB_ROOT_PASSWORD ping"
|
||||
|
||||
|
||||
def pg_test(user, db, config=None):
|
||||
config = config or {}
|
||||
if not user or not db:
|
||||
utils.throw_error("Postgres container: [user] and [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 5432)
|
||||
|
||||
return f"pg_isready -h {host} -p {port} -d {db} -U {user}"
|
||||
|
||||
|
||||
def redis_test(config=None):
|
||||
config = config or {}
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 6379)
|
||||
password = "$$REDIS_PASSWORD"
|
||||
|
||||
return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG"
|
||||
|
||||
|
||||
def curl_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--insecure")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"curl --silent --output /dev/null --show-error --fail {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def wget_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--no-check-certificate")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"wget --spider --quiet {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def http_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return (
|
||||
f"/bin/bash -c 'exec {{health_check_fd}}<>/dev/tcp/{host}/{port} && echo -e \"GET {path} HTTP/1.1\\r\\nHost: "
|
||||
+ f"{host}\\r\\nConnection: close\\r\\n\\r\\n\" >&$${{health_check_fd}} && cat <&$${{health_check_fd}}'"
|
||||
)
|
||||
|
||||
|
||||
def netcat_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"nc -z -w 1 {host} {port}"
|
||||
|
||||
|
||||
def tcp_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"timeout 1 bash -c 'cat < /dev/null > /dev/tcp/{host}/{port}'"
|
||||
@@ -19,8 +19,8 @@ host_mounts: []
|
||||
icon: https://media.sys.truenas.net/apps/castopod/icons/icon.svg
|
||||
keywords:
|
||||
- podcast
|
||||
lib_version: 1.1.1
|
||||
lib_version_hash: 607cf1a2041e87acb12d5c9b9eb447f22ad77f63666e8a7e3ea034da2c124076
|
||||
lib_version: 1.1.2
|
||||
lib_version_hash: 3bf14311f7547731c94dbd4059f7aca95272210409631acbc5603a06223921e4
|
||||
maintainers:
|
||||
- email: dev@ixsystems.com
|
||||
name: truenas
|
||||
@@ -49,4 +49,4 @@ sources:
|
||||
- https://code.castopod.org/adaures/castopod
|
||||
title: Castopod
|
||||
train: community
|
||||
version: 1.0.2
|
||||
version: 1.0.3
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=10, retries=5, start_period=30):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
return {
|
||||
"test": test,
|
||||
"interval": f"{interval}s",
|
||||
"timeout": f"{timeout}s",
|
||||
"retries": retries,
|
||||
"start_period": f"{start_period}s",
|
||||
}
|
||||
|
||||
|
||||
def mariadb_test(db, config=None):
|
||||
config = config or {}
|
||||
if not db:
|
||||
utils.throw_error("MariaDB container: [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 3306)
|
||||
|
||||
return f"mariadb-admin --user=root --host={host} --port={port} --password=$$MARIADB_ROOT_PASSWORD ping"
|
||||
|
||||
|
||||
def pg_test(user, db, config=None):
|
||||
config = config or {}
|
||||
if not user or not db:
|
||||
utils.throw_error("Postgres container: [user] and [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 5432)
|
||||
|
||||
return f"pg_isready -h {host} -p {port} -d {db} -U {user}"
|
||||
|
||||
|
||||
def redis_test(config=None):
|
||||
config = config or {}
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 6379)
|
||||
password = "$$REDIS_PASSWORD"
|
||||
|
||||
return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG"
|
||||
|
||||
|
||||
def curl_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--insecure")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"curl --silent --output /dev/null --show-error --fail {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def wget_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--no-check-certificate")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"wget --spider --quiet {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def http_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return (
|
||||
f"/bin/bash -c 'exec {{health_check_fd}}<>/dev/tcp/{host}/{port} && echo -e \"GET {path} HTTP/1.1\\r\\nHost: "
|
||||
+ f"{host}\\r\\nConnection: close\\r\\n\\r\\n\" >&$${{health_check_fd}} && cat <&$${{health_check_fd}}'"
|
||||
)
|
||||
|
||||
|
||||
def netcat_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"nc -z -w 1 {host} {port}"
|
||||
|
||||
|
||||
def tcp_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"timeout 1 bash -c 'cat < /dev/null > /dev/tcp/{host}/{port}'"
|
||||
@@ -0,0 +1,121 @@
|
||||
from . import utils
|
||||
|
||||
|
||||
def check_health(test, interval=10, timeout=5, retries=30, start_period=10):
|
||||
if not test:
|
||||
utils.throw_error("Expected [test] to be set")
|
||||
|
||||
return {
|
||||
"test": test,
|
||||
"interval": f"{interval}s",
|
||||
"timeout": f"{timeout}s",
|
||||
"retries": retries,
|
||||
"start_period": f"{start_period}s",
|
||||
}
|
||||
|
||||
|
||||
def mariadb_test(db, config=None):
|
||||
config = config or {}
|
||||
if not db:
|
||||
utils.throw_error("MariaDB container: [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 3306)
|
||||
|
||||
return f"mariadb-admin --user=root --host={host} --port={port} --password=$$MARIADB_ROOT_PASSWORD ping"
|
||||
|
||||
|
||||
def pg_test(user, db, config=None):
|
||||
config = config or {}
|
||||
if not user or not db:
|
||||
utils.throw_error("Postgres container: [user] and [db] must be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 5432)
|
||||
|
||||
return f"pg_isready -h {host} -p {port} -d {db} -U {user}"
|
||||
|
||||
|
||||
def redis_test(config=None):
|
||||
config = config or {}
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
port = config.get("port", 6379)
|
||||
password = "$$REDIS_PASSWORD"
|
||||
|
||||
return f"redis-cli -h {host} -p {port} -a {password} ping | grep -q PONG"
|
||||
|
||||
|
||||
def curl_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--insecure")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"curl --silent --output /dev/null --show-error --fail {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def wget_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
scheme = config.get("scheme", "http")
|
||||
host = config.get("host", "127.0.0.1")
|
||||
headers = config.get("headers", [])
|
||||
|
||||
opts = []
|
||||
if scheme == "https":
|
||||
opts.append("--no-check-certificate")
|
||||
|
||||
for header in headers:
|
||||
if not header[0] or not header[1]:
|
||||
utils.throw_error("Expected [header] to be a list of two items")
|
||||
opts.append(f'--header "{header[0]}: {header[1]}"')
|
||||
|
||||
return f"wget --spider --quiet {' '.join(opts)} {scheme}://{host}:{port}{path}"
|
||||
|
||||
|
||||
def http_test(port, path, config=None):
|
||||
config = config or {}
|
||||
if not port or not path:
|
||||
utils.throw_error("Expected [port] and [path] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return (
|
||||
f"/bin/bash -c 'exec {{health_check_fd}}<>/dev/tcp/{host}/{port} && echo -e \"GET {path} HTTP/1.1\\r\\nHost: "
|
||||
+ f"{host}\\r\\nConnection: close\\r\\n\\r\\n\" >&$${{health_check_fd}} && cat <&$${{health_check_fd}}'"
|
||||
)
|
||||
|
||||
|
||||
def netcat_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"nc -z -w 1 {host} {port}"
|
||||
|
||||
|
||||
def tcp_test(port, config=None):
|
||||
config = config or {}
|
||||
if not port:
|
||||
utils.throw_error("Expected [port] to be set")
|
||||
|
||||
host = config.get("host", "127.0.0.1")
|
||||
|
||||
return f"timeout 1 bash -c 'cat < /dev/null > /dev/tcp/{host}/{port}'"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user