From 8d2ad9b385fe9850571af1a8c2f2e97b4da366e6 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 7 Oct 2020 10:14:59 +0200 Subject: [PATCH] Bug 26625: Add a mojolicious section in $KOHA_CONF This allows to configure hypnotoad (listen address, number of workers, ...) https://metacpan.org/pod/Mojo::Server::Hypnotoad#SETTINGS --- Koha/App/Intranet.pm | 7 +++++++ Koha/App/Opac.pm | 7 +++++++ etc/koha-conf.xml | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/Koha/App/Intranet.pm b/Koha/App/Intranet.pm index bf66e9e62b..6278319247 100644 --- a/Koha/App/Intranet.pm +++ b/Koha/App/Intranet.pm @@ -24,9 +24,16 @@ use Mojo::Base 'Mojolicious'; use Koha::Caches; use Koha::Cache::Memory::Lite; +use C4::Context; + sub startup { my ($self) = @_; + my $config = C4::Context->config('mojolicious'); + if ($config && $config->{intranet} && $config->{intranet}->{config}) { + $self->config($config->{intranet}->{config}); + } + push @{$self->plugins->namespaces}, 'Koha::App::Plugin'; push @{$self->static->paths}, $self->home->rel_file('koha-tmpl'); diff --git a/Koha/App/Opac.pm b/Koha/App/Opac.pm index 7af85e1515..5e4de12ceb 100644 --- a/Koha/App/Opac.pm +++ b/Koha/App/Opac.pm @@ -24,9 +24,16 @@ use Mojo::Base 'Mojolicious'; use Koha::Caches; use Koha::Cache::Memory::Lite; +use C4::Context; + sub startup { my ($self) = @_; + my $config = C4::Context->config('mojolicious'); + if ($config && $config->{opac} && $config->{opac}->{config}) { + $self->config($config->{opac}->{config}); + } + push @{$self->plugins->namespaces}, 'Koha::App::Plugin'; push @{$self->static->paths}, $self->home->rel_file('koha-tmpl'); diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index eff50d2bcd..b2da6b3689 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -270,5 +270,24 @@ __PAZPAR2_TOGGLE_XML_POST__ __SMTP_DEBUG__ + + + + + + http://127.0.0.1:8080 + + + + + + + + http://127.0.0.1:8081 + + + + + -- 2.20.1