GitXplorerGitXplorer
s

urlsup

public
15 stars
1 forks
5 issues

Commits

List of commits on branch master.
Unverified
341f6e580339dacc553108c6b60904859e7df519

Bump dependencies and code fixes

ssimeg committed 3 years ago
Unverified
1c62146de5cd381141c70865ce40d8c6b68255dd

Update to 2021 edition

ssimeg committed 3 years ago
Unverified
35b797af5d0cd6482ac8ace6c95d10764bd88b9f

Update deps and new rustc version fixes

ssimeg committed 3 years ago
Unverified
a913b90b4b8b07843073dcb7970bede580c6f516

Pin action-rs/tarpaulin version

ssimeg committed 4 years ago
Unverified
a11099310573bada293f5def31a2711114ee5615

Update dependencies

ssimeg committed 4 years ago
Unverified
94cf14a1e14023c2818102a4b85d4bb66f8eb80f

Use pinned version of reqwest (0.11.0)

ssimeg committed 4 years ago

README

The README file for this repository.

urlsup CI Code Coverage

urlsup (urls up) finds URLs in files and checks whether they are up by making a GET request and checking the response status code. This tool is useful for lists, repos or any type of project containing URLs that you want to be up.

It's written in Rust (stable) and executes the requests async in multiple threads, making it very fast. This in combination with its ease of use makes it the perfect tool for your CI pipeline.

This project is a slim version of awesome_bot but aims to be faster.

Usage

USAGE:
    urlsup [OPTIONS] <FILES>...

FLAGS:
        --allow-timeout             URLs that time out are allowed

OPTIONS:
    -a, --allow <status codes>      Comma separated status code errors to allow
        --threads <thread count>    Thread count for making requests (default: CPU core count)
    -t, --timeout <seconds>         Connection timeout in seconds (default: 30)
    -w, --white-list <urls>         Comma separated URLs to white list

ARGS:
    <FILES>...    Files to check

Examples

$ urlsup `find . -name "*.md"`
> Using threads: 8
> Using timeout (seconds): 30
> Allow timeout: false
> Will check URLs in 1 file
   1. ./README.md

⠹ Finding URLs in files...

> Found 2 unique URLs, 3 in total
   1. https://httpstat.us/401
   2. https://httpstat.us/404

⠏ Checking URLs...

> Issues
   1. 401 https://httpstat.us/401
   2. 404 https://httpstat.us/404
$ urlsup `find . -name "*.md"`
> Using threads: 8
> Using timeout (seconds): 30
> Allow timeout: false
> Will check URLs in 1 file
   1. ./README.md

⠹ Finding URLs in files...

> Found 1 unique URL, 1 in total
   1. https://httpstat.us/200

⠏ Checking URLs...

> No issues!
$ urlsup README.md --white-list rust,crates
# white list all links starting with rust or crates

$ urlsup README.md,README-zh.md
# check links in 2 files

$ urlsup docs/*.md
# check all markdown files in docs/ directory

$ urlsup README.md --allow-timeout -t 5
# speed up validation by setting a timeout of 5 seconds per link request and allowing timeouts

$ urlsup README.md --allow 403,429
# allow status code errors 403 and 429

Installation

Install with cargo to run urlsup on your local machine.

cargo install urlsup

GitHub Actions

See urlsup-action.

Development

This repo uses a Makefile as an interface for common operations.

  1. Do code changes
  2. Run make build link to build the project and create a symlink from the built binary to the root of the project
  3. Run ./urlsup to execute the binary with your changes
  4. Profit ⭐