From yuri at sims.berkeley.edu Tue Apr 14 16:51:47 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Tue Apr 14 18:47:36 2009 Subject: [Sputnik-list] new copas Message-ID: This new release of copas fixes the problem that some people had reported, with Sputnik sometimes hanging on POST when running on Xavante. Note that there also was another issue related to posting: the upload of binary files taking too long because of the inefficient handling of base64 encoding. This has been fixed in Fenchurch. - yuri ---------- Forwarded message ---------- From: Andre Carregal Date: Thu, Apr 9, 2009 at 2:58 PM Subject: [Kepler-Project] [ANN] Copas 1.1.5 To: Kepler Project mailing list Copas is a dispatcher based on coroutines that can be used by TCP/IP servers. It uses LuaSocket as the interface with the TCP/IP stack. A server registered with Copas should provide a handler for requests and use Copas socket functions to send the response. Copas loops through requests and invokes the corresponding handlers. For a full implementation of a Copas HTTP server you can refer to Xavante as an example. Copas is free software and uses the same license as Lua 5.1 Copas is available at http://www.keplerproject.org/copas/ Changes: Copas 1.1.5 [07/Apr/2009] * Fixed bug reported by Sam Roberts on the Kepler list (found due to Xavante locking up on some POST requests) Copas can be downloaded from its LuaForge page or using LuaRocks: luarocks install copas Comments are welcome! Andr? _______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/ -- http://spu.tnik.org/ From spiralofhope at gmail.com Tue Apr 14 22:45:38 2009 From: spiralofhope at gmail.com (Spiral of Hope) Date: Wed Apr 15 00:40:48 2009 Subject: [Sputnik-list] Could not create file '/path/kepler/htdocs/sputnik.ws': Message-ID: Hello, I'm doing a new install on a vanilla PCLinuxOS box. Most of the installation works well. However, this: ./bin/lua -lluarocks.require -e 'require("sputnik").setup()' gives me: Could not create file '/path/kepler/htdocs/sputnik.ws': /path/kepler/htdocs/sputnik.ws: No such file or directory I checked, and I do not see "sputnik.ws" anywhere. The previous command is this: ./bin/luarocks --only-from=http://sputnik.freewisdom.org/rocks/earth install sputnik 8.08.13 which gives me: Installing http://sputnik.freewisdom.org/rocks/earth/sputnik-8.08.13-0.rockspec... sputnik-8.08.13/ ... sputnik-8.08.13/lua/sputnik/actions/wiki.lua Updating manifest for /home/user/working/apps/sputnik/rocks/ What should I do to troubleshoot this? From spiralofhope at gmail.com Tue Apr 14 23:00:43 2009 From: spiralofhope at gmail.com (Spiral of Hope) Date: Wed Apr 15 00:55:49 2009 Subject: [Sputnik-list] world clock demo broken Message-ID: http://spu.tnik.org/en/World_Clock gives me: Sputnik ran but failed due to an unexpected error. Error details: ...ik-examples/cvs-1/lua/sputnik/actions/worldclock.lua:33: attempt to index field 'urls' (a nil value) stack traceback: ...ik-examples/cvs-1/lua/sputnik/actions/worldclock.lua:33: in function 'action_function' ...ik/sputnik/rocks//sputnik/cvs-1/lua/sputnik/init.lua:783: in function <...ik/sputnik/rocks//sputnik/cvs-1/lua/sputnik/init.lua:709> From spiralofhope at gmail.com Tue Apr 14 23:04:17 2009 From: spiralofhope at gmail.com (Spiral of Hope) Date: Wed Apr 15 00:59:24 2009 Subject: [Sputnik-list] graphviz demo broken Message-ID: Visiting http://spu.tnik.org/en/Graphviz_Demo gives me a 'pre' block, with: XSSFilter could not parse (X)HTML:

You can use Sputnik to collaboratively edit graphs. You do this by storing text representation of the graph in the body of a node and telling Sputnik to use Graphviz to generate image files for you on the fly.

What Does This Demo Do?

The Demo consists of two nodes. This node ("Graphviz Demo") is a regular node used for presenting the text of the demo. A separate node - "Raw Dot File" - is used to store dot code, which is converted to SVG on the fly. The default action for "Raw Dot File" (see Raw Dot File) shows the dot code. However, we also add several alternative actions: ".png", ".gif", and ".svg" which will give us the PNG, GIF and SVG representations of the graph. You can see their respective outputs here:

For PNG and GIF we can simple include the file in a different node as we would with any other image:


which would give us:


For SVG, we'll need to embed it with the tag:




which gives us this:

(The SVG image might not display in all browsers, but it's prettier and it allows us to hyperlink nodes - click on "start" for example.)

Note that this image is a wiki node. You can edit it.

How Does this Work?

First, we create a new action, which we save into ~/sputnik/share/lua/5.1/sputnik/actions/graphviz.lua:

module(..., package.seeall)
require"lfs"

function dot(source, format)
    local tempfile = "/tmp/"..math.random()
    local f = io.open(tempfile, "w")
    f:write(source)
    f:close()
    local pipe = io.popen("dot -T"..format.." "..tempfile)
    return pipe:read("*all")
end

actions = {}
actions.dot2svg = function(node, request, sputnik)
    return dot(node.content, "svg"), "image/svg+xml"
end
actions.dot2png = function(node, request, sputnik)
    return dot(node.content, "png"), "image/png"
end
actions.dot2gif = function(node, request, sputnik)
    return dot(node.content, "gif"), "image/gif"
end

We then create a new node (Raw Dot File), and set "action" parameter to

show="wiki.code" -- to avoid running the content throw markdown
svg="graphviz.dot2svg"
png="graphviz.dot2png"
gif="graphviz.dot2gif"

That's it. We can now access Raw Dot File.gif

From spiralofhope at gmail.com Tue Apr 14 23:15:14 2009 From: spiralofhope at gmail.com (Spiral of Hope) Date: Wed Apr 15 01:10:20 2009 Subject: [Sputnik-list] Kepler install typo Message-ID: I was able to install kepler, but there is one small problem with the instructions. kepler-install-1.1.1-1 does not exist. There are two alternatives: either: kepler-install-1.1-1 or the newer: kepler-install-1.1.1-2 From yuri at sims.berkeley.edu Tue Apr 14 23:25:45 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Wed Apr 15 01:21:24 2009 Subject: [Sputnik-list] Kepler install typo In-Reply-To: References: Message-ID: > I was able to install kepler, but there is one small problem with the > instructions. Good. Sounds like you ended up installing Fenchurch, which is a better version to be using anyway. > kepler-install-1.1.1-1 does not exist. Thanks for pointing this out. BTW, the plan it to switch to the Kepler-all-in-one installer (possible a customized one) in the nearest future. This would remove the dependency on luaforge altogether. At least for Linux, it should be easy to do the installation without a network connection at all. - yuri -- http://spu.tnik.org/ From yuri at sims.berkeley.edu Tue Apr 14 23:35:27 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Wed Apr 15 01:31:04 2009 Subject: [Sputnik-list] world clock demo broken In-Reply-To: References: Message-ID: > http://spu.tnik.org/en/World_Clock gives me: > Sputnik ran but failed due to an unexpected error. Oops. Anyway, this demo got broken by an API change, and it's really not worth updating. It was exciting in May of 2007, but we have better things now. And it polluted the logs with all the ajax requests. But showing the visitor an error message is uncool, of course. So, I just disabled it. - yuri -- http://spu.tnik.org/ From yuri at sims.berkeley.edu Tue Apr 14 23:55:28 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Wed Apr 15 01:50:35 2009 Subject: [Sputnik-list] graphviz demo broken In-Reply-To: References: Message-ID: I fixed. Thanks for pointing it out. It was a combination of a more aggressive version of XSSFilter (the site is running code straight from git, so adding exceptions is a little compicated) and the fact that the new server didn't have graphviz installed. - yuri -- http://spu.tnik.org/ From yuri at sims.berkeley.edu Sat Apr 18 00:54:50 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Sat Apr 18 02:49:51 2009 Subject: [Sputnik-list] Sputnik All in One In-Reply-To: References: Message-ID: I took a little bit of time to play with the Kepler-all-in-one installer, turning it into a Sputnik's needs. This works for UNIX only for now, but it shouldn't be too complicated to do the same for Windows. (Any volunteers?) The simplifies the installation process down to the following: 1. Download http://spu.tnik.org/files/sputnik-9.03.16-kaio.tar.gz (1.1MB) 2. Open it with "tar xvzf", cd into the directory 3. Create a directory somewhere where you want to install sputnik, e.g. ~/sputnik/ 4. Run "bash install.sh ~/sputnik/" 5. Go to ~/sputnik and run ./bin/sputnik.lua start-xavante On my laptop, all of those steps together take 40 seconds. No network connection is required apart from the initial download. If you need the exact commands, see below. - yuri -------------------------------------------- Actual UNIX installation commands: cd /tmp/ wget http://spu.tnik.org/files/sputnik-9.03.16-kaio.tar.gz tar xvzf sputnik-9.03.16-kaio.tar.gz cd sputnik-9.03.16-kaio/ mkdir ~/sputnik bash install.sh ~/sputnik/ cd /home/yuri/sputnik ./bin/sputnik.lua start-xavante From streib at cs.indiana.edu Sat Apr 18 06:47:29 2009 From: streib at cs.indiana.edu (Allan Streib) Date: Sat Apr 18 08:43:21 2009 Subject: [Sputnik-list] trouble with mailto link Message-ID: Hi, Just trying out Sputnik (8.08.13), and I can't seem to get a mailto link to work in a page. It creates HTML like link with no href="..." attribute. I've tried markdown syntax and HTML syntax. Links to web pages work fine. Thanks, Allan From yuri at sims.berkeley.edu Sat Apr 18 07:38:29 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Sat Apr 18 09:33:30 2009 Subject: [Sputnik-list] trouble with mailto link In-Reply-To: References: Message-ID: Hi, Allan, Welcome to the list. The href attribute is getting stripped by the XSSFilter. Sputnik follows a very aggressive stance against cross-site scripting, which is based on white-listing of things known to be ok, rather than black-listing things known to be bad. (It doesn't matter whether the HTML is entered directly or generated by Markdown, because the filter is applied _after_ markdown.) So, Sputnik only passes through valid XHTML, and within that, it only allows certain tags, and for those only certain attributes. And attribute values can then also be filtered. In case of a's href attribute, the value is only accepted if it matches one of the following patterns: "^http://", "^https://", "^ftp://", "^/", "#" This can be easily extended. One way to do this, edit the xssfilter_allowed_tags field in @Root. For example, you can allow mailto links by adding the following to xssfilter_allowed_tags: a = { href = {"^http://", "^https://", "^ftp://", "^/", "#", "^mailto:"} } In this particular case, however, filtering out mailto: is probably just an oversight on our part. I will change the default for XSSFilter to allow "mailto:" unless someone gives me a good reason not to. I started a page on XSS Filtering at http://spu.tnik.org/en/XSS_Filtering. - yuri On Sat, Apr 18, 2009 at 1:47 AM, Allan Streib wrote: > Hi, > > Just trying out Sputnik (8.08.13), and I can't seem to get a mailto link > to work in a page. ?It creates HTML like link with no href="..." > attribute. ?I've tried markdown syntax and HTML syntax. > > Links to web pages work fine. - yuri -- http://spu.tnik.org/ From roydobbins at earthlink.net Sat Apr 18 23:34:43 2009 From: roydobbins at earthlink.net (roy) Date: Sun Apr 19 01:28:01 2009 Subject: [Sputnik-list] Re: Sputnik-list Digest, Vol 21, Issue 2 In-Reply-To: References: Message-ID: <200904181834.44184.roydobbins@earthlink.net> Hi Yuri: yes, still interested in following up on the windows install... since we last talked about this, i have downloaded the changes to copas, but have not got so far as to try it out, having been distracted by other work commitments, but i will let you have feedback on that... regards, --roy On Saturday 18 April 2009 05:05, sputnik-list-request@lists.luaforge.net wrote: > Send Sputnik-list mailing list submissions to > sputnik-list@lists.luaforge.net > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list > or, via email, send a message with subject or body 'help' to > sputnik-list-request@lists.luaforge.net > > You can reach the person managing the list at > sputnik-list-owner@lists.luaforge.net > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Sputnik-list digest..." > > > Today's Topics: > > 1. Sputnik All in One (Yuri Takhteyev) > 2. trouble with mailto link (Allan Streib) > 3. Re: trouble with mailto link (Yuri Takhteyev) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 17 Apr 2009 19:54:50 -0700 > From: Yuri Takhteyev > Subject: [Sputnik-list] Sputnik All in One > To: Sputnik > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > I took a little bit of time to play with the Kepler-all-in-one > installer, turning it into a Sputnik's needs. This works for UNIX only > for now, but it shouldn't be too complicated to do the same for > Windows. (Any volunteers?) > > The simplifies the installation process down to the following: > > 1. Download http://spu.tnik.org/files/sputnik-9.03.16-kaio.tar.gz (1.1MB) > 2. Open it with "tar xvzf", cd into the directory > 3. Create a directory somewhere where you want to install sputnik, > e.g. ~/sputnik/ > 4. Run "bash install.sh ~/sputnik/" > 5. Go to ~/sputnik and run ./bin/sputnik.lua start-xavante > > On my laptop, all of those steps together take 40 seconds. No network > connection is required apart from the initial download. > > If you need the exact commands, see below. > > - yuri > > -------------------------------------------- > > Actual UNIX installation commands: > > cd /tmp/ > wget http://spu.tnik.org/files/sputnik-9.03.16-kaio.tar.gz > tar xvzf sputnik-9.03.16-kaio.tar.gz > cd sputnik-9.03.16-kaio/ > mkdir ~/sputnik > bash install.sh ~/sputnik/ > cd /home/yuri/sputnik > ./bin/sputnik.lua start-xavante > > > > ------------------------------ > > Message: 2 > Date: Sat, 18 Apr 2009 04:47:29 -0400 > From: Allan Streib > Subject: [Sputnik-list] trouble with mailto link > To: sputnik-list@lists.luaforge.net > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Hi, > > Just trying out Sputnik (8.08.13), and I can't seem to get a mailto link > to work in a page. It creates HTML like link with no href="..." > attribute. I've tried markdown syntax and HTML syntax. > > Links to web pages work fine. > > Thanks, > > Allan > > > > ------------------------------ > > Message: 3 > Date: Sat, 18 Apr 2009 02:38:29 -0700 > From: Yuri Takhteyev > Subject: Re: [Sputnik-list] trouble with mailto link > To: Allan Streib > Cc: sputnik-list@lists.luaforge.net > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Hi, Allan, > > Welcome to the list. > > The href attribute is getting stripped by the XSSFilter. Sputnik > follows a very aggressive stance against cross-site scripting, which > is based on white-listing of things known to be ok, rather than > black-listing things known to be bad. (It doesn't matter whether the > HTML is entered directly or generated by Markdown, because the filter > is applied _after_ markdown.) > > So, Sputnik only passes through valid XHTML, and within that, it only > allows certain tags, and for those only certain attributes. And > attribute values can then also be filtered. In case of a's href > attribute, the value is only accepted if it matches one of the > following patterns: > > "^http://", "^https://", "^ftp://", "^/", "#" > > This can be easily extended. One way to do this, edit the > xssfilter_allowed_tags field in @Root. For example, you can allow > mailto links by adding the following to xssfilter_allowed_tags: > > a = { > href = {"^http://", "^https://", "^ftp://", "^/", "#", "^mailto:"} > } > > > In this particular case, however, filtering out mailto: is probably > just an oversight on our part. I will change the default for XSSFilter > to allow "mailto:" unless someone gives me a good reason not to. > > I started a page on XSS Filtering at http://spu.tnik.org/en/XSS_Filtering. > > - yuri > > On Sat, Apr 18, 2009 at 1:47 AM, Allan Streib wrote: > > Hi, > > > > Just trying out Sputnik (8.08.13), and I can't seem to get a mailto link > > to work in a page. ?It creates HTML like link with no href="..." > > attribute. ?I've tried markdown syntax and HTML syntax. > > > > Links to web pages work fine. > > - yuri From streib at cs.indiana.edu Tue Apr 21 02:04:07 2009 From: streib at cs.indiana.edu (Allan Streib) Date: Tue Apr 21 03:59:53 2009 Subject: [Sputnik-list] trouble with mailto link In-Reply-To: (Yuri Takhteyev's message of "Sat\, 18 Apr 2009 02\:38\:29 -0700") References: Message-ID: Yuri Takhteyev writes: > So, Sputnik only passes through valid XHTML, and within that, it only > allows certain tags, and for those only certain attributes. And > attribute values can then also be filtered. In case of a's href > attribute, the value is only accepted if it matches one of the > following patterns: > > "^http://", "^https://", "^ftp://", "^/", "#" > > This can be easily extended. One way to do this, edit the > xssfilter_allowed_tags field in @Root. For example, you can allow > mailto links by adding the following to xssfilter_allowed_tags: > > a = { > href = {"^http://", "^https://", "^ftp://", "^/", "#", "^mailto:"} > } Thanks -- that sounds like it should be easy enough, but sorry to say I have not been able to figure out how to do this. I tried adding this just to the node where I want to have a mailto link, but depending on how I did it I either got an error or no effect. Could you explain exactly how to add this "xssfilter_allowed_tags" field to a node? Thanks, Allan From yuri at sims.berkeley.edu Tue Apr 21 05:01:16 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Tue Apr 21 06:58:43 2009 Subject: [Sputnik-list] trouble with mailto link In-Reply-To: References: Message-ID: > Thanks -- that sounds like it should be easy enough, but sorry to say I > have not been able to figure out how to do this. I tried adding this > just to the node where I want to have a mailto link, but depending on > how I did it I either got an error or no effect. Could you explain > exactly how to add this "xssfilter_allowed_tags" field to a node? No problem. Log in as Admin, go to the page for which you want to enable this (or its prototype), click on the cog icon in the top-right corner (between edit and history, you will only see it when logged in as Admin). This should take you to Page_Name.configure and will show you a large number of fields, grouped into sections. Click on "HTML Fields" to open that section, scroll to the bottom and look for a field called "Tags Allowed for XSSFilter" (it should be the last field). Paste the following into that field: a = { href = {"^mailto:", "^http://", "^/"} } Then save. This page (and anything that inherits from it) should now show mailto links. Alternatively, if you are specifically looking to enable mailto liks, you can just update your installation to use the latest version from git (see http://spu.tnik.org/en/Source for how to do this). This will fix the issue, since I changed XSSFilter to allow mailto by default. Let me know how it goes. - yuri -- http://spu.tnik.org/ From streib at cs.indiana.edu Tue Apr 21 13:59:12 2009 From: streib at cs.indiana.edu (Allan Streib) Date: Tue Apr 21 15:54:47 2009 Subject: [Sputnik-list] trouble with mailto link In-Reply-To: References: Message-ID: <1240329552.8275.1311593321@webmail.messagingengine.com> On Tue, 21 Apr 2009 00:01 -0700, "Yuri Takhteyev" wrote: > Log in as Admin, go to the page for which you want to enable this (or > its prototype), click on the cog icon in the top-right corner (between > edit and history, you will only see it when logged in as Admin). This > should take you to Page_Name.configure and will show you a large > number of fields, grouped into sections. Ah I think I have a more basic problem, then. Logged into my site as Admin I do not see that icon. I tried adding the .configure action directly to the URL for the page (the page is called "Parts") and got: Whoops, page Parts does not support action .configure. I tried this on @Root and got: Whoops, page @Root (Root Prototype) does not support action .configure. _(THIS_PAGE_DEFINED_THE_FOLLOWING_ACTIONS) show = "wiki.show" show_content = "wiki.show_content" history = "wiki.history" edit = "wiki.edit" post = "wiki.post" rss = "wiki.rss" diff = "wiki.diff" code = "wiki.code" raw = "wiki.raw" raw_content = "wiki.raw_content" login = "wiki.show_login_form" sputnik_version = "wiki.sputnik_version" save = "wiki.save" preview = "wiki.preview" preview_content = "wiki.preview_content" reload = "wiki.reload" Should this work in the older version of Sputnik? I am not using Fenchurch. I am using the version specified in the Installation instructions (8.08.13)? Thanks, I have a feeling this is just newbie problem stuff so I appreciate the help until I get on my feet. Allan From yuri at sims.berkeley.edu Tue Apr 21 14:37:15 2009 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Tue Apr 21 16:32:10 2009 Subject: [Sputnik-list] trouble with mailto link In-Reply-To: <1240329552.8275.1311593321@webmail.messagingengine.com> References: <1240329552.8275.1311593321@webmail.messagingengine.com> Message-ID: > Should this work in the older version of Sputnik? ?I am not using > Fenchurch. I am using the version specified in the Installation > instructions (8.08.13)? Oh, I see. Yes, that's the reason. Sorry, my mind is totally on Fenchurch those days (which is what I am running all of my current projects on), so I didn't think about this. You should be able to fix this in Earth by editing ~/sputnik/rocks/xssfilter/8.07.07/lua/xssfilter.lua (put the appropriate version number there) and adding "^mailto" to this line: href= {"^http://", "^https://", "^ftp://", "^/", "#"}, However, I would recommend installing Fenchurch instead. As I said before, I still want to polish the installation process a little (like getting rid of the rings dependency, for example) and write some more documentation before making a proper announcement, and it's been a really busy few months, but Fenchurch is definitely better than Earth at this point. If anything is broken in it, it would most likely be things that weren't offered in Earth in the first place, e.g., something in forums or collections. I updated the http://spu.tnik.org/en/Fenchurch page two days ago. The Windows section is still a little spotty, but I think it's better now than the corresponding section for Earth. If you are on Windows, then feedback on the installation process is particularly welcome. - yuri -- http://spu.tnik.org/ From streib at cs.indiana.edu Tue Apr 21 15:49:20 2009 From: streib at cs.indiana.edu (Allan Streib) Date: Tue Apr 21 17:44:46 2009 Subject: [Sputnik-list] trouble with mailto link In-Reply-To: References: <1240329552.8275.1311593321@webmail.messagingengine.com> Message-ID: <1240336160.29480.1311614675@webmail.messagingengine.com> Thanks, I will probably just switch to Fenchurch then, since I'm just getting started and have no commitment to the prior version. I'm not using Windows. Allan On Tue, 21 Apr 2009 09:37 -0700, "Yuri Takhteyev" wrote: > > Should this work in the older version of Sputnik? ?I am not using > > Fenchurch. I am using the version specified in the Installation > > instructions (8.08.13)? > > Oh, I see. Yes, that's the reason. Sorry, my mind is totally on > Fenchurch those days (which is what I am running all of my current > projects on), so I didn't think about this. > > You should be able to fix this in Earth by editing > ~/sputnik/rocks/xssfilter/8.07.07/lua/xssfilter.lua (put the > appropriate version number there) and adding "^mailto" to this line: > > href= {"^http://", "^https://", "^ftp://", "^/", "#"}, > > However, I would recommend installing Fenchurch instead. As I said > before, I still want to polish the installation process a little (like > getting rid of the rings dependency, for example) and write some more > documentation before making a proper announcement, and it's been a > really busy few months, but Fenchurch is definitely better than Earth > at this point. If anything is broken in it, it would most likely be > things that weren't offered in Earth in the first place, e.g., > something in forums or collections. > > I updated the http://spu.tnik.org/en/Fenchurch page two days ago. The > Windows section is still a little spotty, but I think it's better now > than the corresponding section for Earth. If you are on Windows, then > feedback on the installation process is particularly welcome. >