-
Notifications
You must be signed in to change notification settings - Fork 179
Adding a minio startup script #652
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # SPDX-FileCopyrightText: 2021 iteratec GmbH | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Convenience script to start a local minio instance, where your scanner results and findings are stored by default. | ||
| # Port can be set via -p option. | ||
| # The instance runs on your localhost at your defined port (default: 9000). | ||
| # | ||
| # The script (i.e. the port forwarding) must run while you want to access the minio instance. | ||
| # However, it does not need to run while scans are executed in order to store the results. | ||
| # | ||
| # Will also print your access key and secret key. | ||
| # | ||
| # For more information see | ||
| # https://docs.securecodebox.io/docs/getting-started/installation/#accessing-the-included-minio-instance | ||
|
|
||
| set -euo pipefail | ||
| shopt -s extglob | ||
|
|
||
| COLOR_EMPHASIS="\e[32m" | ||
| COLOR_RESET="\e[0m" | ||
| HOST_PORT=9000 # Default port | ||
|
|
||
| function print() { | ||
| if [[ $# == 0 ]]; then | ||
| echo | ||
| elif [[ $# == 1 ]]; then | ||
| local message="${1}" | ||
| echo "${message}" | ||
| elif [[ $# == 2 ]]; then | ||
| local color="${1}" | ||
| local message="${2}" | ||
| echo -e "${color}${message}${COLOR_RESET}" | ||
| fi | ||
| } | ||
|
|
||
| if [[ "$#" -eq 2 ]]; then | ||
| if [[ $1 = "-p" || $1 = "--port" ]]; then | ||
| HOST_PORT=$2 | ||
| print "Using host port $HOST_PORT" | ||
| fi | ||
| else | ||
| print "No port with option -p set. Using default host port 9000" | ||
| fi | ||
|
|
||
| print "$COLOR_EMPHASIS" "Starting minio instance on localhost:9000..\n" | ||
|
|
||
| print "Your access key: " | ||
| ACCESS_KEY=$(kubectl get secret securecodebox-operator-minio -n securecodebox-system -o=jsonpath='{.data.accesskey}' \ | ||
| | base64 --decode;) | ||
| print "$COLOR_EMPHASIS" "$ACCESS_KEY" | ||
|
|
||
| print "Your secret key: " | ||
| SECRET_KEY=$(kubectl get secret securecodebox-operator-minio -n securecodebox-system -o=jsonpath='{.data.secretkey}' \ | ||
| | base64 --decode;) | ||
| print "$COLOR_EMPHASIS" "$SECRET_KEY" | ||
|
|
||
| kubectl port-forward -n securecodebox-system service/securecodebox-operator-minio "$HOST_PORT":9000 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.