Act icon indicating copy to clipboard operation
Act copied to clipboard

Port to PSGI/Plack

Open perigrin opened this issue 14 years ago • 10 comments

Getting ACT into Github was a wonderful first step to opening up hacking. Getting ACT running on PSGI/Plack will be an excellent second setup. It will mean people don't have to set up mod_perl for doing development, something which even back in the day wasn't exact a trivial first step.

perigrin avatar Jul 20 '11 12:07 perigrin

mst once proposed to do that (and make someone work on that), and said that it should be a good example for Plack/PSGI's Apache handler or HTTP::Engine's mod_perl adaptor. And also that it should require few to none change in Act source. Never got any return on this, either positive ("the emulation thingy are worky") or negative. Don't know if that's because they didn't get the time to take a look or they just forgot to tell me. Guess I'll have to look into this myself :)

maddingue avatar Jul 21 '11 22:07 maddingue

actually I think someone is working on this now for YAPC::NA 2012

perigrin avatar Jul 28 '11 07:07 perigrin

(wrong button)

perigrin avatar Jul 28 '11 07:07 perigrin

hoelzro and I are working on this.

haarg avatar Jul 28 '11 11:07 haarg

How much effort/time will this be? I'm asking to gauge whether adding an issue about installation documentation would be worth it.

wchristian avatar Aug 01 '11 14:08 wchristian

@wchristian: in any case, porting to PSGI is needed. Act is (more or less) tied to mod_perl 1, which is long dead. It needs to be brought into modern web age.

maddingue avatar Aug 02 '11 00:08 maddingue

We now have a partly working port to Plack: https://github.com/hoelzro/Act/tree/psgi

The basic functionality of the site seems to be working, including registration and login. There are still a lot of rough edges to clean up, and certainly a number of bugs we've introduced.

The basic design is: Act::Dispatcher is a Plack app that dispatches to the handlers. Act::Handler::* are all Plack apps (subclassing Act::Handler) that get mounted at the appropriate URLs. Act::Handler adapts the PSGI conventions to the existing Act conventions such as %Request and $Config. Act::Request subclasses Plack::Request and has additional methods to be more compatible with the Apache API. Act::Middleware::Auth replaces the Apache::AuthCookie code.

The new auth code I wrote has some pretty ugly bits in it which I'll hopefully be able to fix soon, and we are working on getting the tests fixed.

Hopefully over time more of the code can be adapted to reduce the need for the backward compatibility hacks.

Comments welcome.

haarg avatar Aug 21 '11 04:08 haarg

Great work! I'm going to copy over your commits to a psgi branch over the main repo.

Given I have been republishing some other commits, our branches will look like they have diverged when they really haven't. Just get the master and psgi refs from the main repo again, and we should be in sync. Sorry for the inconvenience.

book avatar Aug 24 '11 22:08 book

We were initially working out of hoelzro's repo and listing psgi specific issues on it. It would probably work better to put that on the main repo, as long as we can have rights to commit and categorize issues.

haarg avatar Aug 25 '11 07:08 haarg

Agreed. I've been recording issues on my own copy, but I think I'll move the PSGI-specific ones here later today, and keep my fork for changes/issues specific to YAPC::NA 2012, such as Facebook login. However, you're more than welcome to cherry pick any changes you like. =)

hoelzro avatar Aug 25 '11 17:08 hoelzro