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
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
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
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>:
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
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
That looks interesting. Looking forward for the repository to show up ;)
Matěj
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
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
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.
>
Yeah, that's something different than what I have on mind ... my UI
interface should be probably lynx-compliant ;).
Matěj
Yeah, that's something different than what I have on mind ... my UI
interface should be probably lynx-compliant ;).
ged
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
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
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
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
>
Well, but that would be post-authentication, right? Which defeats whole
(and sole for me) purpose of https...
Matěj
Meaning it has to be done outside of a ringojs app?
Matěj
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
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;