ttionya / vaultwarden-backup

Backup vaultwarden (formerly known as bitwarden_rs) SQLite3/PostgreSQL/MySQL/MariaDB database by rclone. (Docker)
MIT License
1.04k stars 119 forks source link

Enhance the functionality related to `PING_URL` #164

Closed ttionya closed 1 month ago

ttionya commented 1 month ago

The current PING_URL functionality is very limited, as it only supports the simplest GET requests. To better adapt to the invocation methods of notification and health check tools available in the market, the following features will be added:

  1. Add environment variables for attaching curl options to PING_URL, PING_URL_WHEN_START, PING_URL_WHEN_SUCCESS, and PING_URL_WHEN_FAILURE. These will be named by appending the _CURL_OPTIONS suffix. For example, the PING_URL_CURL_OPTIONS environment variable will allow attaching curl options to PING_URL.

  2. Add placeholders for replacing the actual title and content for the eight environment variables mentioned in the first point. The placeholder for the subject is %{subject}, and for the content, it is %{content}. Note that the title and content may contain spaces. For the four environment variables that include _CURL_OPTIONS, the placeholders will be replaced directly, preserving spaces. For the other PING_URL environment variables, spaces will be replaced with + to comply with URL rules.

The planned request command is curl ${PING_URL_CURL_OPTIONS} ${PING_URL}.

Related #161