Cook: generate a verification file

0 views
Skip to first unread message

Saq Imtiaz

unread,
Feb 16, 2008, 11:23:30 AM2/16/08
to TiddlyWikiDev
In some cases it can be useful to have Cook generate a file with verification information for the TiddlyWikis it assembles. A good example of this is my newly proposed upgrade mechanism which would benefit from being able to verify the integrity of the downloaded new empty TiddlyWiki file.

I'd like to gather opinion on three aspects of such a file:
  1. What format should the file take? Should it be a .js file so it can be used by means of a script tag, also getting around cross-domain restrictions? Such a JavaScript file would contain an object, eg: var latestversion = { version:2.4.0, date:xxx, size: yyy, sha-1:rrrrr }
  2. Or should we use a different format for the file? YAML/XML/plain text ? This might make it slightly easier to parse than the above example but would need a XmlHttpRequest to fetch it.
  3. What information should this file include?
    • version
    • date
    • size
    • sha1-hash
If we can get the details finalized I'd be happy to write a patch for this.
Cheers,
Saq
--
Tiddly Learning ( http://lewcid.org ) : TiddlyWiki news, plugins, themes and educational usage

Xavier Verges

unread,
Feb 17, 2008, 11:46:16 AM2/17/08
to TiddlyWikiDev
Saq, I'd go for javascript, but giving it a lay out that makes it
valid json after removing the leading and trailing lines. I think that
that would be getting is us the best of 1) and 2).

If this file is were one would be getting the "there is a shinnier
version available", I think that I would add an url with the
description of the changes, or an html one-liner.

btw, great job with this and chef!

-Xv

On Feb 16, 5:23 pm, "Saq Imtiaz" <lew...@gmail.com> wrote:
> In some cases it can be useful to have Cook generate a file with
> verification information for the TiddlyWikis it assembles. A good example of
> this is my newly proposed upgrade mechanism which would benefit from being
> able to verify the integrity of the downloaded new empty TiddlyWiki file.
>
> I'd like to gather opinion on three aspects of such a file:
>
> 1. What format should the file take? Should it be a .js file so it can
> be used by means of a script tag, also getting around cross-domain
> restrictions? Such a JavaScript file would contain an object, eg: var
> latestversion = { version:2.4.0, date:xxx, size: yyy, sha-1:rrrrr }
> 2. Or should we use a different format for the file? YAML/XML/plain
> text ? This might make it slightly easier to parse than the above example
> but would need a XmlHttpRequest to fetch it.
> 3. What information should this file include?
> - version
> - date
> - size
> - sha1-hash
>
> If we can get the details finalized I'd be happy to write a patch for this.
> Cheers,
> Saq
> --
> Tiddly Learning (http://lewcid.org) : TiddlyWiki news, plugins, themes and
> educational usage

Saq Imtiaz

unread,
Feb 27, 2008, 8:31:00 AM2/27/08
to Tiddly...@googlegroups.com
OK.. I've just been looking at implementing this and have run into a small obstacle. Cook is not aware of the TiddlyWiki version number or date, this information is only contained in the core js file version.js

Any suggestions on how to go about obtaining this information? Is there a better solution that extracting it from that file? One of the problems, however unlikely, is that if you cooked a file without version.js Cook would be unable to obtain this information.

Any thoughts guys? Martin and Jeremy, would love your take on this too.

Saq
--
Tiddly Learning ( http://lewcid.org ) : TiddlyWiki news, plugins, themes and educational usage
Reply all
Reply to author
Forward
0 new messages