[Koha-bugs] [Bug 20582] Turn Koha into a Mojolicious application
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Jan 30 15:45:58 CET 2019
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20582
Josef Moravec <josef.moravec at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #74517|0 |1
is obsolete| |
Attachment #74518|0 |1
is obsolete| |
Attachment #74519|0 |1
is obsolete| |
Attachment #74520|0 |1
is obsolete| |
Attachment #79648|0 |1
is obsolete| |
Attachment #82423|0 |1
is obsolete| |
--- Comment #36 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 84526
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84526&action=edit
Bug 20582: Turn Koha into a Mojolicious application
This patch is a proof-of-concept of Koha as a Mojolicious application
This has several benefits:
- Run `morbo bin/koha` and you're set : fully functional Koha without
apache2/nginx (URL rewrites and static files are handled by the app)
- apache2/nginx configuration is much simpler (an example of nginx
configuration is included in the patch)
- starman and plack middlewares can still be used for debug or gzip
compression for instance (see bin/koha.psgi)
- All that is needed to run koha is in the source code and not hidden in
an obscure directory (I'm looking at you, debian/templates/plack.psgi)
- Using Test::Mojo we can test the whole application, as we do with the
REST API (which is a Mojolicious application too)
- It's another step in the direction of dropping CGI support
- It also opens a way for converting CGI scripts into Mojolicious
controllers and actions (even if that's not possible at the moment
because of the authentication code)
- It requires zero changes to existing files, so it should apply nicely
forever (no rebase needed \o/)
A few downsides too:
- It is not complete : some things from debian/templates/plack.psgi are
missing, like the L1 cache flush or Koha::Middleware::SetEnv. But that
shouldn't be too hard to add.
- Already mentioned above, but the actual state of get_template_and_user
and checkauth completely forbids the use of Mojolicious controllers.
We really need to rewrite C4::Auth
- Not sure if it's a downside or not, but as OPAC and Intranet are on
the same host:port, if you authenticate on OPAC you will be
authenticated on Intranet too.
This can probably be changed if it's really a problem.
- ... see FIXME in the code
Other remarks:
- It uses the same mechanism as Plack::App::CGIBin to deal with CGI
scripts, so it should be equivalent in terms of performance
How to test ?
- Run `morbo bin/koha`, then go to:
- http://localhost:3000/ - Redirects to OPAC main page
- Then navigate in the OPAC, searching for bugs
- http://localhost:3000/intranet - Redirects to intranet main page
- Then navigate in the Intranet, still searching for bugs
- http://localhost:3000/api/v1/... - The REST API
- Test the web installer
- Read the code (and the comments), it's not very long
Signed-off-by: Josef Moravec <josef.moravec at gmail.com>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list