-
-
Notifications
You must be signed in to change notification settings - Fork 57
Update to Documentation! #579
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
Open
Inventhrice
wants to merge
29
commits into
creativeprojects:master
Choose a base branch
from
Inventhrice:docs_update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
17dd774
Moving features into another file
Inventhrice 6f196ad
Moved version into command line flags reference; Moved cmd flags ref …
Inventhrice f76d5a0
Cleaned up usage/index
Inventhrice b4090e5
Moved keyfile generation docs into Usage
Inventhrice 8364c69
Realized how to do nested sections
Inventhrice d1daf24
Moved the content out of the index of usage
Inventhrice f1c539b
moved monitoring into configuration, added an examples subfolder
Inventhrice ab64197
removed the monitoring folder
Inventhrice 84baf0e
Reorganized files within the configuration folder
Inventhrice 10e80cd
Formatted hooks
Inventhrice ee28aeb
Formatted monitoring
Inventhrice 308ddda
Moved preventing system sleep into schedules, and moved prority into …
Inventhrice 6a5231d
Moved schedules into the configuration file section
Inventhrice 4bb8b8a
Updating Makefile to include fixed commands for submodule
Inventhrice 04ed3a5
Renaming file back to keyfile.md
Inventhrice 6b2a887
Fixing all errors related to relative links
Inventhrice 700796c
Moved a couple of files around; created the profiles/index.md; rearra…
Inventhrice 6dc5e1e
Adding links
Inventhrice cf92423
Updating editorConfig with the correct link
Inventhrice ec341f2
Adding shortcode to quick add Table of Contents in a doc
Inventhrice 97430c9
Updating documentation once more
Inventhrice fba3c17
Updating installation documentation to be more condensed
Inventhrice 28c7d71
Think ive cleaned up installation
Inventhrice cbbb324
Updating documentation broken links
Inventhrice d34edad
Moving examples out of configuration and into usage, streamlining oth…
Inventhrice 1fcf0e0
Updating the configuration variable doc to be its own section
Inventhrice d7ed8de
Reorganizing the Usage section
Inventhrice 350894a
Adding ntfy example and slight modification to hooks
Inventhrice 3e096b3
Fixing issues brought up by the bot; being mindful of the fact that r…
Inventhrice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| --- | ||
| archetype: chapter | ||
| pre: <b>8. </b> | ||
| pre: <b>7. </b> | ||
| title: Release Notes | ||
| weight: 8 | ||
| --- | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: Hooks | ||
| weight: 60 | ||
| alwaysopen: false | ||
| --- | ||
|
|
||
| {{% children sort="weight" depth="2" %}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| --- | ||
| title: "Hooks - HTTP" | ||
| weight: 22 | ||
| tags: [ "monitoring", "healthchecks.io" ] | ||
| --- | ||
|
|
||
| {{< toc >}} | ||
|
|
||
| ## Send HTTP messages before and after a job | ||
|
|
||
| As well as being able to run [shell commands]({{% relref "run_hooks" %}}), you can now send HTTP messages before, after (success or failure) running a restic command. | ||
|
|
||
| The sections that allow sending HTTP hooks are: | ||
| - backup | ||
| - copy | ||
| - check | ||
| - forget | ||
| - prune | ||
|
|
||
| {{% notice tip %}} | ||
| You might notice that's the same sections that can also be scheduled | ||
| {{% /notice %}} | ||
|
|
||
| Each of these commands can send 4 different types of hooks: | ||
|
|
||
| - send-before | ||
| - send-after | ||
| - send-after-fail | ||
| - send-finally | ||
|
|
||
| The configuration is the same for each of these 4 types of hooks: | ||
|
|
||
| | Name | Required | Default | Notes | | ||
| |:-----|:---------|:--------|:------| | ||
| | url | Yes | None | URL of your Webhook | | ||
| | method | No | GET | This is the HTTP method (GET, POST, HEAD, etc.) | | ||
| | skip-tls-verification | No | False | **This is not recommended**: Use only if you're using your own server with a self-signed certificate | | ||
| | headers | No | User-Agent set to resticprofile | This is a subsection with a list of `name` and `value` | | ||
| | body | No | Empty | Used to send data to the Webhook (POST, PUT, PATCH) | | ||
| | body-template | No | None | Template file to generate the body (in go template format) | | ||
|
|
||
|
|
||
| A few environment variables will be available to construct the url and the body: | ||
| - `PROFILE_NAME` | ||
| - `PROFILE_COMMAND`: backup, check, forget, etc. | ||
|
|
||
| Additionally, for the `send-after-fail` hooks, these environment variables will be available: | ||
| - `ERROR` containing the latest error message | ||
| - `ERROR_COMMANDLINE` containing the command line that failed | ||
| - `ERROR_EXIT_CODE` containing the exit code of the command line that failed | ||
| - `ERROR_STDERR` containing any message that the failed command sent to the standard error (stderr) | ||
|
|
||
| URL encoding is applayed for variables `ERROR`, `ERROR_COMMANDLINE` and `ERROR_STDERR` if they are used in URL. | ||
|
|
||
| The `send-finally` hooks are also getting the environment of `send-after-fail` when any previous operation has failed (except any `send` operation). | ||
|
|
||
| Failures in any `send-*` are logged but do not influence environment or return code. | ||
|
|
||
| ## body-template | ||
|
|
||
| Templates pull from the standard go template to build the webhook body. The object passed as an argument to the template is: | ||
|
|
||
| - `ProfileName` **string** | ||
| - `ProfileCommand` **string** | ||
| - `Error` **ErrorContext** | ||
| - `Stdout` **string** | ||
|
|
||
| The type **ErrorContext** is available after an error occurred (otherwise all fields are blank): | ||
| - `Message` **string** | ||
| - `CommandLine` **string** | ||
| - `ExitCode` **string** | ||
| - `Stderr` **string** | ||
|
|
||
| ## Self-signed certificates | ||
|
|
||
| If your monitoring system is using self-signed certificates, you can import them in resticprofile (and you don't need to rely on the `skip-tls-verification` flag) | ||
|
|
||
| The parameter is in the `global` section and is called `ca-certificates`: it contains a list of certificate files (PEM). | ||
|
|
||
| ### timeout | ||
|
|
||
| The default timeout for all HTTP requests is 30 seconds. | ||
|
|
||
| You can change the default timeout in the `global` section with a parameter called `send-timeout`. | ||
|
|
||
| The format is like: | ||
| - 30s | ||
| - 2m | ||
| - 1m20s | ||
|
|
||
| ### global configuration example | ||
|
|
||
|
|
||
| {{< tabs groupid="config-with-json" >}} | ||
| {{% tab title="toml" %}} | ||
|
|
||
| ```toml | ||
| version = "1" | ||
|
|
||
| [global] | ||
| send-timeout = "10s" | ||
| ca-certificates = [ "ca-chain.cert.pem" ] | ||
| ``` | ||
|
|
||
|
|
||
| {{% /tab %}} | ||
| {{% tab title="yaml" %}} | ||
|
|
||
| ```yaml | ||
| version: "1" | ||
|
|
||
| global: | ||
| send-timeout: 10s | ||
| ca-certificates: | ||
| - ca-chain.cert.pem | ||
|
|
||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{% tab title="hcl" %}} | ||
|
|
||
| ```hcl | ||
|
|
||
| global { | ||
| send-timeout = "10s" | ||
| ca-certificates = "ca-chain.cert.pem" | ||
| } | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{% tab title="json" %}} | ||
|
|
||
| ```json | ||
| { | ||
| "version": "1", | ||
| "global": { | ||
| "send-timeout": "10s", | ||
| "ca-certificates": [ | ||
| "ca-chain.cert.pem" | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| {{% /tab %}} | ||
| {{< /tabs >}} | ||
|
|
||
| ## order of `send-*` | ||
|
|
||
| Here's the flow of HTTP hooks: | ||
|
|
||
| ```mermaid | ||
| graph TD | ||
| LOCK(set resticprofile lock) | ||
| UNLOCK(delete resticprofile lock) | ||
| LOCK --> SB | ||
| SB('send-before') --> RUN | ||
| RUN(run restic command, or group of commands) | ||
| RUN -->|Success| SA | ||
| RUN -->|Error| SAF | ||
| SA('send-after') --> SF | ||
| SAF('send-after-fail') --> SF | ||
| SF('send-finally') | ||
| SF --> UNLOCK | ||
| ``` | ||
|
|
||
| {{% notice style="warning" title="resticprofile lock" %}} | ||
| The local resticprofile lock is surrounding the whole process. It means that the `run-after-fail` target is not called if the lock cannot be obtained. This is a limitation of the current implementation. | ||
| {{% /notice %}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix emphasis-style consistency.
Line 14 uses an underscore for emphasis (
_profiles_) which violates the project's emphasis style (should use asterisks:*profiles*). This matches the markdownlint-cli2 warning (MD049).🔎 Proposed fix for emphasis style
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
14-14: Emphasis style
Expected: asterisk; Actual: underscore
(MD049, emphasis-style)
14-14: Emphasis style
Expected: asterisk; Actual: underscore
(MD049, emphasis-style)
🤖 Prompt for AI Agents