Thursday, 18 April 2013< ^ >
arjan has set the subject to: Zotonic - the Erlang Content Management Framework
Room Configuration

[07:06:32] Maas joins the room
[08:29:14] Maas leaves the room
[08:34:20] Maas joins the room
[08:34:25] Maas leaves the room
[08:34:37] Maas joins the room
[08:50:51] simon.smithies joins the room
[08:54:04] Arjan joins the room
[08:58:15] <Maas> zhost site? Sounds interesting.
[08:59:03] Andreas Stenius joins the room
[08:59:33] <Andreas Stenius> yeah, I finally got started on my zotonic-host.com implementation.. :p
[09:00:31] <Andreas Stenius> got the domain name years ago (ok, maybe it's closer to two years now..) but never got around to kick it off the ground, until now :)
[09:00:52] <Maas> Cool
[09:03:26] <Andreas Stenius> it's neat to have your repos as remotes too, that way it's easy to keep up with what you're all working on ;)
From git://github.com/mmzeeman/zotonic
bf7a3a2..f47a7f1 message-bus -> maas/message-bus
[09:05:26] <Maas> Hunting down cookie problem in inets. I'm sometimes missing cookies when doing asynchronous requests.
[09:06:12] <Arjan> in inets?
[09:06:18] <Maas> O yeah, that one. Need to fix some other stuff before I can continue that. The comet transport is broken.
[09:06:33] <Maas> Yes inets, looks like a race condition.
[09:07:30] <Maas> I need a way to send over a bunch of queued messages via the comet transport.
[09:09:56] <Maas> Need to get that repo in sync with the latest master too.
[09:16:55] <Maas> I'll probably rip out the interesting bits and paste them on a fresh branch. The reggy and tubby modules are now easier to integrate with zotonic too.
[09:33:08] <Maas> First fix that inets http client problem
[09:40:21] <Andreas Stenius> do you use to get alot of errors and crashes from mod_development (the inotify auto compile stuff, mostly, I think) ?
[09:41:27] <Arjan> me?
[09:41:46] <Andreas Stenius> you, plural :) but, sure, you too, Arjan :p
[09:41:58] <Arjan> thought you were addressing someone specific
[09:42:01] <Arjan> :)
[09:42:10] <Andreas Stenius> :)
[09:42:16] <Arjan> but no I dont get such errors very often
[09:42:49] <Arjan> would be nice though to replace that feature with watchdog, https://pypi.python.org/pypi/watchdog
[09:42:54] <Arjan> because that one is x-platform
[09:42:56] <Maas> What kind of errors?
[09:43:20] simon.smithies leaves the room
[09:43:21] <Maas> Usually I have mod_development turned off.
[09:43:29] <Andreas Stenius> like these:
09:35:18.119 [info] [zhost] info @ z_filewatcher_inotify:118 Starting inotify file monitor.
09:35:24.155 [error] Error in process <0.20686.1> on node 'zotonic001@cypher' with exit value: {badarg,[{erlang,list_to_existing_atom,["controller_static_pages"],[]},{mod_development,recompile_file,1,[{file,"modules/mod_development/mod_development.erl"},{line,329}]}]}
09:36:11.913 [error] gen_server z_filewatcher_inotify terminated with reason: no such process or port in call to gen_server:call('z_trans_server$mod_admin', table)
09:36:11.922 [error] CRASH REPORT Process z_filewatcher_inotify with 2 neighbours exited with reason: no such process or port in call to gen_server:call('z_trans_server$mod_admin', table) in gen_server:terminate/6 line 747
09:36:11.924 [info] [zhost] info @ z_filewatcher_inotify:118 Starting inotify file monitor.
[09:44:25] <Andreas Stenius> and
09:22:48.945 [error] Error in process <0.32493.0> on node 'zotonic001@cypher' with exit value: {badarg,[{erlang,list_to_existing_atom,["controller_static_pages"],[]},{mod_development,recompile_file,1,[{file,"modules/mod_development/mod_development.erl"},{line,329}]}]}
[09:44:44] <Andreas Stenius> oh, bugger, that was already in the previous paste... sorry :p
[09:45:04] <Andreas Stenius> any how, I've not payed to much attention to those messages...
[09:45:05] <Maas> that atom should be defined. strange
[09:45:43] <Andreas Stenius> hmm...
[09:47:12] <Andreas Stenius> well, I guess that module hasn't been loaded, then
[09:47:47] <Andreas Stenius> seems to be the case
[09:48:06] <Andreas Stenius> I ran controller_static_pages:module_info() from the shell, then tried list_to_existing_atom again, and then it worked...
[09:48:48] <Arjan> btw andreas
[09:49:02] <Arjan> I still have issues with zotonic-tpl-mode getting stuck in an infinite loop some times
[09:49:09] <Andreas Stenius> why safe guard the atom table at mod_development:329?
[09:49:17] <Andreas Stenius> I just fixed one instance of that
[09:49:24] <Andreas Stenius> had it too... :p
[09:49:43] <Arjan> cool
[09:49:48] <Arjan> will update and check again
[09:49:57] <Arjan> crashes on a large HTML file
[09:50:00] Maas leaves the room
[09:50:03] <Andreas Stenius> I've just learned that the font-lock regexp's are really sensitive to too much backtracking :p
[09:50:06] <Arjan> I think the safeguard is not really needed
[09:50:07] Maas joins the room
[09:50:14] <Andreas Stenius> me either..
[09:50:18] <Arjan> since that module is only used in development
[09:50:26] <Arjan> feel free to fix
[09:50:27] <Andreas Stenius> indeed, and on files present on the system
[09:50:30] <Andreas Stenius> ok
[09:51:41] <Andreas Stenius> Arjan: if the tpl mode still crashes, let me know. In that case I'll have to revisit the other regexp's too..
[09:51:46] <Arjan> :)
[09:51:49] <Arjan> will do
[09:52:24] <Andreas Stenius> have some more tweaks I want in with regard to indenting too..
[09:52:43] <Andreas Stenius> see if I get around to it today or not..
[10:33:55] simon.smithies joins the room
[10:40:32] Arjan leaves the room
[10:41:02] Arjan joins the room
[10:51:58] <simon.smithies> Hi guys ... here comes another difficult question from the New Zealander I'm afraid ...
[10:52:52] <simon.smithies> When I click "I forget my Password" in the log on dialog, it asks for a user name or enail address
[10:53:36] <simon.smithies> if I enter the admin name, or the admin_email address from config, nothing happens
[10:54:07] <simon.smithies> and I can't see where to associate an email address with a normal user record
[10:54:16] <simon.smithies> what am I missing?
[10:54:34] <Marc Worrell> You can add the e-mail address in the /admin/edit/<person-id> in the address part
[10:54:46] <Marc Worrell> It is a property of the person
[10:55:19] <Marc Worrell> The admin is a special one - the password is always configured in the site config.
[10:55:38] Arjan leaves the room
[10:57:28] <simon.smithies> ah found it
[10:58:44] <simon.smithies> we hadn't done the verification step for the user who is having the problem, and (of course) i couldn't make the "forgot password" email work for the admin user
[10:58:52] Arjan joins the room
[11:00:13] <simon.smithies> Nice feature :)
[11:03:04] <Marc Worrell> A good idea from Arjan - prevents going to the shell to manually reset passwords :-)
[11:04:59] <Maas> finally... found the httpc cookie problem... an ordinary host matching problem
[11:07:29] <Maas> if the cookie is for domain .example.com <http://example.com> and the request comes to a.b.example.com <http://a.b.example.com> it doesn't recognize it.
[11:08:25] <Andreas Stenius> heh
[11:08:56] <Maas> http clients are pretty complex.
[11:29:55] <Marc Worrell> that is a nice bug - it should be able to match it for two levels.
[11:30:50] <Maas> Here is how they do it:
[11:31:00] <Maas> accept_domain(#http_cookie{domain = Domain}, RequestHost) ->
HostCheck =
case http_util:is_hostname(RequestHost) of
true ->
(lists:suffix(Domain, RequestHost) andalso
string:substr(RequestHost, 1,
(length(RequestHost) -
false ->
andalso (hd(Domain) =:= $.)
andalso (length(string:tokens(Domain, ".")) > 1).
[11:32:31] <Maas> Looks like a cludge to prevent setting cookies for ".com" only.
[11:34:21] <Maas> the lists:member part can be removed I think.
[11:37:05] <Maas> now where is the cookie spec :p
[11:38:05] <Maas> Hmm, no... that is not true...
[11:38:26] <Maas> .co.uk <http://co.uk> you also have
[11:39:00] <Maas> it is missing proper super cookie detection.
[11:48:28] <Maas> pff... that list is huge... http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1
[11:51:12] <Maas> cookie rabbit hole
[11:57:12] arcusfelis joins the room
[12:27:52] <Andreas Stenius> hey, does a site have to be running in order to create a context for it!?
[12:30:00] <Marc Worrell> maybe - when you reference parts of it, like the trans and depcache tables
[12:32:15] simon.smithies leaves the room
[12:37:48] <Andreas Stenius> yeah, I got stuck on that a table was missing... but it was on initializiation already... argh..
[12:38:07] <Andreas Stenius> 12:26:04.509 [info] [zhost] warning @ controller_websocket:120 exit:{noproc,{gen_server,call,['z_trans_server$site_322',table]}}
[12:38:50] <Andreas Stenius> do we need to call that when setting up a new context? can't it be deferred to later?
[12:44:52] <Andreas Stenius> ah, well.. I see I can get by without the site context if I sacrifice the use of the depcache..
[12:50:54] <Andreas Stenius> hehe... I get a lot of interesting edge cases when updating site config, yanking a site out from under the feet, and create a new one on a running instance..
[12:51:12] <Andreas Stenius> I try to be nice about it, stopping the site first and all... but still :p
[13:00:13] Arjan leaves the room
[15:58:27] <Andreas Stenius> Arjan, if you find a hang bug in emacs when using zotonic-tpl-mode, send a USR2 signal to it and it will break and give a stacktrace showing what it was doing. Real handy ;)
[16:09:18] Arjan joins the room
[16:10:18] <Arjan> Andreas Stenius: wow thanks for that tip
[16:11:01] <Andreas Stenius> yeah, you can even edit the troublesome buffer (add the missing closing tag) and hit q in the debug window to continue... no work lost :)
[16:11:43] <Andreas Stenius> just learned this yesterday when hunting down the cause for the hanging...
[16:19:41] <Andreas Stenius> wasn't there some general show_if arg that you could pass to a scomp?
[16:20:04] arcusfelis leaves the room
[16:28:46] <Arjan> dont know
[16:28:49] <Arjan> what would be the use case?
[16:29:47] <Andreas Stenius> {% button text="foo" show_if=some_var %} ...
[16:29:57] <Andreas Stenius> just realized that I'd like some_var to actually be some_expr..
[16:30:08] <Andreas Stenius> but we don't have expressions there, now do we?
[16:30:48] <Andreas Stenius> instead of wrapping the {% ... %} inside an enclosing {% if ... %}
[16:32:01] <Andreas Stenius> actually, your neat css trick you used on the status site is a good inspiration on how to do it better ;)
[16:49:54] <Arjan> oh :)
[16:50:13] <Arjan> but some_var can contain an expression
[16:50:19] <Arjan> show_if=(1 > 2)
[16:50:22] <Arjan> should work
[16:50:31] <Andreas Stenius> aw, cool. didn't think of that
[16:50:55] <Andreas Stenius> have another idea in my head.. template snippets, or inline templates
[16:51:22] <Andreas Stenius> that is, define (local?) templates that can be included within another template.
[16:51:44] <Andreas Stenius> useful when you have smallish (one or a few lines) of template you want to refer to
[16:52:13] <Andreas Stenius> so you don't have to scatter your templates folder with a whole bunch of _foobar.tpl files...
[16:52:44] <Andreas Stenius> also, you can avoid trailing newlines that emacs wants to insert into my files. ick.
[17:05:43] Maas leaves the room
[17:18:00] arcusfelis joins the room
[17:52:34] <Arjan> huh
[17:52:46] <Arjan> I accidentally typed a . after a domain name
[17:52:48] <Arjan> http://zotonic.com./
[17:52:56] <Arjan> wut?!
[17:53:07] <Arjan> is that even a valid hostname?
[21:18:36] arcusfelis leaves the room
[21:40:55] Maas joins the room
[21:43:10] <Maas> That is indeed a valid hostname. :-)
[21:49:43] <Maas> The rfc seem does not agree, but all cli tools just work
[22:08:10] <Maas> Interesting, a domain name ending with a dot is an absolute domain name, without it the dot it is a relative one. If you are referring to foo.com <http://foo.com>, you could actually have meant foo.com.your-domain.nl <http://foo.com.your-domain.nl>. So the FQDN really is zotonic.com <http://zotonic.com>. I guess all http clients are not following the specs here ;-)
[23:09:40] Arjan leaves the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!