diff --git a/.ci/packages/lychee.sh b/.ci/packages/lychee.sh new file mode 100755 index 00000000..4d053376 --- /dev/null +++ b/.ci/packages/lychee.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: 2025 Siemens AG +# +# SPDX-License-Identifier: Apache-2.0 +# +# Author: Michael Adler +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +. "$SCRIPT_DIR/versions.env" + +echo "Installing lychee $LYCHEE_VERSION" +curl -Ls "https://github.com/lycheeverse/lychee/releases/download/lychee-v${LYCHEE_VERSION}/lychee-x86_64-unknown-linux-musl.tar.gz" | + tar --extract --gzip --directory=/usr/local/bin lychee diff --git a/.ci/packages/markdown-link-check.sh b/.ci/packages/markdown-link-check.sh deleted file mode 100755 index 84d82ce0..00000000 --- a/.ci/packages/markdown-link-check.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# SPDX-FileCopyrightText: 2024 Siemens AG -# -# SPDX-License-Identifier: Apache-2.0 -# -# Author: Michael Adler -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -. "$SCRIPT_DIR/versions.env" - -echo "Installing markdown-link-check $MARKDOWN_LINK_CHECK_VERSION" -npm install -g "markdown-link-check@${MARKDOWN_LINK_CHECK_VERSION}" diff --git a/.ci/packages/versions.env b/.ci/packages/versions.env index d8d89700..1ec4a6e9 100644 --- a/.ci/packages/versions.env +++ b/.ci/packages/versions.env @@ -9,6 +9,6 @@ export PANDOC_VERSION=3.2 # github-releases/jgm/pandoc&versioning=semver export STATICCHECK_VERSION=2024.1.1 # github-releases/dominikh/go-tools&versioning=loose export SWAGGER_VERSION=0.31.0 # github-releases/go-swagger/go-swagger&versioning=semver export ZIG_VERSION=0.13.0 # github-releases/ziglang/zig&versioning=semver -export MARKDOWN_LINK_CHECK_VERSION=3.12.2 # github-releases/tcort/markdown-link-check&versioning=semver +export LYCHEE_VERSION=0.18.0 # github-releases/lycheeverse/lychee&versioning=semver export SYFT_VERSION=1.18.1 # github-releases/anchore/syft&versioning=semver export OAPI_CODEGEN_VERSION=2.4.1 # github-releases/oapi-codegen/oapi-codegen&versioning=semver diff --git a/.ci/setup-pages.sh b/.ci/setup-pages.sh index a8f9573f..95cae2e8 100755 --- a/.ci/setup-pages.sh +++ b/.ci/setup-pages.sh @@ -9,4 +9,4 @@ apt-get install -q -y --no-install-recommends npm imagemagick librsvg2-bin "$SCRIPT_DIR/packages/hugo.sh" "$SCRIPT_DIR/packages/just.sh" "$SCRIPT_DIR/packages/pandoc.sh" -"$SCRIPT_DIR/packages/markdown-link-check.sh" +"$SCRIPT_DIR/packages/lychee.sh" diff --git a/.markdown-link-check.json b/.markdown-link-check.json deleted file mode 100644 index bf4220f2..00000000 --- a/.markdown-link-check.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "^http://127.0.0.1" - }, - { - "pattern": "^http://localhost" - } - ], - "timeout": "10s", - "retryOn429": true, - "retryCount": 5, - "fallbackRetryDelay": "30s", - "aliveStatusCodes": [200, 206] -} diff --git a/justfile b/justfile index 6bdf5932..9522acb8 100644 --- a/justfile +++ b/justfile @@ -248,6 +248,6 @@ sqlite-generate-schema name: # Check links used in Markdown files. check-md-links: - git ls-files "*.md" | xargs -n1 markdown-link-check --config .markdown-link-check.json + git ls-files -z "*.md" | xargs -0 lychee # vim: ts=4 sw=4 expandtab diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 00000000..a4b4ce07 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: 2025 Siemens AG +# +# SPDX-License-Identifier: Apache-2.0 +# +# Author: Michael Adler +no_progress = true +exclude_loopback = true +accept = ["200..=204", "429"] diff --git a/shell.nix b/shell.nix index d3d888ef..e2770d37 100644 --- a/shell.nix +++ b/shell.nix @@ -15,10 +15,10 @@ mkShell { htmltest nodePackages.sql-formatter - nodePackages.markdown-link-check nodePackages.prettier nodePackages.markdownlint-cli shfmt + lychee go-swagger golangci-lint