Ticket #658 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

SiteUrl as current document location

Reported by: FND Owned by: MartinBudden
Priority: minor Milestone: 2.6
Component: core Version:
Severity: trivial Keywords:
Cc:

Description (last modified by FND) (diff)

As discussed  here, the SiteUrl? shadow tiddler should display the current document location (rather than a hardcoded link to  http://www.tiddlywiki.com).

With this link any TiddlyWiki document could easily be downloaded from within the document itself.

Attachments

ticket658.patch Download (0.9 KB) - added by FND 4 years ago.
ticket658_alt.patch Download (0.9 KB) - added by FND 3 years ago.
alternative implementation using an empty string by default

Change History

Changed 4 years ago by FND

  Changed 4 years ago by FND

  • owner changed from JeremyRuston to FND
  • status changed from new to assigned

  Changed 4 years ago by FND

  • description modified (diff)

follow-up: ↓ 4   Changed 4 years ago by EricShulman

It is up to the document's author to decide what URL is appropriate for the SiteUrl? value, and setting it automatically would break the semantics of existing functionality!

For example, the value of SiteUrl? is used when generating XML output, and is supposed to point to the URL where you originally got the document... not the *current* location -- which would be  file://... after you've downloaded the document.

Note also that some sites do not contain a 'real' SiteUrl? tiddler, but simply set the shadow value via a 'systemConfig' tiddler. Thus, automatically overwriting the shadow is *not* a viable option.

in reply to: ↑ 3   Changed 4 years ago by EricShulman

As Fred noted in the online discussion, if the *core* sets the shadow value, then any "systemConfig" or "real" tiddler will still be able to override it, so my previous concern is not really an issue.

However, it still doesn't seem all that useful to automatically set the shadow value, especially if the document is being viewed locally (via  file://). If an RSS feed is generated from the local document, it would insert the local filesystem location into the XML output, which would not be correct when the XML file is subsequently posted online. In order for the XML output to be correct, the author *must* specify the SiteUrl? value so that the shadow value would be ignored. Thus, there doesn't seem to be much utility to setting the shadow value in the first place.

  Changed 3 years ago by zooko

I run a klog (it's a lot like a blog) in TiddlyWiki stored on top of the Tahoe-LAFS cloud storage system:

 http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:hgvn7nhforxhfxbx3nbej53qoi:yhbnnuxl4o2hr4sxuocoi735t6lcosdin72axkrcboulfslwbfwq/wiki.html

The CEO of the company that I work for, Peter Secor, asked me for an RSS feed of my klog, so I gave him:

 http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:hgvn7nhforxhfxbx3nbej53qoi:yhbnnuxl4o2hr4sxuocoi735t6lcosdin72axkrcboulfslwbfwq/wiki.xml

I was surprised that the links in that page which are intended to point back to my klog instead point to  http://www.tiddlywiki.com . Per discussion with Jeremy Ruston and FND on IRC I'm going to experiment with setting my ~SiteUrl?.

In this use, it is clear that the current document location is

  Changed 3 years ago by zooko

I was going to say that "it is clear that the current document location is the right default", but it is not so clear... I will post to this ticket again once I've learned more.

  Changed 3 years ago by zooko

Okay, here's what I've learned:

1. The proposed behavior of writing the current document location into the RSS, as implemented in the patch attached by FND to this ticket 7 months ago, would be a fatal security flaw for my use. That's because the current document location contains sensitive information: knowledge of the URL grants you the ability to write to my TiddlyWiki with your own updates. So anything which looks at the current document location and writes that result out to other listeners is dangerous.

2. I tried setting the SiteUrl tiddler to empty in my klog, but this broke the resulting RSS file entirely. So for now I have to manually set the read-only-view of my klog to be the SiteUrl value of my klog. Here is what it looks like when I've manually set the SiteUrl of this klog to empty and generated the .xml file:

 http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:ajvzmii3fyujrgxkxxvu23wari:dkxqyrtl4bzmg3ihts26tveft47il4nn5tduc7ijbb75kerndw4q/wiki.html

 http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:ajvzmii3fyujrgxkxxvu23wari:dkxqyrtl4bzmg3ihts26tveft47il4nn5tduc7ijbb75kerndw4q/wiki.xml

I also tried setting SiteUrl to "./wiki.html", but that also doesn't work.

So, I don't think there is a way for Tiddly Wiki to do what I would really like, which is for the RSS file to point back to the location from which it is being loaded. Is this just a limitation of RSS -- it can't use relative links?

  Changed 3 years ago by MartinBudden

  • owner changed from FND to MartinBudden
  • status changed from assigned to new

After discussion with Fred, we've decided the correct solution is to set SiteUrl? to a null string, since neither "tiddlywiki.com" nor the current document location is correct.

Changed 3 years ago by FND

alternative implementation using an empty string by default

  Changed 3 years ago by FND

  • milestone changed from 2.5.1 to 2.5.2

  Changed 3 years ago by FND

  • milestone changed from 2.5.3 to 2.5.4

  Changed 2 years ago by SaqImtiaz

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.