Skip to content

The Unified and Autonomous Development Platform

chore: initial settings cleanup

Robin Shen17cfef9a9db2
diff --git a/server-product/helm/templates/NOTES.txt b/server-product/helm/templates/NOTES.txt
index ab7e08b7c4..10213666da 100644
--- a/server-product/helm/templates/NOTES.txt
+++ b/server-product/helm/templates/NOTES.txt
@@ -16,7 +16,7 @@ APP VERSION: {{ .Chart.AppVersion }}
{{- if .Values.ingress.enabled }}
-1. You can access OneDev at:
+You can access OneDev at:
{{- if .Values.ingress.tls.enabled }}
https://{{ .Values.ingress.host }}
@@ -26,8 +26,7 @@ APP VERSION: {{ .Chart.AppVersion }}
{{- else }}
-1. Get the OneDev URL by running:
-
+Get the OneDev URL by running:
{{- if contains "ClusterIP" .Values.service.type }}
@@ -50,8 +49,3 @@ APP VERSION: {{ .Chart.AppVersion }}
{{- end }}
{{- end }}
-
-2. Login with the following credentials:
-
- Username: {{ .Values.onedev.initSettings.user }}
- echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "ods.fullname" . }}-secrets -o jsonpath="{.data.password}" | base64 -d)
\ No newline at end of file
diff --git a/server-product/helm/templates/_pod.tpl b/server-product/helm/templates/_pod.tpl
index 785de54c1e..343b11b0e5 100644
--- a/server-product/helm/templates/_pod.tpl
+++ b/server-product/helm/templates/_pod.tpl
@@ -34,17 +34,29 @@ containers:
env:
- name: k8s_service
value: {{ include "ods.fullname" . }}
+{{- if .Values.onedev.initSettings.user }}
+ - name: initial_user
+ value: {{ .Values.onedev.initSettings.user }}
+{{- end }}
+{{- if .Values.onedev.initSettings.password }}
- name: initial_password
valueFrom:
secretKeyRef:
name: {{ include "ods.fullname" . }}-secrets
key: password
- - name: initial_user
- value: {{ .Values.onedev.initSettings.user }}
+{{- end }}
+{{- if .Values.onedev.initSettings.email }}
- name: initial_email
value: {{ .Values.onedev.initSettings.email }}
+{{- end }}
+{{- if .Values.onedev.initSettings.serverUrl }}
- name: initial_server_url
value: {{ .Values.onedev.initSettings.serverUrl }}
+{{- end }}
+{{- if .Values.onedev.initSettings.sshRootUrl }}
+ - name: initial_ssh_root_url
+ value: {{ .Values.onedev.initSettings.sshRootUrl }}
+{{- end }}
{{- if .Values.ingress.enabled }}
- name: ingress_host
value: {{ .Values.ingress.host }}
diff --git a/server-product/helm/templates/secrets.yaml b/server-product/helm/templates/secrets.yaml
index c4ce325fd8..96ed5aa003 100644
--- a/server-product/helm/templates/secrets.yaml
+++ b/server-product/helm/templates/secrets.yaml
@@ -1,6 +1,3 @@
-{{- if .Values.onedev.initSettings.enabled -}}
-{{- $randomValue := randAlphaNum 16 -}}
-
apiVersion: v1
kind: Secret
metadata:
@@ -9,8 +6,5 @@ metadata:
labels: {{ include "ods.labels" . | nindent 4 }}
type: Opaque
data:
- password: {{ default $randomValue .Values.onedev.initSettings.password | b64enc }}
- user: {{ .Values.onedev.initSettings.user | b64enc }}
- dbPassword: {{ .Values.database.dbPassword | b64enc }}
-
-{{- end }}
\ No newline at end of file
+ password: {{ .Values.onedev.initSettings.password | b64enc }}
+ dbPassword: {{ .Values.database.dbPassword | b64enc }}
\ No newline at end of file
diff --git a/server-product/helm/values.yaml b/server-product/helm/values.yaml
index 4a13ff0609..852c054755 100644
--- a/server-product/helm/values.yaml
+++ b/server-product/helm/values.yaml
@@ -23,16 +23,15 @@ onedev:
# Specify OneDev Server initial settings to avoid manual setup
initSettings:
- # onedev.initSettings.enabled -- Enables initial settings for deployment
- enabled: true
- # onedev.initSettings.user -- Admin username
- user: "admin"
- # onedev.initSettings.password -- admin Password, if not specified a random password will be generated automatically
- password: "password"
- # onedev.initSettings.email -- admin Email address
- # onedev.initSettings.serverUrl -- Server url will be ignored if ingress.host is specified
- serverUrl: ""
+ # onedev.initSettings.user -- Administrator username. Leave empty to prompt
+ user: ""
+ # onedev.initSettings.password -- Administrator Password. Leave empty to prompt
+ password: ""
+ # onedev.initSettings.email -- Administrator Email address. Leave empty to prompt
+ email: ""
+ # onedev.initSettings.serverUrl -- Server url. Leave empty to prompt. Will be ignored if ingress.host is specified
+ serverUrl: "http://localhost:6610"
+ # onedev.initSettings.sshRootUrl -- Root url to clone repository via SSH. Leave empty to derive from server url
sshRootUrl: ""
# External database configuration