Skip to content

Commit

Permalink
Merge pull request #15 from aservo/feature/LAS-760_add_rewrite_rule_f…
Browse files Browse the repository at this point in the history
…or_url_retention

Add feature to hash paths for URL retention
  • Loading branch information
brettaufheber authored Dec 5, 2023
2 parents 5d832c5 + a77a3b6 commit 591edbb
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 591edbb

Please sign in to comment.