From a77a3b629856e65fc7d64efdcba40d7d9d4f07f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20L=C3=B6ffler?= Date: Tue, 5 Dec 2023 13:53:12 +0100 Subject: [PATCH] Add feature to hash paths for URL retention --- Dockerfile | 4 ++++ sha256path.sh | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100755 sha256path.sh diff --git a/Dockerfile b/Dockerfile index 4909744..622f681 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,4 +62,8 @@ RUN apt-get update \ # add (and override) scripts to scripts in upstream image COPY ./scripts /opt/bitnami/scripts/apache/ +ADD sha256path.sh /opt/apache2-prg/ + +RUN chmod +x /opt/apache2-prg/sha256path.sh + USER 1001 diff --git a/sha256path.sh b/sha256path.sh new file mode 100755 index 0000000..aa690b6 --- /dev/null +++ b/sha256path.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +while read LINE; do + HASH="$(echo -n "$LINE" | sha256sum | cut -d ' ' -f1)" + echo -n "${HASH:0:2}/${HASH:2:2}/${HASH:4:2}/${HASH:6:2}" + echo -n "/${HASH:8:4}/${HASH:12:4}/${HASH:16:4}/${HASH:20:4}" + echo -n "/${HASH:24:8}/${HASH:32:8}/${HASH:40:8}" + echo -n "/${HASH:48:16}" + echo +done