Skip to content

Commit

Permalink
simplify force auth configuration for sonarqube - #986
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardcl committed Feb 21, 2022
1 parent 7a56452 commit b3c991d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 0 additions & 8 deletions sonarqube/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,6 @@ else
echo_info "Default '${ADMIN_USER_NAME}' password is not in use."
fi

echo_info "Setting sonar.forceAuthentication=true ..."
if ! curl ${INSECURE} -X POST -sSf --user "${ADMIN_USER_NAME}:${ADMIN_USER_PASSWORD}" \
"${SONARQUBE_URL}/api/settings/set?key=sonar.forceAuthentication&value=true"; then
echo_error "Could not enable sonar.forceAuthentication."
exit 1
fi
echo_info "sonar.forceAuthentication is enabled."

echo_info "Checking if '${PIPELINE_USER_NAME}' exists ..."
encodedPipelineUser="$(uriencode "${PIPELINE_USER_NAME}")"
encodedPipelinePassword="$(uriencode "${ADMIN_USER_PASSWORD}")"
Expand Down
3 changes: 3 additions & 0 deletions sonarqube/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if [ "${SONAR_AUTH_CROWD}" = "true" ]; then
} >> conf/sonar.properties
fi

# enforce authentication to sonar
echo "sonar.forceAuthentication=true" >> conf/sonar.properties

# Copy plugins into volume
rm "${SONARQUBE_HOME}"/extensions/plugins/*.jar || true
ls -lah /opt/configuration/sonarqube/plugins
Expand Down

0 comments on commit b3c991d

Please sign in to comment.