Client
Use the snarf client to manage data and users on the server.
It supports three commands:
users: Manage users and permissions.cache: Manage the data in the cache.upstream-caches: Configure upstream caches.
users: Manage Users
init: Initialize a Server
When the server is first starting up, it is in an uninitialized state. To
initialize it and to create the admin client token, use the snarf user init
command. It queries the (uninitialized) server and prints out a client token.
Save that client token, since you can generate it only once. All other commands require the client token to work.
add: Create a Token
Once the server is initialized, use users add to create additional tokens with specific
permissions. Pass one or more permission names as arguments:
Admin— can manage users, tokens, and upstream cachesUpload— can upload store paths to the cache
Example (create an upload-only token):
Example (create a token with both permissions):
The new token is printed to stdout. You need an Admin token to create new tokens.
cache: Manage Data in the Cache
add: Upload a Closure to the Cache
When you want to add a closure, that is a store path and all its references and their references, to the cache, use the add command.
Snarf will first check whether any data is available in the configured upstream caches and skip them.
Example:
upstream-caches: Manage Upstream Caches
Snarf will skip all NAR archives that are already available in upstream caches.
add: Add an Upstream Cache
Add an upstream cache by adding its URL:
Example:
list: List Upstream Caches
Get a list of all configured upstream caches. This list is saved on the server and is used for all clients interacting with the server.
Example:
remove: Remove an Upstream Cache
Remove an upstream cache by its URL:
Example: