-
-
Notifications
You must be signed in to change notification settings - Fork 62
Fix configuration directory and file permissions #563
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
de8a668
2c2cad3
4c6aff4
6413687
38fdd4e
6c58eb4
ef10ecc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -298,34 +298,22 @@ configure_st2_cli_config() { | |
| CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2" | ||
| CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config" | ||
|
|
||
| if ! sudo test -d ${ROOT_USER_CLI_CONFIG_DIRECTORY}; then | ||
| sudo mkdir -p ${ROOT_USER_CLI_CONFIG_DIRECTORY} | ||
| fi | ||
|
|
||
| sudo sh -c "cat <<EOT > ${ROOT_USER_CLI_CONFIG_PATH} | ||
| [credentials] | ||
| username = ${USERNAME} | ||
| password = ${PASSWORD} | ||
| EOT" | ||
| sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \ | ||
| --write-password \ | ||
| --username ${USERNAME} --password ${PASSWORD} | ||
|
|
||
| # Write config for root user | ||
| if [ "${CURRENT_USER}" == "${ROOT_USER}" ]; then | ||
| return | ||
| fi | ||
|
|
||
| # Write config for current user (in case current user != root) | ||
| if [ ! -d ${CURRENT_USER_CLI_CONFIG_DIRECTORY} ]; then | ||
| sudo mkdir -p ${CURRENT_USER_CLI_CONFIG_DIRECTORY} | ||
| fi | ||
|
|
||
| sudo sh -c "cat <<EOT > ${CURRENT_USER_CLI_CONFIG_PATH} | ||
| [credentials] | ||
| username = ${USERNAME} | ||
| password = ${PASSWORD} | ||
| EOT" | ||
| st2 login --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \ | ||
| --write-password \ | ||
| --username ${USERNAME} --password ${PASSWORD} | ||
|
|
||
| # Fix the permissions | ||
| sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} | ||
| chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need to Keep in mind that Backwards compatibility you mentioned should be guaranteed by |
||
| } | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.