Closed 0x0645 closed 1 year ago
@0x0645 The root.json
file is created during the initial setup of your update repository (on your development machine). The original file is located in the repository's metadata
folder.
The root.json
file does the following things:
The root file is only modified when keys are added or removed (which should be rare), or when the file expires.
Note that the repo metadata
folder contains versioned root files, for example 1.root.json
. Every time the root file is modified, you get a new version, e.g. 2.root.json
. A copy of the latest version is always available as root.json
(without the version prefix).
Your app, i.e. the client-side, needs a copy of the root.json
file. This copy should be part of your app's initial distribution. So, when your users first install your app, e.g. after downloading it manually from your website, the app should already include a trusted copy of the root.json
file, and the app's tufup-client should know where to find that file.
How you include this copy of the root.json
is up to you. The tufup-example
uses the PyInstaller spec file to make sure the file is automatically included in the app bundle. The myapp
example then makes sure the file is copied to the required location at runtime. However, this is just one of many possible ways to do it.
One of the features of tufup
is that you have full, explicit, control over where all your files are stored on the client side. That's done via the arguments when you create aClient()
instance. In the example these paths are defined in a settings.py
file, but you could define them anywhere you want.
Thank you for the very useful information and I think it will be handy if your comment gets added to the tufup documentation. Another thing that I think should be added is that the APP_NAME in the client settings shouldn't have spaces because I was having a bug related to that.
Thank you for the very useful information and I think it will be handy if your comment gets added to the tufup documentation.
@0x0645 You're right, the documentation still needs a lot of work. I'll make sure this will be added.
Another thing that I think should be added is that the APP_NAME in the client settings shouldn't have spaces because I was having a bug related to that.
Could you describe how this bug arises? What was the error message and/or stack trace?
So I was trying to build something similar to the example and after building the app start with this error
So when does the
\update_cache\\metadata\\root.json'
get created and why it's missing here despite working with the example