Sign inSign up

jenswbe/dead-link-checker

By jenswbe

•Updated 10 days ago

DeLiC - Dead link checker written in Golang

Image
0

9.1K

jenswbe/dead-link-checker repository overview

Test, build and publish Docker Pulls

Dead link checker written in Golang using Colly⁠.

⁠1. Config

⁠Full example
# Required
sites:
  - url: https://jensw.be
    ignored_links: # Optional, list of regex's which should be ignored
      - ^https://jensw.be/do-not-visit-me.*
    notify: # Optional, send notification to these notifiers by name
      - email_technical_en

# Optional, globally ignored links (see sites.ignored_links)
ignored_links:
  - ^https://jensw.be/also-not-visit-me.*

# Optional, can also be set as environment variable VERBOSE.
# Default is False.
verbose: False

# Optional, run every night.
# If omitted or empty, DeLiC will check the provided sites once and exit.
cron: "0 0 * * *"

# Optional, endpoint to send GET request to on a successful run.
# If omitted or empty, health check request will be skipped.
health_check:
  url: "https://example.com/delic-health-check"

# Optional, see https://github.com/containrrr/shoutrrr/blob/main/docs/services/overview.md for supported URL's.
# If using "smtp", make sure to set option "usehtml=true".
notifiers:
  - name: email_technical_en
    url: smtp://smpt4dev:smpt4dev@localhost:8025/?from=delic@localhost&to=admin1@localhost,admin2@localhost&usehtml=true&subject=Broken%20links%20found
    template_name: "technical_en" # Currently only "technical_en" and "simple_nl" supported
⁠Minimal example

Probably only useful with --json flag.

sites:
  - url: https://jensw.be

⁠2. Run DeLiC

By default, DeLiC tries to read the config file at ./config.yml.

docker run --user "$(id -u):$(id -g)" -v /path/to/config.yml:/config.yml:ro,z jenswbe/dead-link-checker

or with Docker Compose:

services:
  delic:
    image: docker.io/jenswbe/dead-link-checker:latest
    user: "${UID}:${GID}"
    volumes:
      - "./config.yml:/config.yml:ro,z"

⁠3. CLI arguments

-c, --config    Location of the config file
    --json      Print all site reports as JSON to stdout
    --now       Overrides cron and forces an immediate check
-v, --verbose   Enable verbose output

⁠Development

⁠Running E2E tests

cd e2e
docker compose up -d
go test --tags e2e ./...

Tag summary

Content type

Image

Digest

sha256:2b74435a1…

Size

12.9 MB

Last updated

10 days ago

docker pull jenswbe/dead-link-checker