Password protection

So how can I password protect a local TW instance, then have it go to GitHub and Netlify and still be password protected? I don’t care if random visitors see and/or try to use various buttons as long as they can’t save any changes to my online copy. But I can’t seem to find anywhere to add a password in the Control Panel…

If you password protect the wiki, it will be completely encrypted. So nobody can see anything except they know the password.

TW password protection is intended to avoid saving, it is used to completely encrypt the file.

If you want to save to GitHub, you need an Auth-Token, that only the owner of the repository can create and should never share. Without that token, you technically can’t save anything back to GitHub

ok, thanks. I use the PAT w/ GitHub frequently, and definitely don’t want that to end up online!

The PAT that you enter into the $:/ControlPanel, Saving, GitHub Saver input is stored in the TWCore “Password Vault” which uses your browser’s local storage mechanism. Thus, the value of the PAT is NOT stored within your TW file, so it is safe to upload the file to your GitHub repo without exposing the PAT.

-e

Thanks - was just testing that - both ‘save to github’ and the regular save button simply download the file. Not a ‘pretty’ solution, but effective.

1 Like

If you load the online version of your TW and then enter the PAT in the GitHub Saver settings, it will store that value in your browser’s local storage associated with the online URL. The “save to github” button will then work as intended (i.e. save directly to github) instead of triggering the download saver. Note that since the PAT is kept in local storage, even for the online version, it still prevents others from saving to your online copy.

You can save from a local file as well, just then your local version will not match your gh version. So your work flow would be to download the version from gh, set up your gh saver, and then continue working in the local file but saving to gh. You might use this approach if you had a private repository which doesn’t support gh-pages, or if you didn’t want to hassle with gh-pages.

It would be great if there was a simpler way to switch between savers. You might want to work most of the day with the convenience of the gh saver, but periodically make a local save, or a save to tiddlyhost. Currently you would have to delete some field out of your current saver, restore the fields in the alternate saver, save, then reverse those first two steps.

I do most of my TW development locally. I have the GitHub Saver configured, but I leave the “Username” field blank so that the default download saver is active.

As I work, I use the “save changes” button to save local “checkpoint” files (allowing the automatic “(n)” suffix to be added by the download saver). When I am satisfied with all my changes, I do one final local “save changes”, but remove the “(n)”, so that I overwrite the original locally-stored file.

Then, I enter my username in the GitHub Saver, and then press the “save changes” button again to upload to my github gh-pages repo. Then I reload the locally saved version before continuing, so that subsequent saves are local.

There is an open GH issue, where the preferred saver could be selected “on the fly”. …

It would need a bit more work to bundle it as a plugin. … But nobody did it yet. So help would be very welcome.


I think the main “hurdle” was caused by discussions about the overall code structure and some more tooling around code formatting and the like.

I think the contributor was burned out by all the formatting requirements. Couldn’t those be applied by someone else after the base code was accepted? Also, are all these formatting requirements even documented anywhere?

I tried building a plugin just to test it. Immediately got an error, so I guess there was still some work to be done. I’m using an up-to-date browser, so I don’t think it’s the new asynch code.

Thanks!

Edit: I think it wants some default configuration file which isn’t included in the 6 changed files.