necessary renaming and deployment prevention

This commit is contained in:
ryanfkeepers 2024-02-07 12:22:07 -07:00
parent 8081ae7349
commit ef6ca8583a
20 changed files with 134 additions and 98 deletions

View File

@ -59,7 +59,7 @@ runs:
CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-backup-${{inputs.kind }}.log
./corso backup create '${{ inputs.service }}' \
./canario backup create '${{ inputs.service }}' \
--no-stats --hide-progress --json \
${{ inputs.backup-args }} |
tee /dev/stderr | # for printing logs
@ -80,7 +80,7 @@ runs:
CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log
./corso restore '${{ inputs.service }}' \
./canario restore '${{ inputs.service }}' \
--no-stats \
--hide-progress \
--collisions ${{ inputs.on-collision }} \
@ -128,7 +128,7 @@ runs:
CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log
./corso export '${{ inputs.service }}' \
./canario export '${{ inputs.service }}' \
/tmp/export-${{ inputs.service }}${CATEGORY_SUFFIX}-${{inputs.kind }} \
--no-stats \
--hide-progress \
@ -170,7 +170,7 @@ runs:
CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log
./corso export '${{ inputs.service }}' \
./canario export '${{ inputs.service }}' \
/tmp/export-${{ inputs.service }}${CATEGORY_SUFFIX}-${{inputs.kind }}-archive \
--no-stats \
--hide-progress \
@ -213,7 +213,7 @@ runs:
CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-backup-${{ inputs.service }}${CATEGORY_SUFFIX}-list-${{inputs.kind }}.log
./corso backup list ${{ inputs.service }} \
./canario backup list ${{ inputs.service }} \
--no-stats \
--hide-progress \
2>&1 |
@ -237,7 +237,7 @@ runs:
CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-backup-list-${{ inputs.service }}${CATEGORY_SUFFIX}-single-${{inputs.kind }}.log
./corso backup list ${{ inputs.service }} \
./canario backup list ${{ inputs.service }} \
--no-stats \
--hide-progress \
--backup "${{ steps.backup.outputs.result }}" \

View File

@ -1,5 +1,14 @@
name: Publish Binary
###################################
# notice:
# This file has undergone major
# renaming for the canario fork.
# In case of re-incorporation back
# to corso, this refactoring will
# need to be undone.
###################################
inputs:
version:
description: Corso version to use for publishing
@ -40,36 +49,36 @@ runs:
workdir: src
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
RUDDERSTACK_CORSO_WRITE_KEY: ${{ inputs.rudderstack_write_key }}
RUDDERSTACK_CORSO_DATA_PLANE_URL: ${{ inputs.rudderstack_data_plane_url }}
CORSO_VERSION: ${{ inputs.version }}
RUDDERSTACK_CANARIO_WRITE_KEY: ${{ inputs.rudderstack_write_key }}
RUDDERSTACK_CANARIO_DATA_PLANE_URL: ${{ inputs.rudderstack_data_plane_url }}
CANARIO_VERSION: ${{ inputs.version }}
- name: Upload darwin arm64
uses: actions/upload-artifact@v3
with:
name: corso_Darwin_arm64
path: src/dist/corso_darwin_arm64/corso
name: canario_Darwin_arm64
path: src/dist/canario_darwin_arm64/canario
- name: Upload linux arm64
uses: actions/upload-artifact@v3
with:
name: corso_Linux_arm64
path: src/dist/corso_linux_arm64/corso
name: canario_Linux_arm64
path: src/dist/canario_linux_arm64/canario
- name: Upload darwin amd64
uses: actions/upload-artifact@v3
with:
name: corso_Darwin_amd64
path: src/dist/corso_darwin_amd64_v1/corso
name: canario_Darwin_amd64
path: src/dist/canario_darwin_amd64_v1/canario
- name: Upload linux amd64
uses: actions/upload-artifact@v3
with:
name: corso_Linux_amd64
path: src/dist/corso_linux_amd64_v1/corso
name: canario_Linux_amd64
path: src/dist/canario_linux_amd64_v1/canario
- name: Upload windows amd64
uses: actions/upload-artifact@v3
with:
name: corso_Windows_amd64
path: src/dist/corso_windows_amd64_v1/corso.exe
name: canario_Windows_amd64
path: src/dist/canario_windows_amd64_v1/canario.exe

View File

@ -29,6 +29,8 @@ jobs:
- uses: actions/checkout@v4
- name: Publish Binary
# canario should never publish
if: false
uses: ./.github/actions/publish-binary
with:
version: ${{ needs.SetEnv.outputs.version }}

View File

@ -1,6 +1,6 @@
name: Build/Release Corso
env:
IMAGE_NAME: ghcr.io/alcionai/corso
IMAGE_NAME: ghcr.io/alcionai/canario
on:
workflow_dispatch:
@ -30,7 +30,7 @@ jobs:
# --- Prechecks and Checkouts ------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------
Precheck:
uses: alcionai/corso/.github/workflows/_filechange_checker.yml@main
uses: alcionai/canario/.github/workflows/_filechange_checker.yml@main
Checkout:
needs: [Precheck]
@ -52,7 +52,7 @@ jobs:
# SetM365App will decide which M365 app to use for this CI run
SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main
uses: alcionai/canario/.github/workflows/accSelector.yaml@main
SetEnv:
environment: Testing
@ -571,6 +571,8 @@ jobs:
- uses: actions/checkout@v4
- name: Publish Binary
# canario should never publish
if: false
uses: ./.github/actions/publish-binary
with:
version: ${{ needs.SetEnv.outputs.version }}
@ -582,7 +584,9 @@ jobs:
needs: [Test-Suite-Trusted, Source-Code-Linting, Website-Linting, SetEnv]
environment: ${{ needs.SetEnv.outputs.environment }}
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
# canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
defaults:
run:
working-directory: build
@ -635,7 +639,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
# canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps:
@ -665,7 +671,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
# canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps:
@ -687,7 +695,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing
runs-on: macos-latest
if: startsWith(github.ref, 'refs/tags/')
# canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps:
@ -709,7 +719,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/')
# canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps:
@ -730,6 +742,8 @@ jobs:
- uses: actions/checkout@v4 # need to checkout to make the action available
- name: Publish website
# canario should never publish
if: false
uses: ./.github/actions/publish-website
with:
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}
@ -740,12 +754,16 @@ jobs:
needs: [SetEnv, Validate-Linux-Artifacts, Validate-MacOS-Artifacts, Validate-Docker-Artifacts, Validate-Windows-Artifacts]
environment: ${{ needs.SetEnv.outputs.environment }}
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
# canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4 # need to checkout to make the action available
- name: Publish website
# canario should never publish
if: false
uses: ./.github/actions/publish-website
with:
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}
@ -756,7 +774,9 @@ jobs:
needs: [Publish-Website-Prod, SetEnv]
environment: Testing
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
# canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps:

View File

@ -20,7 +20,7 @@ concurrency:
jobs:
SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main
uses: alcionai/canario/.github/workflows/accSelector.yaml@main
Longevity-Tests:
needs: [ SetM365App ]
@ -76,7 +76,8 @@ jobs:
git checkout ${{ steps.version.outputs.version }}
git checkout ${{ github.ref }} -- .github
- run: go build -o corso
- run:
timeout-minutes: 10
- run: mkdir ${CORSO_LOG_DIR}
@ -97,7 +98,7 @@ jobs:
- name: Version Test
timeout-minutes: 10
run: |
./corso --version | grep -c 'Corso version:'
./canario --version | grep -c 'Corso version:'
- name: Repo init test
id: repo-init
@ -105,7 +106,7 @@ jobs:
run: |
set -euo pipefail
echo -e "\nRepo init test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo init s3 \
./canario repo init s3 \
--no-stats \
--hide-progress \
--retention-mode $(echo "${{ env.RETENTION_MODE }}" | tr '[:upper:]' '[:lower:]') \
@ -127,7 +128,7 @@ jobs:
run: |
set -euo pipefail
echo -e "\nRepo connect test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo connect s3 \
./canario repo connect s3 \
--no-stats \
--hide-progress \
--prefix ${{ env.PREFIX }} \
@ -148,7 +149,7 @@ jobs:
timeout-minutes: 30
run: |
echo -e "\nBackup Exchange test\n" >> ${CORSO_LOG_FILE}
./corso backup create exchange \
./canario backup create exchange \
--no-stats \
--mailbox "${TEST_USER}" \
--hide-progress \
@ -174,7 +175,7 @@ jobs:
run: |
set -euo pipefail
echo -e "\nBackup OneDrive test\n" >> ${CORSO_LOG_FILE}
./corso backup create onedrive \
./canario backup create onedrive \
--no-stats \
--hide-progress \
--user "${TEST_USER}" \
@ -200,7 +201,7 @@ jobs:
set -euo pipefail
echo -e "\nBackup SharePoint test\n" >> ${CORSO_LOG_FILE}
./corso backup create sharepoint \
./canario backup create sharepoint \
--no-stats \
--hide-progress \
--site "${{ vars.CORSO_M365_TEST_SITE_URL }}" \
@ -265,9 +266,9 @@ jobs:
echo -e "\Export OneDrive test\n" >> ${CORSO_LOG_FILE}
echo -e "\Export OneDrive test - first entry\n" >> ${CORSO_LOG_FILE}
./corso backup list onedrive 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' |
./canario backup list onedrive 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' |
while read -r line; do
./corso export onedrive \
./canario export onedrive \
"/tmp/corso-export--$line" \
--no-stats \
--backup "$line" \
@ -275,9 +276,9 @@ jobs:
done
echo -e "\Export OneDrive test - last entry\n" >> ${CORSO_LOG_FILE}
./corso backup list onedrive 2>/dev/null | tail -n1 | awk '{print $1}' |
./canario backup list onedrive 2>/dev/null | tail -n1 | awk '{print $1}' |
while read -r line; do
./corso export onedrive \
./canario export onedrive \
"/tmp/corso-export--$line" \
--no-stats \
--backup "$line" \
@ -293,9 +294,9 @@ jobs:
echo -e "\Export SharePoint test\n" >> ${CORSO_LOG_FILE}
echo -e "\Export SharePoint test - first entry\n" >> ${CORSO_LOG_FILE}
./corso backup list sharepoint 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' |
./canario backup list sharepoint 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' |
while read -r line; do
./corso export sharepoint \
./canario export sharepoint \
"/tmp/corso-export--$line" \
--no-stats \
--backup "$line" \
@ -303,9 +304,9 @@ jobs:
done
echo -e "\Export SharePoint test - last entry\n" >> ${CORSO_LOG_FILE}
./corso backup list sharepoint 2>/dev/null | tail -n1 | awk '{print $1}' |
./canario backup list sharepoint 2>/dev/null | tail -n1 | awk '{print $1}' |
while read -r line; do
./corso export sharepoint \
./canario export sharepoint \
"/tmp/corso-export--$line" \
--no-stats \
--backup "$line" \
@ -324,7 +325,7 @@ jobs:
# Run with the force flag so it doesn't fail if the github runner
# hostname isn't what's expected. This is only safe because we can
# guarantee only one runner will be executing maintenance at a time.
./corso repo maintenance --mode metadata \
./canario repo maintenance --mode metadata \
--no-stats \
--hide-progress \
--force \
@ -339,7 +340,7 @@ jobs:
set -euo pipefail
echo -e "\n Maintenance test Weekly\n" >> ${CORSO_LOG_FILE}
./corso repo maintenance --mode complete \
./canario repo maintenance --mode complete \
--no-stats \
--hide-progress \
--force \

View File

@ -41,7 +41,7 @@ jobs:
# SetM365App will decide which M365 app to use for this CI run
SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main
uses: alcionai/canario/.github/workflows/accSelector.yaml@main
# ----------------------------------------------------------------------------------------------------
# --- Nightly Testing -------------------------------------------------------------------

View File

@ -20,7 +20,7 @@ concurrency:
jobs:
SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main
uses: alcionai/canario/.github/workflows/accSelector.yaml@main
Sanity-Tests:
needs: [ SetM365App ]
@ -56,7 +56,7 @@ jobs:
with:
go-version-file: src/go.mod
- run: go build -o corso
- run: go build -o canario
timeout-minutes: 10
- run: go build -o sanity-test ./cmd/sanity_test
@ -114,7 +114,7 @@ jobs:
- name: Version Test
timeout-minutes: 10
run: |
./corso --version | grep -c 'Corso version:'
./canario --version | grep -c 'Corso version:'
- name: Repo init test
timeout-minutes: 10
@ -123,7 +123,7 @@ jobs:
set -euo pipefail
prefix=$(date +"%Y-%m-%d-%T")
echo -e "\nRepo init test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo init s3 \
./canario repo init s3 \
--no-stats \
--hide-progress \
--prefix $prefix \
@ -143,7 +143,7 @@ jobs:
run: |
set -euo pipefail
echo -e "\nRepo connect test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo connect s3 \
./canario repo connect s3 \
--no-stats \
--hide-progress \
--prefix ${{ steps.repo-init.outputs.result }} \
@ -163,7 +163,7 @@ jobs:
run: |
set -euo pipefail
echo -e "\nRepo maintenance test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo maintenance \
./canario repo maintenance \
--no-stats \
--hide-progress \
--mode complete \

View File

@ -49,6 +49,8 @@ jobs:
Publish-Website:
needs: [Website-Linting]
# canario should never publish
if: false
environment: Production
runs-on: ubuntu-latest
defaults:
@ -59,6 +61,8 @@ jobs:
- uses: actions/checkout@v4 # need to checkout to make the action available
- name: Publish website
# canario should never publish
if: false
uses: ./.github/actions/publish-website
with:
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}

4
.gitignore vendored
View File

@ -19,8 +19,8 @@ testlog/
*.swp
# Standard configuration file names
.corso_test.toml
.corso.toml
.canario_test.toml
.canario.toml
# Logging
*.log

View File

@ -1,7 +1,7 @@
<p align="center">
<img src="https://github.com/alcionai/corso/blob/main/website/static/img/corso_logo.svg?raw=true" alt="Corso Logo" width="100" />
</p>
<h1 align="center">Corso</h1>
<h1 align="center">--CANARIO--</h1>
[![Go Report Card](https://goreportcard.com/badge/github.com/alcionai/corso/src)](https://goreportcard.com/report/github.com/alcionai/corso/src)
[![Discord](https://img.shields.io/badge/discuss-discord-blue)](https://discord.gg/63DTTSnuhT)

View File

@ -4,21 +4,21 @@ WORKDIR /go/src/app
COPY src .
ARG CORSO_BUILD_LDFLAGS=""
RUN go build -o corso -ldflags "$CORSO_BUILD_LDFLAGS"
RUN go build -o canario -ldflags "$CORSO_BUILD_LDFLAGS"
FROM alpine:3
LABEL org.opencontainers.image.title="Corso"
LABEL org.opencontainers.image.title="Canario"
LABEL org.opencontainers.image.description="Free, Secure, and Open-Source Backup for Microsoft 365"
LABEL org.opencontainers.image.url="https://github.com/alcionai/canario"
LABEL org.opencontainers.image.source="https://github.com/alcionai/canario"
LABEL org.opencontainers.image.vendor="Alcion, Inc."
COPY --from=builder /go/src/app/corso /corso
COPY --from=builder /go/src/app/canario /canario
RUN apk add --no-cache ca-certificates
ENV CORSO_HOME=/app/corso
ENV CORSO_HOME=/app/canario
ENV CORSO_CONFIG_DIR=$CORSO_HOME \
KOPIA_CONFIG_PATH=$CORSO_HOME/kopia/config/repository.config \
KOPIA_LOG_DIR=$CORSO_HOME/kopia/logs \
@ -26,4 +26,4 @@ ENV CORSO_CONFIG_DIR=$CORSO_HOME \
KOPIA_PERSIST_CREDENTIALS_ON_CONNECT=false \
KOPIA_CHECK_FOR_UPDATES=false
ENTRYPOINT ["/corso"]
ENTRYPOINT ["/canario"]

View File

@ -30,7 +30,7 @@ Darwin) GOOS="darwin" ;;
esac
PLATFORMS="$GOOS/$GOARCH" # default platform
TAG="alcionai/corso" # default image tag
TAG="alcionai/canario" # default image tag
MODE="binary"
case "$1" in
@ -68,13 +68,13 @@ if [ "$MODE" == "binary" ]; then
--env GOOS=${GOOS} --env GOARCH=${GOARCH} \
--workdir "/app/src" \
golang:${GOVER} \
go build -o corso -ldflags "${CORSO_BUILD_LDFLAGS}"
go build -o canario -ldflags "${CORSO_BUILD_LDFLAGS}"
OUTFILE="corso"
[ "$GOOS" == "windows" ] && OUTFILE="corso.exe"
OUTFILE="canario"
[ "$GOOS" == "windows" ] && OUTFILE="canario.exe"
mkdir -p "${ROOT}/bin/${GOOS}-${GOARCH}"
mv "${ROOT}/src/corso" "${ROOT}/bin/${GOOS}-${GOARCH}/${OUTFILE}"
mv "${ROOT}/src/canario" "${ROOT}/bin/${GOOS}-${GOARCH}/${OUTFILE}"
echo Corso $platform binary available in "${ROOT}/bin/${GOOS}-${GOARCH}/${OUTFILE}"
done
else

View File

@ -17,13 +17,13 @@ COPY ./src .
FROM base AS build
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /corso .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /canario .
## Deploy
FROM ubuntu:22.10
COPY --from=build /corso /
COPY --from=build /canario /
USER nobody
ENTRYPOINT ["/corso"]
ENTRYPOINT ["/canario"]

6
src/.gitignore vendored
View File

@ -1,5 +1,5 @@
dist/
corso
canario
# Test binary, built with `go test -c`
*.test
@ -14,8 +14,8 @@ testlog/
*.swp
# Standard configuration file names
.corso_test.toml
.corso.toml
.canario_test.toml
.canario.toml
# Logging
*.log

View File

@ -9,7 +9,7 @@ BAD_LINT_MSG := "Missing golangci-lint version $(WANTED_LINT_VERSION). Visit $(I
.PHONY: check-lint check-lint-version lint load-test
build:
go build -o corso
go build -o canario
lint: check-lint-version
golangci-lint run

View File

@ -28,9 +28,9 @@ import (
// ------------------------------------------------------------------------------------------
// The root-level command.
// `corso <command> [<subcommand>] [<service>] [<flag>...]`
var corsoCmd = &cobra.Command{
Use: "corso",
// `canario <command> [<subcommand>] [<service>] [<flag>...]`
var canarioCmd = &cobra.Command{
Use: "canario",
Short: "Free, Secure, Open-Source Backup for M365.",
Long: `Free, Secure, and Open-Source Backup for Microsoft 365.`,
RunE: handleCorsoCmd,
@ -54,7 +54,7 @@ func preRun(cc *cobra.Command, args []string) error {
}
avoidTheseCommands := []string{
"corso", "env", "help", "backup", "details", "list", "restore", "export", "delete", "repo", "init", "connect",
"canario", "env", "help", "backup", "details", "list", "restore", "export", "delete", "repo", "init", "connect",
}
if len(logger.ResolvedLogFile) > 0 && !slices.Contains(avoidTheseCommands, cc.Use) {
@ -62,7 +62,7 @@ func preRun(cc *cobra.Command, args []string) error {
}
// handle deprecated user flag in Backup exchange command
if cc.CommandPath() == "corso backup create exchange" {
if cc.CommandPath() == "canario backup create exchange" {
handleMailBoxFlag(ctx, cc, flagSl)
}
@ -83,8 +83,8 @@ func handleMailBoxFlag(ctx context.Context, c *cobra.Command, flagNames []string
}
}
// Handler for flat calls to `corso`.
// Produces the same output as `corso --help`.
// Handler for flat calls to `canario`.
// Produces the same output as `canario --help`.
func handleCorsoCmd(cmd *cobra.Command, args []string) error {
v, _ := cmd.Flags().GetBool("version")
if v {
@ -99,7 +99,7 @@ func handleCorsoCmd(cmd *cobra.Command, args []string) error {
// The command tree is built and attached to the returned command.
func CorsoCommand() *cobra.Command {
c := &cobra.Command{}
*c = *corsoCmd
*c = *canarioCmd
BuildCommandTree(c)
return c
@ -118,7 +118,7 @@ func BuildCommandTree(cmd *cobra.Command) {
observe.AddProgressBarFlags(cmd)
print.AddOutputFlag(cmd)
flags.AddGlobalOperationFlags(cmd)
cmd.SetUsageTemplate(indentExamplesTemplate(corsoCmd.UsageTemplate()))
cmd.SetUsageTemplate(indentExamplesTemplate(canarioCmd.UsageTemplate()))
cmd.CompletionOptions.DisableDefaultCmd = true
@ -139,10 +139,10 @@ func Handle() {
//nolint:forbidigo
ctx := config.Seed(context.Background())
ctx, log := logger.Seed(ctx, logger.PreloadLoggingFlags(os.Args[1:]))
ctx = print.SetRootCmd(ctx, corsoCmd)
ctx = print.SetRootCmd(ctx, canarioCmd)
ctx = observe.SeedObserver(ctx, print.StderrWriter(ctx), observe.PreloadFlags())
BuildCommandTree(corsoCmd)
BuildCommandTree(canarioCmd)
defer func() {
observe.Flush(ctx) // flush the progress bars
@ -150,7 +150,7 @@ func Handle() {
_ = log.Sync() // flush all logs in the buffer
}()
if err := corsoCmd.ExecuteContext(ctx); err != nil {
if err := canarioCmd.ExecuteContext(ctx); err != nil {
logger.CtxErr(ctx, err).Error("cli execution")
os.Exit(1)
}

View File

@ -22,7 +22,7 @@ import (
func StubRootCmd(args ...string) *cobra.Command {
id := uuid.NewString()
now := time.Now().UTC().Format(time.RFC3339Nano)
cmdArg := "testing-corso"
cmdArg := "testing-canario"
c := &cobra.Command{
Use: cmdArg,
Short: id,

View File

@ -14,7 +14,7 @@ It provides a convenient wrapper and great coverage of the API surface.
Before using the tool you want to build the container that packages it.
```sh
docker build -t corso/graph_pwsh:latest .
docker build -t canario/graph_pwsh:latest .
```
A prebuilt image is also available currently available as `gmatev/graph_pwsh`.
@ -40,13 +40,13 @@ This is suitable if you would like to issue a number of MS Graph API commands fr
interactive shell in the container.
```sh
docker run --rm -it -v $(pwd):/usr/pwsh -e AZURE_TENANT_ID -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET corso/graph_pwsh pwsh
docker run --rm -it -v $(pwd):/usr/pwsh -e AZURE_TENANT_ID -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET canario/graph_pwsh pwsh
```
Alternatively you can use an environment variable file `env_names` that has the names of the required environment variables
```sh
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh pwsh
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh pwsh
```
Before you run any command you want to authenticate with Graph using a convenient script
@ -64,7 +64,7 @@ Suitable when you want to run just a single command. Essentially running the `Au
before the actual command you want to run.
```sh
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "<your Graph command>"
```
@ -72,7 +72,7 @@ Here is a complete example to get all users
```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/users
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Get-MgUser -All"
```
@ -80,7 +80,7 @@ Another example to retrieve an email message for a given user by ID.
```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/<userID>/messages/<messageId>
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Get-MgUserMessage -UserId <userID or UPN> -MessageID <messageID>"
```
@ -95,7 +95,7 @@ and execute the container which will pull it and then execute it. This can be do
`Execute-Script.ps1` command as follows.
```sh
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Execute-Script.ps1 -ScriptUrl <script download URL>"
```
@ -106,7 +106,7 @@ similar to the example below.
```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/users
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Get-MgUser -All -Debug"
```
@ -119,7 +119,7 @@ Alternatively you can do the following:
```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/users
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Select-MgProfile -Name "beta" && Get-MgUser -All"
```

View File

@ -31,7 +31,7 @@ import (
)
const (
corsoWrapperAlertNamespace = "corso-kopia-wrapper"
corsoWrapperAlertNamespace = "canario-kopia-wrapper"
defaultKopiaConfigDir = "/tmp/"
kopiaConfigFileTemplate = "repository-%s.config"

View File

@ -9,7 +9,7 @@ if you have Go installed on your system.
```bash
# run from within `./src`
go build -o corso
go build -o canario
```
:::info