[Bug 26625] New: Add a mojolicious section in $KOHA_CONF
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 Bug ID: 26625 Summary: Add a mojolicious section in $KOHA_CONF Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org Depends on: 20582 This will allow to configure hypnotoad (and probably other things too in the future) Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20582 [Bug 20582] Turn Koha into a Mojolicious application -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 111323 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111323&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Test plan: 1. Do not apply the patch yet 2. Run `hypnotoad bin/opac` and see that it listens on "http://*:8080" (its default value) 3. Run `hypnotoad -s bin/opac` to stop it 4. Repeat steps 2-3 for intranet 5. Apply the patch 6. Copy the <mojolicious> section from etc/koha-conf.xml to your $KOHA_CONF 7. Change the value of //mojolicious/opac/config/hypnotoad/listen in your $KOHA_CONF to "http://*:8181" 8. Run `hypnotoad bin/opac` and see that it now listens on port 8181 9. Run `hypnotoad -s bin/opac` to stop it 10. Repeat steps 7-9 for intranet -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- As an alternative, we could use the mojolicious Config plugin, but that would require having a separate configuration file for mojo. It might be a good idea, but really I don't know. It's a thing to consider while reviewing this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 111365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111365&action=edit Bug 26625: (alternative) Use Config plugin in Mojolicious apps This allows to have separate config files for each mojolicious app. They can also both use the same config file. The config file is Perl code, so the configuration can be dynamic See https://docs.mojolicious.org/Mojolicious/Plugin/Config -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add a mojolicious section |Add ability to configure |in $KOHA_CONF |mojolicious applications -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Julian Maurice from comment #3)
As an alternative, we could use the mojolicious Config plugin, but that would require having a separate configuration file for mojo. It might be a good idea, but really I don't know. It's a thing to consider while reviewing this patch.
I am fond of Config plugins ( like Catalyst::Plugin::ConfigLoader ), although with Catalyst I had the issue where I wanted to access the config in the Catalyst config from outside Catalyst for arbitrary non-web config items. Not sure how that works with Mojolicious, but with Catalyst I had to use Config::JFDI. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- But if there is something that is strictly relating to Mojolicious, I think having a separate config file sounds like a good idea. Considering that koha-conf.xml is actually a corruption of a YAZ configuration file, I think we should really be looking at alternatives to putting more things in koha-conf.xml... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to David Cook from comment #5)
I am fond of Config plugins ( like Catalyst::Plugin::ConfigLoader ), although with Catalyst I had the issue where I wanted to access the config in the Catalyst config from outside Catalyst for arbitrary non-web config items. Not sure how that works with Mojolicious, but with Catalyst I had to use Config::JFDI.
The eval command can be used for that: `bin/intranet eval -v 'use JSON; to_json(app->config)`. Not the most efficient way to read a config file, but at least it doesn't depend on config file format. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #8 from David Nind <david@davidnind.com> --- I had a go at testing, as this has been sitting in the needs sign off queue for a while. FYI: I don't know what a "mojolicious app" is, or what the use case is, and how to use it 8-) (so I am probably not the right person to test it!). Some notes from testing: 1. Steps 2 and 3: I get these messages: kohadev-koha@kohadevbox:koha(master)$ hypnotoad bin/opac Can't create listen socket: Address already in use at /usr/share/perl5/Mojo/IOLoop.pm line 124. kohadev-koha@kohadevbox:koha(master)$ hypnotoad bin/intranet Can't create listen socket: Address already in use at /usr/share/perl5/Mojo/IOLoop.pm line 124. 2. As expected (since it's been here a while), the first patch doesn't apply - the alternative patch still applies though: kohadev-koha@kohadevbox:koha(bz26625)$ git bz apply 26625 Bug 26625 - Add ability to configure mojolicious applications 111323 - Bug 26625: Add a mojolicious section in $KOHA_CONF 111365 - Bug 26625: (alternative) Use Config plugin in Mojolicious apps Apply? [(y)es, (n)o, (i)nteractive] i Applying: Bug 26625: Add a mojolicious section in $KOHA_CONF Using index info to reconstruct a base tree... M etc/koha-conf.xml Falling back to patching base and 3-way merge... Auto-merging etc/koha-conf.xml CONFLICT (content): Merge conflict in etc/koha-conf.xml error: Failed to merge in the changes. Patch failed at 0001 Bug 26625: Add a mojolicious section in $KOHA_CONF -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26625 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org