From dd1a637083debf7c1a638aa2d1aa2c84524339f0 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Tue, 4 Aug 2015 14:04:35 -0400 Subject: [PATCH] Use sed to make .htaccess change, remove joomla.zip after update --- apache/Dockerfile | 1 - apache/docker-entrypoint.sh | 4 +- apache/joomla-htaccess.txt | 76 ------------------------------------- docker-entrypoint.sh | 4 +- fpm/Dockerfile | 1 - fpm/docker-entrypoint.sh | 4 +- fpm/joomla-htaccess.txt | 76 ------------------------------------- joomla-htaccess.txt | 76 ------------------------------------- update.sh | 3 +- 9 files changed, 8 insertions(+), 237 deletions(-) mode change 100644 => 100755 apache/Dockerfile delete mode 100644 apache/joomla-htaccess.txt mode change 100644 => 100755 fpm/Dockerfile delete mode 100644 fpm/joomla-htaccess.txt delete mode 100644 joomla-htaccess.txt diff --git a/apache/Dockerfile b/apache/Dockerfile old mode 100644 new mode 100755 index 02abba8..465b55d --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -27,7 +27,6 @@ RUN curl -o joomla.zip -SL https://github.com/joomla/joomla-cms/releases/downloa # Copy init scripts and custom .htaccess COPY docker-entrypoint.sh /entrypoint.sh -COPY joomla-htaccess.txt /joomla-htaccess.txt COPY makedb.php /makedb.php ENTRYPOINT ["/entrypoint.sh"] diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index 6770ba0..7791d28 100755 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -45,8 +45,8 @@ if ! [ -e index.php -a -e libraries/cms/version/version.php ]; then tar cf - --one-file-system -C /usr/src/joomla . | tar xf - if [ ! -e .htaccess ]; then - # NOTE: The "Indexes" option is disabled in the php:apache base image so we use a customized .htaccess - cp /joomla-htaccess.txt .htaccess + # NOTE: The "Indexes" option is disabled in the php:apache base image so remove it as we enable .htaccess + sed -r 's/^(Options -Indexes.*)$/#\1/' htaccess.txt > .htaccess chown www-data:www-data .htaccess fi diff --git a/apache/joomla-htaccess.txt b/apache/joomla-htaccess.txt deleted file mode 100644 index dbd6853..0000000 --- a/apache/joomla-htaccess.txt +++ /dev/null @@ -1,76 +0,0 @@ -## -# @package Joomla -# @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. -# @license GNU General Public License version 2 or later; see LICENSE.txt -## - -## -# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE! -# -# The line just below this section: 'Options +FollowSymLinks' may cause problems -# with some server configurations. It is required for use of mod_rewrite, but may already -# be set by your server administrator in a way that disallows changing it in -# your .htaccess file. If using it causes your server to error out, comment it out (add # to -# beginning of line), reload your site in your browser and test your sef url's. If they work, -# it has been set by your server administrator and you do not need it set here. -## - -## No directory listings -IndexIgnore * - -## Can be commented out if causes errors, see notes above. -Options +FollowSymlinks -# Options -Indexes - -## Mod_rewrite in use. - -RewriteEngine On - -## Begin - Rewrite rules to block out some common exploits. -# If you experience problems on your site block out the operations listed below -# This attempts to block the most common type of exploit `attempts` to Joomla! -# -# Block out any script trying to base64_encode data within the URL. -RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] -# Block out any script that includes a