Bug 18377 - Add Plack/PSGI file for dev install
Summary: Add Plack/PSGI file for dev install
Status: RESOLVED DUPLICATE of bug 16733
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-04 07:23 UTC by Julian Maurice
Modified: 2019-06-07 11:54 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18377: Add PSGI file for dev install (2.43 KB, patch)
2017-04-04 07:24 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2017-04-04 07:23:33 UTC
Koha lacks a proper Plack file for dev install.
debian/templates/plack.psgi is for package install and misc/plack/koha.psgi seems a bit outdated (you need 2 plack servers running — 1 for opac and 1 for intranet — and the REST API is not enabled in it)

I'll attach a new one, based on debian/templates/plack.psgi but suited for a dev install
Comment 1 Julian Maurice 2017-04-04 07:24:30 UTC
Created attachment 61812 [details] [review]
Bug 18377: Add PSGI file for dev install

It is very similar to the one for debian install, but uses FindBin to set the
paths
Comment 2 Julian Maurice 2017-04-04 07:32:18 UTC
Test plan:

1. Install koha in dev mode
2. Run `starman /your/koha/install/app.psgi`
3. Configure your webserver as a reverse proxy for starman (there is some examples for apache in debian/templates/apache-shared-*-plack.conf)
4. Verify that you can access OPAC, intranet and the REST API
Comment 3 Jonathan Druart 2017-05-30 15:10:26 UTC
Why do not you update misc/plack/koha.psgi?
Comment 4 Julian Maurice 2017-05-30 15:26:23 UTC
(In reply to Jonathan Druart from comment #3)
> Why do not you update misc/plack/koha.psgi?

I would have deleted it but I figured it may be used somewhere. Maybe we could add a deprecation warning in it before deleting it.
As to why I think /app.psgi is a better place, it's because you can just cd to koha directory and run starman without any arguments (you don't have to look after the psgi file), and it will work.

But I'm not strongly against updating misc/plack/koha.psgi if you still think it's better. I can make a new patch
Comment 5 Julian Maurice 2017-05-30 15:27:52 UTC
s/look after/look for/
Comment 6 Katrin Fischer 2017-10-15 13:09:46 UTC
Jonathan, could you take another look here?
Comment 7 Jonathan Druart 2017-10-16 13:20:27 UTC
It does not sound like a good idea to add a third .psgi file to maintain/update.

Tomas, what is your feeling about this change/need?
Comment 8 Julian Maurice 2017-10-16 13:37:47 UTC
(In reply to Jonathan Druart from comment #7)
> It does not sound like a good idea to add a third .psgi file to
> maintain/update.

My first intention was to move debian/templates/plack.psgi into app.psgi and remove misc/plack/ but I felt that it would have prevented a quick integration into master...

I believe that we should have one (and only one) psgi file, it should not be hidden in debian/ directory, and it should work out-of-the box on dev installs.

Changing status to In Discussion
Comment 9 Mason James 2018-02-17 03:53:23 UTC
(In reply to Julian Maurice from comment #0)
> Koha lacks a proper Plack file for dev install.
> debian/templates/plack.psgi is for package install and misc/plack/koha.psgi
> seems a bit outdated 

hi Julian

i think BZ16733 now provides DEV_INSTALL support in the debian/templates/plack.psgi file

so, this issue is now resolved?
Comment 10 Nick Clemens 2019-06-07 10:37:49 UTC

*** This bug has been marked as a duplicate of bug 16733 ***
Comment 11 Julian Maurice 2019-06-07 11:54:03 UTC
(In reply to Mason James from comment #9)
> (In reply to Julian Maurice from comment #0)
> > Koha lacks a proper Plack file for dev install.
> > debian/templates/plack.psgi is for package install and misc/plack/koha.psgi
> > seems a bit outdated 
> 
> hi Julian
> 
> i think BZ16733 now provides DEV_INSTALL support in the
> debian/templates/plack.psgi file
> 
> so, this issue is now resolved?
Sort of. I still believe that the main entry point for Koha should be outside of the debian/ directory, and that the "debian case" should be treated as a specific case, rather than the default.
But this "problem" would be solved if we decide to use a web framework like suggested in bug 20582, so this bug is obsolete anyway.