forked from openziti/ziti-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawl-for-broken-links.sh
More file actions
executable file
·49 lines (44 loc) · 1.1 KB
/
crawl-for-broken-links.sh
File metadata and controls
executable file
·49 lines (44 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
if [[ $# -eq 0 || $1 =~ -h|(--)?help ]]; then
echo "ERROR: need URL to check as first param. Extra params are passed to muffet" >&2
exit 1
else
SERVER="$1"
shift
fi
# ignore all http:// links and selected https:// links
EXCLUDE_PATTERN="(http://|https://("
while read -r; do
EXCLUDE_PATTERN+="${REPLY}|"
done<<EOF
EXWPKK5PV4-dsn.algolia.net
www\.google\.com/search
www\.googletagmanager\.com
mermaid-js\.github.io
mermaid\.live
mermaid\.ink
play\.google\.com
apps\.apple\.com
www\.reddit\.com/r/openziti
.*#(__)?docusaurus_skipToContent_fallback$
.*\.ziti
.*\.zitik8s
.*\.svc
twitter\.com/(OpenZiggy|OpenZiti)
landing.openziti.io/xmlrpc.php\?rsd
landing.openziti.io/wp-includes/wlwmanifest.xml
fonts.gstatic.com/
EOF
# github\.com/.*/releases/latest/download
EXCLUDE_PATTERN="${EXCLUDE_PATTERN%|}))"
docker run --rm --network=host raviqqe/muffet "${SERVER}" \
--buffer-size=8192 \
--max-connections-per-host=1 \
--header=User-Agent:curl/7.54.0 \
--timeout=20 \
"--exclude=${EXCLUDE_PATTERN}" \
"${@}"