No description
Find a file
2025-05-04 10:54:21 +02:00
.woodpecker initial release 2025-05-04 10:49:50 +02:00
cmd/dharma initial release 2025-05-04 10:49:50 +02:00
pkg initial release 2025-05-04 10:49:50 +02:00
scripts initial release 2025-05-04 10:49:50 +02:00
testsite initial release 2025-05-04 10:49:50 +02:00
.gitignore initial release 2025-05-04 10:49:50 +02:00
.goreleaser.yml initial release 2025-05-04 10:49:50 +02:00
go.mod initial release 2025-05-04 10:49:50 +02:00
go.sum initial release 2025-05-04 10:49:50 +02:00
LICENSE initial release 2025-05-04 10:49:50 +02:00
Makefile initial release 2025-05-04 10:49:50 +02:00
README.md docs: update readme installation from release 2025-05-04 10:54:21 +02:00
testsite_test.go initial release 2025-05-04 10:49:50 +02:00

Dharma

A website link checker that crawls websites to find broken links, images, CSS references, and more.

Features

  • Crawls websites and checks for broken links, images, stylesheets, and other references
  • Checks both internal and external links
  • Supports CSS file scanning for @import and url() references
  • Concurrent requests for faster scanning
  • Multiple output formats (pretty terminal output, JSON, CSV)
  • Configurable scan depth, concurrency, and timeout

Installation

From releases

Download the latest release from the releases page for your platform, there are binaries for Linux, macOS and Windows along with Alpine, Fedora and Debian packages.

From Source

git clone git.nakama.town/fmartingr/dharma
cd dharma
go install ./cmd/dharma

Usage

# Basic usage (defaults to 'pretty' output format)
dharma https://example.com

# Use JSON output format
dharma --format json https://example.com

# Increase concurrency and depth
dharma --concurrency 20 --depth 5 https://example.com

# Increase timeout for slow sites
dharma --timeout 30 https://example.com

# Enable verbose output
dharma --verbose https://example.com

Command Line Options

  • --format, -f: Output format (pretty, json, csv) (default: "pretty")
  • --concurrency, -c: Number of concurrent requests (default: 10)
  • --depth, -d: Maximum depth to crawl (default: 3)
  • --timeout, -t: Timeout in seconds for each request (default: 10)
  • --verbose, -v: Enable verbose output

Development

Testing

The project includes a comprehensive test suite:

# Run all tests
go test -v ./...

# Run tests excluding integration tests
go test -v -short ./...

# Run testsite tests specifically
make test-testsite

A test site is included in the testsite/ directory to test the tool against a controlled environment with known broken and working links. The test suite will start a local HTTP server for this test site and run the tool against it to verify its functionality.

License

LICENSE