diff --git a/api-gateway/src/main/resources/application-internal.yml b/api-gateway/src/main/resources/application-internal.yml new file mode 100644 index 0000000000..77a01a5b41 --- /dev/null +++ b/api-gateway/src/main/resources/application-internal.yml @@ -0,0 +1,18 @@ +spring: + security: + oauth2: + client: + provider: + codehub: + authorization-uri: https://codehub-g.huawei.com/oauth/authorize + token-uri: https://codehub-g.huawei.com/oauth/token + user-info-uri: https://codehub-g.huawei.com/api/v4/user + user-name-attribute: username + user-info-authentication-method: post + registration: + codehub: + provider: codehub + redirect-uri: '${gateway.frontend.url}/{action}/oauth2/code/{registrationId}' + authorization-grant-type: authorization_code + client-authentication-method: client_secret_post + scope: profile diff --git a/save-cloud-charts/save-cloud/README.md b/save-cloud-charts/save-cloud/README.md index 243e5dfd2b..0dc0a52bb4 100644 --- a/save-cloud-charts/save-cloud/README.md +++ b/save-cloud-charts/save-cloud/README.md @@ -47,6 +47,16 @@ command line using `--set` flag. ## Local deployment * Install minikube: https://minikube.sigs.k8s.io/docs/start/ +* install csi addon in minikube to provide this StorageClass type in your minikube cluster + ```bash + minikube addons enable csi-hostpath-driver + ``` +* [optional] modify kube config file to use base64 encripted info about certs and keys instead of using path to cert file + ```yaml + certificate-authority-data: + client-certificate-data: + client-key-data: + ``` * Environment should be prepared: ```bash minikube ssh @@ -60,13 +70,9 @@ command line using `--set` flag. build.docker.tls-verify=true build.docker.cert-path=/.minikube/certs ``` -* (Required only once) Install Helm chart using `values-minikube.yaml`: - ```bash - $ helm install save-cloud save-cloud-0.1.0.tgz --namespace save-cloud --values values-minikube.yaml - ``` * (On consecutive deployments) Upgrade an existing Helm release: ```bash - $ helm upgrade save-cloud save-cloud-0.1.0.tgz --namespace save-cloud --values values-minikube.yaml + $ helm --kube-context=minikube --namespace=save-cloud upgrade -i save-cloud save-cloud-0.1.0.tgz/ --values values-minikube.yaml --values=values-images.yaml ``` * Database migrations can be run by setting value `mysql.migrations.enabled` to `true` (no additional setup, migrations are executed by init container, but may be too slow with constant recreations of backend/sandbox pods) diff --git a/save-cloud-charts/save-cloud/values-images.yaml b/save-cloud-charts/save-cloud/values-images.yaml new file mode 100644 index 0000000000..e7c1283710 --- /dev/null +++ b/save-cloud-charts/save-cloud/values-images.yaml @@ -0,0 +1,25 @@ +chartVersion: '0.2.1+1056' + +# The version from the "Build and push Docker images" action. +# +# Search the log for the "Successfully built image +# 'ghcr.io/saveourtool/api-gateway:master'" line, or simply +# look up the version of the latest published package at +# . +dockerTag: '0.4.0-alpha.0.379-70423bd' +gateway: + dockerTag: '0.4.0-alpha.0.379-70423bd' +backend: + dockerTag: '0.4.0-alpha.0.379-70423bd' +frontend: + dockerTag: '0.4.0-alpha.0.379-70423bd' +preprocessor: + dockerTag: '0.4.0-alpha.0.379-70423bd' +orchestrator: + dockerTag: '0.4.0-alpha.0.379-70423bd' +sandbox: + dockerTag: '0.4.0-alpha.0.379-70423bd' +demo: + dockerTag: '0.4.0-alpha.0.379-70423bd' +demo_cpg: + dockerTag: '0.4.0-alpha.0.379-70423bd' diff --git a/save-frontend-common/src/main/kotlin/com/saveourtool/save/frontend/common/utils/LoginUtils.kt b/save-frontend-common/src/main/kotlin/com/saveourtool/save/frontend/common/utils/LoginUtils.kt index 85222e1701..058ed4c6bc 100644 --- a/save-frontend-common/src/main/kotlin/com/saveourtool/save/frontend/common/utils/LoginUtils.kt +++ b/save-frontend-common/src/main/kotlin/com/saveourtool/save/frontend/common/utils/LoginUtils.kt @@ -6,8 +6,6 @@ package com.saveourtool.save.frontend.common.utils -import com.saveourtool.save.frontend.common.externals.fontawesome.* -import com.saveourtool.save.frontend.common.externals.fontawesome.faCopyright import com.saveourtool.save.frontend.common.externals.fontawesome.faSignInAlt import com.saveourtool.save.frontend.common.externals.fontawesome.fontAwesomeIcon import com.saveourtool.save.info.OauthProviderInfo @@ -43,7 +41,7 @@ fun ChildrenBuilder.processRegistrationId( ) = oauthLoginForKnownAwesomeIcons( oauthProvidersFeConfig, mapKnownUploadedIcons(oauthProvidersFeConfig.provider.registrationId), - mapKnownFontAwesomeIcons(oauthProvidersFeConfig.provider.registrationId) + faSignInAlt ) /** @@ -88,15 +86,6 @@ private fun ChildrenBuilder.oauthLoginForKnownAwesomeIcons( } } -/** - * @param registrationId oauth provider name (same as in spring security config) from api-gateway - */ -fun mapKnownFontAwesomeIcons(registrationId: String) = - when (registrationId) { - "codehub" -> faCopyright - else -> faSignInAlt - } - /** * Mapping ONLY for those icons that are uploaded to SAVE. * Please note that companies like google strictly prohibits incorrect usage of sign-in buttons: @@ -110,5 +99,6 @@ fun mapKnownUploadedIcons(registrationId: String) = "gitee" -> "/img/gitee.svg" "github" -> "/img/github.svg" "google" -> "/img/google.svg" + "codehub" -> "/img/codehub.svg" else -> "" } diff --git a/save-frontend/src/main/resources/img/codehub.svg b/save-frontend/src/main/resources/img/codehub.svg new file mode 100644 index 0000000000..6153995a75 --- /dev/null +++ b/save-frontend/src/main/resources/img/codehub.svg @@ -0,0 +1,37 @@ + + logo + + + + + + + + + + + + + + + + + + + + + + + + Layer 1 + + + \ No newline at end of file