Skip to content
Draft

lychee #23808

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ public
resources
static/pagefind
tmp
.lycheecache
16 changes: 0 additions & 16 deletions .htmltest.yml

This file was deleted.

23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

ARG ALPINE_VERSION=3.21
ARG GO_VERSION=1.24
ARG HTMLTEST_VERSION=0.17.0
# LYCHEE_VERSION v0.21.0
ARG LYCHEE_VERSION=92a3a7c
ARG VALE_VERSION=3.11.2
ARG HUGO_VERSION=0.141.0
ARG NODE_VERSION=22
Expand Down Expand Up @@ -61,11 +62,15 @@ RUN --mount=type=bind,target=. \
--ignore "content/manuals/desktop/previous-versions/*.md"

# test validates HTML output and checks for broken links
FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS test
FROM lycheeverse/lychee:sha-${LYCHEE_VERSION}-alpine AS test
WORKDIR /test
COPY --from=build /project/public ./public
ADD .htmltest.yml .htmltest.yml
RUN htmltest
ADD lychee.toml lychee.toml
RUN lychee --config lychee.toml \
--base-url file:///test/public \
--include-fragments \
--verbose \
./public

# vale
FROM jdkato/vale:v${VALE_VERSION} AS vale-run
Expand Down Expand Up @@ -134,11 +139,15 @@ ENV HUGO_MODULE_REPLACEMENTS="github.com/${UPSTREAM_MODULE_NAME} -> github.com/$
RUN hugo --ignoreVendorPaths "github.com/${UPSTREAM_MODULE_NAME}"

# validate-upstream validates HTML output for upstream builds
FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS validate-upstream
FROM lycheeverse/lychee:sha-${LYCHEE_VERSION}-alpine AS validate-upstream
WORKDIR /test
COPY --from=build-upstream /project/public ./public
ADD .htmltest.yml .htmltest.yml
RUN htmltest
ADD lychee.toml lychee.toml
RUN lychee --config lychee.toml \
--base-url file:///test/public \
--include-fragments \
--verbose \
./public

# unused-media checks for unused graphics and other media
FROM alpine:${ALPINE_VERSION} AS unused-media
Expand Down
2 changes: 1 addition & 1 deletion content/manuals/engine/swarm/manage-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ a `PluginSpec` instead of a `ContainerSpec`.

The [`PluginSpec`](/engine/extend/plugin_api/#json-specification)
is defined by the plugin developer. To add the plugin to all Docker nodes, use
the [`service/create`](/reference/api/engine/v1.31/#operation/ServiceCreate) API, passing
the [`service/create`](/reference/api/engine/version/v1.52/#operation/ServiceCreate) API, passing
the `PluginSpec` JSON defined in the `TaskTemplate`.

## Leave the swarm
Expand Down
49 changes: 49 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Lychee link checker configuration
# Replacement for htmltest

# Cache configuration
cache = true
max_cache_age = "6h"

require_https = false
# base_url = "https://docs.docker.com"

# Explicitly include file scheme for local fragment checking
# This is crucial for checking fragments in local HTML files
scheme = ["file"]

exclude = [
# Exclude external links (we only check internal links)
'^https?://.*',
# Ignore specific internal paths
'/reference/api/hub/',
# Exclude API engine version links with fragments (Redoc JavaScript-rendered)
'/reference/api/engine/version/v[0-9.]+/#',
'/reference/api/registry/',
]

# Exclude specific directories and file types
exclude_path = [
'registry/configuration',
'compose/compose-file',
# Exclude markdown/txt files from being scanned
'\.md$',
'\.txt$',
]

# Accept these HTTP status codes as valid
accept = [200, 204, 301, 302, 307, 308, 429]

# Configure retries and timeout
max_retries = 2
timeout = 10

# Set user agent
user_agent = "lychee/link-checker"

# Check fragments (anchors) in URLs
# This is essential for validating internal anchor links
include_fragments = true

# Don't ignore localhost since we're checking local files
exclude_loopback = false
Loading