Change the URL of the local documentation development server to be more like the production URL.

This commit is contained in:
Dan Helfman
2025-10-12 15:16:25 -07:00
parent f45258b6b7
commit 8ea9a7cb55
6 changed files with 37 additions and 6 deletions
+1 -1
View File
@@ -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 = {
+1
View File
@@ -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
+1 -1
View File
@@ -11,7 +11,7 @@ headerClass: elv-header-default
{% set navPages = collections.all | eleventyNavigation %}
{% macro renderNavListItem(entry) -%}
<li{% if entry.url == page.url %} class="elv-toc-active"{% endif %}>
<a {% if entry.url %}href="{% if borgmatic.environment == "production" %}https://torsion.org/borgmatic/docs{% else %}http://localhost:8080/docs{% endif %}{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
<a {% if entry.url %}href="{% if borgmatic.environment == "production" %}https://torsion.org/borgmatic/docs{% else %}http://localhost:8080/borgmatic/docs{% endif %}{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
{%- if entry.children.length -%}
<ul>
{%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
+32 -3
View File
@@ -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
+1 -1
View File
@@ -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
+1
View File
@@ -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