Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

library: fix healthcheck #662

Merged
merged 14 commits into from
Oct 16, 2024
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions ix-dev/community/actual-budget/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ icon: https://media.sys.truenas.net/apps/actual-budget/icons/icon.png
keywords:
- finance
- budget
lib_version: 1.1.3
lib_version_hash: 2aa61e120fd30dd72800bea5d56ad12793d4a6b74cf69140780d51add22c7768
lib_version: 1.1.4
lib_version_hash: 6e32ff5969906d9c3a10fea2b17fdd3197afb052d3432344da03188d8a907113
maintainers:
- email: [email protected]
name: truenas
Expand All @@ -33,4 +33,4 @@ sources:
- https://hub.docker.com/r/actualbudget/actual-server
title: Actual Budget
train: community
version: 1.1.12
version: 1.1.13
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ services:
{% if values.network.dns_opts %}
dns_opt: {{ ix_lib.base.network.dns_opts(values.network.dns_opts) | tojson }}
{% endif %}
{% set test = ix_lib.base.healthchecks.http_test(path="/health", port=values.network.web_port) %}
{% set test = "NODE_TLS_REJECT_UNAUTHORIZED=0 npm run health-check" %}
healthcheck: {{ ix_lib.base.healthchecks.check_health(test) | tojson }}
{% set app_env = {
"ACTUAL_PORT": values.network.web_port,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ def http_test(port, path, config=None):

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}}'"
)
return f"""
/bin/bash -c 'exec {{hc_fd}}<>/dev/tcp/{host}/{port} && echo -e "GET {path} HTTP/1.1\\r\\nHost: {host}\\r\\nConnection: close\\r\\n\\r\\n" >&$${{hc_fd}} && cat <&$${{hc_fd}} | grep "HTTP/1.1 200"'
""" # noqa


def netcat_test(port, config=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def process_dir_shell_func():

if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
return 0
fi

if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
return 0
fi

if [ "$$is_temporary" = "true" ]; then
Expand All @@ -86,7 +86,7 @@ def process_dir_shell_func():

if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
return 0
fi

echo "Current Ownership and Permissions on [$$dir]:"
Expand Down
6 changes: 3 additions & 3 deletions ix-dev/community/adguard-home/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ icon: https://media.sys.truenas.net/apps/adguard-home/icons/icon.svg
keywords:
- dns
- adblock
lib_version: 1.1.3
lib_version_hash: 2aa61e120fd30dd72800bea5d56ad12793d4a6b74cf69140780d51add22c7768
lib_version: 1.1.4
lib_version_hash: 6e32ff5969906d9c3a10fea2b17fdd3197afb052d3432344da03188d8a907113
maintainers:
- email: [email protected]
name: truenas
Expand All @@ -40,4 +40,4 @@ sources:
- https://hub.docker.com/r/adguard/adguardhome
title: AdGuard Home
train: community
version: 1.0.21
version: 1.0.22
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
{% if values.network.dns_opts %}
dns_opt: {{ ix_lib.base.network.dns_opts(values.network.dns_opts) | tojson }}
{% endif %}
{% set test = ix_lib.base.healthchecks.wget_test(port=values.network.web_port, path="/health-check", config={"scheme": "https" if values.adguard.use_https_probe else "http"}) %}
{% set test = ix_lib.base.healthchecks.wget_test(port=values.network.web_port, path="/", config={"scheme": "https" if values.adguard.use_https_probe else "http"}) %}
healthcheck: {{ ix_lib.base.healthchecks.check_health(test) | tojson }}
environment: {{ ix_lib.base.environment.envs(app={}, user=values.adguard.additional_envs,values=values) | tojson }}
{% if not values.network.host_network and not values.network.dhcp_enabled %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ def http_test(port, path, config=None):

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}}'"
)
return f"""
/bin/bash -c 'exec {{hc_fd}}<>/dev/tcp/{host}/{port} && echo -e "GET {path} HTTP/1.1\\r\\nHost: {host}\\r\\nConnection: close\\r\\n\\r\\n" >&$${{hc_fd}} && cat <&$${{hc_fd}} | grep "HTTP/1.1 200"'
""" # noqa


def netcat_test(port, config=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def process_dir_shell_func():

if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
return 0
fi

if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
return 0
fi

if [ "$$is_temporary" = "true" ]; then
Expand All @@ -86,7 +86,7 @@ def process_dir_shell_func():

if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
return 0
fi

echo "Current Ownership and Permissions on [$$dir]:"
Expand Down
6 changes: 3 additions & 3 deletions ix-dev/community/audiobookshelf/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ icon: https://media.sys.truenas.net/apps/audiobookshelf/icons/icon.svg
keywords:
- media
- audiobook
lib_version: 1.1.3
lib_version_hash: 2aa61e120fd30dd72800bea5d56ad12793d4a6b74cf69140780d51add22c7768
lib_version: 1.1.4
lib_version_hash: 6e32ff5969906d9c3a10fea2b17fdd3197afb052d3432344da03188d8a907113
maintainers:
- email: [email protected]
name: truenas
Expand All @@ -33,4 +33,4 @@ sources:
- https://github.com/advplyr/audiobookshelf
title: Audiobookshelf
train: community
version: 1.2.13
version: 1.2.14
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ def http_test(port, path, config=None):

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}}'"
)
return f"""
/bin/bash -c 'exec {{hc_fd}}<>/dev/tcp/{host}/{port} && echo -e "GET {path} HTTP/1.1\\r\\nHost: {host}\\r\\nConnection: close\\r\\n\\r\\n" >&$${{hc_fd}} && cat <&$${{hc_fd}} | grep "HTTP/1.1 200"'
""" # noqa


def netcat_test(port, config=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def process_dir_shell_func():

if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
return 0
fi

if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
return 0
fi

if [ "$$is_temporary" = "true" ]; then
Expand All @@ -86,7 +86,7 @@ def process_dir_shell_func():

if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
return 0
fi

echo "Current Ownership and Permissions on [$$dir]:"
Expand Down
6 changes: 3 additions & 3 deletions ix-dev/community/autobrr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ keywords:
- media
- torrent
- usenet
lib_version: 1.1.3
lib_version_hash: 2aa61e120fd30dd72800bea5d56ad12793d4a6b74cf69140780d51add22c7768
lib_version: 1.1.4
lib_version_hash: 6e32ff5969906d9c3a10fea2b17fdd3197afb052d3432344da03188d8a907113
maintainers:
- email: [email protected]
name: truenas
Expand All @@ -31,4 +31,4 @@ sources:
- https://github.com/autobrr/autobrr
title: Autobrr
train: community
version: 1.1.13
version: 1.1.14
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ def http_test(port, path, config=None):

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}}'"
)
return f"""
/bin/bash -c 'exec {{hc_fd}}<>/dev/tcp/{host}/{port} && echo -e "GET {path} HTTP/1.1\\r\\nHost: {host}\\r\\nConnection: close\\r\\n\\r\\n" >&$${{hc_fd}} && cat <&$${{hc_fd}} | grep "HTTP/1.1 200"'
""" # noqa


def netcat_test(port, config=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def process_dir_shell_func():

if [ -z "$$dir" ]; then
echo "Path is empty, skipping..."
exit 0
return 0
fi

if [ ! -d "$$dir" ]; then
echo "Path [$$dir] does is not a directory, skipping..."
exit 0
return 0
fi

if [ "$$is_temporary" = "true" ]; then
Expand All @@ -86,7 +86,7 @@ def process_dir_shell_func():

if [ "$$is_temporary" = "false" ] && [ -n "$$(ls -A $$dir)" ]; then
echo "Path [$$dir] is not empty, skipping..."
exit 0
return 0
fi

echo "Current Ownership and Permissions on [$$dir]:"
Expand Down
6 changes: 3 additions & 3 deletions ix-dev/community/bazarr/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ icon: https://media.sys.truenas.net/apps/bazarr/icons/icon.png
keywords:
- media
- subtitles
lib_version: 1.1.3
lib_version_hash: 2aa61e120fd30dd72800bea5d56ad12793d4a6b74cf69140780d51add22c7768
lib_version: 1.1.4
lib_version_hash: 6e32ff5969906d9c3a10fea2b17fdd3197afb052d3432344da03188d8a907113
maintainers:
- email: [email protected]
name: truenas
Expand All @@ -31,4 +31,4 @@ sources:
- https://github.com/morpheus65535/bazarr
title: Bazarr
train: community
version: 1.0.21
version: 1.0.22
121 changes: 0 additions & 121 deletions ix-dev/community/bazarr/templates/library/base_v1_1_3/healthchecks.py

This file was deleted.

Loading
Loading