A Dockerfile to proccess Apache Server-side Include and dump the fully rendered static files https://blog.narf.ssji.net/2023/04/24/render-apache-server-side-includes-docker/
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
# usage: | |
# | |
# docker build -t ssi-extractor - < Dockerfile | |
# docker run -v ./www:/usr/local/apache2/htdocs/ -v ./out:/out ssi-extractor | |
FROM httpd:alpine | |
RUN apk update \ | |
&& apk add wget | |
RUN sed -i \ | |
-e 's/#LoadModule include_module/LoadModule include_module/' \ | |
-e 's/#LoadModule negotiation_module/LoadModule negotiation_module/' \ | |
-e 's/Options Indexes FollowSymLinks/& Includes MultiViews/' \ | |
-e 's/#\(Add.*shtml\)/\1/' \ | |
-e 's/DirectoryIndex index.html/DirectoryIndex index.shtml/' \ | |
/usr/local/apache2/conf/httpd.conf \ | |
&& rm /usr/local/apache2/htdocs/index.html | |
RUN mkdir /out \ | |
&& echo '#!/bin/sh' > /cmd.sh \ | |
&& echo 'httpd-foreground &' >> /cmd.sh \ | |
&& echo 'sleep 3; cd /out; wget -rl 0 -nH -E --accept-regex "/[^.]*(.html)?$" http://localhost/' >> /cmd.sh \ | |
&& chmod a+x /cmd.sh | |
CMD ["/cmd.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment