ringojs-blosxom?

24 views
Skip to first unread message

Matěj Cepl

unread,
Jul 22, 2010, 4:58:57 PM7/22/10
to RingoJS
Is there some simple RingoJS based blogging platform (I imagine
something in the style of blosxom, etc.)? I would love to have a basis
for extending it with Atompub support.

Thanks for any ideas,

Matěj
--
Q: Is vi an easy editor to learn, is it intuitive?
A: Yes, some of us think so. But most people think that we are
crazy.
-- vi FAQ

Simon Oberhammer

unread,
Jul 23, 2010, 2:39:24 AM7/23/10
to RingoJS
On Jul 22, 10:58 pm, Matěj Cepl <mc...@redhat.com> wrote:
> Is there some simple RingoJS based blogging platform (I imagine
> something in the style of blosxom, etc.)? I would love to have a basis
> for extending it with Atompub support.

blosxom looks nice, didn't know it.

because you say "any ideas" i'll mention robert's microblogging app
http://github.com/robi42/ringolog

greetings
simon

Hannes Wallnoefer

unread,
Aug 3, 2010, 11:55:32 AM8/3/10
to RingoJS
I think I'd love to have something like blosxom for the ringojs.org
wiki/website. Well actually I don't know blosxom well enough to say
that - what I'd like to have is something like Jekyll, but for a wiki,
using Markdown, and dynamically rendered. Basically, I'd like to have
the contents of the ringojs.org wiki in plain Markdown files in a git/
github repository.

This is something we've discussed long ago - in fact there's an issue
for it: http://github.com/ringo/ringojs/issues#issue/17 - but maybe
now I want it enough to actually go ahead and do it.

Hannes

On Jul 22, 10:58 pm, Matěj Cepl <mc...@redhat.com> wrote:
>  smime.p7s
> 8KViewDownload

Matěj Cepl

unread,
Aug 5, 2010, 5:57:30 PM8/5/10
to rin...@googlegroups.com
Matěj Cepl píše v St 04. 08. 2010 v 23:34 -0400:
> I was looking at ringojs webapps and I have to say that I am quite
> confused by the lack of documentation. What do actions.js, config.js,
> main.js, and model.js are meant to be? What is their syntax? There is a
> bit in http://ringojs.org/wiki/middleware/, but otherwise I am afraid I
> will have to "Use the Source, Luke!" ;) Any examples of how I should
> write my webapp which would be a bit more complicated
> than /apps/jsgi/main.js ? For exmaple, how is config.js/exports.urls
> supposed to work?

Of course, just after sending this message I found
http://ringojs.org/wiki/Tutorial/ :( And not only it is a great
tutorial, but you've made me complete convert ... forget blosxom, this
looks like functional and something to be develop upon.

I'll look into it.

Matěj

Matěj Cepl

unread,
Aug 4, 2010, 11:30:58 PM8/4/10
to rin...@googlegroups.com
Hannes Wallnoefer píše v Út 03. 08. 2010 v 08:55 -0700:

> I think I'd love to have something like blosxom for the ringojs.org
> wiki/website. Well actually I don't know blosxom well enough to say
> that - what I'd like to have is something like Jekyll, but for a wiki,
> using Markdown, and dynamically rendered. Basically, I'd like to have
> the contents of the ringojs.org wiki in plain Markdown files in a git/
> github repository.

But Jekyll is just static web pages generator, right? I wouldn't like to
get crazy about dynamic generation, but a bit of it could be helpful I
guess.

My itch, waiting to be scratched, is to get a blog which could be fed
just by Atompub. I.e., I write my post locally and generate an Atom file
from it, which would be then posted to my blog site just for the
presentation. To my biggest surprise (given how much buzz there was
about Atompub and how everybody and their dog claim to support it),
there isn't one blogging site able to do this perfectly without making
my life miserable.

So my dreamed about platform has two critical features:

a) Using something simple (RESTful interface would be awesome) allow
pushing whole Atom feed to the site, with the server recognizing which
entries were already published (but it would allow updating existing
ones) based on metadata included in the Atom entries.
b) Allow pushing entry with <content type="xhtml"> (or html), which
would ideally just leave HTML as it comes in the <entry>. I guess the
server should somehow refer to some CSS stylesheet somewhere which would
allow to have pure content-only (separation of content and presentation
style) entries.

For example, no blogging platform known to me supports
<atom:source><atom:id> construct, although it is part of the standard,
and for example Blogger claims <entry> with such element to be broken
feed :( ... (http://code.google.com/p/gdata-issues/issues/detail?id=1912
goes without Google folks even noticing it, apparently).

Other blogging platforms (I am looking at you, Wordpress!) even though
claim to support Atompub, make publishing it almost impossible and
understand HTML-formatted <entry> as plain ASCII and reformat it with
beastly results ... http://core.trac.wordpress.org/ticket/9513).
Livejournal (another blogging platform claiming to support Atompub)
fails even more spectacularly (not sure whether I have a bug link ...
again, it went even without noticing by Livejournal folks).

Looking at Jekyll, it is obviously different than what I was talking
about, but at least it would allow my local authoring/remote publishing
style. Not sure whether it is possible to add some plugins which would
allow communicating with the system via Atompub, but I am not sure
whether it is actually really that much important (although publishing
blog with git push feels quite hackish to me). It somehow puts all my
thoughts for the past year on its head, so I have to go through it
again.

I was thinking about blosxom-like system because of its simplicity (the
original Perl version of blosxom.cgi has 1027 lines including quite
extensive documentation) while having a possibility of quite extensive
plugins both for publishing as well as for input (different formats of
input and different protocols for input; I was myself maintaining for
some time plugin for wiki input with Pyblosxom and it was just 401 lines
of very simple Python code).

However, I would prefer to maintain code in javascript, as I would like
to learn more about server-side Javascript (well, about writing server
apps generally). When looking around I found
http://blosxom.ookee.com/blog/news/blosxom/javascript-blosxom.html which
mentions http://tokyoenvious.xrea.jp/blosxom.js/ currently available in
my temporary repo on git://fedorapeople.org/~mcepl/jsBlosxom.git). It is
obviously just a proof of concept but it could be a good inspiration.

I was looking at ringojs webapps and I have to say that I am quite
confused by the lack of documentation. What do actions.js, config.js,
main.js, and model.js are meant to be? What is their syntax? There is a
bit in http://ringojs.org/wiki/middleware/, but otherwise I am afraid I
will have to "Use the Source, Luke!" ;) Any examples of how I should
write my webapp which would be a bit more complicated
than /apps/jsgi/main.js ? For exmaple, how is config.js/exports.urls
supposed to work?

Does this rambling make any sense?

Best,

Matěj

Hannes Wallnoefer

unread,
Aug 6, 2010, 10:12:04 AM8/6/10
to rin...@googlegroups.com
I must admit that I didn't know a thing about Atompub. For our
purpose, keeping the site as a collection of markdown-formatted files
in git probably works best, so we started a small ringo application
for that:

http://github.com/davidbierbauer/simplesite

It's not finished but it's functional. We'll probably use it to serve
parts of ringojs.org at some point. Maybe it can serve you as a
starting point or source of inspiration.

Hannes

2010/8/5 Matěj Cepl <mc...@redhat.com>:

Matěj Cepl

unread,
Aug 6, 2010, 9:54:15 PM8/6/10
to rin...@googlegroups.com
Hannes Wallnoefer píše v Pá 06. 08. 2010 v 16:12 +0200:

> I must admit that I didn't know a thing about Atompub. For our
> purpose, keeping the site as a collection of markdown-formatted files
> in git probably works best, so we started a small ringo application
> for that:

Yeah, you are probably right. What you need is something different from
what I need ... you seem to be after a good wiki, whereas I want a
blogging platform. That doesn't seem to be same.

Matěj

George Moschovitis

unread,
Aug 7, 2010, 1:45:53 AM8/7/10
to rin...@googlegroups.com

Yeah, you are probably right. What you need is something different from
what I need ... you seem to be after a good wiki, whereas I want a
blogging platform. That doesn't seem to be same.

Matěj

FYI, I am working on a simple content management system powered by RingoJS and AppengineJS (that means in runs on GAE). I will probably release the source code.

-g.



--
http://www.gmosx.com/blog
http://www.appenginejs.org

Matěj Cepl

unread,
Aug 7, 2010, 6:55:26 PM8/7/10
to rin...@googlegroups.com
George Moschovitis píše v So 07. 08. 2010 v 08:45 +0300:

> FYI, I am working on a simple content management system powered by
> RingoJS and AppengineJS (that means in runs on GAE). I will probably
> release the source code.

That looks interesting. Looking forward for the repository to show up ;)

Matěj

Matěj Cepl

unread,
Aug 7, 2010, 8:12:54 PM8/7/10
to rin...@googlegroups.com
George Moschovitis píše v So 07. 08. 2010 v 08:45 +0300:
> FYI, I am working on a simple content management system powered by
> RingoJS and AppengineJS (that means in runs on GAE). I will probably
> release the source code.

BTW, I hope that the system will be backstore independent. I would
certainly prefer to host it on my own server. Could I use as backend
something more conservative (ringo-hibernate or berkeleystore)?

Matěj

John Hardy

unread,
Aug 7, 2010, 8:43:48 PM8/7/10
to rin...@googlegroups.com
No George is targeting the Google Appengine specifically. Which is great in my opinion but may not suit you.

That said I'm sure you could port it to make it more Ringo oriented.

Matěj Cepl

unread,
Aug 7, 2010, 9:03:49 PM8/7/10
to rin...@googlegroups.com
John Hardy píše v Ne 08. 08. 2010 v 10:43 +1000:

> No George is targeting the Google Appengine specifically. Which is
> great in my opinion but may not suit you.

OK, we'll see. I will play with Tutorial's blogengine to learn more
about Atompub and ringo, and I'll see if George's script will be of any
use to me.

Matěj

George Moschovitis

unread,
Aug 8, 2010, 2:56:48 AM8/8/10
to rin...@googlegroups.com
No it will be Google App Engine specific, sorry.
Moreover it will use Google Closure (which I *love* btw) for the UI, I am not sure if it will be of much help to you if you prefer jQuery or something.

regards,
-g.

Ged Wed

unread,
Aug 8, 2010, 4:49:55 AM8/8/10
to rin...@googlegroups.com
Hey George.

I wrote my little spec a few days ago as i wanted to also make a ajax like CMS.
Mainly to do all the composition on the client :)

The server does not much else other than data store, queries and security.

Its attached. It might give you some ideas - who knows

g

> --
> You received this message because you are subscribed to the Google Groups
> "RingoJS" group.
> To post to this group, send email to rin...@googlegroups.com.
> To unsubscribe from this group, send email to
> ringojs+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ringojs?hl=en.
>

ajax cms.txt

George Moschovitis

unread,
Aug 8, 2010, 7:54:56 AM8/8/10
to rin...@googlegroups.com
thanks, will have a look.

I am using a similar design, with an ajax admin app implemented using Google Closure. The Appengine app is just a REST service consumed by the admin and the actual blog.

Mainly an attempt to get familiar with ajax, desktop-like apps using Closure, but should be useful for other AppengineJS developers...

-g.

Matěj Cepl

unread,
Aug 8, 2010, 8:36:59 AM8/8/10
to rin...@googlegroups.com
George Moschovitis píše v Ne 08. 08. 2010 v 09:56 +0300:

> No it will be Google App Engine specific, sorry.
> Moreover it will use Google Closure (which I *love* btw) for the UI, I
> am not sure if it will be of much help to you if you prefer jQuery or
> something.

Yeah, that's something different than what I have on mind ... my UI
interface should be probably lynx-compliant ;).

Matěj

George Moschovitis

unread,
Aug 8, 2010, 9:30:23 AM8/8/10
to rin...@googlegroups.com

Yeah, that's something different than what I have on mind ... my UI
interface should be probably lynx-compliant ;).


sounds good ;-) would love to see the end-result.

-g.

Ged Wed

unread,
Aug 8, 2010, 12:59:35 PM8/8/10
to rin...@googlegroups.com
let me know when it goes up on gitbug - would be happy to contrib back
to your master etc.

ged

George Moschovitis

unread,
Aug 8, 2010, 3:20:44 PM8/8/10
to rin...@googlegroups.com
sure, it will take a couple of weeks though...

-g.

Matěj Cepl

unread,
Aug 8, 2010, 5:30:02 PM8/8/10
to rin...@googlegroups.com
Dne 8.8.2010 15:20, George Moschovitis napsal(a):

> sure, it will take a couple of weeks though...

Ah, I thought it was pointed towards me ;) (a) I don't use github, b) it
will take much longer before anything happens)

Matěj
--
Science is meaningless because it gives no answer to our
question, the only question important to us: ``What shall we do
and how shall we live?''
-- Lev Nikolaevich Tolstoy

Matěj Cepl

unread,
Aug 8, 2010, 5:37:44 PM8/8/10
to rin...@googlegroups.com
Matěj Cepl píše v Čt 05. 08. 2010 v 17:57 -0400:

> Of course, just after sending this message I found
> http://ringojs.org/wiki/Tutorial/ :( And not only it is a great
> tutorial, but you've made me complete convert ... forget blosxom, this
> looks like functional and something to be develop upon.
>
> I'll look into it.

Is there a SIMPLE way how to say that some branches of the web (/admin/
and planned /atom/) would be accessible only over https:// and if
accessed via http:// browser would get immediately redirected?

Matěj

Matěj Cepl

unread,
Aug 8, 2010, 9:15:46 PM8/8/10
to rin...@googlegroups.com
Matěj Cepl píše v Čt 05. 08. 2010 v 17:57 -0400:
> Of course, just after sending this message I found
> http://ringojs.org/wiki/Tutorial/ :( And not only it is a great
> tutorial, but you've made me complete convert ... forget blosxom, this
> looks like functional and something to be develop upon.
>
> I'll look into it.

BTW, one more nit. Skin examples in the Tutorial (which are supposed to
be more or less HTML files) have in the top name of the file commented
out with the Javascript comment (//).

Matěj

Hannes Wallnoefer

unread,
Aug 9, 2010, 7:20:26 AM8/9/10
to rin...@googlegroups.com
2010/8/8 Matěj Cepl <mc...@redhat.com>:

>
> Is there a SIMPLE way how to say that some branches of the web (/admin/
> and planned /atom/) would be accessible only over https:// and if
> accessed via http:// browser would get immediately redirected?

The only way I can think of is to check if request.scheme is "https"
and redirect if not. It's possible that this can be configured in
Jetty somehow, but I've never done that.

Hannes

> Matěj
>

John Hardy

unread,
Aug 9, 2010, 7:45:04 AM8/9/10
to rin...@googlegroups.com
Yes that's how I do it.

Matěj Cepl

unread,
Aug 11, 2010, 1:06:51 AM8/11/10
to rin...@googlegroups.com
Hannes Wallnoefer píše v Po 09. 08. 2010 v 13:20 +0200:

> The only way I can think of is to check if request.scheme is "https"
> and redirect if not. It's possible that this can be configured in
> Jetty somehow, but I've never done that.

Well, but that would be post-authentication, right? Which defeats whole
(and sole for me) purpose of https...

Matěj

John Hardy

unread,
Aug 11, 2010, 1:21:04 AM8/11/10
to rin...@googlegroups.com
you should never authenticate in http, you should redirect to https before authentication.

Matěj Cepl

unread,
Aug 11, 2010, 10:19:27 AM8/11/10
to rin...@googlegroups.com
John Hardy píše v St 11. 08. 2010 v 15:21 +1000:

> you should never authenticate in http, you should redirect to https
> before authentication.

Meaning it has to be done outside of a ringojs app?

Matěj

John Hardy

unread,
Aug 11, 2010, 10:46:52 AM8/11/10
to rin...@googlegroups.com
There are lots of ways to authenticate, most involve setting a cookie. I was just making a general security point that you should not take a user's password over HTTP, the form and action should be sent over HTTPS and any cookie set should be secure and not be shared with HTTP requests.

So in answer to your question, when a user comes to an HTTP page and wants to log in, its easy for the server to redirect them to an HTTPS version of that page with a little URL hacking.

I use appenginjs and let Google handle the authentication but I do not want this to happen over HTTP so if the URL scheme is HTTP I redirect the user to the equivalent HTTPS URL

        if (req.scheme == 'http') {
            throw {redirect: 'https://' + req.headers.host + req.path};
        }

Matěj Cepl

unread,
Aug 21, 2010, 11:32:49 AM8/21/10
to rin...@googlegroups.com
Dne 11.8.2010 10:46, John Hardy napsal(a):

> There are lots of ways to authenticate, most involve setting a cookie. I
> was just making a general security point that you should not take a
> user's password over HTTP, the form and action should be sent over HTTPS
> and any cookie set should be secure and not be shared with HTTP requests.

Of course, that's obvious, and I haven't thought we need to discuss it
here.
And of course when thinking about authentication
http://bitworking.org/news/Problems_with_HTTP_Authentication_Interop
comes to my mind (and ringojs has currently only Basic).

> I use appenginjs and let Google handle the authentication but I do not
> want this to happen over HTTP so if the URL scheme is HTTP I redirect
> the user to the equivalent HTTPS URL
>
> if (req.scheme == 'http') {
> throw {redirect: 'https://' + req.headers.host + req.path};
> }
>

Of course I can do that, but then I loose all advantages of built-in
middleware. Or, hmm, thinking about it ... how difficult it would be to
create httpsonly middleware, which would do something like this but
before we would get into action.js?

I'll investigate this.

Matěj

Matěj Cepl

unread,
Aug 21, 2010, 10:24:06 PM8/21/10
to rin...@googlegroups.com
Dne 21.8.2010 11:32, Matěj Cepl napsal(a):

> middleware. Or, hmm, thinking about it ... how difficult it would be to
> create httpsonly middleware, which would do something like this but
> before we would get into action.js?

So, talking about middleware, do you think that this could do what I want?

jakoubek:coelodonta$ git diff HEAD
diff --git a/config.js b/config.js
index d0de1be..09ebf4a 100644
--- a/config.js
+++ b/config.js
@@ -16,6 +16,7 @@ exports.middleware = [
'ringo/middleware/etag',
'ringo/middleware/responselog',
'ringo/middleware/basicauth',
+ 'middleware/onlyhttps',
'ringo/middleware/error',
'ringo/middleware/notfound'
];
diff --git a/middleware/onlyhttps.js b/middleware/onlyhttps.js
new file mode 100644
index 0000000..a048bc1
--- /dev/null
+++ b/middleware/onlyhttps.js
@@ -0,0 +1,24 @@
+var Response = require('ringo/webapp/response').Response;
+var config = require("config");
+
+function matchesREkey (obj, path) {
+ for (key in obj) {
+ if (new RegExp(key).test(path)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Don't allow HTTP for authenticated pages
+ */
+exports.middleware = function(app) {
+ return function(request) {
+ if (matchesREkey(config.auth, request.path) &&
+ (request.scheme === 'http')) {
+ throw {redirect: 'https://' + request.headers.host +
request.path};
+ }
+ return app(request);
+ };
+};
(END)
x;

Reply all
Reply to author
Forward
0 new messages