01:11:41 <tazjin> stepcut ^: My connection died for a moment, I'm back here on my bouncer now.
01:47:50 <donri> stepcut: what to do when: session cookie isn't set yet; session cookie holds an invalid value
01:48:44 <donri> i think people might have an expectation of a session being "always there", in which case we need some place to specify the default empty session value
01:49:05 <donri> but on the other hand it'd be more consistent with happstack to have that be an alternative empty?
01:49:42 <donri> and we probably don't want to serialize an empty session value, so we'd need extra logic to handle that ...
02:05:47 <tazjin> donri: In the server-side or client-side session implementation?
02:09:51 <donri> client
02:12:43 <hpaste> donri pasted this is what i have so far at http://hpaste.org/66792
02:14:31 <donri> the run function assumes Encoded and the decoding for that in turn assumes an existing and valid encoded cookie or otherwise mzero's
02:14:51 <donri> so... in this current code there's no way to set the first session, not really :)
02:37:32 <hpaste> donri pasted withSession at http://hpaste.org/66793
02:37:59 <donri> the problem with withSession though is that it'll always put the session state as Modified
02:38:56 <donri> i suppose i could compare st and s ...
02:40:34 <donri> worth the Eq constraint right?
10:57:42 <donri> stepcut: website code still not public? i wanna hack on it!
12:39:43 <donri> mightybyte: might perhaps mention happstack's preference for jmacro for javascripting. it provides much stronger compile-time guarantees than julius (in particular it's syntax checked, julius is not).
12:39:54 <donri> ...if you can phrase that in a way that doesn't sound too biased ;)
12:42:35 <donri> i'm admittedly biased but honestly i think happstack tends to provide much stronger static types than yesod. for example acid-state let's you model data without the limits of SQL or mongo and the use of combinators for routing rather than parsing strings means more typos are caught or completely avoided ...
12:42:49 <donri> i think yesod's selling point is RAD, not type safety
12:44:26 <mekeor> btw, do you have websites running happs? i'd like to see some examples.  -- donri, do you have a website?
12:44:39 <donri> (although, while "no one does it", SQL let's you encode certain invariants in its schemas that would require more work to do with acid-state, like "int in range" and "sum of two fields equal some fixed total". i'd love to have that sort of thing handy with acid-state ...)
12:45:14 <mekeor> http://www.pocoo.org/ ??   does this run happs?
12:45:22 <donri> that's python
12:45:29 <donri> i'm no longer active in python
12:45:29 <mekeor> :(
12:45:31 <mekeor> cool
12:45:33 <mekeor> :)
12:45:37 <donri> https://github.com/dag/happaste is an example app i wrote in happstack
12:45:54 <mekeor> donri: wow! you're even a lojban speaker!! i like you.
12:46:00 <donri> https://github.com/dag/kibr is a more real app i'm working on
12:46:08 <donri> haha
12:46:50 <donri> have you noticed the lojban in the happstack crash course? :P
12:47:00 <donri> (stepcut's doing, not me)
12:47:01 <mekeor> what's kibr?
12:47:24 <mekeor> actually, i like lojban, but i'm not yet able to speak it.  i wanna learn it.
12:47:26 <donri> kibr is vaporware that i'll never finish, and have rewritten some five times or so in different languages and frameworks :D
12:47:41 <mekeor> lol
12:47:45 <donri> it's intended to be a rewrite of jbovlaste plus generic infrastructure for the lojban community
12:47:50 <mekeor> ACTION doesn't know what vaporwares are.
12:47:58 <mekeor> cool
12:47:59 <donri> project's that never ship
12:48:01 <mekeor> ah
12:48:06 <donri> like gnu hurd, perl6, duke nukem forever
12:48:12 <mekeor> ACTION doesn't know jbovlaste
12:48:18 <mekeor> hehe :D
12:48:23 <donri> it's the dictionary editor for lojban
12:48:41 <mekeor> ACTION didn't know perl6 isn't yet finished. (but he knows that it's implemented in haskell!)
12:48:43 <mekeor> ah
12:48:55 <mekeor> what's #sampla ?
12:49:09 <donri> the most active perl6 implementation today isn't haskell
12:49:16 <mekeor> oO
12:49:19 <mekeor> O_O
12:49:20 <mekeor> :(
12:49:21 <mekeor> ;(
12:49:22 <donri> #sampla isn't much of anything yet. i use it to test the kibr bot.
12:49:28 <mekeor> cool
12:49:41 <mekeor> donri: but the bot isn't alive atm, right?
12:49:50 <donri> nope
12:50:11 <donri> it's far from ready to ship :)
12:50:16 <mekeor> donri: so, you're a really active lojban-speaker, right? you're really engaged...
12:50:22 <donri> i have old bots written in python running in #lojban etc
12:50:22 <mekeor> donri: are you a linguis?
12:50:35 <mekeor> linguist
12:50:38 <donri> nope
12:50:52 <mekeor> donri: what's your profession?
12:50:58 <mekeor> are you studying CS?
12:51:03 <mekeor> or maths?
12:51:06 <mekeor> or both?
12:51:09 <donri> ACTION raises speer and howls
12:51:11 <mekeor> did you study ?
12:51:11 <donri> FOR SPARTAA
12:51:16 <mekeor> hehe
12:51:25 <mekeor> donri: srsly, what are you doing?
12:51:44 <donri> :)
12:51:44 <mekeor> (i'm refering to your profession..)
12:51:50 <mekeor> btw, i like sweden. (but finland more :)
12:51:59 <mekeor> *finnland
12:52:16 <mekeor> actually, *finland.
12:52:20 <mekeor> anyway.
12:52:24 <mekeor> donri: talk!
12:52:57 <donri> i'm an unemployed high school drop out who can't get his life in order
12:53:21 <mekeor> ACTION is a scholar. he wants to study maths and CS. and he likes linguistics (such as grammer and lojban) and is probably interested in type theory.
12:53:28 <mekeor> donri: really?
12:54:04 <mekeor> s/scholar/pupil/ # i have some issues with english vocabulary..
12:54:16 <donri> "student"
12:54:18 <mekeor> donri: which OS do you use?
12:54:21 <donri> fedora
12:54:28 <mekeor> donri: i use student for university-students...
12:55:03 <donri> what do you use scholar/pupil for then
12:55:08 <mekeor> donri: is your github-avatar a picture of you?
12:55:15 <donri> yea at age 7 :P
12:55:18 <mekeor> :)
12:55:23 <mekeor> pupil == going to school.
12:55:34 <donri> what does school mean, then :D
12:55:47 <donri> are you in high school?
12:55:52 <mekeor> school means a school BEFORE university.
12:55:56 <mekeor> yep.
12:55:58 <mekeor> i'm 16.
12:56:02 <donri> ah
12:56:03 <mekeor> donri: are you rich?
12:56:09 <mekeor> donri: how old are you?
12:56:11 <donri> verily not
12:56:18 <donri> i'm 23
12:56:41 <mekeor> ah
12:57:15 <mekeor> donri: do you know that guy? https://secure.gravatar.com/avatar/7150388ba01baf73b0cabb68778dcb55?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png
12:57:21 <donri> i'm in the process of getting diagnosed for ADHD. i hope to take up studying later if i can get some help with that.
12:57:27 <mekeor> which browser do you use, donri?
12:57:37 <donri> that guy is stepcut
12:57:43 <mekeor> correct. :)
12:57:44 <donri> i use firefox
12:57:47 <mekeor> me, too.
12:57:58 <mekeor> more precisely iceweasel anyway.
12:58:02 <mekeor> ACTION uses debian testing
12:58:07 <mekeor> donri: do you use xmonad?
12:58:10 <mekeor> or gnome3?
12:58:12 <mekeor> or kde???
12:58:16 <donri> gnome3/shell
12:58:23 <mekeor> (i don't really like kde.. don't know why..)
12:58:26 <mekeor> donri: cool.
12:58:42 <mekeor> donri: so, you have ADHD? hmm
12:58:49 <donri> most likely
12:58:57 <mekeor> do you take medicaments?
12:59:12 <donri> nope, not diagnosed yet which is required for those medications
12:59:35 <mekeor> ah
12:59:44 <mekeor> ACTION doesn't think donri has ADHD.
12:59:48 <donri> :D
13:00:28 <mekeor> ACTION thinks donri just doesn't want to do his homeworks and that's the only reason for him not to do his homeworks  not ADHD.
13:00:41 <donri> ;)
13:01:05 <mekeor> ACTION  because donri is able to work on haskell-projects which he likes.  so it's just a matter of interest.
13:01:07 <donri> i rarely even showed up in school and when i did it was at random times of the day and in the wrong classes
13:01:21 <mekeor> anyway. that's me on github: https://github.com/MekeorMelire
13:01:31 <donri> usually taking over the class from the teacher (i often knew more than they; IT school :/)
13:01:51 <mekeor> my blog (which's quite out-dated), http://mekeor.me.ohost.de/ ,  is generated by #hakyll.
13:02:04 <mekeor> http://uxl.dyndns.org/ is handled by #happs.
13:02:26 <mekeor> donri: heh.
13:02:58 <mekeor> actually, the happs-code for http://uxl.dyndns.org/ is just one file! lol.
13:03:23 <donri> :)
13:03:27 <mekeor> donri: i wanna make the *.hs-file in http://uxl.dyndns.org/code/ text/plain-mimeType.
13:03:30 <mekeor> how can i do that?
13:03:45 <donri> you should get in touch with djanatyn; he's also 16 and into haskell and lojban
13:03:54 <mekeor> donri: cooool
13:04:25 <donri> and linux and emacs and vim (he's ADHD too hah)
13:04:34 <mekeor> rly??
13:04:35 <mekeor> lol.
13:04:40 <mekeor> ACTION uses emacs.
13:04:50 <donri> #jbopre is the social channel for lojbanists
13:05:00 <mekeor> but it's probably in lojban...
13:05:02 <mekeor> right?
13:05:07 <donri> nope
13:05:26 <donri> we encourage lojban discussions to move to #lojban where they're logged adding to the corpora
13:05:52 <donri> to change the mimetype you'd have to use a different mapping than the default one
13:06:34 <donri> you could use Map.insert to get a modified copy of the default one
13:07:11 <mekeor> hmm
13:07:32 <donri> serveFile (guessContentTypeM (Map.insert "hs" "text/plain" mimeTypes)) ...
13:07:54 <mekeor> wow
13:08:17 <donri> oh but you're using serveDirectory of course ...
13:09:24 <mekeor> yep
13:10:19 <donri> you'd have to use serveFile and handle the routing yourself then, i think
13:10:46 <mekeor> hmmm....
13:11:20 <donri> dir "code" $ uriRest $ \file -> serveFile ...
13:11:39 <donri> may need to sanitize the file name, not sure?
13:12:02 <donri> or use "path" to not allow recursive browsing of /code
13:17:01 <donri> stepcut: idea: serveFileFrom, takes a root directory and a relative path and makes sure no files outside that root are served
13:25:14 <mekeor> couldn't there be a variant of serveDirectory which gets an argument of type (FilePath -> m String) such that you can define mimeTypes ?
13:25:33 <donri> that too
13:25:40 <mekeor> that'd be great.
13:25:49 <mekeor> i don't think it would be hard to implement.
13:25:55 <mekeor> maybe even i could do that!
13:27:55 <mekeor> wow. donri: that'd be really really easy to do!
13:28:13 <donri> i'm sensing a patch?
13:28:14 <mekeor> just look at the definition of http://hackage.haskell.org/packages/archive/happstack-server/latest/doc/html/src/Happstack-Server-FileServe-BuildingBlocks.html#serveDirectory !
13:35:22 <mekeor> ACTION clones happstack (from patch-tag)
13:36:24 <mekeor> actually, i prefer darcsden over patch-tag.
13:36:48 <mekeor> it's cooler.
13:38:04 <donri> patch-tag is written in happstack, and more stable, plus has wikis
13:38:10 <donri> but my happstack fork is on darcsden too ...
13:38:23 <mekeor> ah, cool.
13:40:51 <mekeor> donri: what about just adding *.hs to mimeTypes?
13:41:11 <donri> dude, this is haskell ;)
13:41:20 <mekeor> so, what?
13:41:30 <donri> so you can't really modify mimeTypes globally
13:41:37 <mekeor> why not?
13:41:49 <donri> oh you mean in a patch?
13:41:56 <mekeor> yes.
13:42:10 <donri> well, the default is arguably more correct. haskell files on your server open as haskell in vim for me. much more useful :P
13:42:27 <mekeor> hmm
13:42:46 <donri> but it might be useful to allow overrides in apps
13:43:01 <luite> bah how is opening in vim useful ;p
13:43:05 <mekeor> okay. i won't override it then. (i mean, add the mimetype.)
13:43:12 <mekeor> luite: :D
13:43:27 <mekeor> luite: you're an emacs-guy? me, too.
13:44:09 <donri> it opens in the editor configured on the user's system :P
13:50:03 <mekeor> yep. or rather, configured in the operating system -- or in firefox.
14:14:11 <mekeor> so, i forked happstack. i changed its code and recompiled happstack-server.
14:14:22 <mekeor> but i can't load Happstack.Lite now. why?
14:15:31 <mekeor> okay.. i'll just compile happstack-lite myself, too, then.
14:15:44 <mekeor> works.
14:16:03 <luite> you have to recompile packages if you reinstall their dependencies
14:16:07 <luite> at least, usually
14:16:14 <mekeor> ah, okay.
14:16:36 <luite> if anything is changed in the visible api, they won't be compatible anymore, so you have to recompile packages that depend on them
14:17:03 <donri> maybe cabal should resolve that recursively for reverse deps?
14:17:05 <luite> that's the api hashes you see in the package db
14:35:23 <mekeor> donri: i hacked it.
14:35:30 <mekeor> i mean, i patched it.
14:38:10 <donri> \o/
14:38:29 <donri> did you make it a new function? or you'll break most existing apps ;)
14:40:20 <mekeor> of course.
14:40:31 <mekeor> it was actually veery easy.
14:40:58 <donri> should be as there's a low-level "building blocks" module
14:40:59 <mekeor> ACTION is slowly -- really really slowly -- becoming a hacker. yay!
14:41:30 <donri> did you push your fork to darcsden?
14:41:55 <mekeor> not yet. not *yet*.
15:02:21 <mekeor> donri: i recorded my changes. how can i make my fork available for others now?
15:02:38 <donri> you said you use darcsden?
15:02:40 <mekeor> ACTION is sorry. he doesn't know darcs well. he is rather a git(hub)-user.
15:02:41 <donri> so create a repo there
15:02:46 <mekeor> ok. done.
15:02:49 <mekeor> now?
15:02:57 <donri> then push to it :)
15:03:01 <donri> didn't it give you a URL?
15:03:18 <mekeor> http://darcsden.com/mekeor/happstack---another-fork
15:03:26 <mekeor> it says "push your code to mekeor@darcsden.com:happstack---another-fork to get started" to me.
15:03:36 <donri> why the extra junk in the name
15:03:42 <mekeor> idk
15:03:44 <mekeor> ok.
15:03:54 <donri> anyway yep, darcs push mekeor@...
15:04:01 <mekeor> it's called http://darcsden.com/mekeor/happstack
15:04:05 <mekeor> now. i renamed it.
15:04:08 <donri> :)
15:04:29 <mekeor> hmm
15:04:31 <mekeor> doesn't work.
15:04:41 <mekeor> i get this error:
15:04:45 <mekeor> darcs failed:  Not a repository: mekeor@darcsden.com:happstack ((scp) failed to fetch: mekeor@darcsden.com:happstack/_darcs/inventory)
15:05:00 <donri> maybe rename is broken
15:05:02 <donri> try delete and recreate
15:05:30 <mekeor> donri: i had the same error with the original name.
15:06:04 <donri> maybe try again? could be a delay thing
15:06:43 <donri> you can also link to the patch-tag repo in "bootstrap" to have that cloned first
15:06:55 <mekeor> ah
15:08:37 <mekeor> donri: okay. i did that.
15:09:06 <donri> and push now?
15:10:00 <mekeor> push still doesn't work. i'll just patch in the repository once more...
15:11:37 <donri> o_O
15:11:40 <donri> maybe consult #darcs
15:14:25 <mekeor> hmm, ok
15:14:58 <donri> or try patch-tag
15:16:02 <donri> what's your darcs --version?
15:16:08 <donri> i just managed to push to darcsden
15:16:13 <mekeor> 2.5.2
15:16:16 <donri> 2.5.2 (release)
15:16:24 <donri> ok so not that :D
15:16:25 <mekeor> yep
15:16:30 <mekeor> :)
15:18:26 <donri> mekeor: wait, did you configure ssh keys?
15:18:31 <mekeor> yep
15:18:37 <mekeor> or
15:18:38 <mekeor> wait
15:18:39 <donri> http://darcsden.com/settings
15:18:50 <mekeor> oh, no!
15:18:58 <donri> that could be a problem ;)
15:19:05 <donri> though the error message didn't help much
15:24:17 <mekeor> donri: http://darcsden.com/mekeor/happstack/browse/happstack-server/src/Happstack/Server/FileServe/BuildingBlocks.hs#L-644
15:25:42 <donri> or more specifically http://darcsden.com/mekeor/happstack/patch/20120411151331-a13f9
15:26:06 <mekeor> yep
15:27:09 <donri> looks good to me; next stepcut will hopefully take a look and maybe merge it (he should wake up soon?)
15:27:11 <mekeor> stepcut: it would be great if you could accept merge that. oh, and it would be even greater if you could fix that ARM-problem... =)
15:27:20 <mekeor> hehe :D
15:28:15 <mekeor> isn't IRC awesome, donri?
15:28:22 <donri> \o/
15:28:34 <donri> ohai stepkut
15:28:36 <mekeor> i wonder what i'd do without it... probably implementing it :D
15:28:42 <donri> "speak of the devil"
15:40:31 <stepkut> :)
15:47:09 <stepkut> donri: the always modified thing is a bit annoying. The reason for wanting to reuse MonadState instead of create a new MonadSession is so that we can use the MonadState stuff from lenses ?
15:52:07 <donri> stepkut: i solved the always modified thing. i don't see why we need a custom class, just a simple State?
15:52:23 <hpaste> donri pasted current withSession at http://hpaste.org/66815
15:53:31 <donri> or do you think it is worth it to have more than Identity at the bottom?
15:53:33 <luite> donri: if you have to compare them anyway, why bother with tracking whether it has been modified at all?
15:53:56 <donri> luite: because withSession is just a convenience wrapper
15:55:02 <donri> and otherwise we'd have to keep the old session for comparison during the whole request? or re-decode from cookie
15:57:51 <stepkut> I am not in-love with the idea of the Eq constraint
15:58:01 <donri> me either
15:58:06 <donri> but not sure which is worse :)
15:58:19 <donri> it might not be common to *not* modify it
15:58:33 <donri> or that may turn out to be verily useful in deed
15:58:53 <luite> really? wouldn't you expect most requests to not modify the session?
15:59:21 <donri> but then do they need lenses and a state api? maybe ...
16:00:40 <donri> (withSession . getL $ userData . userId) ... maybe ...
16:01:21 <donri> but then perhaps a getsSession :: (st -> a) -> m a, is equally useful
16:02:20 <donri> s/getL/access/
16:04:31 <luite> for login things, I think that something like withUser (\u -> ) would be a common use case, but the function probably wouldn't return a new user
16:06:04 <luite> I don't recall having written anything where withSession would be useful
16:06:45 <donri> no, yesod handles that for you because you just have the text/bytestring pairs
16:07:13 <donri> so you can easily provide specialized apis for "set key to value"
16:08:38 <luite> hm, good point, just setting a single key would be a use case here
16:08:49 <donri> withSession $ flashMessages %= ("hello":)
16:09:29 <donri> assuming you have something like data Session = Session { _flashMessages :: [String] }; makeLens ''Session
16:10:17 <donri> so you want to put modify that list rather than overwrite it completely, and also not touch any other fields in the Session type (when there are more)
16:10:29 <donri> s/put/both/
16:11:28 <luite> right, btw, I was wondering what kind of glue you'd make if you wanted some authentication framework that required sessions
16:12:43 <donri> we're not sure yet how "plugins" will look, but i'm hoping we can have a session that plugins can use without interfering with each other
16:13:20 <donri> snaplets are mostly built around lenses, something similar might be concievable
16:13:34 <luite> I guess you could require some lens to be supplied, that requires user credentials to be retrieved and modified
16:13:36 <donri> conceivable, argh neither looked right
16:13:44 <luite> the latter is right
16:13:48 <donri> yea :)
16:14:23 <donri> i wonder how bad it would be to have multiple clientsessions in different cookies
16:14:35 <donri> if it adds much overhead over a container type in a single cookie
16:15:37 <donri> i'm also thinking that serversessions might be better suited for plugin architecture... but for now we just want basic clientsessions work well :)
16:17:27 <luite> I think clientsessions with a little server-side persistence could work beautifully as distributed sessions without the problems with replay attacks
16:17:55 <donri> i've considered that, but not sure if clientsession really adds much in that case ...
16:18:32 <luite> I do actually, if you have a larger number of servers
16:18:52 <donri> like, sure, if you have a signed cookie you don't even need the session ID to be securely generated. could just have a counter, even.
16:19:15 <donri> but that's not less complex than securely generating IDs in the first place, not really
16:19:27 <donri> maybe i misunderstand your point
16:22:06 <luite> no I mean that with a large number of servers, you'd need some central point where sessions are stored, for purely server side sessions. with clientsessions, you can guarantee that a session is not replayed, and still handle 99% of requests (made-up number) without any central-server queries, while having a guarantee that the session is never a replayed older version
16:22:07 <stepkut> donri: I think I fixed my original code that it can work with lenses, but I have to go out for lunch now
16:22:37 <hpaste> stepcut pasted ClientSessionT again at http://hpaste.org/66818
16:22:42 <luite> donri: youc an probably guess now how to do it :)
16:22:50 <luite> got to go, brb
16:23:09 <stepkut> starting in line 99..
16:24:35 <donri> luite: do you mean "can't guarantee"?
16:25:49 <donri> stepkut: but we don't want the transformer itself to be a monadstate because that'll get in the way of the user / integersupply
16:32:04 <stepkut> donri: i think you just need lift then
16:32:26 <hpaste> stepcut pasted double state at http://hpaste.org/66820
16:32:35 <stepkut> maybe?
16:32:41 <stepkut> haven't finished thinking, but I have to leave anywy
16:33:51 <donri> possibly
16:33:57 <donri> it'd certainly be nicer if that works :)
16:35:35 <donri> though might get confusing when the behavior depends on the order of your transformer stack...
16:35:54 <donri> i mean, why not have askRq be just "ask"?
16:36:43 <donri> or is that so for historical reasons you disagree with?
17:17:38 <luite> donri: no, can
17:26:28 <donri> hmmm, didn't you say the other day that replays are an issue with clientsession?
17:38:36 <luite> donri: yes, but that is if you don't have server-side state
17:40:25 <donri> ...exactly? i feel i'm missing the point :D
17:41:24 <luite> right, so I'm not talking about just clientsessions, but clientsessions with just a bit of server-side state to fix that replay issue
17:41:51 <luite> problem with server side state: once you get lots of servers, where do you store that state?
17:44:38 <donri> if you typically only need to execute queries, the future replicating backend might make that cheap?
17:46:54 <luite> you still need to replicate then, I'll describe the idea in a bit more detail, it can be executed easily now with a redis server, or a network frontend for acid-state.
17:47:24 <luite> dunno if it's of an value, but it's simple enough to describe and implement in a blog post :)
17:47:36 <donri> sure
17:48:09 <donri> i can imagine how it can be done, but i'm trying to figure out if it can be done with minimized writes...
17:50:12 <mekeor> stepcut: i would really really appreciate a new darcs-version of happstack supporting ARM and serveDirectory'.
17:50:37 <mekeor> donri: is there another person who can push to the official darcs-repo?
17:51:33 <donri> no one active i don't think
17:51:40 <mekeor> ok
17:52:54 <luite> The idea is to have session id and a sequence number in every clientsession. Every time you change a session id, you increment the sequence number, update session -> sequence number on a (possibly sharded) central server.
17:53:00 <luite> Now let every web server store a local LRU cache with most recent sequence numbers for session id's it has seen for sessions it has processed.
17:53:03 <luite> When a new request comes in, first check against local cache, if it's valid according to the cache, you're done, accept. If it's outdated, request session id sequence from central server and update cache.
17:53:10 <luite> If you combine this with a load balancer that has short term connection/client tracking, you can probably serve almost all session read requests from local cache, without losing any security, or losing session state after a longer idle time.
17:53:50 <luite> hmm
17:53:57 <luite> I see a mistake now :(
17:54:28 <donri> yea that's more or less how i imagined it too
17:54:35 <donri> but i can't see a way to do it with less writes :(
17:55:05 <luite> right, but I don't think writes are a problem here since you can easily horizontally scale this kind of thing
17:55:28 <donri> but we can only do like 20 000 writes per second on a laptop!
17:56:09 <donri> (jokes aside, it'd be slower on a replicating or networked backend. haven't seen benchmarks though.)
17:56:12 <luite> well, I think the problem is more with the networked read requests to some central server that you'd have to make for every request
17:57:07 <donri> exactly
17:57:50 <luite> anyway it looks like the local cache idea is wrong :(
17:58:18 <donri> trying to think of real life security schemes for preventing replay attacks, they seem to have that requirement too ... (e.g. wireless car keys (they actually used to not have that protection so you could easily record and replay when owner locks up their car))
17:58:55 <luite> real life usually means some challenge response scheme or a different initialization vector or similar
17:59:06 <donri> exactly
17:59:25 <donri> although in this case a counter works since it's digitally signed
17:59:38 <luite> right, but the point here is to do it without any external interaction at all
18:00:03 <donri> hey we could re-generate the key and restart all servers for every request!
18:00:11 <donri> it's the php way, man
18:00:30 <donri> ACTION needs to eat, bbl :)
18:00:51 <luite> I think you could make the lifetime of the local caches relatively short and it would not be a problem at all in practice: every time you try to update the session, it would get checked against the central server anyway
18:02:05 <luite> but bah that's way too practical and ugly, it can only be a blog post if you can show an implementation of the session backend in a few lines, another few for a nice acid-state sequence storage server and then claim that haskell once again saves the day
18:02:17 <donri> :)
18:02:19 <donri> +1
19:18:17 <stepkut> donri: the serveFileFrom thing is a good idea.. but one step to limited I think. In the IRC log stuff on happstack.com I actually have to use readFile to open the log files and paste the contents in. But it suffers from the same problem -- I need to make sure that the user can't do ../../../etc/password
19:18:30 <stepkut> the BuildingBlocks module exports isSafePath.. but that is not enough
19:18:53 <donri> stepkut: that's where file-embed is useful... though in your case that doesn't work as they're dynamic ...
19:18:57 <stepkut> or, rather, isSafePath maybe just needs a different type
19:19:56 <stepkut> I don't really have a solution in mind.. just a realization when I was writing the irc stuff that it was easy to do it wrong, and harder to do it right than I would have liked
19:21:10 <donri> yea a generic function for just building such a file path would be handy and could be used to implement the other
19:21:33 <stepkut> right
19:26:21 <donri> doesn't look like filepath or directory help here :/
19:26:30 <stepkut> no
19:39:34 <mekeor> stepkut: can you fix ARM pls? pls pls pls pls pls pls pls pls pls ;-(
19:39:59 <mekeor> > cycle "please "
19:40:00 <lambdabot>   "please please please please please please please please please please plea...
19:40:10 <stepkut> mekeor: I am working on it right now
19:40:23 <mekeor> stepkut: cooool. thank you veeery much =)
19:40:40 <mekeor> stepkut: do you have a test machine? i have one. i can test.
19:41:03 <mekeor> i mean, do you have access to an ARM-machine?
19:41:20 <mekeor> ..on which you can test your fix..
19:41:24 <stepkut> nope
19:41:39 <mekeor> fine. let me test your fix if it's ready then.
19:41:44 <mekeor> if you want, of course.
19:42:44 <donri> if the fix is "remove template haskell" that's easy enough to test (remove the dependency)
19:42:59 <mekeor> oh, right.
19:44:14 <mekeor> stepkut: did you also consider to accept my serveDirectory' ?  (you can also rename it or change the order of its parameter... but i think that function would be used often..)
19:44:36 <mekeor> anyways. little by little..
19:44:59 <stepkut> mekeor: already pulled
19:45:04 <stepkut> but not repushed
19:45:36 <donri> hey, system-filepath does help here
19:46:01 <mekeor> stepkut: cool.
19:46:01 <stepkut> nice
19:46:48 <donri> do we want another dependency? i think maybe in the long run everything should be ported to system-filepath anyway?
19:47:01 <donri> and i'd rather not rely on custom hacks for security that might not work on different systems ...
19:48:05 <stepkut> donri: dunno.. system-filepath seems pretty lightweight though.. not really any new dependencies except maybe deepseq
19:48:21 <donri> yea
19:48:55 <stepkut> but I am not really sure why it exists and if it is really aimed at solving problem we care about
19:49:20 <donri> duno, happstack-server depends on filepath but i don't know what for
19:49:41 <donri> and filepath is potentially problematic because it acts on strings
19:50:09 <donri> which in part is less type safe perhaps, and in part flat out wrong since not all systems treat filepaths as unicode
19:50:22 <donri> duno how much it matters for us in practice but hey
19:50:25 <stepkut> yeah
19:50:48 <stepkut> that is my problem.. I know there are issues with filepath.. but I am not qualified to say if they affect us or if system-filepath is better for us
19:51:43 <stepkut> mekeor: ok, pushed patches to http://patch-tag.com/r/mae/happstack
19:51:45 <donri> in this particular case, system-filepath is the only one providing means to normalize "../"
19:52:49 <stepkut> normalise in what way? filepath has a normalise function..
19:53:06 <donri> yes but it skips "../"
19:53:55 <mekeor> stepkut: so, fixed ARM-issue and serveDirectory' ???
19:54:20 <stepkut> mekeor: I hope so.. you tell me :)
19:54:31 <mekeor> great. i'm so glad :)
19:54:50 <stepkut> mekeor: if it is good I think I can upload to hackage.. I think I can just make it happstack-server-7.0.2
19:55:07 <stepkut> which means I am happier to make a release than if I had to bump to happstack-server-7.1.0
19:55:21 <donri> it also provides helpers for computing a common prefix which is help to check that the path is inside a root dir
19:55:37 <donri> bbl dinner
19:55:41 <stepkut> donri: sounds good on paper :)
19:56:03 <donri> yea i'll try to write the code, just wanted to bounce the possibility of another dep with you ;)
19:56:19 <mekeor> donri: bye
19:56:25 <stepkut> as far as dependencies go, that one seems easy to swallow
19:56:39 <stepkut> as long as we are getting real benefit :)
19:57:25 <mekeor> Saizan did also contribute to happs?
19:57:52 <mightybyte> Yep
19:58:09 <mekeor> you, too, mightybyte?
19:58:12 <mekeor> who are you?
19:58:17 <mightybyte> Saizan was very longsuffering with me when I was learning Haskell and HAppS.
19:58:38 <mekeor> nice.
19:58:59 <mekeor> cool: http://patch-tag.com/r/mightybyte/happstack-facebook/home
19:59:15 <mightybyte> hells yeah!
19:59:29 <stepkut> :)
19:59:39 <stepkut> but facebook has completely changed their API since then
19:59:46 <mightybyte> Let's see here...http://softwaresimply.blogspot.com/2008_02_01_archive.html
19:59:56 <mekeor> stepkut: oh
19:59:59 <stepkut> so, then the authenticate library was the place to go.. and then authenticate dropped facebook support, so now you need the fb library
20:01:31 <stepkut> bah. The use of the IPV6_SOCKET_SUPPORT CPP in network to add extra constructors to to SockAddr is very unfortunate
20:01:41 <mekeor> @where web-frameworks
20:01:41 <lambdabot> I know nothing about web-frameworks.
20:01:52 <mekeor> @where+ web-frameworks http://softwaresimply.blogspot.de/2012/04/hopefully-fair-and-useful-comparison-of.html
20:01:52 <lambdabot> It is forever etched in my memory.
20:03:17 <mightybyte> Heh, .de
20:04:16 <mekeor> .de ?
20:04:22 <mekeor> oh
20:04:33 <mekeor> oops
20:04:50 <mekeor> mightybyte: you're from germany? me, too.
20:05:18 <stepkut> maybe we should be using getNameInfo to implement, sockAddrToHostName ::  SockAddr -> HostName ?
20:06:46 <mekeor> btw, can happs handle sub-domains? i mean like foo.example.com, bar.example.com &c
20:07:53 <luite> mekeor: ich glaube nicht dass mightybyte ein deutscher ist
20:07:58 <mekeor> lol
20:08:22 <mekeor> luite: so, you're from germany?
20:08:34 <luite> no, netherlands, but I speak a little deutsch
20:08:46 <mekeor> more than a little.
20:09:07 <mekeor> most germans would have written "das" instead of "dass" but you did it correctly.
20:10:30 <luite> hmm, probably because I really have to think when writing german, if you don't really have to think about it, it's much easier to confuse homophones
20:11:13 <mekeor> nice theory.
20:11:34 <mekeor> other theory: germans are just stupid.
20:11:54 <mekeor> ACTION is not a german. he lives (and was born) in germany though.
20:13:58 <mekeor> (the theory was not seriously meant. howbeit.)  darcs seems to be really really slow. it need nearly infinite time to get(==clone (in git-jargon)) happstack..
20:14:10 <luite> ah looks like the exact term i was looking for is 'heterographs' :) (according to wikipedia that implies same pronunciation, didn't expect that)
20:14:24 <mightybyte> mekeor: I'm not, but my ancestors are. :)
20:14:50 <mekeor> mightybyte: ah.
20:15:28 <mightybyte> Did you get the .de from the reddit link?
20:15:34 <mekeor> er, no.
20:15:46 <mekeor> i can't visit .com. i get redirected to .de.
20:15:47 <mightybyte> I put in .com, so don't know where .de came from.
20:15:52 <mightybyte> Ahhh
20:16:31 <mekeor> mightybyte: are you from us?
20:16:47 <mekeor> > map toUpper "us"
20:16:48 <lambdabot>   "US"
20:17:20 <mekeor> ACTION talks too much off-topic. (that's because he's waiting for darcs to finish cloning.)
20:17:39 <mightybyte> mekeor: Yeah
20:18:45 <mightybyte> ACTION contradicts himself and doesn't refrain for making a comment about git being faster
20:19:50 <mekeor> mightybyte: do you say "gesundheit" when you sneeze?
20:20:07 <mightybyte> No, but I heard it said in my family growing up.
20:20:20 <mekeor> cool.
20:20:35 <luite> "gezondheid" in dutch :)
20:20:42 <mekeor> lol
20:20:57 <mightybyte> I think it was my great grandfather that I'm told would not eat with the women and children.
20:21:00 <mekeor> ACTION wonders whether darcs hung up.
20:21:06 <mekeor> should i cancel it?
20:21:29 <mekeor> mightybyte: wow.
20:21:40 <mightybyte> Apparently very traditional German.
20:21:55 <mekeor> heh
20:22:06 <mekeor> more german than germans themselves :D
20:22:39 <mightybyte> Right.  That's just what I've been led to believe.  Who knows whether that's true and what the reasons were.
20:22:48 <mekeor> yep.
20:22:53 <luite> hmm, I've never heard of that as a specific german thing
20:23:54 <luite> of course in the netherlands we have other stereotypes for germans
20:23:58 <mightybyte> It fits into the American perception of Germans as a stereotypically regimented, historically war-mongering people.
20:24:23 <mightybyte> Which is pretty sad when I put it in those words.
20:24:44 <mekeor> indeed.
20:25:29 <mekeor> i'm ready to answer questions about the truth on (todays) germans.
20:25:33 <mightybyte> On the other hand, that stereotypes Americans as well.
20:25:38 <luite> hehe
20:25:58 <mightybyte> How dare you trample on my pristine perception of my ancestors!
20:26:15 <luite> mekeor: why do you always dig holes in our beaches? ;)
20:26:23 <mightybyte> rotfl
20:26:34 <mekeor> luite: what does that mean?
20:26:51 <mightybyte> Oh, that was hilarious.
20:26:54 <mekeor> lol, i thought that was a privite question..
20:27:01 <mekeor> private
20:27:31 <donri> we say "prosit" which i think is from latin...
20:27:42 <luite> hehe that's one of the best known stereotypes for germans. that they come to the netherlands in the summer, expecting everone to speak german (well most dutchlanders do) and digging holes in the beach to sit in
20:28:21 <mekeor> prosit (german) == cheers (english)
20:28:31 <luite> proost (dutch)
20:28:47 <mekeor> luite: hehe
20:29:28 <mekeor> yea, we usually say "prost", too.
20:29:31 <donri> http://en.wiktionary.org/wiki/prosit#Latin heh apparently it's "prosit" in swedish but comes from "pro sit" in latin and "prosit" in latin means something else
20:29:49 <donri> kind of fun that we basically say "well done, bravo, congratulations" when people sneeze
20:30:21 <mekeor> heh
20:32:01 <donri> and apparently it is the same as your "prost", but used for sneezing
20:32:02 <luite> actually it's only part of the netherlands where "proost" is really used for sneezing, in the rest it's mainly a drinking toast
20:32:43 <donri> ah so you have both
20:33:14 <mekeor> luite: here it's only for drinking, afaik..
20:34:18 <donri> it's also common wisdom that "prosit" as used in swedish means "bless you" in latin. which is apparently completely wrong.
20:36:05 <mekeor> neat.
20:42:29 <mekeor> stepcut: successfully compiled on ARM. thank you once more.
21:05:41 <stepkut> mekeor: cool!
21:16:34 <stepkut> mekeor: see host and withHost, http://www.happstack.com/docs/happstack-server-7.0.0/doc/html/happstack-server/Happstack-Server-Routing.html#g:4
21:17:20 <mekeor> stepkut: cool. thanks
21:37:47 <donri> stepkut: http://darcsden.com/dag/happstack/patch/20120411213517-6eb02
21:39:46 <stepkut> donri: neat. I'll look at it closely later today
21:46:55 <donri> stepkut: apparently your ARM changes conflicted with mine; I recorded a conflict resolution
21:48:17 <donri> ACTION just hopes he's using darcs correctly ^_^
21:52:27 <donri> nice to see commits from four different people in the last 7 hours :)
22:22:54 <mekeor> :)
22:39:55 <mekeor> so, i always have to compile the code, kill the running server and start the new one when i update my happs-application. how can i do that automatically? i mean, restarting the server.
22:40:43 <mekeor> the problem is that i have to start the server as root (with sudo).
22:41:28 <mekeor> i do always do this: $ make; sudo htop # here i kill the existing server; sudo ./executable &
22:41:44 <mekeor> is there a better way?
22:42:00 <mekeor> i don't want to have to kill the existing server process manually.
22:49:09 <donri> why are you running the server as root
22:57:52 <mekeor> donri: because it runs on port 80.
22:58:22 <mekeor> which (seems to) requires root privileges.
22:58:53 <donri> running as root for that is a horrible idea :)
22:59:00 <mekeor> donri: rly?
22:59:11 <donri> means your whole app executes with root privileges
22:59:19 <mekeor> yep...
22:59:22 <mekeor> hm.
22:59:32 <mekeor> how can i execute it as user then?
23:00:04 <donri> just run it on a user port and reverse proxy from another web server
23:00:45 <mekeor> huh?
23:00:56 <mekeor> isn't that annoying?
23:02:07 <mekeor> hmmm
23:05:25 <donri> slightly more to setup initially, but more secure and easier to manage after
23:06:08 <mekeor> okay. i'll consider it.
23:07:59 <donri> http://www.nginx.org/en/docs/http/ngx_http_proxy_module.html#example
23:08:13 <mekeor> donri: huh?
23:08:37 <donri> it should be like apt-get nginx and copy-paste those 5 lines of configuration
23:08:56 <mekeor> donri: on another server, right?
23:09:21 <mekeor> or on the server which is running my happstack-lite-application-server?
23:09:51 <donri> ether
23:10:44 <mekeor> did you mean: nether?
23:11:14 <donri> i mean both should work
23:11:20 <mekeor> ah
23:11:51 <donri> stepkut: do you have a preferred way to deal with this?
23:12:22 <mekeor> donri: does happs have a ML, btw?  web-devel@haskell.org ?
23:13:16 <donri> https://groups.google.com/group/HAppS
23:13:53 <mekeor> neat. why not on haskell.org ??
23:14:20 <donri> i think it predates those
23:16:12 <donri> (well, there are some old lists on @haskell.org but i think maybe the support for proposing new ones is more recent than happs?)
23:24:52 <mekeor> donri: i could also do this: http://www.debian-administration.org/articles/386
23:25:00 <mekeor> "Running network services as a non-root user"
23:25:15 <donri> yea
23:25:40 <donri> nginx might be easier if you have multiple apps
23:25:44 <donri> https://help.ubuntu.com/community/Nginx/ReverseProxy
23:27:37 <mekeor> donri: multiple apps? why should i have multiple apps?
23:28:32 <donri> how should i know? :)
23:29:39 <mekeor> :)
23:30:19 <stepcut> you can also start as root, bind to port 80, and then drop root privileges
23:30:34 <stepcut> that is why there is a  simpleHTTP variant that takes a Socket
23:31:44 <mekeor> stepcut: what do you mean by "drop root privileges"? like this?:  su; ./startApp; exit # ?
23:32:18 <mekeor> ACTION is gonna try this http://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-1024-on-l#414258
23:33:45 <mekeor> works fine.
23:33:56 <mekeor> http://uxl.dyndns.org/ now runs as user.
23:41:22 <mekeor> which library do you guys use for CSS-generation, btw?
23:41:45 <mekeor> luite: you asked something about shakespeare-css before, in #haskell.
23:42:17 <luite> yes, I do use it, but it didn't have anything to do with that package actually
23:42:29 <luite> cabal install got stuck on shakespeare-css
23:42:33 <mekeor> ah
23:42:53 <luite> turned out because of problems with handling some numeric literals in my version of ghc
23:43:03 <luite> just entering 2.54 in ghci makes it crash
23:43:10 <mekeor> Oo
23:43:12 <luite> entering 2.55 gives a division by zero
23:43:17 <mekeor> LOL
23:43:18 <mekeor> :D
23:43:34 <luite> shakespare-css had a 2.54 literal in the unit conversion code (inches to cm)
23:43:43 <mekeor> okay...
23:43:58 <mekeor> omg
23:44:21 <mekeor> luite: so, you were a victim of a bug, or?
23:44:49 <luite> yeah, I've been trying to get a working OS X versio of GHC 7.4 since sunday now, but it's been giving me nothing but trouble...
23:47:48 <mekeor> heh. anyway. which CSS-libray should i use? which is best? the more it is similar to BlazeHtml, the better it is.
23:49:13 <luite> hmm, in that case not shakespeare-css
23:49:23 <mekeor> hmm. ok.
23:50:07 <donri> mekeor: language-css
23:50:09 <mekeor> @package language-css  -- seems nice
23:50:09 <lambdabot> http://hackage.haskell.org/package/language-css  -- seems nice
23:50:12 <mekeor> yea
23:50:21 <mekeor> ok. i'll try that.