summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-05-27 07:34:53 +0200
committerByron Jones <glob@mozilla.com>2014-05-27 07:34:53 +0200
commit049ea3d136ca73c82f5aa530f328d2596f8e6090 (patch)
tree892b9c5f78d1ca9e5e195eaacb641ad52ee6599b /Bugzilla/Install
parent612ab3f079cb9f716581c37d52804d2da0422929 (diff)
downloadbugzilla-049ea3d136ca73c82f5aa530f328d2596f8e6090.tar.gz
bugzilla-049ea3d136ca73c82f5aa530f328d2596f8e6090.tar.xz
Bug 1014374: backport bug 977969 to bmo (concatenate and slightly minify css files)
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/Filesystem.pm31
1 files changed, 27 insertions, 4 deletions
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index 5ea0917fa..fc05aaacd 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -125,6 +125,7 @@ sub FILESYSTEM {
my $localconfig = bz_locations()->{'localconfig'};
my $template_cache = bz_locations()->{'template_cache'};
my $graphsdir = bz_locations()->{'graphsdir'};
+ my $assetsdir = bz_locations()->{'assetsdir'};
# We want to set the permissions the same for all localconfig files
# across all PROJECTs, so we do something special with $localconfig,
@@ -211,7 +212,7 @@ sub FILESYSTEM {
dirs => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE },
"$datadir/db" => { files => CGI_WRITE,
dirs => DIR_CGI_WRITE },
- "$skinsdir/assets" => { files => WS_SERVE,
+ $assetsdir => { files => WS_SERVE,
dirs => DIR_CGI_OVERWRITE | DIR_ALSO_WS_SERVE },
# Readable directories
@@ -275,7 +276,8 @@ sub FILESYSTEM {
# The name of each directory that we should actually *create*,
# pointing at its default permissions.
my %create_dirs = (
- # This is DIR_ALSO_WS_SERVE because it contains $webdotdir.
+ # This is DIR_ALSO_WS_SERVE because it contains $webdotdir and
+ # $assetsdir.
$datadir => DIR_CGI_OVERWRITE | DIR_ALSO_WS_SERVE,
# Directories that are read-only for cgi scripts
"$datadir/mining" => DIR_CGI_READ,
@@ -286,7 +288,7 @@ sub FILESYSTEM {
$attachdir => DIR_CGI_WRITE,
$graphsdir => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE,
$webdotdir => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE,
- "$skinsdir/assets" => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE,
+ $assetsdir => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE,
# Directories that contain content served directly by the web server.
"$skinsdir/custom" => DIR_WS_SERVE,
"$skinsdir/contrib" => DIR_WS_SERVE,
@@ -376,6 +378,18 @@ EOT
Deny from all
EOT
},
+
+ "$assetsdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT
+# Allow access to .css files
+<FilesMatch \\.css\$>
+ Allow from all
+</FilesMatch>
+
+# And no directory listings, either.
+Deny from all
+EOT
+ },
+
);
Bugzilla::Hook::process('install_filesystem', {
@@ -534,9 +548,18 @@ sub _convert_single_file_skins {
# delete all automatically generated css files to force recreation at the next
# request.
sub _remove_dynamic_css_files {
- foreach my $file (glob(bz_locations()->{skinsdir} . '/assets/*.css')) {
+ foreach my $file (glob(bz_locations()->{assetsdir} . '/*.css')) {
unlink($file);
}
+
+ # remove old skins/assets directory
+ my $old_path = bz_locations()->{skinsdir} . '/assets';
+ if (-d $old_path) {
+ foreach my $file (glob("$old_path/*.css")) {
+ unlink($file);
+ }
+ rmdir($old_path);
+ }
}
sub create_htaccess {