Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions Bugzilla/DB/MariaDB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,19 @@ sub bz_setup_database {
if (Bugzilla->params->{'utf8'} && $non_utf8_tables) {
print "\n", install_string('mysql_utf8_conversion');

if (!Bugzilla->installation_answers->{NO_PAUSE}) {
if (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
die install_string('continue_without_answers'), "\n";
}
else {
print "\n " . install_string('enter_or_ctrl_c');
getc;
}
my $allow_unsafe_utf8_conversion
= Bugzilla->installation_answers->{ALLOW_UNSAFE_UTF8_CONVERSION};
if ($allow_unsafe_utf8_conversion) {
print "\n"
. install_string('continuing_with_unsafe_utf8_conversion')
. "\n";
}
elsif (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
die install_string('continue_without_answers'), "\n";
}
else {
print "\n " . install_string('enter_or_ctrl_c');
getc;
}

print
Expand Down
21 changes: 13 additions & 8 deletions Bugzilla/DB/Mysql.pm
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,19 @@ sub bz_setup_database {
if (Bugzilla->params->{'utf8'} && $non_utf8_tables) {
print "\n", install_string('mysql_utf8_conversion');

if (!Bugzilla->installation_answers->{NO_PAUSE}) {
if (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
die install_string('continue_without_answers'), "\n";
}
else {
print "\n " . install_string('enter_or_ctrl_c');
getc;
}
my $allow_unsafe_utf8_conversion
= Bugzilla->installation_answers->{ALLOW_UNSAFE_UTF8_CONVERSION};
if ($allow_unsafe_utf8_conversion) {
print "\n"
. install_string('continuing_with_unsafe_utf8_conversion')
. "\n";
}
elsif (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
die install_string('continue_without_answers'), "\n";
}
else {
print "\n " . install_string('enter_or_ctrl_c');
getc;
}

print
Expand Down
2 changes: 2 additions & 0 deletions conf/checksetup_answers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ $answer{'ADMIN_PASSWORD'} = 'password01!';
$answer{'passwdqc_min'} = '8, 8, 8, 8, 8';
$answer{'ADMIN_REALNAME'} = 'Vagrant User';
$answer{'NO_PAUSE'} = 1;
$answer{'ALLOW_UNSAFE_UTF8_CONVERSION'}
= $ENV{'BZ_ALLOW_UNSAFE_UTF8_CONVERSION'} ? 1 : 0;
$answer{'size_limit'} = 750000;
$answer{'bugzilla_version'} = '1';
$answer{'create_htaccess'} = '1';
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- BMO_ses_password=password123456789!
- BMO_urlbase=http://127.0.0.1:8000/
- BUGZILLA_ALLOW_INSECURE_HTTP=1
- BZ_ALLOW_UNSAFE_UTF8_CONVERSION=${BZ_ALLOW_UNSAFE_UTF8_CONVERSION:-0}
- BZ_ANSWERS_FILE=/app/conf/checksetup_answers.txt
- HTTP_BACKEND=morbo
- LOCALCONFIG_ENV=1
Expand Down
8 changes: 8 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ Currently, the entry point takes a single command argument. This can be
This should never be set in production. It allows auth delegation
and oauth over http.

- BZ\_ALLOW\_UNSAFE\_UTF8\_CONVERSION
Controls whether checksetup may proceed with the database UTF-8
conversion in non-interactive mode. Default: 0.

Set this to 1 only when you explicitly approve the conversion and
have a database backup. For example:
`BZ_ALLOW_UNSAFE_UTF8_CONVERSION=1 docker compose up`

- BMO\_urlbase
The public URL for this instance. Note that if this begins with
<https://> and BMO\_inbound\_proxies is set to '\*' Bugzilla will
Expand Down
7 changes: 7 additions & 0 deletions template/en/default/setup/strings.txt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ END
continue_without_answers => <<'END',
Re-run checksetup.pl in interactive mode (without an 'answers' file)
to continue.

To continue non-interactively, set ALLOW_UNSAFE_UTF8_CONVERSION to 1
in your answers file.
END
continuing_with_unsafe_utf8_conversion => <<'END',
WARNING: ALLOW_UNSAFE_UTF8_CONVERSION is enabled. Continuing the UTF-8
conversion without an interactive confirmation prompt.
END
cpanfile_created => "##file## created",
cpan_bugzilla_home => "WARNING: Using the Bugzilla directory as the CPAN home.",
Expand Down
Loading