Skip to content

Commit

Permalink
Fix configuration directory and file permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
blag committed Jun 19, 2018
1 parent 40d278a commit 49cec89
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 40 deletions.
Empty file modified scripts/build_os_package.sh
100644 → 100755
Empty file.
16 changes: 6 additions & 10 deletions scripts/includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,9 @@ configure_st2_cli_config() {
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 sh -c st2 login --config ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
if [ "${CURRENT_USER}" == "${ROOT_USER}" ]; then
Expand All @@ -201,11 +199,9 @@ EOT"
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"
sudo sh -c st2 login --config ${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}
Expand Down
16 changes: 6 additions & 10 deletions scripts/st2bootstrap-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,9 @@ configure_st2_cli_config() {
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 sh -c st2 login --config ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
if [ "${CURRENT_USER}" == "${ROOT_USER}" ]; then
Expand All @@ -318,11 +316,9 @@ EOT"
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"
sudo sh -c st2 login --config ${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}
Expand Down
16 changes: 6 additions & 10 deletions scripts/st2bootstrap-el6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,9 @@ configure_st2_cli_config() {
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 sh -c st2 login --config ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
if [ "${CURRENT_USER}" == "${ROOT_USER}" ]; then
Expand All @@ -313,11 +311,9 @@ EOT"
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"
sudo sh -c st2 login --config ${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}
Expand Down
16 changes: 6 additions & 10 deletions scripts/st2bootstrap-el7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,9 @@ configure_st2_cli_config() {
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 sh -c st2 login --config ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
if [ "${CURRENT_USER}" == "${ROOT_USER}" ]; then
Expand All @@ -313,11 +311,9 @@ EOT"
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"
sudo sh -c st2 login --config ${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}
Expand Down

0 comments on commit 49cec89

Please sign in to comment.