diff options
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r-- | Bugzilla/Install/DB.pm | 2 | ||||
-rw-r--r-- | Bugzilla/Install/Filesystem.pm | 82 | ||||
-rw-r--r-- | Bugzilla/Install/Localconfig.pm | 7 |
3 files changed, 88 insertions, 3 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index e6a7a3be0..2c8a22448 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -3895,7 +3895,7 @@ sub _migrate_group_owners { my $dbh = Bugzilla->dbh; return if $dbh->bz_column_info('groups', 'owner_user_id'); $dbh->bz_add_column('groups', 'owner_user_id', {TYPE => 'INT3'}); - my $nobody = Bugzilla::User->check('nobody@mozilla.org'); + my $nobody = Bugzilla::User->check(Bugzilla->params->{'nobody_user'}); $dbh->do('UPDATE groups SET owner_user_id = ?', undef, $nobody->id); } diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 71169345b..5e51dd9cc 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -115,6 +115,52 @@ sub HTTPD_ENV_CONF { return join( "\n", map { "PerlPassEnv " . $_ } @env ) . "\n"; } +sub _error_page { + my ($code, $title, $description) = @_; + warn "urlbase: ", Bugzilla->urlbase, "\n"; + my $host = Bugzilla->urlbase->host; + + return <<EOT; +<!DOCTYPE HTML> +<html> + <head> + <title>$title</title> + <style> + body { + margin: 1em 2em; + background-color: #455372; + color: #ddd; + font-family: sans-serif; + } + h1, h3 { + color: #fff; + } + a { + color: #fff; + text-decoration: none; + } + #buggie { + float: left; + } + #content { + margin-left: 100px; + padding-top: 20px; + } + </style> + </head> + <body> + <img src="/images/buggie.png" id="buggie" alt="buggie" width="78" height="215"> + <div id="content"> + <h1>$title</h1> + <p>$description</p> + <h3>Error $code</h3> + <p><a href="/">$host</a></p> + </div> + </body> +</html> +EOT +} + ############### # Permissions # ############### @@ -430,6 +476,40 @@ sub FILESYSTEM { contents => \&HTTPD_ENV_CONF }, ); + # Create static error pages. + $create_dirs{"errors"} = DIR_CGI_READ; + $create_files{"errors/401.html"} = { + perms => CGI_READ, + overwrite => 1, + contents => _error_page( + 401, 'Authentication Required', + "This server could not verify that you are authorized to access + that url. you either supplied the wrong credentials (e.g., bad + password), or your browser doesn't understand how to supply the + credentials required.") + }; + $create_files{"errors/403.html"} = { + perms => CGI_READ, + overwrite => 1, + contents => _error_page( + 403, 'Access Denied', + "Access to the requested resource has been denied.") + }; + $create_files{"errors/404.html"} = { + perms => CGI_READ, + overwrite => 1, + contents => _error_page( + 404, 'Object Not Found', + "The requested URL was not found on this server.") + }; + $create_files{"errors/500.html"} = { + perms => CGI_READ, + overwrite => 1, + contents => _error_page( + 500, 'Internal Server Error', + "The server encountered an internal error and was unable to complete your request.") + }; + # Because checksetup controls the creation of index.html separately # from all other files, it gets its very own hash. my %index_html = ( @@ -564,7 +644,7 @@ sub update_filesystem { # Delete old files that no longer need to exist # 2001-04-29 jake@bugzilla.org - Remove oldemailtech - # http://bugzilla.mozilla.org/show_bugs.cgi?id=71552 + # http://bugzilla.mozilla.org/show_bug.cgi?id=71552 if (-d 'shadow') { print "Removing shadow directory...\n"; rmtree("shadow"); diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index 7a913358c..85092f23a 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -283,7 +283,12 @@ sub read_localconfig { my ($include_deprecated) = @_; if ($ENV{LOCALCONFIG_ENV}) { - return _read_localconfig_from_env(); + my $lc = _read_localconfig_from_env(); + if ( $lc->{urlbase} eq 'AUTOMATIC' ) { + $lc->{urlbase} = sprintf 'http://%s:%d/%s', hostname(), $ENV{PORT}, $ENV{BZ_QA_LEGACY_MODE} ? 'bmo/' : ''; + $ENV{BZ_BASE_URL} = sprintf 'http://%s:%d', hostname(), $ENV{PORT}; + } + return $lc; } else { return _read_localconfig_from_file($include_deprecated); |