Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ jobs:
--manifest /tmp/s3-en-manifest.json \
--remote-prefix en/
aws s3 sync ./book s3://hacktricks-wiki/en --delete
bash scripts/upload_immutable_images.sh hacktricks-wiki en

- name: Upload root sitemap index
run: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/translate_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ jobs:
wget -O compare_and_fix_refs.py https://raw.githubusercontent.com/HackTricks-wiki/hacktricks-cloud/master/scripts/compare_and_fix_refs.py
wget -O translator.py https://raw.githubusercontent.com/HackTricks-wiki/hacktricks-cloud/master/scripts/translator.py
cp mark_unchanged_s3_files.py /tmp/mark_unchanged_s3_files.py
cp upload_immutable_images.sh /tmp/upload_immutable_images.sh
cd ..
mkdir -p /tmp/immutable-images
cp src/images/{hacktricks-summer-discount-2026-v1.webp,arte-badge-v1.webp,grte-badge-v1.webp,azrte-badge-v1.webp} /tmp/immutable-images/
cp theme/discount.js /tmp/discount.js
wget -O /tmp/seo_postprocess.py https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/master/scripts/seo_postprocess.py

- name: Run get_and_save_refs.py
Expand Down Expand Up @@ -128,6 +132,8 @@ jobs:
git checkout "$BRANCH"
git pull
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && echo "" && echo "" && echo "Debug logs" && (cat hacktricks-preprocessor.log | tail -n 20) && exit 1)
cp /tmp/immutable-images/* ./book/images/
cp /tmp/discount.js ./book/discount.js

- name: Push search index to hacktricks-searchindex repo
shell: bash
Expand Down Expand Up @@ -275,6 +281,7 @@ jobs:
--manifest /tmp/s3-branch-manifest.json \
--remote-prefix "$BRANCH/"
aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete
bash /tmp/upload_immutable_images.sh hacktricks-wiki "$BRANCH"
echo "Sync completed"
echo "Cat 3 files from the book"
find . -type f -name 'index.html' -print | head -n 3 | xargs -r cat
Expand Down
42 changes: 42 additions & 0 deletions scripts/upload_immutable_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -ne 2 ]; then
echo "usage: $0 <bucket> <language-prefix>" >&2
exit 2
fi

bucket="$1"
prefix="${2#/}"
prefix="${prefix%/}"
cache_control="public,max-age=31536000,immutable"

for image in \
hacktricks-summer-discount-2026-v1.webp \
arte-badge-v1.webp \
grte-badge-v1.webp \
azrte-badge-v1.webp; do
source_path="./book/images/${image}"
if [ ! -f "$source_path" ]; then
echo "Missing immutable image: $source_path" >&2
exit 1
fi
key="${prefix}/images/${image}"
local_etag="\"$(md5sum "$source_path" | cut -d' ' -f1)\""
remote_state="$(aws s3api head-object \
--bucket "$bucket" \
--key "$key" \
--query '[ETag,CacheControl,ContentType]' \
--output text 2>/dev/null || true)"
read -r remote_etag remote_cache_control remote_content_type <<< "$remote_state"
if [ "$remote_etag" = "$local_etag" ] \
&& [ "$remote_cache_control" = "$cache_control" ] \
&& [ "$remote_content_type" = "image/webp" ]; then
echo "Immutable image already current: $key"
continue
fi
aws s3 cp "$source_path" "s3://${bucket}/${key}" \
--only-show-errors \
--content-type image/webp \
--cache-control "$cache_control"
done
6 changes: 3 additions & 3 deletions src/banners/hacktricks-training.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
> [!TIP]
> Learn & practice AWS Hacking:<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://hacktricks-training.com/courses/arte)<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Learn & practice GCP Hacking: <img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training GCP Red Team Expert (GRTE)**](https://hacktricks-training.com/courses/grte)<img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Learn & practice Az Hacking: <img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training Azure Red Team Expert (AzRTE)**](https://hacktricks-training.com/courses/azrte)<img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Learn & practice AWS Hacking:<img src="../../../../../images/arte-badge-v1.webp" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://hacktricks-training.com/courses/arte)<img src="../../../../../images/arte-badge-v1.webp" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Learn & practice GCP Hacking: <img src="../../../../../images/grte-badge-v1.webp" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training GCP Red Team Expert (GRTE)**](https://hacktricks-training.com/courses/grte)<img src="../../../../../images/grte-badge-v1.webp" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Learn & practice Az Hacking: <img src="../../../../../images/azrte-badge-v1.webp" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training Azure Red Team Expert (AzRTE)**](https://hacktricks-training.com/courses/azrte)<img src="../../../../../images/azrte-badge-v1.webp" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Browse the [**full HackTricks Training catalog**](https://hacktricks-training.com/courses/).
>
> <details>
Expand Down
Binary file added src/images/arte-badge-v1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/azrte-badge-v1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/grte-badge-v1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion theme/discount.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var CAMPAIGN_ID = "summer-" + new Date().getFullYear()
var DISMISS_KEY = "htDiscountDismissedUntil:" + CAMPAIGN_ID
var DISMISS_MS = 10 * 24 * 60 * 60 * 1000
var IMAGE_PATH = "images/hacktricks-summer-discount-2026.png"
var IMAGE_PATH = "images/hacktricks-summer-discount-2026-v1.webp"
var TARGET_URL = "https://hacktricks-training.com"
var TITLE = "HackTricks Training Summer Discount"

Expand Down