Skip to content

Commit

Permalink
Added the option to enable webhook curl debugging for weird error edg…
Browse files Browse the repository at this point in the history
…e-cases
  • Loading branch information
jammsen committed Feb 14, 2024
1 parent b359357 commit 75926c6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[Back to main](README.md#changelog)

## 2024-02-13

* Added the option to enable webhook curl debugging for weird error edge-cases

## 2024-02-13
* **Breaking changes:**
* Changed the default BACKUP_RETENTION_POLICY to true and changed BACKUP_RETENTION_AMOUNT_TO_KEEP to 72, meaning 3 days worth of backup are kept in the default configuration
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
RESTART_CRON_EXPRESSION="0 3,15 * * *" \
# Webhook-settings
WEBHOOK_ENABLED=false \
WEBHOOK_DEBUG_ENABLED=false \
WEBHOOK_URL= \
WEBHOOK_INFO_TITLE="Info" \
WEBHOOK_INFO_DESCRIPTION="This is an info from the server" \
Expand Down
1 change: 1 addition & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RESTART_ENABLED=false
RESTART_CRON_EXPRESSION="0 3,15 * * *"
# Webhook-settings
WEBHOOK_ENABLED=false
WEBHOOK_DEBUG_ENABLED=false
WEBHOOK_URL="YOUR-URL-IN-HERE"
WEBHOOK_INFO_TITLE="Info"
WEBHOOK_INFO_DESCRIPTION="This is an info from the server"
Expand Down
1 change: 1 addition & 0 deletions docs/ENV_VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ These settings control the behavior of the Docker container:
| RESTART_ENABLED | Automatic restarts the server | false | Boolean |
| RESTART_CRON_EXPRESSION | Needs a Cron-Expression - See [Cron expression](#cron-expression) | 0 3,15 * * * | Cron-Expression |
| WEBHOOK_ENABLED | Set to enabled will send webhook notifications, NEEDS `WEBHOOK_URL` | false | Boolean |
| WEBHOOK_DEBUG_ENABLED | Set to enabled will enable feedback of curl and not use --silent | false | Boolean |
| WEBHOOK_URL | Defines the url the webhook to send data to | | Url |
| WEBHOOK_* | See below the table "Webhook environment variables" | | String |
| SERVER_SETTINGS_MODE | Determines whether settings can be modified via environment variables or via file, except `COMMUNITY_SERVER` and `MULTITHREAD_ENABLED`! | `auto` | Enum<br>`auto`: Settings are modified only by environment variables, manual edits will be ignored<br>`manual`: Settings are modified only by editing the file directly, environment variables are ignored |
Expand Down
13 changes: 8 additions & 5 deletions includes/webhook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ send_webhook_notification() {
local title="$1"
local description="$2"
local color="$3"

# Debug Curl
#curl --ssl-no-revoke -H "Content-Type: application/json" -X POST -d "$(generate_post_data "$title" "$description" "$color")" "$WEBHOOK_URL"
# Prod Curl
curl --silent --ssl-no-revoke -H "Content-Type: application/json" -X POST -d "$(generate_post_data "$title" "$description" "$color")" "$WEBHOOK_URL"

if [[ -n $WEBHOOK_DEBUG_ENABLED ]] && [[ $WEBHOOK_DEBUG_ENABLED == "true" ]]; then
# Debug Curl
curl --ssl-no-revoke -H "Content-Type: application/json" -X POST -d "$(generate_post_data "$title" "$description" "$color")" "$WEBHOOK_URL"
else
# Prod Curl
curl --silent --ssl-no-revoke -H "Content-Type: application/json" -X POST -d "$(generate_post_data "$title" "$description" "$color")" "$WEBHOOK_URL"
fi
}

#Aliases to use in scripts
Expand Down

0 comments on commit 75926c6

Please sign in to comment.