View | Details | Raw Unified | Return to bug 41774
Collapse All | Expand All

(-)a/Koha/Encryption.pm (-2 / +2 lines)
Lines 54-63 It's based on Crypt::CBC Link Here
54
54
55
sub new {
55
sub new {
56
    my ($class) = @_;
56
    my ($class) = @_;
57
    my $encryption_key = C4::Context->config('encryption_key');
57
    my $encryption_key = C4::Context->config('encryption_key') || $ENV{KOHA_ENCRYPTION_KEY};
58
    if ( !$encryption_key || $encryption_key eq '__ENCRYPTION_KEY__' ) {
58
    if ( !$encryption_key || $encryption_key eq '__ENCRYPTION_KEY__' ) {
59
        Koha::Exceptions::MissingParameter->throw(
59
        Koha::Exceptions::MissingParameter->throw(
60
            q{No encryption_key in koha-conf.xml. Please generate a key. We recommend one of at least 32 bytes. (You might use 'pwgen 32' to do so.)}
60
            q{No encryption_key in koha-conf.xml or environment variable KOHA_ENCRYPTION_KEY. Please generate a key. We recommend one of at least 32 bytes. (You might use 'pwgen 32' to do so.)}
61
        );
61
        );
62
    }
62
    }
63
    return $class->SUPER::new(
63
    return $class->SUPER::new(
(-)a/about.pl (-4 / +4 lines)
Lines 290-296 if ( $tab eq 'sysinfo' ) { Link Here
290
        };
290
        };
291
    }
291
    }
292
292
293
    my $encryption_key = C4::Context->config('encryption_key');
293
    my $encryption_key = C4::Context->config('encryption_key') || $ENV{KOHA_ENCRYPTION_KEY};
294
    if ( !$encryption_key || $encryption_key eq '__ENCRYPTION_KEY__' ) {
294
    if ( !$encryption_key || $encryption_key eq '__ENCRYPTION_KEY__' ) {
295
        push @xml_config_warnings, { error => 'encryption_key_missing' };
295
        push @xml_config_warnings, { error => 'encryption_key_missing' };
296
    }
296
    }
Lines 954-960 if ( $tab eq 'database' ) { Link Here
954
954
955
my $bwsbranch_filename = '/usr/share/koha/bin/bwsbranch';
955
my $bwsbranch_filename = '/usr/share/koha/bin/bwsbranch';
956
if ( -r $bwsbranch_filename ) {
956
if ( -r $bwsbranch_filename ) {
957
    my $bwsbranch = read_file( $bwsbranch_filename );
957
    my $bwsbranch = read_file($bwsbranch_filename);
958
    $template->param( bwsbranch => $bwsbranch );
958
    $template->param( bwsbranch => $bwsbranch );
959
}
959
}
960
960
Lines 962-969 my $url = C4::Context->preference('staffClientBaseURL'); Link Here
962
$url =~ s|https://||;
962
$url =~ s|https://||;
963
$url =~ s|http://||;
963
$url =~ s|http://||;
964
$template->param(
964
$template->param(
965
    inbound_ip => qx{dig $url +short | grep '^[.0-9]*\$'},
965
    inbound_ip  => qx{dig $url +short | grep '^[.0-9]*\$'},
966
    outbound_ip  => qx{curl ipinfo.io/ip},
966
    outbound_ip => qx{curl ipinfo.io/ip},
967
);
967
);
968
968
969
output_html_with_http_headers $query, $cookie, $template->output;
969
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/debian/scripts/koha-plack (+1 lines)
Lines 117-122 start_plack() Link Here
117
117
118
    if ! is_plack_running ${instancename}; then
118
    if ! is_plack_running ${instancename}; then
119
        export KOHA_CONF="/etc/koha/sites/${instancename}/koha-conf.xml"
119
        export KOHA_CONF="/etc/koha/sites/${instancename}/koha-conf.xml"
120
        [ -n "$KOHA_ENCRYPTION_KEY" ] && export KOHA_ENCRYPTION_KEY
120
121
121
        log_daemon_msg "Starting Plack daemon for ${instancename}"
122
        log_daemon_msg "Starting Plack daemon for ${instancename}"
122
123
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-1 / +4 lines)
Lines 771-777 Link Here
771
                        [% ELSIF config_entry.error == 'encryption_key_missing' %]
771
                        [% ELSIF config_entry.error == 'encryption_key_missing' %]
772
                            <tr>
772
                            <tr>
773
                                <th scope="row"><strong>Warning</strong></th>
773
                                <th scope="row"><strong>Warning</strong></th>
774
                                <td> You are missing the &lt;encryption_key&gt; entry in your koha-conf.xml file. Please generate a key. We recommend one of at least 32 bytes. (You might use 'pwgen 32' to do so.) </td>
774
                                <td>
775
                                    You are missing the &lt;encryption_key&gt; entry in your koha-conf.xml file ( or as an environment variable KOHA_ENCRYPTION_KEY ). Please generate a key. We recommend one of at least 32 bytes. (You might
776
                                    use 'pwgen 32' to do so.)
777
                                </td>
775
                            </tr>
778
                            </tr>
776
                        [% END # /IF config_entry.error %]
779
                        [% END # /IF config_entry.error %]
777
                    [% END # /FOREACH config_entry %]
780
                    [% END # /FOREACH config_entry %]
(-)a/members/two_factor_auth.pl (-2 / +1 lines)
Lines 64-70 if ( !$patron ) { Link Here
64
    exit;
64
    exit;
65
}
65
}
66
66
67
if ( !C4::Context->config('encryption_key') ) {
67
if ( !( C4::Context->config('encryption_key') || $ENV{KOHA_ENCRYPTION_KEY} ) ) {
68
    $template->param( missing_key => 1 );
68
    $template->param( missing_key => 1 );
69
} else {
69
} else {
70
70
71
- 

Return to bug 41774