docs: add healthcheck page

This commit is contained in:
2025-04-11 07:45:38 -07:00
parent 0690e1551b
commit 1750b6ff11
9 changed files with 526 additions and 175 deletions

View File

@@ -28,6 +28,60 @@ This section outlines all releases of TVApp2, including the version of the relea
<br /> <br />
### <!-- md:version stable- --> 1.4.0 <small>Apr 10, 2025</small> { id="1.4.0" }
- `feat`: add new environment variable `HEALTH_TIMER` _(See feature below)_
- `feat`: new health check icon in top right; triggers every `10 minutes` and reports back to the web interface as a toast notification
- health check shows timer until next health check is performed.
- `feat`: added bootstramp toast notifications and modals
- `feat`: new modal dialog when when user triggers a re-sync of the m3u and epg data
- `feat`: footer of web interface how discloses which build is being ran; `stable` or `development`
- `refactor`: console logging system overhauled with new syntax for how logs are displayed
- `refactor`: additional logs added for `LOG_LEVEL=5` or higher
<br />
---
<br />
### <!-- md:version stable- --> 1.3.0 <small>Apr 9, 2025</small> { id="1.3.0" }
- `feat`: new button to upper-right side of header which allows you to **force re-sync** your m3u and xml data.
- `feat`: new api endpoint `/api/resync`; utilized to resync M3U and EPG data
- `feat`: new api endpoint `/api/health`; utilized in your `docker-compose.yml` health check
- `feat`: new env variable `WEB_ENCODING`; allows you to customize the HTTP `Accept-Encoding` request and response header
- `feat`: new env variable `IP_GATEWAY`; stores assigned container gateway ip
- `feat`: new env variable `IP_CONTAINER`; stores assigned container ip
- `refactor`: env variables re-named
- `FILE_TAR``FILE_GZP`
- `refactor`: errors and success messages now use api endpoint; lists timestamp, error code, etc.
- `build`: bump bootstrap from `v4` to `v5`
- `fix`: bug in Jellyfin which caused EPG data syncing to error out for hosts which cannot support gzip compression
- Error: _[ERR] [27] Jellyfin.LiveTv.Guide.GuideManager: Error getting programs for channel XXXXXXXXXXXXXXX (Source 2) System.Xml.XmlException: '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1._
<br />
---
<br />
### <!-- md:version stable- --> 1.2.0 <small>Apr 5, 2025</small> { id="1.2.0" }
- `feat`: add support for additional mime types and default file type
- `style`: rename env variable `FILE_PLAYLIST` to `FILE_M3U`
- `build`: add new env vars to `Dockerfile`
- `FILE_TAR`
- `FILE_URL`
- `refactor`: m3u and epg files now stored in `www` folder
- `fix`: html template links pointing to old repo
<br />
---
<br />
### <!-- md:version stable- --> 1.1.0 <small>Mar 25, 2025</small> { id="1.1.0" } ### <!-- md:version stable- --> 1.1.0 <small>Mar 25, 2025</small> { id="1.1.0" }
- `feat`: new interface & theme for web ui - `feat`: new interface & theme for web ui
@@ -66,6 +120,10 @@ This section outlines all releases of TVApp2, including the version of the relea
<br /> <br />
---
<br />
### <!-- md:version stable- --> 1.0.0 <small>Feb 24, 2025</small> { id="1.0.0" } ### <!-- md:version stable- --> 1.0.0 <small>Feb 24, 2025</small> { id="1.0.0" }
- Initial release - Initial release

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -175,6 +175,63 @@ services:
<br /> <br />
## WEB_ENCODING
<!-- md:control env -->
<!-- md:version stable-1.3.0 -->
<!-- md:default `deflate, br` -->
The `WEB_ENCODING` environment variable allows you to customize the HTTP `Accept-Encoding` request and response header. This value specifies what content encoding the sender can understand when sending these requests.
Most users will not need to modify this value unless you are running Jellyfin and receive the following error when attempting to sync EPG data between Jellyfin and the TVApp2 container:
!!! warning "Jellyfin Error"
```
[ERR] [27] Jellyfin.LiveTv.Guide.GuideManager: Error getting programs for channel
XXXXXXXXXXXXXXX (Source 2) System.Xml.XmlException: '', hexadecimal value 0x1F,
is an invalid character. Line 1, position 1.
```
If you receive the above error and you have already customized this environment variable to include `gzip`, you must remove it from your accepted encoders string to fix the error.
=== "Old"
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- WEB_ENCODING: 'gzip, deflate, br'
```
=== "New"
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- WEB_ENCODING: 'deflate, br'
```
<br />
## URL_REPO ## URL_REPO
<!-- md:control env --> <!-- md:control env -->
<!-- md:version stable-1.0.0 --> <!-- md:version stable-1.0.0 -->
@@ -202,19 +259,19 @@ services:
``` ```
1. :warning: It is highly recommended that you do not change this value 1. :warning: It is highly recommended that you do not change this value
otherwise you will not be able to download the latest M3U playlists and EPG otherwise you will not be able to download the latest M3U playlists
guide data. and EPG guide data.
<br /> <br />
## DIR_BUILD ## FILE_URL
<!-- md:control env --> <!-- md:control env -->
<!-- md:version stable-1.0.0 --> <!-- md:version stable-1.2.0 -->
<!-- md:default `/usr/src/app` --> <!-- md:default `urls.txt` -->
<!-- md:flag dangerous -->
The `DIR_BUILD` environment variable specifies what local folder will be utilized The `FILE_URL` environment variable allows you to specify what the name of the downloaded `urls.txt` cache file. This file is downloaded when you first spin up the TVApp2 container.
by the TVApp2 docker container when the container builds the app.
There should be no need to utilize this environment variable unless you have a specific reason.
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" } ``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services: services:
@@ -229,85 +286,22 @@ services:
- ./config:/config - ./config:/config
- ./app:/usr/bin/app - ./app:/usr/bin/app
environment: environment:
- DIR_BUILD=/usr/src/app # (1) - FILE_URL=urls.txt # (1)
``` ```
1. :warning: You should not change this unless you are an advanced user. 1. :warning: There is really no reason to modify this environment variable
unless you have a specific purpose.
<br /> <br />
## DIR_RUN ## FILE_M3U
<!-- md:control env -->
<!-- md:version stable-1.0.0 -->
<!-- md:default `/usr/src/app` -->
<!-- md:flag dangerous -->
The `DIR_RUN` environment variable specifies what local folder will be utilized
by the TVApp2 docker container when the container has built the app and placed it
into a production folder.
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- DIR_RUN=/usr/bin/app # (1)
```
1. :warning: You should not change this unless you are an advanced user.
<br />
## STREAM_QUALITY
<!-- md:control env -->
<!-- md:version stable-1.1.0 -->
<!-- md:default `hd` -->
The `STREAM_QUALITY` environment variable specifies the default stream quality that will
be used when you initiate a new channel to view.
Available Options:
* `hd` High Definition
* `sd` Standard Definition
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- STREAM_QUALITY=hd # (1)
```
1. :information: This environment variable has the following options:
- hd
- sd
<br />
## FILE_PLAYLIST
<!-- md:control env --> <!-- md:control env -->
<!-- md:version stable-1.1.0 --> <!-- md:version stable-1.1.0 -->
<!-- md:default `playlist.m3u8` --> <!-- md:default `playlist.m3u8` -->
The `FILE_PLAYLIST` environment variable specifies the filename that will be utilized when The `FILE_M3U` environment variable allows you to specify what the name of the downloaded `playlist.m3u8` file will be. This file is downloaded when you first spin up the TVApp2 container, and contains a list of what channels you can pick from.
your .m3u playlist file is generated.
There should be no need to utilize this environment variable unless you have a specific reason.
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" } ``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services: services:
@@ -322,11 +316,12 @@ services:
- ./config:/config - ./config:/config
- ./app:/usr/bin/app - ./app:/usr/bin/app
environment: environment:
- FILE_PLAYLIST=playlist.m3u8 # (1) - FILE_M3U=playlist.m3u8 # (1)
``` ```
1. :information: Changing this file only changes the filename locally; it does 1. :warning: There is really no reason to modify this environment variable
not affect the server-side fetching mechanism. unless you have a specific purpose.
<br /> <br />
@@ -389,6 +384,100 @@ services:
<br /> <br />
## STREAM_QUALITY
<!-- md:control env -->
<!-- md:version stable-1.1.0 -->
<!-- md:default `hd` -->
The `STREAM_QUALITY` environment variable specifies the default stream quality that will
be used when you initiate a new channel to view.
Available Options:
* `hd` High Definition
* `sd` Standard Definition
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- STREAM_QUALITY=hd # (1)
```
1. :information: This environment variable has the following options:
- hd
- sd
<br />
## DIR_BUILD
<!-- md:control env -->
<!-- md:version stable-1.0.0 -->
<!-- md:default `/usr/src/app` -->
<!-- md:flag dangerous -->
The `DIR_BUILD` environment variable specifies what local folder will be utilized
by the TVApp2 docker container when the container builds the app.
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- DIR_BUILD=/usr/src/app # (1)
```
1. :warning: You should not change this unless you are an advanced user.
<br />
## DIR_RUN
<!-- md:control env -->
<!-- md:version stable-1.0.0 -->
<!-- md:default `/usr/src/app` -->
<!-- md:flag dangerous -->
The `DIR_RUN` environment variable specifies what local folder will be utilized
by the TVApp2 docker container when the container has built the app and placed it
into a production folder.
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- DIR_RUN=/usr/bin/app # (1)
```
1. :warning: You should not change this unless you are an advanced user.
<br />
## LOG_LEVEL ## LOG_LEVEL
<!-- md:control env --> <!-- md:control env -->
<!-- md:version stable-1.1.0 --> <!-- md:version stable-1.1.0 -->
@@ -417,13 +506,16 @@ when being output to your console.
1. :information: The default log level is `4` (info). 1. :information: The default log level is `4` (info).
=== "Logging Options" === "Log Levels"
| Log Level | Name | Description | | Log Level | Name | Description |
| --------------- | ----------- | ------------------------------------------------------------------------------- | | --------------- | ----------- | ------------------------------------------------------------------------------- |
| `6` | Trace | Displays all possible logs in console, along with anything below this line. | | `6` | :material-checkbox-blank-circle:{ style="color: var(--md-loglevel-trace-color) " } Trace | Displays all possible logs in console, along with anything below this line. |
| `5` | Debug | Displays debug / developer logs, along with anything below this line. | | `5` | :material-checkbox-blank-circle:{ style="color: var(--md-loglevel-debug-color) " } Debug | Displays debug / developer logs, along with anything below this line. |
| `4` | Info | Displays informative logs, along with anything below this line. | | `4` | :material-checkbox-blank-circle:{ style="color: var(--md-loglevel-info-color) " } Info | Displays informative logs, along with anything below this line. |
| `3` | Notice | Displays important notices, along with anything below this line. | | `3` | :material-checkbox-blank-circle:{ style="color: var(--md-loglevel-notice-color) " } Notice | Displays important notices, along with anything below this line. |
| `2` | Warm | Displays warnings, along with anything below this line. | | `2` | :material-checkbox-blank-circle:{ style="color: var(--md-loglevel-warn-color) " } Warn | Displays warnings, along with anything below this line. |
| `1` | Error | Displays only errors, none of the log levels above this line will be shown | | `1` | :material-checkbox-blank-circle:{ style="color: var(--md-loglevel-error-color) " } Error | Displays only errors, none of the log levels above this line will be shown |
<br />
<br />

View File

@@ -13,108 +13,97 @@ The TVApp2 docker image provides a few different paths that you can mount to you
<br /> <br />
## 📁 /usr/bin/app ## 📁 /usr/bin/app
<!-- md:control env -->
<!-- md:version stable-1.0.0 -->
<!-- md:default `Etc/UTC` -->
The `TZ` environment variable specifies the timezone that your docker container will <!-- md:control volume -->
utilize. This is useful for syncing your local time with console outputs such as <!-- md:version stable-1.0.0 -->
our logging system.
The mountable volume `/usr/bin/app` is where TVApp2 files will be placed once the app has been built when your docker container spins up. The files in this folder include:
| File | Description |
| --- | --- |
| `📁 node_modules` | List of all NodeJS packages utilized by TVApp2 |
| `📁 www` | Main storage folder for TVApp2. Contains website files and M3U / EPG synced files |
| `📄 package.json` | NodeJS package file |
| `📄 playlist.m3u8` | Generated playlist containing channels |
| `📄 urls.txt` | List containing cached URLs utilized by TVApp2 |
| `📄 xmltv.xml` | EPG guide data in uncompressed XML format |
| `📄 xmltv.xml.gz` | EPG guide data in compressed GZ archive |
| `📄 index.js` | Main source code file for TVApp2 |
<br />
=== "Example" === "Example"
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" } ``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="7" }
services: services:
tvapp2: tvapp2:
container_name: tvapp2 container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /etc/timezone:/etc/timezone:ro - ./app:/usr/bin/app # (1)
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- TZ=Etc/UTC # (1)
``` ```
1. :information: Changing this env variable will change the time for anything 1. :information: Changing this env variable will change the time for anything
related to the TVApp2 docker container. related to the TVApp2 docker container.
=== "Timezones" <br />
``` yaml This folder path can be changed by specifying a new path with the environment variable `DIR_RUN`
Etc/UTC
Africa/Cairo === "Example"
Africa/Johannesburg
Africa/Lagos ``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="7" }
America/Argentina/Buenos_Aires services:
America/Bogota tvapp2:
America/Caracas container_name: tvapp2
America/Chicago image: ghcr.io/thebinaryninja/tvapp2:latest
America/El_Salvador restart: unless-stopped
America/Juneau volumes:
America/Lima - ./app:/usr/bin/app # (1) (2)
America/Los_Angeles
America/Mexico_City
America/New_York
America/Phoenix
America/Santiago
America/Sao_Paulo
America/Toronto
America/Vancouver
Asia/Almaty
Asia/Ashkhabad
Asia/Bahrain
Asia/Bangkok
Asia/Chongqing
Asia/Dubai
Asia/Ho_Chi_Minh
Asia/Hong_Kong
Asia/Jakarta
Asia/Jerusalem
Asia/Kathmandu
Asia/Kolkata
Asia/Kuwait
Asia/Muscat
Asia/Qatar
Asia/Riyadh
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Taipei
Asia/Tehran
Asia/Tokyo
Atlantic/Reykjavik
Australia/ACT
Australia/Adelaide
Australia/Brisbane
Australia/Sydney
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Copenhagen
Europe/Helsinki
Europe/Istanbul
Europe/London
Europe/Luxembourg
Europe/Madrid
Europe/Moscow
Europe/Paris
Europe/Riga
Europe/Rome
Europe/Stockholm
Europe/Tallinn
Europe/Vilnius
Europe/Warsaw
Europe/Zurich
Pacific/Auckland
Pacific/Chatham
Pacific/Fakaofo
Pacific/Honolulu
Pacific/Norfolk
US/Mountain
``` ```
1. :information: Changing this env variable will change the folder within the docker container which stores the fully built TVApp2 files.
2. This should not be used unless you know what you're doing
<br />
---
<br />
## 📁 /config
<!-- md:control volume -->
<!-- md:version stable-1.0.0 -->
The mountable volume `/config` defines where the TVApp2 application will store SSL certificates related to the TVApp2 web interface being ran using https instead of http. The files in this folder include:
| File | Description |
| --- | --- |
| `📁 keys` | Folder which stores the SSL cert and keys |
| `📄 keys/cert.crt` | SSL public certificate |
| `📄 keys/key.crt` | SSL private key |
<br />
=== "Example"
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="7" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- ./config:/config # (1) (2)
```
1. :information: Changing this env variable will change the folder within the docker container which stores the fully built TVApp2 files.
2. This should not be used unless you know what you're doing
<br />
<br /> <br />

View File

@@ -191,6 +191,13 @@
--md-tooltip-width: 400px; --md-tooltip-width: 400px;
--glow-color: hsl(186 100% 69%); --glow-color: hsl(186 100% 69%);
--md-loglevel-error-color: #f06090;
--md-loglevel-warn-color: #e6695b;
--md-loglevel-notice-color: #e2d55e;
--md-loglevel-info-color: #6791e0;
--md-loglevel-debug-color: #c973d9;
--md-loglevel-trace-color: hsla(225deg,15%,90%,0.56);
--md-default-fg-color: hsla(var(--md-hue),15%,90%,0.82); --md-default-fg-color: hsla(var(--md-hue),15%,90%,0.82);
--md-default-fg-color--light: hsla(var(--md-hue),15%,90%,0.56); --md-default-fg-color--light: hsla(var(--md-hue),15%,90%,0.56);
--md-default-fg-color--lighter: hsla(var(--md-hue),15%,90%,0.32); --md-default-fg-color--lighter: hsla(var(--md-hue),15%,90%,0.32);
@@ -561,6 +568,25 @@ h4:has(.twemoji) .twemoji
--md-typeset-bg-color: #111; --md-typeset-bg-color: #111;
} }
@keyframes health
{
0%, 40%, 80%, 100% {
transform: scale(1);
color: #FFF;
fill: #FFF !important;
}
20%, 60% {
transform: scale(1.15);
color: #FF6593;
fill: #FF6593 !important;
}
}
.heart
{
animation: health 1000ms infinite;
}
.md-typeset .mdx-badge--heart { .md-typeset .mdx-badge--heart {
--md-badge-icon-color: #e92063; --md-badge-icon-color: #e92063;
--md-badge-icon-hover-color: #FFFFFF; --md-badge-icon-hover-color: #FFFFFF;

View File

@@ -0,0 +1,164 @@
---
title: Healthcheck
tags:
- usage
---
# Healthcheck
This docker container includes the ability to run health checks between the container api and outside services such as Portainer, or any other app that has the ability to query the endpoint `api/health`.
<br />
---
<br />
## API
<!-- md:version stable-1.4.0 -->
This container includes the ability to run health checks utilizing the built-in API. You can directly access the health check and view a json formatted result with the url `https://tvapp2.domain.lan/api/health`
=== "Example"
``` { .yaml .copy .select title="/api/health" linenums="1" }
{
"ip": "172.18.2.1",
"gateway": "172.18.0.1",
"uptime": 5903.549082501,
"message": "healthy",
"status": "healthy",
"ref": "/api/health",
"method": "GET",
"code": 200,
"timestamp": 1744386346242
}
```
<br />
Numerous aliases have been added; you can use any of the following URLs to access the same health check results as they go to the same endpoint:
- https://tvapp2.domain.lan/api/health
- https://tvapp2.domain.lan/api/status
<br />
---
<br />
## Portainer
<!-- md:version stable-1.3.0 -->
To run a health check between TVApp2 and Portainer, apply the following lines of code to your TVApp2 `docker-compose.yml`. Two examples have been provided, you can use either one; `wget` or `curl`:
=== "Using CURL"
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="14-18" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- TZ=Etc/UTC
health check:
test: "curl --fail --silent http://127.0.0.1:4124/api/health | grep -i healthy || exit 1"
interval: 15s
timeout: 10s
retries: 3
```
=== "Using WGET"
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="14-18" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- TZ=Etc/UTC
health check:
test: "wget -qO- http://127.0.0.1:4124/api/health | grep -i healthy || exit 1"
interval: 15s
timeout: 10s
retries: 3
```
<br />
---
<br />
## Web Interface
<!-- md:version stable-1.4.0 -->
The TVApp2 web interface is equip with its own health check which is ran every `10 minutes` by default. Users will notice a health indicator in the top right of the header navigation bar which is represented by the :octicons-heart-fill-24:{ .heart } icon.
When the health check is ran every 10 minutes; a toast notification will appear in the lower-right side of the page:
<figure markdown="span">
![Image settings](../../assets/images/health-toast.gif){ width="80%" }
<figcaption>Health check toast notification</figcaption>
</figure>
<br />
### Health Check Duration
<!-- md:control env -->
<!-- md:version stable-1.4.0 -->
<!-- md:default `600000` -->
By default, a health check between the TVApp2 container and the web interface is done every `10 minutes`, but you can change this duration to something less or more. Be aware that if you set the time too low, you will constantly be spammed with toast notifications.
To change the health check delay, add the environment variable `HEALTH_TIMER` to your TVApp2 `docker-compose.yml`. Duration is in milliseconds.
<br />
=== "Example"
``` { .yaml .copy .select title="docker-compose.yml" linenums="1" hl_lines="13" }
services:
tvapp2:
container_name: tvapp2
image: ghcr.io/thebinaryninja/tvapp2:latest
restart: unless-stopped
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
- ./app:/usr/bin/app
environment:
- HEALTH_TIMER=600000 # (1)
```
1. :information: Defines how often to perform health checks between the container and the web interface. Time is in milliseconds. <br /><br />Default value is `600000` (10 minutes)
=== "Time Chart"
| HEALTH_TIMER Value | Delay Between Checks |
| --- | --- |
| `HEALTH_TIMER=300000` | 5 minutes |
| `HEALTH_TIMER=600000` | 10 minutes |
| `HEALTH_TIMER=1200000` | 20 minutes |
| `HEALTH_TIMER=1800000` | 30 minutes |
| `HEALTH_TIMER=3600000` | 1 hour |
<br />
<br />

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><defs><style>.fa-secondary{opacity:.4}</style></defs><path class="fa-secondary" d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 224c0 5.5-.7 10.8-2 16c-3.6-13.8-11.6-25.8-22.5-34.4c-5.4-4.3-11.6-7.7-18.2-10c-3.3-1.2-6.8-2.1-10.3-2.7c-1.8-.3-3.6-.5-5.4-.7c-.9-.1-1.8-.1-2.8-.2s-1.8-.1-2.8-.1L64 288c-29.8 0-54.9 20.4-62 48c-1.3-5.1-2-10.5-2-16L0 96zM352 384a32 32 0 1 1 -64 0 32 32 0 1 1 64 0z"/><path class="fa-primary" d="M0 352c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-64zm352 32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm64 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"/></svg>

After

Width:  |  Height:  |  Size: 872 B

View File

@@ -164,6 +164,7 @@ def badgeControl( args: str, page: Page, files: Files ):
elif type == "button": return newControlButton( page, files ) elif type == "button": return newControlButton( page, files )
elif type == "slider": return newControlSlider( page, files ) elif type == "slider": return newControlSlider( page, files )
elif type == "env": return newControlEnvVar( page, files ) elif type == "env": return newControlEnvVar( page, files )
elif type == "volume": return newControlVolume( page, files )
elif type == "color": return newControlColor( args, page, files ) elif type == "color": return newControlColor( args, page, files )
else: return newControlDefault( page, files ) else: return newControlDefault( page, files )
@@ -935,7 +936,7 @@ def newControlColor( text: str, page: Page, files: Files ):
# Icon : Control : Env Variable # Icon : Control : Env Variable
# #
# use the following tag in your md file: # use the following tag in your md file:
# <!-- md:control slider --> # <!-- md:control env -->
# # # #
def newControlEnvVar( page: Page, files: Files ): def newControlEnvVar( page: Page, files: Files ):
@@ -948,3 +949,21 @@ def newControlEnvVar( page: Page, files: Files ):
icon = f"[:{icon}:]({href} 'Type: Environment Variable')", icon = f"[:{icon}:]({href} 'Type: Environment Variable')",
type = "env" type = "env"
) )
# #
# Icon : Control : Volume
#
# use the following tag in your md file:
# <!-- md:control volume -->
# #
def newControlVolume( page: Page, files: Files ):
icon = "aetherx-axd-volume"
href = _resolve_path( f"{PAGE_CONVENTIONS}#control", page, files )
print(clr.MAGENTA + 'VERBOSE - ' + clr.WHITE + ' Running ' + clr.YELLOW + inspect.stack()[0][3] + clr.WHITE + ' for page ' + clr.GREY + str(href) + clr.WHITE )
return badgeCreate(
icon = f"[:{icon}:]({href} 'Type: Mountable Volume')",
type = "volume"
)

View File

@@ -241,6 +241,8 @@ nav:
- Config: - Config:
- Environment Variables: 'config/env.md' - Environment Variables: 'config/env.md'
- Volumes: 'config/volumes.md' - Volumes: 'config/volumes.md'
- Usage:
- Healthcheck: 'usage/healthcheck.md'
- Changelog: 'about/changelog.md' - Changelog: 'about/changelog.md'
- Discord: 'https://discord.gg/gTze6hRe' - Discord: 'https://discord.gg/gTze6hRe'