Skip to content

Commit 757d449

Browse files
authored
Merge pull request #14 from stackhpc/enable-admin
Allow users to enable the admin ui
2 parents 2f83dc7 + 3ab013a commit 757d449

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

helm/templates/ragflow.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,19 @@ spec:
4040
{{- with .Values.ragflow.image.pullPolicy }}
4141
imagePullPolicy: {{ . }}
4242
{{- end }}
43+
{{- if .Values.ragflow.enableDangerousAdminServer }}
44+
args:
45+
- --enable-adminserver
46+
{{- end }}
4347
ports:
4448
- containerPort: 80
4549
name: http
4650
- containerPort: 9380
4751
name: http-api
52+
{{- if .Values.ragflow.enableDangerousAdminServer }}
53+
- containerPort: 9381
54+
name: http-admin
55+
{{- end }}
4856
volumeMounts:
4957
- mountPath: /etc/nginx/conf.d/ragflow.conf
5058
subPath: ragflow.conf
@@ -117,3 +125,23 @@ spec:
117125
name: http-api
118126
type: {{ .Values.ragflow.api.service.type }}
119127
{{- end }}
128+
---
129+
{{- if .Values.ragflow.enableDangerousAdminServer }}
130+
apiVersion: v1
131+
kind: Service
132+
metadata:
133+
name: {{ .Release.Name }}-admin
134+
labels:
135+
{{- include "ragflow.labels" . | nindent 4 }}
136+
app.kubernetes.io/component: ragflow
137+
spec:
138+
selector:
139+
{{- include "ragflow.selectorLabels" . | nindent 4 }}
140+
app.kubernetes.io/component: ragflow
141+
ports:
142+
- protocol: TCP
143+
port: 80
144+
targetPort: http-admin
145+
name: http-admin
146+
type: ClusterIP
147+
{{- end }}

helm/templates/ragflow_config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ data:
3030
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
3131
gzip_vary on;
3232
gzip_disable "MSIE [1-6]\.";
33-
33+
{{- if .Values.ragflow.enableDangerousAdminServer }}
34+
# Admin API route to access /api/v1/admin backend API
35+
location ~ ^/api/v1/admin {
36+
proxy_pass http://localhost:9381;
37+
include proxy.conf;
38+
}
39+
{{- end }}
3440
location ~ ^/(v1|api) {
3541
proxy_pass http://localhost:9380;
3642
include proxy.conf;

helm/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ ragflow:
9292
service:
9393
enabled: true
9494
type: ClusterIP
95+
# Be careful in enabling the admin server, as it gives access to sensitive
96+
# administrative privileges and has default credentials to access the admin API.
97+
enableDangerousAdminServer: false
9598

9699
infinity:
97100
image:

0 commit comments

Comments
 (0)