Simplify docs on how to run Corso (#1239)

## Description

Simplify docs on how to run Corso

- Add Docker and Windows binary instructions
- Add synced tabs
- Tweak tabs content to allow for copy-paste

## Type of change

- [x] 🗺️ Documentation
This commit is contained in:
Niraj Tolia 2022-10-19 19:01:37 -07:00 committed by GitHub
parent 6055d8c16a
commit b4e3ea0e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 64 additions and 45 deletions

View File

@ -7,7 +7,9 @@
"TOCInline", "TOCInline",
"br", "br",
"img", "img",
"div" "div",
"Tabs",
"TabItem"
] ]
}, },
} }

View File

@ -1,29 +1,15 @@
# Running Corso # Running Corso
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Corso is available as a [Docker](https://docs.docker.com/engine/install/) image (Linux `x86_64` and `arm64`) and Corso is available as a [Docker](https://docs.docker.com/engine/install/) image (Linux `x86_64` and `arm64`) and
as an `x86_64` and `arm64` executable for Windows, Linux and OS X. as an `x86_64` and `arm64` executable for Windows, Linux and macOS.
:::note Two things are needed to run Corso:
We highly recommend the use of Corso's Docker container when getting started. For Windows, you can run the `amd64`
container in [Linux Mode](https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-10-linux).
While our documentation focuses on the Docker command-line, converting the examples to work with native executables
should be straightforward.
:::
As shown in the following example command and described further below, two things are needed to run Corso commands in
its Docker container:
* Environment variables containing configuration information * Environment variables containing configuration information
* A local directory (a `volume` in Docker terminology) for Corso to store configuration and logs * A directory for Corso to store its configuration file
```bash
$ docker run --env-file ~/.corso/corso.env \
--volume ~/.corso/corso:/app/corso \
corso/corso <command> <command options>
```
## Environment Variables ## Environment Variables
@ -31,37 +17,66 @@ Three distinct pieces of configuration are required by Corso:
* S3 object storage configuration to store backups. See [AWS Credentials Setup](/configuration/repos##s3-creds-setup) for * S3 object storage configuration to store backups. See [AWS Credentials Setup](/configuration/repos##s3-creds-setup) for
alternate ways to pass AWS credentials. alternate ways to pass AWS credentials.
* `AWS_ACCESS_KEY_ID`: * `AWS_ACCESS_KEY_ID`: Access key for an IAM user or role for accessing an S3 bucket
* `AWS_SECRET_ACCESS_KEY`: * `AWS_SECRET_ACCESS_KEY`: Secret key associated with the access key
* (Optional) `AWS_SESSION_TOKEN`: * (Optional) `AWS_SESSION_TOKEN`: Session token required when using temporary credentials
* Microsoft 365 Configuration * Microsoft 365 Configuration
* `AZURE_TENANT_ID`: * `AZURE_CLIENT_ID`: Client ID for your Azure AD application used to access your M365 tenant
* `AZURE_CLIENT_ID`: * `AZURE_CLIENT_SECRET`: Azure secret for your Azure AD application used to access your M365 tenant
* `AZURE_CLIENT_SECRET`: * `AZURE_TENANT_ID`: ID for the M365 tenant where the Azure AD application is registered
* Corso Security Passphrase * Corso Security Passphrase
* `CORSO_PASSPHRASE`: * `CORSO_PASSPHRASE`: Passphrase to protect encrypted repository contents
<Tabs groupId="os">
<TabItem value="win" label="Powershell">
Ensure that all of the above environment variables are available in your Powershell environment.
</TabItem>
<TabItem value="docker" label="Docker">
For ease of use with Docker, we recommend adding the names of the required environment variables (but not their For ease of use with Docker, we recommend adding the names of the required environment variables (but not their
values!) to a [Docker environment variables file](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file). values!) to a [Docker environment variables file](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file).
To create the environment variables file, you can run the following command: To create the environment variables file, you can run the following command:
```bash
# Create an environment variables file
cat <<EOF ~/.corso/corso.env
CORSO_PASSPHRASE
AZURE_TENANT_ID
AZURE_CLIENT_ID
AZURE_CLIENT_SECRET
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
EOF
```
</TabItem>
</Tabs>
## Configuration File
<Tabs groupId="os">
<TabItem value="win" label="Powershell">
By default, Corso store its configuration file (`.corso.toml`) in the directory where the binary is executed.
The location of the configuration file can be specified using the `--config-file` option.
</TabItem>
<TabItem value="docker" label="Docker">
To preserve configuration across container runs, Corso requires access to a directory outside of its Docker container
to read or create its configuration file (`.corso.toml`). This directory must be mapped, by Docker, to the `/app/corso`
directory within the container.
```bash ```bash
# create an env vars file $ docker run --env-file ~/.corso/corso.env \
$ cat <<EOF ~/.corso/corso.env --volume ~/.corso/corso:/app/corso \
CORSO_PASSPHRASE corso/corso <command> <command options>
AZURE_TENANT_ID
AZURE_CLIENT_ID
AZURE_CLIENT_SECRET
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
EOF
``` ```
## Local directory </TabItem>
</Tabs>
To preserve configuration across container runs and for logs, if enabled, Corso requires access to a directory outside
of its Docker container to read or create its configuration file (`corso.toml`). This directory is mapped by Docker to
the `/app/corso` directory within the container.

View File

@ -154,6 +154,7 @@ const config = {
prism: { prism: {
theme: lightCodeTheme, theme: lightCodeTheme,
darkTheme: darkCodeTheme, darkTheme: darkCodeTheme,
additionalLanguages: ['powershell'],
}, },
}), }),
}; };

View File

@ -6,4 +6,5 @@ datetime
(?i)OneDrive (?i)OneDrive
[Rr]epo [Rr]epo
env env
src src
Powershell