gitit2 roadmap?

240 views
Skip to first unread message

Thomas Koch

unread,
Apr 17, 2013, 9:23:46 AM4/17/13
to gitit-discuss
Hi,

I've found the gitit2 github repo as it was mentioned in the "Hacking Gitit...
advice for newbies" thread. But I've not seen a dedicated thread about it here
on the mailing list.

I've just started to learn Haskell so I can't provide too much help, but I'd
like to work on gitit2 to practice. Do you have ideas what could be easy jobs?

Yesod already provides authentication and authorization. Could I try to add it
to gitit2?

What logit of gitit1 can be copied over, what do you want to do otherwise?

Regards,

Thomas Koch, http://www.koch.ro

John MacFarlane

unread,
Apr 17, 2013, 4:32:50 PM4/17/13
to gitit-...@googlegroups.com
Thomas,

There's a TODO file in the repository, which lists features that
gitit has that are still lacking in gitit2.
Authentication/authorization is one of them.

gitit1 supports several different authentication methods (see the
README and the annotated config file), including one that involves
storing hashed passwords and usernames in a file, complete with a
password-reset email system etc. Some of this is ugly, and a case could
be made for simplifying things in gitit2. In any case, starting with
the Yesod authentication and authorization would make lots of sense.
So, go ahead!

John

+++ Thomas Koch [Apr 17 13 15:23 ]:
> --
> You received this message because you are subscribed to the Google Groups "gitit-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gitit-discus...@googlegroups.com.
> To post to this group, send email to gitit-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/gitit-discuss?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

John Lenz

unread,
Apr 18, 2013, 3:39:27 PM4/18/13
to John MacFarlane, gitit-...@googlegroups.com, Thomas Koch
On 2013-04-17 20:32:50 UTC, John MacFarlane <fiddlo...@gmail.com> wrote:
> Thomas,
>
> There's a TODO file in the repository, which lists features that
> gitit has that are still lacking in gitit2.
> Authentication/authorization is one of them.
>
> gitit1 supports several different authentication methods (see the
> README and the annotated config file), including one that involves
> storing hashed passwords and usernames in a file, complete with a
> password-reset email system etc. Some of this is ugly, and a case could
> be made for simplifying things in gitit2. In any case, starting with
> the Yesod authentication and authorization would make lots of sense.
> So, go ahead!
>

I wrote a yesod-auth based plugin to handle this kind of authentication recently. I haven't posted it on hackage yet since there were some improvements to yesod-auth I was waiting for, but plan on sticking the code on hackage. The (current) code is here

https://groups.google.com/forum/?fromgroups=#!topic/yesodweb/X8s7v7WEBEc

Looking at gitit2 and how it relates to authentication, here is one thought I had on how it could work with yesod-auth.

I would remove requireUser from the HasGitit class. Instead, I would make all authorization go through the isAuthorized (and authRoute and isWriteRequest) methods on the master site's Yesod instance, and all authentication go through yesod-auth. To facilite easy writing of isAuthorized, I would add a helper function like the following

data GititRouteType = ReadPage Page
| WritePage Page
| Other
-- Maybe more types here, not sure

gititRouteType :: Route Gitit -> GititRouteType

then one could write

instance Yesod MyApp where
....

isAuthorized (GititSubsite route) isWrite = do
muser <- maybeAuthId
case muser of
Nothing -> return AuthenticationRequired
Just user -> case gititRouteType route of
-- lookup if the user can access the page, or allow all, or whatever.

-------

This allows a lot of flexibility for people that embed the gitit subsite themselves. For people who just want to use a compiled version, gitit.hs could have several different possible isAuthorized functions, and then the provided master site could select between them based on a config setting.

Kẏra

unread,
Jul 1, 2013, 2:38:21 AM7/1/13
to gitit-...@googlegroups.com, tho...@koch.ro
Ah, I just found the gitit2 repository: https://github.com/jgm/gitit2

But it looks like it hasn't had any changes in a couple of months.

John Lenz

unread,
Jul 1, 2013, 2:44:36 PM7/1/13
to Kẏra, gitit-...@googlegroups.com, tho...@koch.ro
On Mon Jul 1 01:38 -0500 2013, Kẏra <kx...@riseup.net> wrote:
> Ah, I just found the gitit2 repository: https://github.com/jgm/gitit2
>
> But it looks like it hasn't had any changes in a couple of months.
>

I've been thinking about continuing to add some features to gitit2
recently but haven't had the time. But if other people are interested
and start developing, that will motivate me to throw in and help. :)

The first thing I was going to look at, as I posted elsewhere in this
thread, was to work on the authentication. I now have posted
my auth code for yesod here:
http://hackage.haskell.org/package/yesod-auth-account
and am planning on integrating that.

Kẏra

unread,
Jul 1, 2013, 2:58:46 PM7/1/13
to John Lenz, gitit-...@googlegroups.com, tho...@koch.ro
Ah, cool!

A friend and myself are excited to start learning haskell together on wednesday. We're pretty much starting at nowhere, so if you have very basic tasks we could assist with that would help us learn, that would be fantastic!
--
Board of Directors, Free Culture Foundation: www.freeculture.org

Web: kxra.info  -  StatusNet Microblog: http://identi.ca/kxra
Email: kx...@freeculture.org  -  SMS: +1.617.340.3661
Jabber/XMPP: kx...@riseup.net  -  IRC: kxra @freenode @oftc @indymedia
Reply all
Reply to author
Forward
0 new messages