From 288561cdb1feb3d5923369c1fef42b7efa77192e Mon Sep 17 00:00:00 2001 From: Martin Vrachev Date: Thu, 6 Jun 2024 19:10:23 +0300 Subject: [PATCH] Update guide docs Signed-off-by: Martin Vrachev --- docs/source/guide/index.rst | 55 ++++++++++++------------ repository_service_tuf/cli/admin/sign.py | 4 +- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/docs/source/guide/index.rst b/docs/source/guide/index.rst index 1146c86e3..629c18f3b 100644 --- a/docs/source/guide/index.rst +++ b/docs/source/guide/index.rst @@ -97,14 +97,15 @@ It executes administrative commands to the Repository Service for TUF. Administrative Commands - ╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ - │ --help -h Show this message and exit. │ - ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ - ╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ - │ ceremony Bootstrap Ceremony to create initial root metadata and RSTUF config. │ - │ import-artifacts Import artifacts to RSTUF from exported CSV file. │ - │ metadata Metadata management. │ - ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ + ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ + │ --api-server TEXT URL to an RSTUF API. │ + │ --help -h Show this message and exit. │ + ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ + ╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ + │ ceremony Bootstrap Ceremony to create initial root metadata and RSTUF config. │ + │ import-artifacts Import artifacts information from exported CSV file and send it to RSTUF API deployment. │ + │ metadata Metadata management. │ + ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ .. rstuf-cli-admin-ceremony @@ -129,10 +130,10 @@ You can do the Ceremony offline. This means on a disconnected computer Bootstrap Ceremony to create initial root metadata and RSTUF config. - ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ - │ --save -s FILENAME Write json result to FILENAME (default: 'ceremony-payload.json') │ - │ --help -h Show this message and exit. │ - ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ + ╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────╮ + │ --out FILENAME Write output json result to FILENAME (default: 'ceremony-payload.json') │ + │ --help -h Show this message and exit. │ + ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ There are four steps in the ceremony. @@ -176,22 +177,15 @@ sign (``sign``) ❯ rstuf admin metadata sign -h - Usage: rstuf admin metadata sign [OPTIONS] [SIGNING_JSON_INPUT_FILE] + Usage: rstuf admin metadata sign [OPTIONS] Add one signature to root metadata. - There are two ways to use this command: - 1) utilizing access to the RSTUF API and signing pending metadata roles - 2) provide a local file using the SIGNING_JSON_INPUT_FILE argument - When using method 2: - - 'SIGNING_JSON_INPUT_FILE' must be a file containing the JSON response from the 'GET /api/v1/metadata/sign' API endpoint. - - '--api-server' will be ignored. - - the result of the command will be saved into the 'sign-payload.json' file unless a different name is provided with '--save'. -╭─ Options ────────────────────────────────────────────────────────────────────────────────╮ -│ --api-server TEXT URL to an RSTUF API. │ -│ --save -s FILENAME Write json result to FILENAME (default: 'sign-payload.json') │ -│ --help -h Show this message and exit. │ -╰──────────────────────────────────────────────────────────────────────────────────────────╯ + ╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ + │ --in FILENAME Input file containing the JSON response from the 'GET /api/v1/metadata/sign' RSTUF API endpoint. │ + │ --out FILENAME Write output JSON result to FILENAME (default: 'sign-payload.json') │ + │ --help -h Show this message and exit. │ + ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ @@ -243,12 +237,17 @@ See the below CSV file example: ❯ rstuf admin import-artifacts -h - Usage: rstuf admin import-artifacts [OPTIONS] + Usage: rstuf admin import-artifacts [OPTIONS] + + Import artifacts information from exported CSV file and send it to RSTUF API deployment. + Note: there are two additional requirements for this command: + + 1) sqlalchemy needs to be installed in order to use this command: + pip install repository-service-tuf[sqlalchemy,psycopg2] - Import artifacts to RSTUF from exported CSV file. + 2) '--api-server' admin option or 'SERVER' in RSTUF config set ╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ -│ --api-server TEXT RSTUF API URL i.e.: http://127.0.0.1 . │ │ * --db-uri TEXT RSTUF DB URI. i.e.: postgresql://postgres:secret@127.0.0.1:5433 [required] │ │ * --csv TEXT CSV file to import. Multiple --csv parameters are allowed. See rstuf CLI guide for more details. [required] │ │ --skip-publish-artifacts Skip publishing artifacts in TUF Metadata. │ diff --git a/repository_service_tuf/cli/admin/sign.py b/repository_service_tuf/cli/admin/sign.py index f5cd943d6..6c590470d 100644 --- a/repository_service_tuf/cli/admin/sign.py +++ b/repository_service_tuf/cli/admin/sign.py @@ -70,7 +70,7 @@ def _get_pending_roles(settings: Any) -> Dict[str, Dict[str, Any]]: "--in", "input", help=( - "Input ile containing the JSON response from the " + "Input file containing the JSON response from the " "'GET /api/v1/metadata/sign' RSTUF API endpoint." ), type=click.File("r"), @@ -80,7 +80,7 @@ def _get_pending_roles(settings: Any) -> Dict[str, Dict[str, Any]]: "--out", is_flag=False, flag_value=DEFAULT_PATH, - help=f"Write output json result to FILENAME (default: '{DEFAULT_PATH}')", + help=f"Write output JSON result to FILENAME (default: '{DEFAULT_PATH}')", type=click.File("w"), required=False, )