Skip to content

Commit b6b8285

Browse files
Documentation versioning (#464)
* rephrasing home and getting started pages * add release notes generated from github releases * add pageversions shortcode * add flag to ignore checking documentation on some files * also ignore in CI * changelog: remove links to old documentation * fixes from markdownlint * remove temporary profile on test config
1 parent 6c9b3cd commit b6b8285

File tree

12 files changed

+1162
-74
lines changed

12 files changed

+1162
-74
lines changed

.github/workflows/doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
go-version: ~1.23
2929

3030
- name: Check configuration snippets in documentation
31-
run: go run ./config/checkdoc -r docs/content
31+
run: go run ./config/checkdoc -r docs/content -i changelog.md
3232
shell: bash
3333

3434
- name: Build JSON schema & config reference
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
url: "https://${{ env.BRANCH_NAME }}.resticprofile.pages.dev/"
5757
pages_path: ./public/
58-
cmd_params: '--exclude="(linux.die.net|stackoverflow.com)" --buffer-size=8192 --max-connections=10 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0" --timeout=20'
58+
cmd_params: '--exclude="(linux.die.net|stackoverflow.com|scoop.sh)" --buffer-size=8192 --max-connections=10 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0" --timeout=20'
5959

6060
- name: Publish to pages.dev
6161
continue-on-error: true # secrets are not set for PRs from forks

.github/workflows/release-doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
go-version: ~1.23
2323

2424
- name: Check configuration snippets in documentation
25-
run: go run ./config/checkdoc -r docs/content
25+
run: go run ./config/checkdoc -r docs/content -i changelog.md
2626
shell: bash
2727

2828
- name: Build JSON schema & config reference
@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
url: https://creativeprojects.github.io/resticprofile/
5151
pages_path: ./www/
52-
cmd_params: '--exclude="(linux.die.net|stackoverflow.com)" --buffer-size=8192 --max-connections-per-host=5 --rate-limit=5 --timeout=20 --header="User-Agent:curl/7.54.0" --skip-tls-verification'
52+
cmd_params: '--exclude="(linux.die.net|stackoverflow.com|scoop.sh)" --buffer-size=8192 --max-connections-per-host=5 --rate-limit=5 --timeout=20 --header="User-Agent:curl/7.54.0" --skip-tls-verification'
5353

5454
- name: Deploy to GitHub Pages
5555
uses: peaceiris/actions-gh-pages@v4

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,12 @@ syslog-ng:
292292

293293
checkdoc:
294294
@echo "[*] $@"
295-
$(GOCMD) run ./config/checkdoc -r docs/content
295+
$(GOCMD) run ./config/checkdoc -r docs/content -i changelog.md
296296

297297
.PHONY: checklinks
298298
checklinks:
299299
@echo "[*] $@"
300-
muffet -b 8192 --exclude="(linux.die.net|stackoverflow.com)" http://localhost:1313/resticprofile/
300+
muffet -b 8192 --max-connections=10 --exclude="(linux.die.net|stackoverflow.com|scoop.sh)" http://localhost:1313/resticprofile/
301301

302302
.PHONY: lint
303303
lint: $(GOBIN)/golangci-lint

config/checkdoc/main.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ func main() {
3939

4040
var root string
4141
var verbose bool
42+
var ignoreFiles []string
4243
pflag.StringVarP(&root, "root", "r", "", "root directory where to search for documentation files (*.md)")
4344
pflag.StringVarP(&tempDir, "temp-dir", "t", "", "temporary directory to store extracted configuration files")
4445
pflag.BoolVarP(&verbose, "verbose", "v", false, "display more information")
46+
pflag.StringSliceVarP(&ignoreFiles, "ignore", "i", nil, "ignore files")
4547
pflag.Parse()
4648

4749
level := clog.LevelInfo
@@ -68,12 +70,18 @@ func main() {
6870
if d.IsDir() {
6971
return nil
7072
}
73+
simplePath := strings.TrimPrefix(path, wd)
74+
for _, ignore := range ignoreFiles {
75+
if strings.Contains(simplePath, ignore) {
76+
clog.Infof("* ignoring file %s", simplePath)
77+
return nil
78+
}
79+
}
7180
base := filepath.Base(path)
7281
ext := filepath.Ext(base)
7382
if ext != ".md" {
7483
return nil
7584
}
76-
simplePath := strings.TrimPrefix(path, wd)
7785
clog.Infof("* file %s", simplePath)
7886
if !extractConfigurationSnippets(path) {
7987
exitCode = 1

docs/content/_index.md

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,38 @@ description: Configuration profiles manager for restic backup
66

77
Configuration profiles manager for [restic backup](https://restic.net/)
88

9-
**resticprofile** is the missing link between a configuration file and restic backup. Creating a configuration file for restic has been [discussed before](https://github.com/restic/restic/issues/16), but seems to be a very low priority right now.
9+
**resticprofile** bridges the gap between a configuration file and restic backup. Although creating a configuration file for restic has been [discussed](https://github.com/restic/restic/issues/16), it remains a low priority.
1010

1111
With resticprofile:
1212

13-
* You no longer need to remember command parameters and environment variables
14-
* You can create multiple profiles inside one configuration file
15-
* A profile can inherit all the options from another profile
16-
* You can run the forget command before or after a backup (in a section called *retention*)
17-
* You can check a repository before or after a backup
18-
* You can create groups of profiles that will run sequentially
19-
* You can run [shell commands]({{% relref "/configuration/run_hooks" %}}) before or after running a profile: useful if you need to mount and unmount your backup disk for example
20-
* You can run a [shell command]({{% relref "/configuration/run_hooks" %}}) if an error occurred (at any time)
21-
* You can send a backup stream via _stdin_
22-
* You can start restic at a lower or higher priority (Priority Class in Windows, *nice* in all unixes) and/or _ionice_ (only available on Linux)
23-
* It can check that you have [enough memory]({{% relref "/usage/memory" %}}) before starting a backup. (I've had some backups that literally killed a server with swap disabled)
24-
* You can generate cryptographically secure random keys to use as a restic [key file]({{% relref "/usage/keyfile" %}})
25-
* You can easily [schedule]({{% relref "/schedules" %}}) backups, retentions and checks (works for *systemd*, *crond*, *launchd* and *windows task scheduler*)
26-
* You can generate a simple [status file]({{% relref "/status" %}}) to send to some monitoring software and make sure your backups are running fine
27-
* You can use a template syntax in your configuration file
28-
* You can generate scheduled tasks using *crond*
29-
* Get backup statistics in your [status file]({{% relref "/status" %}})
30-
* Automatically clear up [stale locks]({{% relref "/usage/locks" %}})
31-
* Export a [prometheus]({{% relref "/status/prometheus" %}}) file after a backup, or send the report to a push gateway automatically
32-
* **[new for v0.17.0]** Run shell commands in the background when non fatal errors are detected from restic
33-
* **[new for v0.18.0]** Send messages to [HTTP hooks]({{% relref "/configuration/http_hooks" %}}) before, after a successful or failed job (backup, forget, check, prune, copy)
34-
* **[new for v0.18.0]** Automatically initialize the secondary repository using `copy-chunker-params` flag
35-
* **[new for v0.18.0]** Send resticprofile logs to a syslog server
36-
* **[new for v0.19.0]** Preventing your system from idle sleeping
37-
* **[new for v0.21.0]** See the help from both restic and resticprofile via the `help` command or `-h` flag
38-
* **[new for v0.24.0]** Don't schedule a job when the system is running on battery
39-
* **[new for v0.29.0]** Scheduling a group of profiles is finally available (configuration `v2` only)
40-
41-
The configuration file accepts various formats:
42-
* [TOML](https://github.com/toml-lang/toml) : configuration file with extension _.toml_ and _.conf_ to keep compatibility with versions before 0.6.0
43-
* [JSON](https://en.wikipedia.org/wiki/JSON) : configuration file with extension _.json_
44-
* [YAML](https://en.wikipedia.org/wiki/YAML) : configuration file with extension _.yaml_
45-
* [HCL](https://github.com/hashicorp/hcl): configuration file with extension _.hcl_
13+
* No need to remember command parameters and environment variables
14+
* Create multiple profiles in one configuration file
15+
* Profiles can inherit options from other profiles
16+
* Run the forget command before or after a backup (in a section called *retention*)
17+
* Check a repository before or after a backup
18+
* Create groups of profiles to run sequentially
19+
* Run [shell commands]({{% relref "/configuration/run_hooks" %}}) before or after running a profile, useful for mounting and unmounting backup disks
20+
* Run a [shell command]({{% relref "/configuration/run_hooks" %}}) if an error occurs
21+
* Send a backup stream via _stdin_
22+
* Start restic at different [priorities]({{% relref "/configuration/priority" %}}) (Priority Class in Windows, *nice* in Unix, and/or _ionice_ in Linux)
23+
* Check for [enough memory]({{% relref "/usage/memory" %}}) before starting a backup
24+
* Generate cryptographically secure random keys for a restic [key file]({{% relref "/usage/keyfile" %}})
25+
* Easily [schedule]({{% relref "/schedules" %}}) backups, retentions, and checks (supports *systemd*, *crond*, *launchd*, and *Windows Task Scheduler*)
26+
* Generate a simple [status file]({{% relref "/status" %}}) for monitoring software to ensure backups are running smoothly
27+
* Use [template syntax]({{% relref "/configuration/templates" %}}) in your configuration file
28+
* Automatically clear [stale locks]({{% relref "/usage/locks" %}})
29+
* Export a [prometheus]({{% relref "/status/prometheus" %}}) file after a backup or send the report to a push gateway
30+
* Run shell commands in the background when non-fatal errors are detected
31+
* Send messages to [HTTP hooks]({{% relref "/configuration/http_hooks" %}}) before, after a successful or failed job (backup, forget, check, prune, copy)
32+
* Automatically [initialize the secondary repository]({{% relref "/configuration/copy" %}}) using the `copy-chunker-params` flag
33+
* Send resticprofile [logs]({{% relref "/configuration/logs" %}}) to a syslog server
34+
* Prevent the system from [idle sleeping]({{% relref "/configuration/sleep" %}})
35+
* View help for both restic and resticprofile via the `help` command or `-h` flag
36+
* Avoid scheduling a job when the system is on battery
37+
* **[new for v0.29.0]** Schedule a group of profiles (configuration `v2` only)
4638

39+
The configuration file supports various formats:
40+
* [TOML](https://github.com/toml-lang/toml): files with extensions *.toml* and *.conf* (for compatibility with versions before 0.6.0)
41+
* [JSON](https://en.wikipedia.org/wiki/JSON): files with extension *.json*
42+
* [YAML](https://en.wikipedia.org/wiki/YAML): files with extension *.yaml*
43+
* [HCL](https://github.com/hashicorp/hcl): files with extension *.hcl*

0 commit comments

Comments
 (0)