System tiddlers content hash, support updateas, patches #5954
Replies: 6 comments 18 replies
-
Post script: Sure a plugin designed to do this could be made but it would change all shadows, that's why it should be slipped into the core or a special edition. Importing tiddlers whose has hash not changed could be discarded and it made clearer to the importer which tiddlers actually changed on import/overwrite. Perhaps modified date needs to be left out of the hash. Tony |
Beta Was this translation helpful? Give feedback.
-
The simple check, if a system tiddler is overwritten is:
That doesn't work. ... If the hash is part of the system tiddler I can create a plugin, that overwrites a core tiddler and add the hash of the new tiddler to that field. ... Since the hash-field can not be part of the hash you have no chance to detect, that I did create a new system tiddler, that looks like core, because the hash is valid. ... We can only trust a hash, if it comes from a "trusted source" outside the wiki. The only way that works is, that the wiki build process will create the hashes and publish them separately and versioned. So if a user or a plugin author wants to check the code has been modified, they would calculate the hash of the wiki-tiddler and compare it with the hash of the original-tiddler published at GitHub. If we use a sha256 hash, which should be secure for now, it has 32 characters. Changing the encoding will make validation more complicated. |
Beta Was this translation helpful? Give feedback.
-
IMO "text" would not be enough. TW allows us to use a |
Beta Was this translation helpful? Give feedback.
-
For plugins, it would be enough to have 1 hash for the whole plugin including all tiddlers. |
Beta Was this translation helpful? Give feedback.
-
This gives us a new problem. .. How can we verify, that nobody did mess with the hashes? ... Compress the hashes into 1 file and sign it with PGP. Similar to: https://wiki.debian.org/Creating%20signed%20GitHub%20releases |
Beta Was this translation helpful? Give feedback.
-
Sorry, I am still working through the whole story, but if you can see my reasons, perhaps we can find a solution. So my idea is that perhaps the vast majority of core tiddlers do not change between versions, if a plugin applied a patch to a system tiddler with a particular hash then if that hash does not change then the core tiddler has not changed and the same patch can be retained or reapplied. If the core hash has being changed then all bets are off and the patch cant be reapplied without intervention. In some ways this would allow every tiddler in the core to have its own change flag, even a hash for each version giving finer grained control and the ability to write patches to a specific "version" or "hash" of a core tiddler. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Folks,
I was wondering if we could build a System tiddler content hash for tiddlers in the core?. This would be stored in a hidden field on each system tiddler, or regular ones by design. I believe it serves a few identified purposes below but such a facility could be used in other applications if made available as widgets.
Basically as a new release is issued an algoritium runs against each system tiddler which is analysed and generates a hash, ideally using a method to keep the hash size as small as possible (eg use a base 60 encoding) whilst giving those interested the ability to test if the system tiddler has changed. Yes this is in addition to shadows vs tiddlers. Basically a good hash will allow you to detect if even one character in the tiddler changes. Ideally this would apply to the whole tiddler but text would be enough.
Now if the hashing algorithm is made available to us, we can test a given system tiddler for changes, if the stored (published) hash does not match the computed hash. This could be used for the upgrade utility to quarantine edited system tiddlers that have being modified, and Plugins forced to modify a system tiddler, could detect if an upgrade has changed an underlying system tiddler it wants to modify. Ideally this would trigger a diff view one could choose to update or maintain the changes selectively.
Most of all such a facility could give rise to the ability to distribute core hacks or patches which can detect if and when a plugin or upgrade has changed a system or shadow tiddler. This will be of great benefit to designers and developers who want to test and share possible core changes with a patch.
Plugin authors could detect changes to their own tiddlers and include handling as desired. Some beautiful Agile and component based development solutions could be built on this alone, not to mention the ability to use this to manage data plugins and as a de facto packable delete, retain the hash but delete the content.
Your thoughts?
Tony
Beta Was this translation helpful? Give feedback.
All reactions