Github Sync - tomboy-notes/tomboy-ng GitHub Wiki

Github Sync

Please note, current tomboy-ng is either unreliable or unuseable with openssl 3.0. This issue will be fixed in v0.40, there is a reasonably reliable beta here https://github.com/tomboy-notes/tomboy-ng/releases/tag/v0.39d

Applies to v0.34 and beyond.

Overview

You can use Github Sync in the same way as File Sync or Tomboy's Network Sync, sync to it with one to many instances of tomboy-ng on Linux, Windows or MacOS. Keeps all your notes available and, incidentally provides a useful backup.

In addition, syncing to Github allows you to access your notes through Github's pretty reasonable Markdown editor from almost any device with a browser. So, view and edit using your phone, tablet or a friend's computer.

Security and Privacy

Everyone has a different view of these issues. When you move your notes into a cloud service, any cloudservice, you need to consider your need for security and privacy. Github allows you to set a repository as private, denying assess to anyone you have not authorised. But how securely ? And does Github staff have access, maybe they are required by civil authorities to disclose your content ?

Github Sync in tomboy-ng allows an optional "selective sync" - only notes in a particular Notebook, SyncGithub are moved to Github. Clearly, this is no longer a general purpose sync service if you take that approach, its your choice. You can use both File Sync and Github Sync on the same notes repository, in this model, Github is just there to allow mobile access to those notes you select.

You also need to consider the risk to other content you may have on Github if your Access Token is compromised.

In use, tomboy-ng is given an Access Token you generate in Github. This token will allow access (read AND write) to all your Github repository. It is stored in tomboy-ng's config with only minimal attempt to obfuscate. If someone has unfettered access to your computer and medium IT skills, they can get to that token. If this is not acceptable to you, do not use this service (and perhaps tell me, maybe I add a password at tomboy-ng startup ?).

Requirements

Pretty simple, tomboy-ng 0.34 (or 0.33d for the risk takers) and a github account, network access. Github accounts are free. Github puts a limit of 5000 "accesses" per day, that could be a problem for people with very large note collections but, IMHO, the mobile access model might be a bit awkward with all of a large collection uploaded anyway. Paid Github accounts do not have that 5000 per day limit.

SetUp

  • Windows users may need to see the FAQ below about OpenSSL InOut errors, its just a case of adding some OpenSSL DLLs.

  • Firstly, decide now if you will use a "selective sync" or sync your full repository. You can change later (easy to remove and recreate the repo) but better to get it right the first time. If its selective, create a tomboy-ng notebook called SyncGithub (yes, cases sensitive, no space) and maybe add some notes to it. To create a notebook, from tomboy-ng's Search window, right click the notebook list, left hand side.

  • Next, if you don't already have a Github account (or want a separate one for this purpose) go to https://github.com and create that account.

  • Finally, back in tomboy-ng (0.33d or later), click the menu, Settings, Sync tab. Set the Sync Type to Github (this will not affect your File Sync if you have one). Now, you need two things, the github username, and a Github Token (see below, "Repo" scope only), enter them and click Setup. If you have a lot of notes, its likely be a bit slow from here on.

Access Token

Have you read the last paragraph of the Security and Privacy section ? Please read it again.

Github's preferred access model involves a security Token, its a 40 character "word" you generate on their website when logged in. For tomboy-ng's purposes, you should tick only the "Repo" box. This token could potentially allow someone with access to your computer to mess with your Github repositories.

Go to https://github.com/settings/tokens/new enter some arbitrary note in the field (maybe something like tomboy Oct21 ?) enable only the "Repo" scope, choose what you think is a reasonable expire time and hit the green "generate Token" button. Copy the text of the token into your clipboard and paste it into tomboy-ng's Token field and click the ChangeSyncRepo button. Github will send you email reminders when the token is about to expire.

If you are replacing an expired token, paste it in, click the Sync Enabled tick box, off and then again to turn it back on.

FAQ

Remove, replace, reset my Github Repo.

You may want to do this to stop using Github, you want to change your decision about Selective Sync or you need to remove note content retained in Github's history. Its quite easy and safe if done correctly, while other approaches may seem easier, please don't experiment with content that matters!

  • First, if you intend to make a new Repo, go to all your tomboy-ng clients and sync them, having them all on the same sync level makes reestablishing sync a lot easier.

  • Logon to Github's web page, browse to your tb_notes repository and click the "gear icon, Settings" near to top row. That takes you to settings for this repo, scroll down to the very bottom, last entry under Danger Zone is delete this repository, click the button, type (or copy and paste) the exact repository name, it MUST be your_user_name/tb_notes. Done, Github indicate that content is now permanently gone. Your notes are still safe on your computer.

  • If you want to now recreate the repo and, perhaps change your Selective policy, now is the time to add or remove your SyncGithub notebook.

  • Back in tomboy_ng, Settings, Sync Tab, Github, your user name and token (if current) should still be displayed, click Setup. You will be asked if you wish to create a new repo, you do. It does a test run, you click Save and Sync, it might be a bit slow.

  • When thats finished (and not before), go to each one of your other tomboy-ng instances in turn, same thing, click SetUp, no questions about creating a repo this time, but depending on your previous sync state, you may get some clashes. If you did run a full sync before this all started as recommended, you can safely tell tomboy-ng to use all the remote notes and let it run.

I want to stop using Github

OK, easy. In tomboy-ng, Settings, Sync Tab, Github. Click the Sync Enabled checkbox so it is not longer checked. You probably want to remove the Github repo, see above.

I want to use Selective Sync

If you are already using Github Sync but not Selective, your best approach (by far) is to remove the Github sync repo (see above), make a new notebook called SyncGithub (exactly like that) and add at least one note to and then (assuming your github userbame and Token is still current) click ChangeSyncRepo button. Then, bring your other instances of tomboy-ng back into the new sync with the Setup button. You need only add that Notebook in the tomboy-ng instance that you use to make the new repo, when you rejoin the others, they will download the new notebook.

Warning, trying to convert an existing Github repo to a Selective one does not work as you might expect, that's for a number of reasons, chief one being the Github keeps a copy of every old note it has every seen. Remove and re-create is safe and easy.

I don't want to use Selective Sync

OK, the answer (and background reasons) is almost the same as changing to Selective Sync (above) except that after you remove the existing Github repo and before you re-create it, you MUST remove the SyncGithub notebook from EVERY instance of tomboy-ng you use. You do not need to take notes out of the notebook before you remove the notebook, the notes will be safe.

Can I use File Sync and Github Sync ?

Sure can. Probably you want to keep all your tomboy-ng instances in sync with File Sync and then use Github Sync to make some or all notes available online. I suggest you have only one computer pushing notes to Github under that model. Having more than one computer using both File Sync and Github Sync at the same time might be risky and is not tested.

Can I recover a previous version of a github note ?

Easily ? No !

Willing to play a bit, maybe. Github keeps every revision of your notes it has seen. In their web interface, you can go back to a previous version of a note, download to your computer (no, not in tomboy-ng) as a markdown file. Then import that md file into tomboy-ng, see the command line help for the right command. I have not tested this ...

I get a message about OpenSSL InOut Error when trying to Sync

tomboy-ng uses openSSL to connect to github and transfer files. Windows users may not have openSSL installed system wide (or have an old version installed). You will need to download current OpenSSL libraries, I suggest you get them from the Indy people, https://indy.fulgan.com/SSL/ - they are tested and keep up to date. Extract the two DLL files and put them in the same directory as the tomboy-ng binary, in my case thats c:\Program Files\tomboy-ng

If you have your own favourite OpenSSL libraries, try then in the tomboy-ng binary directory if you prefer.

⚠️ **GitHub.com Fallback** ⚠️