diff --git a/.github/workflows/md-link-check.yml b/.github/workflows/md-link-check.yml new file mode 100644 index 0000000..f6face4 --- /dev/null +++ b/.github/workflows/md-link-check.yml @@ -0,0 +1,52 @@ +name: Check Markdown links + +on: push + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + +# name: Markdown Link Check + +# on: +# push: +# pull_request: +# branches: +# - dev + +# jobs: +# link-check: +# runs-on: ubuntu-22.04 +# env: +# CI: true +# steps: +# - name: Setup Action +# uses: actions/checkout@master +# # - name: Setup Node +# # uses: actions/setup-node@v4 +# # with: +# # node-version: 12.x +# - name: Install dependencies +# run: npm install +# - name: Run link check +# run: npm run link-check +# - name: Show broken links +# if: failure() +# run: | +# cat log | awk -v RS="FILE:" 'match($0, /(\S*\.md).*\[✖\].*(\d*\slinks\schecked\.)(.*)/, arr ) { print "FILE:"arr[1] arr[3] > "brokenlinks"}' +# rm -f err log +# cat brokenlinks +# links=`cat brokenlinks` +# links="${links//'%'/'%25'}" +# links="${links//$'\n'/'%0A'}" +# links="${links//$'\r'/'%0D'}" +# echo ::set-output name=links::**Following links are broken:** %0A$links +# - name: Send comment to PR with broken links +# if: failure() && github.event_name == 'pull_request' +# uses: thollander/actions-comment-pull-request@main +# with: +# message: ${{ steps.brokenlinks.outputs.links }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.linkcheck.json b/.linkcheck.json new file mode 100644 index 0000000..cd4d17c --- /dev/null +++ b/.linkcheck.json @@ -0,0 +1,10 @@ +{ + "default": true, + "MD004": { "style": "dash"}, + "MD007": {"indent": 4}, + "MD013": false, + "MD024": { "siblings_only": true}, + "MD029": false, + "MD033": { "allowed_elements": [ "details" , "summary" ]}, + "MD040": false +} \ No newline at end of file diff --git a/README.md b/README.md index 3ad2510..322a28d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ Data Leak, scam, username - [WhatsMyName](https://whatsmyname.app/) - This tool allow to enumerate usernames across many websites.
-[⇧ Top](#index) ## AI AI tools/Site - [Decktopus](https://www.decktopus.com/) - Create beautiful & professional presentations in just minutes. @@ -56,7 +55,7 @@ Tools for Image/Audio/Video/Doc reconnaissance [⇧ Top](#index) ## PRODUCTIVITY -- [unfurl](https://dfir.blog/unfurl/) - Unflurl url +- [unfurl](https://dfir.blog/unfurl/) - Break down url into pieces and find out what each thing do. - [Wolfram|Alpha](https://www.wolframalpha.com/) - solve mathematical Equations - [Cryptpad.fr](https://cryptpad.fr/) - Flagship instance of CryptPad, the end-to-end encrypted and open-source collaboration suite. Administered by the CryptPad development team. - [Recontool.org](https://recontool.org/) - Recon tools @@ -99,7 +98,7 @@ It takes a 'snapshot' of a webpage that will always be online even if the origin - [Multi Translate](https://translate.mix.pink/) - [Yandex.Translate](https://translate.yandex.com/) - translator from yandex - [Bing Microsoft Translator](https://www.bing.com/translator) - translator from microsoft -- [Reverso](https://www.reverso.net/text_translation.aspx?lang=EN) - Enjoy cutting-edge AI-powered translation from Reverso in 15+ languages +- [Reverso](https://www.reverso.net/text_translation.aspx?lang=EN) - Enjoy cutting-edge AI-powered translation from Reverso in 25+ languages including Arabic, Chinese, Italian, Portuguese, Dutch, Hebrew, Turkish, and Polish - [Translate](https://www.translatedict.com/) - - [text to speech online](https://www.naturalreaders.com/online/) - text to speech translator online diff --git a/markdown-link-check-config.json b/markdown-link-check-config.json new file mode 100644 index 0000000..3034efc --- /dev/null +++ b/markdown-link-check-config.json @@ -0,0 +1,18 @@ +{ + "ignorePatterns": [ + { + "pattern": "^bundle.zip" + }, + { + "pattern": "^/" + } + ], + "httpHeaders": [ + { + "urls": ["https://", "http://"], + "headers": { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0" + } + } + ] + } \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..da948fb --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "devDependencies": { + "markdownlint-cli": "^0.26.0", + "textlint": "^11.6.3", + "textlint-filter-rule-comments": "^1.2.2", + "textlint-filter-rule-whitelist": "^2.0.0", + "textlint-rule-terminology": "^2.1.4" + }, + "scripts": { + "test": "npm run lint-markdown && npm run lint-terminology", + "lint-terminology": "textlint ./README.md", + "lint-markdown": "markdownlint ./README.md --ignore node_modules", + "link-check": find . -name README.md -exec markdown-link-check -c markdown-link-check-config.json 1> log 2> err {} \\; + // "link-check": "find README -name \\*.md -exec markdown-link-check -c markdown-link-check-config.json 1> log 2> err {} \\; && if [ -e err ] && grep -q \"ERROR:\" err ; then exit 113 ; else echo -e \"All good\"; fi" + } + } \ No newline at end of file diff --git a/scripts/apply_link_check.sh b/scripts/apply_link_check.sh new file mode 100644 index 0000000..aae7cd9 --- /dev/null +++ b/scripts/apply_link_check.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Script in charge of auditing the released cheatsheets MD files +# in order to detect dead links +# cd ../ +# find . -name \*.md -exec markdown-link-check -c ../.linkcheck.json {} \; 1>../link-check-result.out 2>&1 +# errors=`grep -c "ERROR:" ../link-check-result.out` +# content=`cat ../link-check-result.out` +# if [[ $errors != "0" ]] +# then +# echo "[!] Error(s) found by the Links validator: $errors CS have dead links !" +# exit $errors +# else +# echo "[+] No error found by the Links validator." +# fi + +# Only check the specific README.md file +target_file="../README.md" + +# Run link check with specific file and redirect output +markdown-link-check -c ../.linkcheck.json "$target_file" 1>../link-check-result.out 2>&1 + +# Check for errors and handle appropriately +errors=$(grep -c "ERROR:" ../link-check-result.out) + +if [[ $errors != "0" ]]; then + echo "[!] Error(s) found in 'README.md': $errors broken links!" + exit $errors +else + echo "[+] No errors found in 'README.md'." +fi