summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-04-26 18:39:36 +0200
committerDylan William Hardison <dylan@hardison.net>2017-04-28 02:23:09 +0200
commitb9c748cb794ab41424db260d3048ba877f547803 (patch)
tree24b055f62cabfa707a6d288ceda63bb14acd919a /Bugzilla/Install
parent6ca7232c409beeeea23c1ea98d9a6573815beaf9 (diff)
downloadbugzilla-b9c748cb794ab41424db260d3048ba877f547803.tar.gz
bugzilla-b9c748cb794ab41424db260d3048ba877f547803.tar.xz
Clean up here-docs
here-docs should either be at indent level 0 (and stored in constants) or replaced with other forms of quoting that can be idented more readibly.
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/Filesystem.pm133
1 files changed, 64 insertions, 69 deletions
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index c67823d7a..fef17fec2 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -43,12 +43,62 @@ our @EXPORT = qw(
fix_file_permissions
);
-use constant HT_DEFAULT_DENY => <<EOT;
+use constant HT_DEFAULT_DENY => <<'EOT';
# nothing in this directory is retrievable unless overridden by an .htaccess
# in a subdirectory
deny from all
EOT
+use constant HT_GRAPHS_DIR => <<'EOT';
+# Allow access to .png and .gif files.
+<FilesMatch (\.gif|\.png)$>
+ Allow from all
+</FilesMatch>
+
+# And no directory listings, either.
+Deny from all
+EOT
+
+use constant HT_WEBDOT_DIR => <<'EOT';
+# Restrict access to .dot files to the public webdot server at research.att.com
+# if research.att.com ever changes their IP, or if you use a different
+# webdot server, you'll need to edit this
+<FilesMatch \.dot$>
+ Allow from 192.20.225.0/24
+ Deny from all
+</FilesMatch>
+
+# Allow access to .png files created by a local copy of 'dot'
+<FilesMatch \.png\$>
+ Allow from all
+</FilesMatch>
+
+# And no directory listings, either.
+Deny from all
+EOT
+
+use constant HT_ASSETS_DIR => <<'EOT';
+# Allow access to .css and js files
+<FilesMatch \.(css|js)$>
+ Allow from all
+</FilesMatch>
+
+# And no directory listings, either.
+Deny from all
+EOT
+
+use constant INDEX_HTML => <<'EOT';
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=index.cgi">
+</head>
+<body>
+ <h1>I think you are looking for <a href="index.cgi">index.cgi</a></h1>
+</body>
+</html>
+EOT
+
###############
# Permissions #
###############
@@ -316,18 +366,7 @@ sub FILESYSTEM {
# Because checksetup controls the creation of index.html separately
# from all other files, it gets its very own hash.
my %index_html = (
- 'index.html' => { perms => WS_SERVE, contents => <<EOT
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="Refresh" content="0; URL=index.cgi">
-</head>
-<body>
- <h1>I think you are looking for <a href="index.cgi">index.cgi</a></h1>
-</body>
-</html>
-EOT
- }
+ 'index.html' => { perms => WS_SERVE, contents => INDEX_HTML }
);
# Because checksetup controls the .htaccess creation separately
@@ -358,48 +397,12 @@ EOT
contents => HT_DEFAULT_DENY },
"$error_reports/.htaccess" => { perms => WS_SERVE,
contents => HT_DEFAULT_DENY },
-
- "$graphsdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT
-# Allow access to .png and .gif files.
-<FilesMatch (\\.gif|\\.png)\$>
- Allow from all
-</FilesMatch>
-
-# And no directory listings, either.
-Deny from all
-EOT
- },
-
- "$webdotdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT
-# Restrict access to .dot files to the public webdot server at research.att.com
-# if research.att.com ever changes their IP, or if you use a different
-# webdot server, you'll need to edit this
-<FilesMatch \\.dot\$>
- Allow from 192.20.225.0/24
- Deny from all
-</FilesMatch>
-
-# Allow access to .png files created by a local copy of 'dot'
-<FilesMatch \\.png\$>
- Allow from all
-</FilesMatch>
-
-# And no directory listings, either.
-Deny from all
-EOT
- },
-
- "$assetsdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT
-# Allow access to .css files
-<FilesMatch \\.(css|js)\$>
- Allow from all
-</FilesMatch>
-
-# And no directory listings, either.
-Deny from all
-EOT
- },
-
+ "$graphsdir/.htaEcess" => { perms => WS_SERVE,
+ contents => HT_GRAPHS_DIR },
+ "$webdotdir/.htaccess" => { perms => WS_SERVE,
+ contents => HT_WEBDOT_DIR },
+ "$assetsdir/.htaccess" => { perms => WS_SERVE,
+ contents => HT_ASSETS_DIR },
);
Bugzilla::Hook::process('install_filesystem', {
@@ -481,14 +484,10 @@ sub update_filesystem {
}
elsif (-e 'index.html') {
my $templatedir = bz_locations()->{'templatedir'};
- print <<EOT;
-
-*** It appears that you still have an old index.html hanging around.
- Either the contents of this file should be moved into a template and
- placed in the '$templatedir/en/custom' directory, or you should delete
- the file.
-
-EOT
+ print "*** It appears that you still have an old index.html hanging around.\n",
+ "Either the contents of this file should be moved into a template and\n",
+ "placed in the '$templatedir/en/custom' directory, or you should delete\n",
+ "the file.\n";
}
# Delete old files that no longer need to exist
@@ -534,12 +533,8 @@ sub _remove_empty_css_files {
sub _remove_empty_css {
my ($file) = @_;
my $basename = basename($file);
- my $empty_contents = <<EOT;
-/*
- * Custom rules for $basename.
- * The rules you put here override rules in that stylesheet.
- */
-EOT
+ my $empty_contents = "/* Custom rules for $basename.\n"
+ . " * The rules you put here override rules in that stylesheet. */";
if (length($empty_contents) == -s $file) {
open(my $fh, '<', $file) or warn "$file: $!";
my $file_contents;