Skip to content

Commit

Permalink
Add feature to hash paths for URL retention
Browse files Browse the repository at this point in the history
  • Loading branch information
brettaufheber committed Dec 5, 2023
1 parent 5d832c5 commit 9762e80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions sha256path.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9762e80

Please sign in to comment.