Last active
December 14, 2019 01:43
-
-
Save antevens/458e6723ea3d09dd544ac8cb5d9111ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a script, this can easily be ported/re-written, I used /usr/local/bin/get_real_filename | |
#!/bin/bash | |
while read line ; do | |
abs_path="$(readlink "${line}")" | |
echo "processing ${line}" >> /tmp/log | |
if [ -n "${abs_path}" ] ; then | |
stdbuf --output=0 echo "$(basename "${abs_path}")" | |
else | |
stdbuf --output=0 echo 'NULL' | |
fi | |
done | |
sudo chmod 755 "/usr/local/bin/get_real_filename" | |
sudo chown root:root "/usr/local/bin/get_real_filename" | |
# In every virtualhost, (443 and 5000) add these lines around the top part: | |
# Set up rewrite map to look up real file names for sha256 sums for Docker-Content-Digest | |
RewriteEngine On | |
RewriteMap symlink "prg:/usr/local/bin/get_real_filename" apache:apache | |
# In pulp_docker.conf Under <Directory /var/www/pub/docker/v2/web/*/manifests/2>, around the other Headers | |
RewriteCond %{REQUEST_FILENAME} -l | |
RewriteCond ${symlink:%{REQUEST_FILENAME}} "(.+)" | |
RewriteRule "(.*)" - [E=DIGEST:%1] | |
Header set Docker-Content-Digest "%{DIGEST}e" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment