2018-01-25 22:11:32 +00:00
|
|
|
# Quickstart #
|
|
|
|
|
|
2018-06-26 17:26:38 +00:00
|
|
|
The CLI requires a few dependencies and C extensions that can be installed with
|
|
|
|
|
`pip install securesystemslib[crypto,pynacl]`.
|
2018-06-25 15:53:59 +00:00
|
|
|
|
2018-06-26 21:21:07 +00:00
|
|
|
----
|
2018-01-29 22:10:49 +00:00
|
|
|
The following is a basic workflow in four steps:
|
2018-01-25 22:11:32 +00:00
|
|
|
|
2018-06-26 21:07:33 +00:00
|
|
|
**Step (1)** - Initialize a repo. The `tufrepo`, `tufkeystore`, and
|
|
|
|
|
`tufclient` directories are created in the current working directory.
|
2018-01-25 22:33:14 +00:00
|
|
|
```Bash
|
|
|
|
|
$ repo.py --init
|
|
|
|
|
```
|
|
|
|
|
|
2018-06-26 21:07:33 +00:00
|
|
|
**Step (2)** - Add a target file to the repo. The file size and hashes of
|
|
|
|
|
the target file are also written to the Targets metadata file.
|
2018-01-25 22:33:14 +00:00
|
|
|
```Bash
|
2018-04-06 21:24:15 +00:00
|
|
|
$ echo 'Test file' > testfile
|
|
|
|
|
$ repo.py --add testfile
|
2018-06-26 21:07:33 +00:00
|
|
|
$ tree tufrepo/
|
|
|
|
|
tufrepo/
|
|
|
|
|
├── metadata
|
|
|
|
|
│ ├── 1.root.json
|
|
|
|
|
│ ├── root.json
|
|
|
|
|
│ ├── snapshot.json
|
|
|
|
|
│ ├── targets.json
|
|
|
|
|
│ └── timestamp.json
|
|
|
|
|
├── metadata.staged
|
|
|
|
|
│ ├── 1.root.json
|
|
|
|
|
│ ├── root.json
|
|
|
|
|
│ ├── snapshot.json
|
|
|
|
|
│ ├── targets.json
|
|
|
|
|
│ └── timestamp.json
|
|
|
|
|
└── targets
|
|
|
|
|
└── testfile
|
|
|
|
|
|
|
|
|
|
3 directories, 11 files
|
2018-01-25 22:33:14 +00:00
|
|
|
```
|
|
|
|
|
|
2018-01-26 16:39:27 +00:00
|
|
|
**Step (3)** - Serve the repo
|
2018-01-25 22:33:14 +00:00
|
|
|
```Bash
|
2018-01-30 17:20:21 +00:00
|
|
|
$ cd "tufrepo/"
|
2018-01-25 22:33:14 +00:00
|
|
|
$ python -m SimpleHTTPServer 8001
|
2018-01-26 16:39:27 +00:00
|
|
|
|
|
|
|
|
or with Python 3...
|
|
|
|
|
$ python3 -m http.server 8001
|
2018-01-25 22:33:14 +00:00
|
|
|
```
|
|
|
|
|
|
2018-06-26 21:07:33 +00:00
|
|
|
**Step (4)** - Fetch a target file from the repo. The client downloads
|
|
|
|
|
any required metadata and the requested target file.
|
2018-01-25 22:33:14 +00:00
|
|
|
```Bash
|
2018-01-30 17:20:21 +00:00
|
|
|
$ cd "tufclient/"
|
2018-04-06 21:24:15 +00:00
|
|
|
$ client.py --repo http://localhost:8001 testfile
|
2018-06-26 21:07:33 +00:00
|
|
|
$ tree
|
|
|
|
|
.
|
|
|
|
|
├── tufrepo
|
|
|
|
|
│ └── metadata
|
|
|
|
|
│ ├── current
|
|
|
|
|
│ │ ├── 1.root.json
|
|
|
|
|
│ │ ├── root.json
|
|
|
|
|
│ │ ├── snapshot.json
|
|
|
|
|
│ │ ├── targets.json
|
|
|
|
|
│ │ └── timestamp.json
|
|
|
|
|
│ └── previous
|
|
|
|
|
│ ├── 1.root.json
|
|
|
|
|
│ ├── root.json
|
|
|
|
|
│ ├── snapshot.json
|
|
|
|
|
│ ├── targets.json
|
|
|
|
|
│ └── timestamp.json
|
|
|
|
|
└── tuftargets
|
|
|
|
|
└── testfile
|
|
|
|
|
|
|
|
|
|
5 directories, 11 files
|
2018-01-25 22:33:14 +00:00
|
|
|
```
|
2018-06-26 21:21:07 +00:00
|
|
|
----
|
2018-01-26 16:23:59 +00:00
|
|
|
|
2018-04-10 20:48:34 +00:00
|
|
|
See [CLI.md](CLI.md) and [CLI_EXAMPLES.md](CLI_EXAMPLES.md) to learn about the
|
|
|
|
|
other supported CLI options. A [tutorial](TUTORIAL.md) is also available, and
|
|
|
|
|
intended for users that want more control over the repo creation process.
|