@@ -13,8 +13,13 @@ CPUS := $(shell sysctl -n hw.ncpu | awk '{print int($$1 / 2)}')
13
13
ALOGLIA_CONFIG =$(shell cat docsearch.dev.config.json | jq -r tostring)
14
14
15
15
# Find all *.md files in docs, cut the prefix ./
16
- # Remove all security-bulletins and cve-reports.md
17
- VERIFY_URL_PATHS =$(shell find ./docs -name "* .md" | cut -c 3- | sed '/security-bulletins/d' | sed '/cve-reports/d' )
16
+ # Remove all security-bulletins and cve-reports.md because they are rate limited by nvd.nist.gov
17
+ # Remove oss-licenses.md because they are rate limited by npmjs.com
18
+ VERIFY_URL_PATHS =$(shell find ./docs -name "* .md" | cut -c 3- | sed '/security-bulletins/d' | sed '/cve-reports/d' | sed '/oss-licenses/d')
19
+
20
+ RATE_LIMITED_FILES_LIST: ="docs/docs-content/security-bulletins/**/*.md" \
21
+ "docs/docs-content/security-bulletins/*.md" \
22
+ "docs/docs-content/unlisted/cve-reports.md"
18
23
19
24
help : # # Display this help
20
25
@awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[0m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
@@ -175,78 +180,36 @@ pdf-local: ## Generate PDF from local docs
175
180
verify-url-links :
176
181
@echo " Checking for broken external URLs in markdown files..."
177
182
rm link_report.csv || echo " No report exists. Proceeding to scan step"
178
- @npx linkinator $(VERIFY_URL_PATHS ) --concurrency 50 --markdown --recurse --timeout 100000 --retry --retry-errors-jitter --retry-errors-count 5 \
179
- --skip " ^https:\/\/docs\.spectrocloud\.com.*$$ " \
180
- --skip " ^https:\/\/docs\.spectrocloud\.com\/.*\/supplemental\-packs$$ " \
181
- --skip " ^http:\/\/docs\.spectrocloud\.com.*$$ " \
182
- --skip " ^https:\/\/software-private\.spectrocloud\.com.*$$ " \
183
- --skip " ^\/.*\.md$$ " \
184
- --skip " !\[.*\]\(.*\)$$ " \
185
- --skip " \.(jpg|jpeg|png|gif|webp)$$ " \
186
- --skip " https:\/\/linux\.die\.net\/man\/.*$$ " \
187
- --skip " https:\/\/mysql\.com\/.*\.*$$ " \
188
- --skip " https:\/\/dev\.mysql\.com\/doc\/.*$$ " \
189
- --format csv > temp_report.csv && sleep 2
183
+ @npx linkinator $(VERIFY_URL_PATHS ) --config ./linkinator/linkinator.config.json > temp_report.csv && sleep 2
190
184
@grep -E ' https?://' temp_report.csv > filtered_report.csv
191
185
@grep -E ' ,[[:space:]]*([4-9][0-9]{2}|[0-9]{4,}),' filtered_report.csv > link_report.csv && rm temp_report.csv filtered_report.csv
192
186
193
- verify-security-bulletins-links :
194
- @echo " Checking for broken URLs in security-bulletins markdown files..."
195
- rm link_sec_bul_report.csv || echo " No security bulletins report exists. Proceeding to scan step"
196
- @npx linkinator " docs/docs-content/security-bulletins/**/*.md" " docs/docs-content/security-bulletins/*.md" " docs/docs-content/unlisted/cve-reports.md" --concurrency 1 --markdown --recurse --timeout 100000 --retry --retry-errors-jitter --retry-errors-count 5 \
197
- --skip " ^https:\/\/docs\.spectrocloud\.com.*$$ " \
198
- --skip " ^https:\/\/docs\.spectrocloud\.com\/.*\/supplemental\-packs$$ " \
199
- --skip " ^http:\/\/docs\.spectrocloud\.com.*$$ " \
200
- --skip " ^https:\/\/software-private\.spectrocloud\.com.*$$ " \
201
- --skip " ^\/.*\.md$$ " \
202
- --skip " !\[.*\]\(.*\)$$ " \
203
- --skip " \.(jpg|jpeg|png|gif|webp)$$ " \
204
- --skip " https:\/\/linux\.die\.net\/man\/.*$$ " \
205
- --skip " https:\/\/mysql\.com\/.*\.*$$ " \
206
- --skip " https:\/\/dev\.mysql\.com\/doc\/.*$$ " \
207
- --format csv > temp_sec_bul_report.csv && sleep 2
208
- @grep -E ' https?://' temp_sec_bul_report.csv > filtered_sec_bul_report.csv
209
- @grep -E ' ,[[:space:]]*([4-9][0-9]{2}|[0-9]{4,}),' filtered_sec_bul_report.csv > link_sec_bul_report.csv && rm temp_sec_bul_report.csv filtered_sec_bul_report.csv
187
+ verify-rate-limited-links :
188
+ @echo " Checking for broken URLs in security-bulletins and oss-licenses markdown files..."
189
+ @rm link_rate_limit_report.csv || echo " No rate limited report exists. Proceeding to scan step"
190
+ @echo " Checking the following paths: $( RATE_LIMITED_FILES_LIST) "
191
+ @npx linkinator $(RATE_LIMITED_FILES_LIST ) --config ./linkinator/linkinator-rate-limit.config.json > temp_rate_limit_report.csv && sleep 2
192
+ @grep -E ' https?://' temp_rate_limit_report.csv > filtered_rate_limit_report.csv
193
+ @grep -E ' ,[[:space:]]*([4-9][0-9]{2}|[0-9]{4,}),' filtered_rate_limit_report.csv > link_rate_limit_report.csv && rm temp_rate_limit_report.csv filtered_rate_limit_report.csv
210
194
211
195
verify-url-links-ci : # # Check for broken URLs in production in a GitHub Actions CI environment
212
196
@echo " Checking for broken external URLs in CI environment..."
213
- rm link_report.json || echo " No report exists. Proceeding to scan step"
214
- @npx linkinator $(VERIFY_URL_PATHS ) --concurrency 50 --markdown --recurse --timeout 100000 --retry --retry-errors-jitter --retry-errors-count 5 \
215
- --skip " ^https:\/\/docs\.spectrocloud\.com.*$$ " \
216
- --skip " ^https:\/\/docs\.spectrocloud\.com\/.*\/supplemental\-packs$$ " \
217
- --skip " ^http:\/\/docs\.spectrocloud\.com.*$$ " \
218
- --skip " ^https:\/\/software-private\.spectrocloud\.com.*$$ " \
219
- --skip " ^\/.*\.md$$ " \
220
- --skip " !\[.*\]\(.*\)$$ " \
221
- --skip " \.(jpg|jpeg|png|gif|webp)$$ " \
222
- --skip " https:\/\/linux\.die\.net\/man\/.*$$ " \
223
- --skip " https:\/\/mysql\.com\/.*\.*$$ " \
224
- --skip " https:\/\/dev\.mysql\.com\/doc\/.*$$ " \
225
- --format json > temp_report.json
197
+ @rm link_report.json || echo " No report exists. Proceeding to scan step"
198
+ @npx linkinator $(VERIFY_URL_PATHS ) --config ./linkinator/linkinator-ci.config.json > temp_report.json
226
199
@# Use jq to filter out links that do not start with http or https and keep only broken links
227
200
@jq ' [.links[] | select(.url | test("^https?://")) | select(.status >= 400)]' temp_report.json > filtered_report.json
228
201
@rm temp_report.json
229
202
@mv filtered_report.json scripts/link_report.json
230
203
231
- verify-security-bulletins-links-ci : # # Check for broken URLs in production in a GitHub Actions CI environment
232
- @echo " Checking for broken URLs in security-bulletins markdown files in CI environment..."
233
- rm link_sec_bul_report.json || echo " No security bulletins report exists. Proceeding to scan step"
234
- @npx linkinator " docs/docs-content/security-bulletins/**/*.md" " docs/docs-content/security-bulletins/*.md" " docs/docs-content/unlisted/cve-reports.md" --concurrency 1 --markdown --recurse --timeout 100000 --retry --retry-errors-jitter --retry-errors-count 5 \
235
- --skip " ^https:\/\/docs\.spectrocloud\.com.*$$ " \
236
- --skip " ^https:\/\/docs\.spectrocloud\.com\/.*\/supplemental\-packs$$ " \
237
- --skip " ^http:\/\/docs\.spectrocloud\.com.*$$ " \
238
- --skip " ^https:\/\/software-private\.spectrocloud\.com.*$$ " \
239
- --skip " ^\/.*\.md$$ " \
240
- --skip " !\[.*\]\(.*\)$$ " \
241
- --skip " \.(jpg|jpeg|png|gif|webp)$$ " \
242
- --skip " https:\/\/linux\.die\.net\/man\/.*$$ " \
243
- --skip " https:\/\/mysql\.com\/.*\.*$$ " \
244
- --skip " https:\/\/dev\.mysql\.com\/doc\/.*$$ " \
245
- --format json > temp_sec_bul_report.json
204
+ verify-rate-limited-links-ci : # # Check for broken URLs in production in a GitHub Actions CI environment
205
+ @echo " Checking for broken URLs in security-bulletins and oss-licenses markdown files in CI environment..."
206
+ @rm link_rate_limit_report.json || echo " No rate limited report exists. Proceeding to scan step"
207
+ @echo " Checking the following paths: $( RATE_LIMITED_FILES_LIST) "
208
+ @npx linkinator $(RATE_LIMITED_FILES_LIST ) --config ./linkinator/linkinator-rate-limit-ci.config.json > temp_rate_limit_report.json
246
209
@# Use jq to filter out links that do not start with http or https and keep only broken links
247
- @jq ' [.links[] | select(.url | test("^https?://")) | select(.status >= 400)]' temp_sec_bul_report .json > filtered_sec_bul_report .json
248
- @rm temp_sec_bul_report .json
249
- @mv filtered_sec_bul_report .json scripts/link_sec_bul_report .json
210
+ @jq ' [.links[] | select(.url | test("^https?://")) | select(.status >= 400)]' temp_rate_limit_report .json > filtered_rate_limit_report .json
211
+ @rm temp_rate_limit_report .json
212
+ @mv filtered_rate_limit_report .json scripts/link_rate_limit_report .json
250
213
251
214
# ##@ Image Formatting
252
215
0 commit comments