### Initialize scrt Local Store Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Initialize a new scrt store with `scrt init`, specifying local storage, a password, and a local path for the encrypted store file. Note that the password used in this example is weak and should not be used in production. ```shell scrt init --storage=local \ --password=p4ssw0rd \ --local-path=store.scrt ``` -------------------------------- ### Install scrt using Go Get Source: https://github.com/loderunner/scrt/blob/main/docs/guide/installation.md This snippet demonstrates how to use the `go get` command to download and build the latest version of scrt directly from its GitHub repository, placing the binary in your GOPATH. ```shell go get github.com/loderunner/scrt ``` -------------------------------- ### Set and Retrieve scrt Secret Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Demonstrates the basic operations of setting a new secret with `scrt set` and then retrieving its value using `scrt get`. ```shell scrt set hello 'World!' scrt get hello # Output: World! ``` -------------------------------- ### List scrt Storage Options Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Shows the command to query `scrt` for information about its supported storage backends. ```shell scrt storage ``` -------------------------------- ### Example: Retrieve Value with scrt get Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/get.md This example demonstrates how to use the `scrt get` command to retrieve the value associated with the key `greeting`. It also shows the expected output, 'Hello World', indicating a successful retrieval from the store using implicit configuration. ```shell scrt get greeting # Output: Hello World ``` -------------------------------- ### Display scrt Help Information Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Provides the command to access the general help documentation for the `scrt` tool, listing available commands and options. ```shell scrt --help ``` -------------------------------- ### Add Additional scrt Secrets Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Illustrates how to add another secret to the store by using `scrt set` with a different key-value pair. ```shell scrt set barbes 'rochechouart' scrt get barbes # Output: rochechouart ``` -------------------------------- ### Build scrt from Source Code Source: https://github.com/loderunner/scrt/blob/main/docs/guide/installation.md This snippet outlines the steps to clone the scrt repository and build the executable using `go build`, which requires Go version 1.16 or higher installed on your system. ```shell git clone https://github.com/loderunner/scrt.git cd scrt go build . ``` -------------------------------- ### Install scrt from Binary Release Source: https://github.com/loderunner/scrt/blob/main/docs/guide/installation.md This snippet demonstrates how to decompress the scrt binary archive for Linux and copy the executable to a system-wide path, making it accessible from the command line. ```shell tar xzvf scrt_0.3.3_linux_x86_64.tar.gz sudo cp scrt_0.3.3_linux_x86_64/scrt /usr/local/bin/scrt ``` -------------------------------- ### Configure scrt Environment Variables Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Set environment variables for scrt configuration to avoid retyping them for each command. This includes defining the storage type, password, and local path for the secret store. ```shell export SCRT_STORAGE=local export SCRT_PASSWORD=p4ssw0rd export SCRT_LOCAL_PATH=store.scrt ``` -------------------------------- ### Example: Set 'greeting' to 'Hello World' Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/set.md Illustrates how to use the `scrt set` command to store 'Hello World' under the key 'greeting', utilizing implicit store configuration. ```shell scrt set greeting "Hello World" ``` -------------------------------- ### Install scrt on Debian/Ubuntu via apt Source: https://github.com/loderunner/scrt/blob/main/docs/guide/installation.md These snippets provide instructions for configuring the scrt apt repository and then installing the scrt package on Debian or Ubuntu systems. It includes adding the repository to sources and importing the GPG key. ```shell echo "deb [signed-by=/usr/share/keyrings/scrt-archive-keyring.gpg] https://apt.scrt.run /" \ | sudo tee /etc/apt/sources.list.d/scrt.list curl "https://apt.scrt.run/key.gpg" \ | gpg --dearmor \ | sudo tee /usr/share/keyrings/scrt-archive-keyring.gpg > /dev/null ``` ```shell sudo apt update sudo apt install scrt ``` -------------------------------- ### Install scrt on macOS via Homebrew Source: https://github.com/loderunner/scrt/blob/main/docs/guide/installation.md These snippets show how to add the scrt Homebrew tap and then install the scrt package using Homebrew on macOS, simplifying the installation process. ```shell brew tap loderunner/scrt ``` ```shell brew install scrt ``` -------------------------------- ### Update Existing scrt Secret Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Shows how to modify the value of an existing secret by calling `scrt set` with a key that is already present in the store. ```shell scrt set hello 'Brooklyn' scrt get hello # Output: Brooklyn ``` -------------------------------- ### Example scrt Configuration File Source: https://github.com/loderunner/scrt/blob/main/DOCKER.md This YAML snippet provides an example of a `.scrt.yml` configuration file, specifying the storage backend, location, and password for `scrt`. ```yaml storage: s3 location: s3://scrt-bucker/store.scrt password: p4ssw0rd ``` -------------------------------- ### Example: Initialize Local scrt Store with Password Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/init.md Demonstrates how to initialize a new scrt store in a local file named `store.scrt` within the current working directory, using a specified password. It utilizes the `--storage`, `--password`, and `--local-path` options. ```shell scrt init --storage=local --password=p4ssw0rd --local-path=./store.scrt ``` -------------------------------- ### Configure scrt with Command-line Arguments Source: https://github.com/loderunner/scrt/blob/main/DOCKER.md This example demonstrates how to initialize `scrt` within a Docker container by passing storage backend, location, and password parameters directly as command-line arguments to the `scrt` executable. ```sh docker run loderunner/scrt --storage=s3 \ --location=s3://scrt-bucket/store.scrt \ --password=p4ssw0rd \ init ``` -------------------------------- ### Install scrt on RHEL/CentOS/Rocky Linux via yum Source: https://github.com/loderunner/scrt/blob/main/docs/guide/installation.md These snippets detail how to configure the scrt yum repository by creating a .repo file and subsequently installing the scrt package on RHEL, CentOS, or Rocky Linux distributions. ```ini [scrt] name=scrt baseurl=https://yum.scrt.run repo_gpgcheck=1 gpgcheck=1 enabled=1 gpgkey=https://yum.scrt.run/key.gpg sslverify=1 metadata_expire=300 ``` ```shell sudo yum update sudo yum install scrt ``` -------------------------------- ### Initialize scrt with S3 Storage Backend Source: https://github.com/loderunner/scrt/blob/main/docs/reference/storage/s3.md This example demonstrates how to initialize a `scrt` store using S3 as the storage type, specifying the required bucket name and key. It also includes a placeholder for the password. ```shell scrt init --storage=s3 \ --password=p4ssw0rd \ --s3-bucket-name=scrt-bucket \ --s3-key=/store.scrt ``` -------------------------------- ### Delete scrt Secret Source: https://github.com/loderunner/scrt/blob/main/docs/guide/getting-started.md Explains how to remove a secret from the store using the `scrt unset` command. Attempting to retrieve a deleted secret will result in an error. ```shell scrt unset hello scrt get hello # Error: no value for key: "hello" ``` -------------------------------- ### Initialize scrt Store with Git Backend Source: https://github.com/loderunner/scrt/blob/main/docs/reference/storage/git.md An example command demonstrating how to initialize a new `scrt` store that uses a Git repository for storage. This command specifies the storage type as 'git', provides a password, the Git repository URL, and the relative path to the store file within the repository. ```shell scrt init --storage=git \ --password=p4ssw0rd \ --git-url=git@github.com:githubuser/secrets.git \ --git-path=store.scrt ``` -------------------------------- ### scrt get Command Line Interface Signature Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/get.md This snippet illustrates the general syntax for the `scrt get` command, showing that it accepts optional flags and requires a 'key' argument to specify which value to retrieve from the store. ```cli scrt get [flags] key ``` -------------------------------- ### YAML Configuration File Example for scrt Source: https://github.com/loderunner/scrt/blob/main/docs/guide/configuration.md This YAML snippet demonstrates how to define `scrt` configuration options in a file. It specifies the storage type as 'local', provides a password, and sets the path for the local store. This file can be named `.scrt`, `.scrt.yml`, or `.scrt.yaml` and placed in the project root. ```yaml storage: local password: p4ssw0rd local: path: store.scrt ``` -------------------------------- ### Example: Unset a Key Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/unset.md Demonstrates how to remove the value associated with a specific key, `greeting`, from the store using the `scrt unset` command. After execution, no value will be associated with the key. ```shell scrt unset greeting ``` -------------------------------- ### scrt init Command Syntax Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/init.md Displays the basic command-line syntax for initializing a new scrt store, showing the general structure with optional flags. ```shell scrt init [flags] ``` -------------------------------- ### scrt set Command Reference Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/set.md Detailed documentation for the `scrt set` command, including its syntax, arguments, and available options. This command associates a value with a key in the store, with an option to overwrite existing values. ```APIDOC scrt set [flags] key [value] Arguments: key: The key to associate the value with. value: The value to associate with the key. If omitted, the value is read from standard input. Options: --overwrite: When set, `scrt` will overwrite an existing value for `key` instead of returning an error. Has no effect if no value is associated with `key`. ``` -------------------------------- ### Display scrt Docker Image Help Source: https://github.com/loderunner/scrt/blob/main/DOCKER.md This command runs the `scrt` Docker image and passes the `--help` flag to display available options and commands for the `scrt` executable. ```sh docker run loderuner/scrt --help ``` -------------------------------- ### List `scrt` Storage Types Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/storage.md This command-line snippet uses the `scrt` utility to display all available storage types and their associated options. It's a foundational command for understanding the storage capabilities of the `scrt` system and is typically used as a first step before configuring storage. ```Shell scrt storage ``` -------------------------------- ### Basic Usage of scrt Command-Line Secret Manager Source: https://github.com/loderunner/scrt/blob/main/docs/README.md This snippet demonstrates the fundamental operations of the `scrt` command-line tool, including setting an environment variable for the password, adding a new secret, and retrieving an existing secret. It showcases the straightforward key-value interface for managing secrets. ```sh # Set store password in environment $ export SCRT_PASSWORD=******* # Add a secret to the store $ scrt set greeting 'Good news, everyone!' # Retrieve the secret from the store $ scrt get greeting Good news, everyone! ``` -------------------------------- ### scrt Local Storage Configuration Source: https://github.com/loderunner/scrt/blob/main/docs/reference/configuration/README.md Specifies parameters for configuring 'scrt' to use a local file system as its storage backend. This section details the necessary path configuration for storing data directly on the local computer. ```APIDOC Local Storage Configuration: path: Type: string YAML: local > path Environment variable: SCRT_LOCAL_PATH Description: The path to the store file on the local computer. ``` -------------------------------- ### scrt Git Storage Configuration Source: https://github.com/loderunner/scrt/blob/main/docs/reference/configuration/README.md Outlines the parameters required to configure 'scrt' for Git-based storage. This covers settings such as the repository URL, the path to the store file within the repository, the branch to use, a specific commit or tag to checkout, and the commit message for updates. ```APIDOC Git Storage Configuration: url: Type: string YAML: git > url Environment variable: SCRT_GIT_URL Description: The URL of the git repository. path: Type: string YAML: git > path Environment variable: SCRT_GIT_PATH Description: The path of the store file in the repository. branch: Type: string YAML: git > branch Environment variable: SCRT_GIT_BRANCH Description: The name of the branch to checkout, commit and push to on updates. Uses the default branch when missing. checkout: Type: string YAML: git > checkout Environment variable: SCRT_GIT_CHECKOUT Description: A tree-ish revision to checkout, e.g. commit or tag. message: Type: string Default: "update secrets" YAML: git > message Environment variable: SCRT_GIT_MESSAGE Description: The commit message used when updating the store. ``` -------------------------------- ### Initialize scrt with Local Filesystem Storage Source: https://github.com/loderunner/scrt/blob/main/docs/reference/storage/local.md This command initializes a new `scrt` store using the `local` storage type. It sets a password for the store and specifies the absolute path to the store file on the local filesystem. ```shell scrt init --storage=local --password=p4ssw0rd --local-path=/tmp/store.scrt ``` -------------------------------- ### Bash Environment Variable Configuration for scrt Source: https://github.com/loderunner/scrt/blob/main/docs/guide/configuration.md This Bash script shows how to set `scrt` configuration options using environment variables. These variables, prefixed with `SCRT_`, correspond to global options and are typically added to a shell's startup file like `.bashrc` to establish default settings for `scrt`. ```bash export SCRT_STORAGE=local export SCRT_PASSWORD=p4ssw0rd export SCRT_LOCAL_PATH=~/.scrt/store.scrt ``` -------------------------------- ### scrt Global Command-Line Options Reference Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/global.md This section details the global command-line options available for the `scrt` tool, including their purpose and usage. These options affect the overall behavior of the `scrt` application, such as specifying configuration files, storage types, or master passwords. ```APIDOC -c, --config string: description: Path to a YAML Configuration file --storage string: description: storage type, see Reference for details. -p, --password string: description: master password to unlock the store. The argument will be used to derive a key, to decrypt and encrypt the data in the store. ``` -------------------------------- ### scrt S3 Storage Configuration Options Source: https://github.com/loderunner/scrt/blob/main/docs/reference/storage/s3.md This section details the command-line options available for configuring S3 storage when interacting with `scrt`. It includes parameters for bucket name, object key, region, and custom endpoint URLs for compatible storage services. ```APIDOC --s3-bucket-name (required): the name of the bucket to save to store to --s3-key (required): the key to the store object --s3-region: set the region for the S3 bucket --s3-endpoint-url: when using an S3-compatible object storage other than AWS, scrt requires the URL of the S3 API endpoint. ``` -------------------------------- ### scrt Global Configuration Parameters Source: https://github.com/loderunner/scrt/blob/main/docs/reference/configuration/README.md Defines global configuration parameters applicable to all 'scrt' operations, including password management, storage backend selection, and verbosity settings. These parameters influence the overall behavior of the tool regardless of the chosen storage type. ```APIDOC Global Configuration: password: Type: string YAML: password Environment variable: SCRT_PASSWORD Description: The password to the store. The setting will be used to derive a key, to decrypt and encrypt the data in the store. storage: Type: string ("local" | "s3" | "git") YAML: N/A Environment variable: SCRT_STORAGE Description: The storage backend to use for the store. Storage type (storage) can be ignored in the YAML configuration file. scrt will read the configuration under the key for the storage type (e.g. local:). Defining configurations for multiple storage types in a single file will result in undefined behavior. verbose: Type: boolean Default: false YAML: verbose Environment variable: SCRT_VERBOSE Description: Controls the verbosity of scrt output. ``` -------------------------------- ### scrt Git Storage Configuration Options Source: https://github.com/loderunner/scrt/blob/main/docs/reference/storage/git.md Detailed documentation of the command-line options available for configuring `scrt` when using Git as a storage backend. These options control the Git repository URL, the specific file path within the repository, the branch to checkout, an optional specific revision for detached HEAD mode, and the commit message for changes. ```APIDOC GitStorageOptions: --git-url (required): a git-compatible repository URL. Most git-compatible URLs and protocols can be used. See git clone documentation to learn more. --git-path (required): the path to the store file inside the the git repository, relative to the repository root. A repository can contain multiple scrt stores, at different paths. --git-branch: the name of the branch to checkout after cloning (or initializing). If no branch is given, the default branch from the remote will be used, or main if a new repository is initialized. --git-checkout: a git revision to checkout. If this option is specified, the revision will be checked out in a "detached HEAD" and pushing will not work; making updates (init, set or unset) will be impossible. --git-message: the message of the git commit. A default message will be used if this is not set. ``` -------------------------------- ### scrt unset Command Syntax Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/unset.md Shows the general syntax for the `scrt unset` command, including required arguments and optional flags. ```shell scrt unset [flags] key ``` -------------------------------- ### Mount scrt Configuration File in Docker Source: https://github.com/loderunner/scrt/blob/main/DOCKER.md This command demonstrates how to mount a local `.scrt.yml` configuration file into the root of the `scrt` Docker container's filesystem, allowing `scrt` to use the specified settings. ```sh docker run -v .scrt.yml:/.scrt.yml loderunner/scrt init ``` -------------------------------- ### scrt S3 Storage Configuration Source: https://github.com/loderunner/scrt/blob/main/docs/reference/configuration/README.md Details the configuration options for using Amazon S3 as the storage backend for 'scrt'. This includes settings for the S3 bucket name, object key, endpoint URL, and the AWS region where the bucket is located. ```APIDOC S3 Storage Configuration: bucket-name: Type: string YAML: s3 > bucket-name Environment variable: SCRT_S3_BUCKET_NAME Description: The name of the bucket where the store object is located. key: Type: string YAML: s3 > key Environment variable: SCRT_S3_KEY Description: The path of the store object in the bucket. endpoint-url: Type: string Default: https://s3..amazonaws.com YAML: s3 > endpoint-url Environment variable: SCRT_S3_ENDPOINT_URL Description: Override the default S3 URL. region: Type: string YAML: s3 > region Environment variable: SCRT_S3_REGION Description: The region of the S3 storage. ``` -------------------------------- ### scrt Command-Line Interface Usage and Commands Source: https://github.com/loderunner/scrt/blob/main/docs/reference/commands/global.md This snippet displays the general usage, available commands, and global flags for the `scrt` command-line secret manager. It provides a comprehensive overview of how to interact with the tool, listing all primary operations and common flags. ```Shell A secret manager for the command-line Usage: scrt [command] Available Commands: init Initialize a new store set Associate a key to a value in a store get Retrieve the value associated to key from a store list List all the keys in a store unset Remove the value associated to key in a store storage List storage types and options help Help about any command completion Generate the autocompletion script for the specified shell Flags: -c, --config string configuration file -h, --help help for scrt -p, --password string master password to unlock the store --storage string storage type -v, --verbose verbose output --version version for scrt ``` -------------------------------- ### Configure scrt with Environment Variables Source: https://github.com/loderunner/scrt/blob/main/DOCKER.md This snippet shows how to configure `scrt` inside a Docker container using environment variables. The `SCRT_STORAGE`, `SCRT_LOCATION`, and `SCRT_PASSWORD` variables are set before running the `init` command. ```sh docker run --env SCRT_STORAGE=s3 \ --env SCRT_LOCATION=s3://scrt-bucket/store.scrt \ --env SCRT_PASSWORD=p4ssw0rd \ init ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.