benrubson commented on a change in pull request #469: GUACAMOLE-890: Security: 
Allow image to run as non-root user
URL: https://github.com/apache/guacamole-client/pull/469#discussion_r373166716
 
 

 ##########
 File path: Dockerfile
 ##########
 @@ -56,6 +56,13 @@ WORKDIR /opt/guacamole
 # Copy artifacts from builder image into this image
 COPY --from=builder /opt/guacamole/ .
 
+# Turn on the Remote IP Valve
+RUN sed -i 's+^\(\( *\)</Host>\)+\2  <Valve 
className="org.apache.catalina.valves.RemoteIpValve" />\n\n\1+' 
/usr/local/tomcat/conf/server.xml
 
 Review comment:
   Thank you for your review @manolan1 👍
   
   > Why does the regex care about spaces before the closing tag?
   
   To be sure, in addition to the `^` anchor, to select the real closing tag, 
and not for example a comment.
   
   > And, if it does, shouldn't it use a generic whitespace pattern rather than 
a space?
   
   I used space because the .xml file uses spaces, but I've switched to `\s`, 
even stronger. Thx.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to