Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise QUICKSTART.md to address reviewer's comments #758

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 46 additions & 4 deletions docs/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,38 @@ This is a work in progress and subject to change.
The CLI requires a few dependencies and C extensions that can be installed with
`pip install securesystemslib[crypto,pynacl]`.

----
The following is a basic workflow in four steps:

**Step (1)** - Initialize an empty repo
**Step (1)** - Initialize a repo. The `tufrepo`, `tufkeystore`, and
`tufclient` directories are created in the current working directory.
```Bash
$ repo.py --init
```

**Step (2)** - Add a target file to the repo
**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.
```Bash
$ echo 'Test file' > testfile
$ repo.py --add testfile
$ 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
```

**Step (3)** - Serve the repo
Expand All @@ -28,12 +49,33 @@ or with Python 3...
$ python3 -m http.server 8001
```

**Step (4)** - Fetch a target file from the repo
**Step (4)** - Fetch a target file from the repo. The client downloads
any required metadata and the requested target file.
```Bash
$ cd "tufclient/"
$ client.py --repo http://localhost:8001 testfile
```
$ 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
```
----

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
Expand Down
5 changes: 3 additions & 2 deletions tuf/scripts/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,9 @@ def parse_arguments():
description='Create or modify a TUF repository.')

parser.add_argument('-i', '--init', action='store_true',
help='Create a repository. The repository is created in the current'
' working directory unless --path is specified.')
help='Create a repository. The "tufrepo", "tufkeystore", and'
' "tufclient" directories are created in the current working'
' directory, unless --path is specified.')

parser.add_argument('-p', '--path', nargs='?', default='.',
metavar='</path/to/repo_dir>', help='Specify a repository path. If used'
Expand Down