Skip to content

Commit

Permalink
feat(Files&Vault&Wise&Files server): update LarePass new version to v…
Browse files Browse the repository at this point in the history
…1.3.14 (#861)

feat: files server send message to frontend with nats when directory changed

Co-authored-by: lovehunter9 <[email protected]>
  • Loading branch information
wushuangs and lovehunter9 authored Jan 13, 2025
1 parent 33e45f8 commit 5b35eb2
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 8 deletions.
69 changes: 67 additions & 2 deletions apps/files/config/cluster/deploy/files_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
{{ $files_redis_password = randAlphaNum 16 | b64enc }}
{{- end -}}

{{- $files_nats_secret := (lookup "v1" "Secret" "os-system" "files-nats-secrets") -}}
{{- $files_nats_password := "" -}}
{{ if $files_nats_secret -}}
{{ $files_nats_password = (index $files_nats_secret "data" "files_nats_password") }}
{{ else -}}
{{ $files_nats_password = randAlphaNum 16 | b64enc }}
{{- end -}}

---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -101,7 +109,7 @@ spec:
{{ end }}

- name: files
image: beclab/files-server:v0.2.46
image: beclab/files-server:v0.2.47
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: true
Expand Down Expand Up @@ -191,6 +199,16 @@ spec:
# use redis db 0 for redis cache
- name: REDIS_DB
value: '0'
- name: NATS_HOST
value: nats
- name: NATS_PORT
value: '4222'
- name: NATS_USERNAME
value: os-system-files-server
- name: NATS_PASSWORD
value: {{ $files_nats_password | b64dec }}
- name: NATS_SUBJECT
value: terminus.os-system.files-notify
- name: POD_NAME
valueFrom:
fieldRef:
Expand Down Expand Up @@ -345,7 +363,13 @@ spec:
- sh
- -c
- |
chown -R 1000:1000 /appdata
chown -R 1000:1000 /appdata
- args:
- -it
- nats.os-system:4222
image: owncloudci/wait-for:latest
imagePullPolicy: IfNotPresent
name: check-nats
containers:
- name: files
image: beclab/files-server:v0.2.46
Expand Down Expand Up @@ -412,6 +436,16 @@ data:
password: {{ $password }}
files_redis_password: {{ $files_redis_password }}

---
apiVersion: v1
kind: Secret
metadata:
name: files-nats-secrets
namespace: os-system
data:
files_nats_password: {{ $files_nats_password }}
type: Opaque

---
apiVersion: apr.bytetrade.io/v1alpha1
kind: MiddlewareRequest
Expand All @@ -430,6 +464,37 @@ spec:
name: files-secrets
namespace: files-redis

---
apiVersion: apr.bytetrade.io/v1alpha1
kind: MiddlewareRequest
metadata:
name: files-server-nat
namespace: os-system
spec:
app: files-server
appNamespace: os-system
middleware: nats
nats:
password:
valueFrom:
secretKeyRef:
key: files_nats_password
name: files-nats-secrets
refs: []
subjects:
- export:
- appName: files-frontend
pub: allow
sub: allow
- appName: vault
pub: allow
sub: allow
name: files-notify
permission:
pub: allow
sub: allow
user: os-system-files-server

---
kind: ConfigMap
apiVersion: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
{{ $pg_password = randAlphaNum 16 | b64enc }}
{{- end -}}

{{- $files_frontend_nats_secret := (lookup "v1" "Secret" $namespace "files-frontend-nats-secrets") -}}
{{- $files_frontend_nats_password := "" -}}
{{ if $files_frontend_nats_secret -}}
{{ $files_frontend_nats_password = (index $files_frontend_nats_secret "data" "files_frontend_nats_password") }}
{{ else -}}
{{ $files_frontend_nats_password = randAlphaNum 16 | b64enc }}
{{- end -}}


---
apiVersion: v1
Expand Down Expand Up @@ -134,6 +142,12 @@ spec:
image: owncloudci/wait-for:latest
imagePullPolicy: IfNotPresent
name: check-auth
- args:
- -it
- nats.user-system-{{ .Values.bfl.username }}:4222
image: owncloudci/wait-for:latest
imagePullPolicy: IfNotPresent
name: check-nats
- name: terminus-sidecar-init
image: openservicemesh/init:v1.2.3
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -283,13 +297,24 @@ spec:
# - /filebrowser
# - --noauth
- name: files-frontend
image: beclab/files-frontend:v1.3.9
image: beclab/files-frontend:v1.3.14
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: false
runAsUser: 0
ports:
- containerPort: 80
env:
- name: NATS_HOST
value: nats.user-system-{{ .Values.bfl.username }}
- name: NATS_PORT
value: '4222'
- name: NATS_USERNAME
value: user-system-{{ .Values.bfl.username }}-files-frontend
- name: NATS_PASSWORD
value: {{ $files_frontend_nats_password | b64dec }}
- name: NATS_SUBJECT
value: terminus.os-system.files-notify
volumeMounts:
- name: userspace-dir
mountPath: /data
Expand Down Expand Up @@ -606,6 +631,16 @@ data:
redis_password: {{ $redis_password }}
pg_password: {{ $pg_password }}

---
apiVersion: v1
kind: Secret
metadata:
name: files-frontend-nats-secrets
namespace: user-system-{{ .Values.bfl.username }}
data:
files_frontend_nats_password: {{ $files_frontend_nats_password }}
type: Opaque

#---
#apiVersion: apr.bytetrade.io/v1alpha1
#kind: MiddlewareRequest
Expand Down Expand Up @@ -646,6 +681,31 @@ spec:
name: zinc-files-secrets
namespace: zinc-files

---
apiVersion: apr.bytetrade.io/v1alpha1
kind: MiddlewareRequest
metadata:
name: files-frontend-nat
namespace: user-system-{{ .Values.bfl.username }}
spec:
app: files-frontend
appNamespace: user-space-{{ .Values.bfl.username }}
middleware: nats
nats:
password:
valueFrom:
secretKeyRef:
key: files_frontend_nats_password
name: files-frontend-nats-secrets
refs:
- appName: files-server
appNamespace: os-system
subjects:
- name: files-notify
perm:
- pub
- sub
user: user-system-{{ .Values.bfl.username }}-files-frontend

---
apiVersion: v1
Expand Down
4 changes: 2 additions & 2 deletions apps/vault/config/cluster/deploy/vault_server_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
value: os_system_vault
containers:
- name: vault-server
image: beclab/vault-server:v1.3.11
image: beclab/vault-server:v1.3.14
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
Expand Down Expand Up @@ -114,7 +114,7 @@ spec:
- name: vault-attach
mountPath: /padloc/packages/server/attachments
- name: vault-admin
image: beclab/vault-admin:v1.3.11
image: beclab/vault-admin:v1.3.14
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3010
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{{- $namespace := printf "%s%s" "user-system-" .Values.bfl.username -}}

{{- $vault_nats_secret := (lookup "v1" "Secret" $namespace "vault-nats-secrets") -}}
{{- $vault_nats_password := "" -}}
{{ if $vault_nats_secret -}}
{{ $vault_nats_password = (index $vault_nats_secret "data" "vault_nats_password") }}
{{ else -}}
{{ $vault_nats_password = randAlphaNum 16 | b64enc }}
{{- end -}}



---
Expand Down Expand Up @@ -36,6 +46,12 @@ spec:
image: owncloudci/wait-for:latest
imagePullPolicy: IfNotPresent
name: check-auth
- args:
- -it
- nats.user-system-{{ .Values.bfl.username }}:4222
image: owncloudci/wait-for:latest
imagePullPolicy: IfNotPresent
name: check-nats
- name: terminus-sidecar-init
image: openservicemesh/init:v1.2.3
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -72,13 +88,13 @@ spec:

containers:
- name: vault-frontend
image: beclab/vault-frontend:v1.3.9
image: beclab/vault-frontend:v1.3.14
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80

- name: notification-server
image: beclab/vault-notification:v1.3.9
image: beclab/vault-notification:v1.3.14
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3010
Expand All @@ -93,6 +109,17 @@ spec:
value: '{{ .Values.os.vault.appSecret }}'
- name: OS_APP_KEY
value: {{ .Values.os.vault.appKey }}
- name: NATS_HOST
value: nats.user-system-{{ .Values.bfl.username }}
- name: NATS_PORT
value: '4222'
- name: NATS_USERNAME
value: user-system-{{ .Values.bfl.username }}-vault
- name: NATS_PASSWORD
value: {{ $vault_nats_password | b64dec }}
- name: NATS_SUBJECT
value: terminus.os-system.files-notify


- name: terminus-envoy-sidecar
image: bytetrade/envoy:v1.25.11
Expand Down Expand Up @@ -238,3 +265,38 @@ spec:
version: v1
status:
state: active
---
apiVersion: v1
kind: Secret
metadata:
name: vault-nats-secrets
namespace: user-system-{{ .Values.bfl.username }}
data:
vault_nats_password: {{ $vault_nats_password }}
type: Opaque

---
apiVersion: apr.bytetrade.io/v1alpha1
kind: MiddlewareRequest
metadata:
name: vault-nat
namespace: user-system-{{ .Values.bfl.username }}
spec:
app: vault
appNamespace: user-space-{{ .Values.bfl.username }}
middleware: nats
nats:
password:
valueFrom:
secretKeyRef:
key: vault_nats_password
name: vault-nats-secrets
refs:
- appName: files-server
appNamespace: os-system
subjects:
- name: files-notify
perm:
- pub
- sub
user: user-system-{{ .Values.bfl.username }}-vault
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
- name: DISABLE_TELEMETRY
value: "false"
- name: operator-api
image: beclab/middleware-operator:0.1.37
image: beclab/middleware-operator:0.1.38
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9080
Expand Down

0 comments on commit 5b35eb2

Please sign in to comment.