From bc134283d9d3be0868d65dfb470c797ce23e8658 Mon Sep 17 00:00:00 2001 From: wiy Date: Thu, 13 Nov 2025 00:45:50 +0800 Subject: [PATCH] feat(olares-app): add share application (#2058) * files: share * feat: update olares-app version to 1.6.1 --------- Co-authored-by: aby913 --- .../system-apps/templates/olares-app.yaml | 21 ++++- .../config/launcher/templates/bfl_deploy.yaml | 2 +- .../cluster/deploy/chart_repo_deploy.yaml | 2 +- .../crds/sys.bytetrade.io_sharesambas.yaml | 81 +++++++++++++++++ .../config/cluster/deploy/files_deploy.yaml | 89 ++++++++++++++++++- .../config/cluster/deploy/market_deploy.yaml | 2 +- .../cluster/deploy/vault_server_deploy.yaml | 2 +- 7 files changed, 189 insertions(+), 10 deletions(-) create mode 100644 framework/files/.olares/config/cluster/crds/sys.bytetrade.io_sharesambas.yaml diff --git a/apps/.olares/config/user/helm-charts/system-apps/templates/olares-app.yaml b/apps/.olares/config/user/helm-charts/system-apps/templates/olares-app.yaml index 6e90d9a4f..c86daae51 100644 --- a/apps/.olares/config/user/helm-charts/system-apps/templates/olares-app.yaml +++ b/apps/.olares/config/user/helm-charts/system-apps/templates/olares-app.yaml @@ -209,6 +209,21 @@ spec: port: 80 targetPort: 91 --- +apiVersion: v1 +kind: Service +metadata: + name: share-fe-service + namespace: user-space-{{ .Values.bfl.username }} +spec: + selector: + app: olares-app + type: ClusterIP + ports: + - protocol: TCP + name: share + port: 80 + targetPort: 92 +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -220,12 +235,12 @@ metadata: applications.app.bytetrade.io/owner: '{{ .Values.bfl.username }}' applications.app.bytetrade.io/author: bytetrade.io annotations: - applications.app.bytetrade.io/default-thirdlevel-domains: '[{"appName": "olares-app","entranceName":"dashboard","thirdLevelDomain":"dashboard"},{"appName":"olares-app","entranceName":"control-hub","thirdLevelDomain":"control-hub"},{"appName":"olares-app","entranceName":"files","thirdLevelDomain":"files"},{"appName": "olares-app","entranceName":"vault","thirdLevelDomain":"vault"},{"appName":"olares-app","entranceName":"headscale","thirdLevelDomain":"headscale"},{"appName":"olares-app","entranceName":"settings","thirdLevelDomain":"settings"},{"appName": "olares-app","entranceName":"market","thirdLevelDomain":"market"},{"appName":"olares-app","entranceName":"profile","thirdLevelDomain":"profile"}]' + applications.app.bytetrade.io/default-thirdlevel-domains: '[{"appName": "olares-app","entranceName":"dashboard","thirdLevelDomain":"dashboard"},{"appName":"olares-app","entranceName":"control-hub","thirdLevelDomain":"control-hub"},{"appName":"olares-app","entranceName":"files","thirdLevelDomain":"files"},{"appName":"olares-app","entranceName":"share","thirdLevelDomain":"share"},{"appName": "olares-app","entranceName":"vault","thirdLevelDomain":"vault"},{"appName":"olares-app","entranceName":"headscale","thirdLevelDomain":"headscale"},{"appName":"olares-app","entranceName":"settings","thirdLevelDomain":"settings"},{"appName": "olares-app","entranceName":"market","thirdLevelDomain":"market"},{"appName":"olares-app","entranceName":"profile","thirdLevelDomain":"profile"}]' applications.app.bytetrade.io/icon: https://app.cdn.olares.com/appstore/olaresapps/icon.png applications.app.bytetrade.io/title: 'Olares Apps' applications.app.bytetrade.io/version: '0.0.1' applications.app.bytetrade.io/policies: '{"policies":[{"entranceName":"dashboard","uriRegex":"/js/script.js", "level":"public"},{"entranceName":"dashboard","uriRegex":"/js/api/send", "level":"public"}]}' - applications.app.bytetrade.io/entrances: '[{"name":"files", "host":"files-fe-service", "port":80,"title":"Files","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/files/icon.png"},{"name":"vault", "host":"vault-service", "port":80,"title":"Vault","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/vault/icon.png"},{"name":"market", "host":"appstore-fe-service", "port":80,"title":"Market","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/appstore/icon.png"},{"name":"settings", "host":"settings-service", "port":80,"title":"Settings","icon":"https://app.cdn.olares.com/appstore/settings/icon.png"},{"name":"profile", "host":"profile-service", "port":80,"title":"Profile","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/profile/icon.png"},{"name":"dashboard","host":"dashboard-service","port":80,"title":"Dashboard","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/dashboard/icon.png"},{"name":"control-hub","host":"control-hub-service","port":80,"title":"Control Hub","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/control-hub/icon.png"},{"name":"headscale", "host":"headscale-svc", "port":80,"title":"Headscale","invisible": true,"icon":"https://app.cdn.olares.com/appstore/headscale/icon.png"}]' + applications.app.bytetrade.io/entrances: '[{"name":"files", "host":"files-fe-service", "port":80,"title":"Files","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/files/icon.png"},{"name":"share", "host":"share-fe-service", "port":80,"title":"Share","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/files/icon.png","invisible":true},{"name":"vault", "host":"vault-service", "port":80,"title":"Vault","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/vault/icon.png"},{"name":"market", "host":"appstore-fe-service", "port":80,"title":"Market","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/appstore/icon.png"},{"name":"settings", "host":"settings-service", "port":80,"title":"Settings","icon":"https://app.cdn.olares.com/appstore/settings/icon.png"},{"name":"profile", "host":"profile-service", "port":80,"title":"Profile","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/profile/icon.png"},{"name":"dashboard","host":"dashboard-service","port":80,"title":"Dashboard","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/dashboard/icon.png"},{"name":"control-hub","host":"control-hub-service","port":80,"title":"Control Hub","windowPushState":true,"icon":"https://app.cdn.olares.com/appstore/control-hub/icon.png"},{"name":"headscale", "host":"headscale-svc", "port":80,"title":"Headscale","invisible": true,"icon":"https://app.cdn.olares.com/appstore/headscale/icon.png"}]' spec: replicas: 1 selector: @@ -303,7 +318,7 @@ spec: chown -R 1000:1000 /uploadstemp && \ chown -R 1000:1000 /appdata - name: olares-app-init - image: beclab/system-frontend:v1.5.26 + image: beclab/system-frontend:v1.6.1 imagePullPolicy: IfNotPresent command: - /bin/sh diff --git a/framework/bfl/.olares/config/launcher/templates/bfl_deploy.yaml b/framework/bfl/.olares/config/launcher/templates/bfl_deploy.yaml index bdb831065..83a986d4b 100644 --- a/framework/bfl/.olares/config/launcher/templates/bfl_deploy.yaml +++ b/framework/bfl/.olares/config/launcher/templates/bfl_deploy.yaml @@ -317,7 +317,7 @@ spec: apiVersion: v1 fieldPath: spec.nodeName - name: ingress - image: beclab/bfl-ingress:v0.3.24 + image: beclab/bfl-ingress:v0.3.25 imagePullPolicy: IfNotPresent env: - name: AUTHELIA_AUTH_URL diff --git a/framework/chart-repo/.olares/config/cluster/deploy/chart_repo_deploy.yaml b/framework/chart-repo/.olares/config/cluster/deploy/chart_repo_deploy.yaml index 9ad3fb20f..27a87e715 100644 --- a/framework/chart-repo/.olares/config/cluster/deploy/chart_repo_deploy.yaml +++ b/framework/chart-repo/.olares/config/cluster/deploy/chart_repo_deploy.yaml @@ -121,7 +121,7 @@ spec: name: check-appservice containers: - name: chartrepo - image: beclab/dynamic-chart-repository:v0.2.4 + image: beclab/dynamic-chart-repository:v0.2.5 imagePullPolicy: IfNotPresent ports: - containerPort: 81 diff --git a/framework/files/.olares/config/cluster/crds/sys.bytetrade.io_sharesambas.yaml b/framework/files/.olares/config/cluster/crds/sys.bytetrade.io_sharesambas.yaml new file mode 100644 index 000000000..f87b24a94 --- /dev/null +++ b/framework/files/.olares/config/cluster/crds/sys.bytetrade.io_sharesambas.yaml @@ -0,0 +1,81 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: sharesambas.sys.bytetrade.io +spec: + group: sys.bytetrade.io + names: + categories: + - all + kind: ShareSamba + listKind: ShareSambaList + plural: sharesambas + shortNames: + - sharesamba + singular: sharesamba + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.operator + name: operator + type: string + - jsonPath: .metadata.creationTimestamp + name: creation + type: date + name: v1 + schema: + openAPIV3Schema: + description: ShareSamba is the Schema for the sharesambas API + properties: + apiVersion: + description: + "APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: + "Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: ShareSambaSpec defines the desired state of ShareSamba + properties: + operator: + type: string + share_items: + items: + type: string + type: array + required: + - operator + - share_items + type: object + status: + description: ShareSambaStatus defines the observed state of ShareSamba + properties: + state: + description: + 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file' + type: string + updateTime: + format: date-time + type: string + required: + - state + - updateTime + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/framework/files/.olares/config/cluster/deploy/files_deploy.yaml b/framework/files/.olares/config/cluster/deploy/files_deploy.yaml index f631ab209..6d4f381f6 100644 --- a/framework/files/.olares/config/cluster/deploy/files_deploy.yaml +++ b/framework/files/.olares/config/cluster/deploy/files_deploy.yaml @@ -75,8 +75,7 @@ spec: command: - sh - -c - - | - chown -R 1000:1000 /appdata; chown -R 1000:1000 /appcache; chown -R 1000:1000 /data + - env - name: init-container image: 'postgres:16.0-alpine3.18' command: @@ -172,8 +171,74 @@ spec: name: shared-lib {{ end }} + - name: samba-server + image: beclab/samba-server:0.0.3 + imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: true + runAsUser: 0 + privileged: true + volumeMounts: + - mountPath: /data/appcache/ + name: upload-appdata + - name: fb-data + mountPath: /appdata + - name: userspace-dir + mountPath: /data + - name: upload-appdata + mountPath: /appcache/ +{{ if .Values.sharedlib }} + - name: shared-lib + mountPath: /data/External + mountPropagation: Bidirectional +{{ end }} + ports: + - containerPort: 445 + env: +{{ if .Values.sharedlib }} + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: TERMINUSD_HOST + value: $(NODE_IP):18088 +{{ end }} + - name: EXTERNAL_PREFIX + value: '/External/' + - name: ROOT_PREFIX + value: /data + - name: REDIS_HOST + value: redis-cluster-proxy.os-platform + - name: REDIS_PORT + value: '6379' + - name: REDIS_USERNAME + value: '' + - name: REDIS_PASSWORD + value: {{ $files_redis_password | b64dec }} + - name: REDIS_USE_SSL + value: 'false' + # use redis db 0 for redis cache + - name: REDIS_DB + value: '0' + - name: PGHOST + value: citus-headless.os-platform + - name: PGPORT + value: '5432' + - name: PGUSER + value: files_os_framework + - name: PGPASSWORD + value: {{ $files_postgres_password | b64dec }} + - name: PGDB1 + value: os_framework_files + command: + - /samba_share - name: files - image: beclab/files-server:v0.2.124 + image: beclab/files-server:v0.2.125 imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: true @@ -371,6 +436,24 @@ spec: type: Directory {{ end }} +--- +kind: Service +apiVersion: v1 +metadata: + name: files-samba + namespace: os-framework +spec: + ports: + - name: smb + protocol: TCP + port: 445 + targetPort: 445 + nodePort: 30445 + selector: + app: files + type: NodePort + externalTrafficPolicy: Local + --- apiVersion: v1 kind: Service diff --git a/framework/market/.olares/config/cluster/deploy/market_deploy.yaml b/framework/market/.olares/config/cluster/deploy/market_deploy.yaml index af8cba11f..d99784abb 100644 --- a/framework/market/.olares/config/cluster/deploy/market_deploy.yaml +++ b/framework/market/.olares/config/cluster/deploy/market_deploy.yaml @@ -140,7 +140,7 @@ spec: name: check-chart-repo containers: - name: appstore-backend - image: beclab/market-backend:v0.5.4 + image: beclab/market-backend:v0.5.6 imagePullPolicy: IfNotPresent ports: - containerPort: 81 diff --git a/framework/vault/.olares/config/cluster/deploy/vault_server_deploy.yaml b/framework/vault/.olares/config/cluster/deploy/vault_server_deploy.yaml index b8dbd40c3..b428fc624 100644 --- a/framework/vault/.olares/config/cluster/deploy/vault_server_deploy.yaml +++ b/framework/vault/.olares/config/cluster/deploy/vault_server_deploy.yaml @@ -101,7 +101,7 @@ spec: value: os_framework_vault containers: - name: vault-server - image: beclab/vault-server:v1.5.20 + image: beclab/vault-server:v1.6.1 imagePullPolicy: IfNotPresent ports: - containerPort: 3000