diff --git a/.eleventy.js b/.eleventy.js
index 30057a4a..4ed8c195 100644
--- a/.eleventy.js
+++ b/.eleventy.js
@@ -21,7 +21,7 @@ module.exports = function(eleventyConfig) {
if (process.env.NODE_ENV == "production") {
return link;
}
- return link.replace('https://torsion.org/borgmatic/', 'http://localhost:8080/');
+ return link.replace('https://torsion.org/', 'http://localhost:8080/');
}
};
let markdownItAnchorOptions = {
diff --git a/NEWS b/NEWS
index 83494dbb..bde39c25 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
2.0.10.dev0
* #1161: Fix a traceback (TypeError) in the "check" action with Python 3.14.
+ * Change the URL of the local documentation development server to be more like the production URL.
2.0.9
* #1105: More accurately collect Btrfs subvolumes to snapshot. As part of this, the Btrfs hook no
diff --git a/docs/_includes/layouts/main.njk b/docs/_includes/layouts/main.njk
index 81300bae..82b4e32b 100644
--- a/docs/_includes/layouts/main.njk
+++ b/docs/_includes/layouts/main.njk
@@ -11,7 +11,7 @@ headerClass: elv-header-default
{% set navPages = collections.all | eleventyNavigation %}
{% macro renderNavListItem(entry) -%}
- {{ entry.title }}
+ {{ entry.title }}
{%- if entry.children.length -%}
{%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
diff --git a/docs/docker-compose.yaml b/docs/docker-compose.yaml
index f6934ce0..cbf2eda7 100644
--- a/docs/docker-compose.yaml
+++ b/docs/docker-compose.yaml
@@ -1,9 +1,38 @@
services:
+ traefik:
+ image: public.ecr.aws/docker/library/traefik:3.5.3
+ container_name: borgmatic-docs-traefik
+ command:
+ - "--global.checkNewVersion=false"
+ - "--global.sendAnonymousUsage=false"
+ - "--entrypoints.web.address=:8080"
+ - "--accesslog"
+ - "--accesslog.fields.headers.defaultmode=keep"
+ - "--providers.docker"
+ - "--providers.docker.exposedbydefault=false"
+ - "--api.insecure=false"
+ - "--api.dashboard=false"
+ - "--log.level=WARN"
+ ports:
+ - "127.0.0.1:8080:8080"
+ volumes:
+ - ${CONTAINER_SOCKET_PATH:-/run/user/docker.sock}:/var/run/docker.sock:ro
docs:
image: borgmatic-docs
container_name: borgmatic-docs
- ports:
- - 8080:80
+ labels:
+ - "traefik.enable=true"
+ - "traefik.http.routers.borgmatic-docs.rule=PathPrefix(`/borgmatic`)"
+# - "traefik.http.routers.borgmatic-docs.middlewares=borgmatic-trailing-slash-redirectregex,borgmatic-docs-redirectregex,borgmatic-stripprefix"
+ - "traefik.http.routers.borgmatic-docs.middlewares=borgmatic-trailing-slash-redirectregex,borgmatic-stripprefix"
+ - "traefik.http.middlewares.borgmatic-trailing-slash-redirectregex.redirectregex.regex=^(.*)/borgmatic$$"
+ - "traefik.http.middlewares.borgmatic-trailing-slash-redirectregex.redirectregex.replacement=$${1}/borgmatic/"
+ - "traefik.http.middlewares.borgmatic-trailing-slash-redirectregex.redirectregex.permanent=true"
+# - "traefik.http.middlewares.borgmatic-docs-redirectregex.redirectregex.regex=^(.*)/borgmatic/docs/(.*)$$"
+# - "traefik.http.middlewares.borgmatic-docs-redirectregex.redirectregex.replacement=$${1}/borgmatic/$${2}"
+# - "traefik.http.middlewares.borgmatic-docs-redirectregex.redirectregex.permanent=true"
+ - "traefik.http.middlewares.borgmatic-stripprefix.stripprefix.prefixes=/borgmatic"
+ - "traefik.http.routers.borgmatic-docs.entrypoints=web"
build:
dockerfile: docs/Dockerfile
context: ..
@@ -16,6 +45,6 @@ services:
- sh
- -c
- |
- echo; echo "You can view dev docs at http://localhost:8080"; echo
+ echo; echo "You can view dev docs at http://localhost:8080/borgmatic/"; echo
depends_on:
- docs
diff --git a/docs/how-to/develop-on-borgmatic.md b/docs/how-to/develop-on-borgmatic.md
index 084be6cd..aac59903 100644
--- a/docs/how-to/develop-on-borgmatic.md
+++ b/docs/how-to/develop-on-borgmatic.md
@@ -217,7 +217,7 @@ This script assumes you have permission to run `docker`. If you don't, then
you may need to run with `sudo`.
After you run the script, you can point your web browser at
-http://localhost:8080 to view the documentation with your changes.
+http://localhost:8080/borgmatic/ to view the documentation with your changes.
To close the documentation server, ctrl-C the script. Note that it does not
currently auto-reload, so you'll need to stop it and re-run it for any
diff --git a/scripts/dev-docs b/scripts/dev-docs
index 7443802c..f1ac6139 100755
--- a/scripts/dev-docs
+++ b/scripts/dev-docs
@@ -6,6 +6,7 @@ USER_PODMAN_SOCKET_PATH=/run/user/$UID/podman/podman.sock
if [ -e "$USER_PODMAN_SOCKET_PATH" ]; then
export DOCKER_HOST="unix://$USER_PODMAN_SOCKET_PATH"
+ export CONTAINER_SOCKET_PATH="$USER_PODMAN_SOCKET_PATH"
fi
BUILDKIT_PROGRESS=plain docker-compose --file docs/docker-compose.yaml up --build --force-recreate