From 92458a963640aae10d66ef72723171dbf073d7de Mon Sep 17 00:00:00 2001 From: zlepper Date: Fri, 9 Jun 2023 07:47:57 +0200 Subject: [PATCH] Rename everything to "digizuite" --- .github/workflows/docker-image.yml | 26 +- charts/sftpgo-operator/Chart.yaml | 6 +- ...rvers.sftpgo.zlepper.dk.yaml => crds.yaml} | 605 +++++++++++++++++- .../sftpgo-operator/templates/operator.yaml | 10 +- .../sftpgoadmins.sftpgo.zlepper.dk.yaml | 135 ---- .../sftpgofolders.sftpgo.zlepper.dk.yaml | 184 ------ .../sftpgousers.sftpgo.zlepper.dk.yaml | 274 -------- crds/src/admin.rs | 2 +- crds/src/folder.rs | 2 +- crds/src/server.rs | 2 +- crds/src/user.rs | 2 +- examples/simple_ftp/server.yaml | 8 +- operator/src/finalizers.rs | 2 +- schema_generator/src/main.rs | 26 +- 14 files changed, 646 insertions(+), 638 deletions(-) rename charts/sftpgo-operator/templates/{sftpgoservers.sftpgo.zlepper.dk.yaml => crds.yaml} (70%) delete mode 100644 charts/sftpgo-operator/templates/sftpgoadmins.sftpgo.zlepper.dk.yaml delete mode 100644 charts/sftpgo-operator/templates/sftpgofolders.sftpgo.zlepper.dk.yaml delete mode 100644 charts/sftpgo-operator/templates/sftpgousers.sftpgo.zlepper.dk.yaml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0e2e9ab..cbbb849 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -30,17 +30,16 @@ jobs: docker: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v3 - - - name: Docker meta + + - name: Docker meta id: meta uses: docker/metadata-action@v4 with: # list of Docker images to use as base name for tags images: | - zlepper/sftpgo-k8s-operator + ghcr.io/digizuite/sftpgo-k8s-operator # generate Docker tags based on the following events/attributes tags: | type=schedule @@ -50,18 +49,19 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha - - - name: Set up Docker Buildx + + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub + + - name: Login to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: - username: ${{ vars.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push uses: docker/build-push-action@v4 with: context: . diff --git a/charts/sftpgo-operator/Chart.yaml b/charts/sftpgo-operator/Chart.yaml index 3015bf2..eb50cc8 100644 --- a/charts/sftpgo-operator/Chart.yaml +++ b/charts/sftpgo-operator/Chart.yaml @@ -1,13 +1,13 @@ apiVersion: v2 appVersion: 2.5.0 description: An operator for Managing Sftpgo -home: https://github.com/zlepper/sftpgo-k8s-operator +home: https://github.com/digizuite/sftpgo-k8s-operator keywords: - operator - sftpgo kubeVersion: ">= 1.25.0-0" name: sftpgo-operator sources: - - https://github.com/zlepper/sftpgo-k8s-operator -version: 0.1.4 + - https://github.com/digizuite/sftpgo-k8s-operator +version: 0.1.5 icon: https://sftpgo.com/assets/img/logo.png \ No newline at end of file diff --git a/charts/sftpgo-operator/templates/sftpgoservers.sftpgo.zlepper.dk.yaml b/charts/sftpgo-operator/templates/crds.yaml similarity index 70% rename from charts/sftpgo-operator/templates/sftpgoservers.sftpgo.zlepper.dk.yaml rename to charts/sftpgo-operator/templates/crds.yaml index 9ff8a45..47c056e 100644 --- a/charts/sftpgo-operator/templates/sftpgoservers.sftpgo.zlepper.dk.yaml +++ b/charts/sftpgo-operator/templates/crds.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: sftpgoservers.sftpgo.zlepper.dk + name: sftpgoservers.sftpgo.digizuite.com spec: - group: sftpgo.zlepper.dk + group: sftpgo.digizuite.com names: categories: [] kind: SftpgoServer @@ -1388,3 +1388,604 @@ spec: served: true storage: true subresources: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: sftpgousers.sftpgo.digizuite.com +spec: + group: sftpgo.digizuite.com + names: + categories: [] + kind: SftpgoUser + plural: sftpgousers + shortNames: [] + singular: sftpgouser + scope: Namespaced + versions: + - additionalPrinterColumns: [] + name: v1alpha1 + schema: + openAPIV3Schema: + description: Auto-generated derived type for SftpgoUserSpec via `CustomResource` + properties: + spec: + properties: + configuration: + properties: + enabled: + enum: + - Disabled + - Enabled + nullable: true + type: string + filesystem: + nullable: true + oneOf: + - required: + - local + - required: + - azureBlobStorage + properties: + azureBlobStorage: + properties: + accessTier: + enum: + - Hot + - Cool + - Archive + nullable: true + type: string + authorization: + oneOf: + - required: + - sharedKey + - required: + - sharedAccessSignatureUrl + properties: + sharedAccessSignatureUrl: + type: string + sharedKey: + properties: + accountKey: + type: string + accountName: + type: string + container: + description: The name of the container to use. Sftpgo does not create this automatically, so make sure it exists before using it here. + type: string + required: + - accountKey + - accountName + - container + type: object + type: object + downloadConcurrency: + description: the number of parts to download in parallel. If this value is not set, the default value (5) will be used + format: int32 + nullable: true + type: integer + downloadPartSize: + description: the buffer size (in MB) to use for multipart downloads. If this value is not set, the default value (5MB) will be used. + format: int32 + nullable: true + type: integer + endpoint: + description: optional endpoint. Default is "blob.core.windows.net". If you use the emulator the endpoint must include the protocol, for example "http://127.0.0.1:10000" + nullable: true + type: string + keyPrefix: + description: key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole container contents will be available + nullable: true + type: string + uploadConcurrency: + description: the number of parts to upload in parallel. If this value is not set, the default value (5) will be used + format: int32 + nullable: true + type: integer + uploadPartSize: + description: the buffer size (in MB) to use for multipart uploads. If this value is not set, the default value (5MB) will be used. + format: int32 + nullable: true + type: integer + useEmulator: + nullable: true + type: boolean + required: + - authorization + type: object + local: + properties: + readBufferSize: + format: int32 + nullable: true + type: integer + writeBufferSize: + format: int32 + nullable: true + type: integer + type: object + type: object + globalPermissions: + items: + enum: + - all + - list + - download + - upload + - overwrite + - create_dirs + - rename + - rename_files + - rename_dirs + - delete + - delete_files + - delete_dirs + - create_symlinks + - chmod + - chown + - chtimes + type: string + type: array + homeDir: + type: string + password: + description: Password of the user. Changes to this field will not propagate to the user after creation as we have no way of retrieving the password from the server. + type: string + perDirectoryPermissions: + items: + properties: + path: + type: string + permissions: + items: + enum: + - all + - list + - download + - upload + - overwrite + - create_dirs + - rename + - rename_files + - rename_dirs + - delete + - delete_files + - delete_dirs + - create_symlinks + - chmod + - chown + - chtimes + type: string + type: array + required: + - path + - permissions + type: object + nullable: true + type: array + username: + description: The username of the user + type: string + virtualFolders: + items: + properties: + name: + description: The kubernetes resource name of the virtual folder + type: string + namespace: + description: The kubernetes namespace the folder is defined in, if different from the namespace of this resource. + nullable: true + type: string + quotaFiles: + description: Quota as number of files. 0 means unlimited, , -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + format: int32 + nullable: true + type: integer + quotaSize: + description: Quota as size in bytes. 0 means unlimited, -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + format: int64 + nullable: true + type: integer + virtualPath: + description: The path to use inside the virtual folder. + type: string + required: + - name + - virtualPath + type: object + nullable: true + type: array + required: + - globalPermissions + - homeDir + - password + - username + type: object + disconnectOnChange: + description: This way you force the user to login again, if connected, and so to use the new configuration + nullable: true + type: boolean + sftpgoServerReference: + properties: + connectionSecret: + nullable: true + properties: + name: + type: string + namespace: + nullable: true + type: string + required: + - name + type: object + name: + nullable: true + type: string + namespace: + nullable: true + type: string + overrideValues: + nullable: true + properties: + password: + nullable: true + type: string + url: + nullable: true + type: string + username: + nullable: true + type: string + type: object + type: object + required: + - configuration + - sftpgoServerReference + type: object + status: + nullable: true + properties: + last_username: + type: string + user_id: + format: int32 + nullable: true + type: integer + required: + - last_username + type: object + required: + - spec + title: SftpgoUser + type: object + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: sftpgofolders.sftpgo.digizuite.com +spec: + group: sftpgo.digizuite.com + names: + categories: [] + kind: SftpgoFolder + plural: sftpgofolders + shortNames: [] + singular: sftpgofolder + scope: Namespaced + versions: + - additionalPrinterColumns: [] + name: v1alpha1 + schema: + openAPIV3Schema: + description: Auto-generated derived type for SftpgoFolderSpec via `CustomResource` + properties: + spec: + properties: + configuration: + description: Defines the filesystem for the virtual folder and the used quota limits. The same folder can be shared among multiple users and each user can have different quota limits or a different virtual path. + properties: + description: + description: optional description + nullable: true + type: string + filesystem: + description: Storage filesystem details + oneOf: + - required: + - local + - required: + - azureBlobStorage + properties: + azureBlobStorage: + properties: + accessTier: + enum: + - Hot + - Cool + - Archive + nullable: true + type: string + authorization: + oneOf: + - required: + - sharedKey + - required: + - sharedAccessSignatureUrl + properties: + sharedAccessSignatureUrl: + type: string + sharedKey: + properties: + accountKey: + type: string + accountName: + type: string + container: + description: The name of the container to use. Sftpgo does not create this automatically, so make sure it exists before using it here. + type: string + required: + - accountKey + - accountName + - container + type: object + type: object + downloadConcurrency: + description: the number of parts to download in parallel. If this value is not set, the default value (5) will be used + format: int32 + nullable: true + type: integer + downloadPartSize: + description: the buffer size (in MB) to use for multipart downloads. If this value is not set, the default value (5MB) will be used. + format: int32 + nullable: true + type: integer + endpoint: + description: optional endpoint. Default is "blob.core.windows.net". If you use the emulator the endpoint must include the protocol, for example "http://127.0.0.1:10000" + nullable: true + type: string + keyPrefix: + description: key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole container contents will be available + nullable: true + type: string + uploadConcurrency: + description: the number of parts to upload in parallel. If this value is not set, the default value (5) will be used + format: int32 + nullable: true + type: integer + uploadPartSize: + description: the buffer size (in MB) to use for multipart uploads. If this value is not set, the default value (5MB) will be used. + format: int32 + nullable: true + type: integer + useEmulator: + nullable: true + type: boolean + required: + - authorization + type: object + local: + properties: + readBufferSize: + format: int32 + nullable: true + type: integer + writeBufferSize: + format: int32 + nullable: true + type: integer + type: object + type: object + mappedPath: + description: absolute filesystem path to use as virtual folder + nullable: true + type: string + name: + description: unique name for this virtual folder + type: string + required: + - filesystem + - name + type: object + sftpgoServerReference: + properties: + connectionSecret: + nullable: true + properties: + name: + type: string + namespace: + nullable: true + type: string + required: + - name + type: object + name: + nullable: true + type: string + namespace: + nullable: true + type: string + overrideValues: + nullable: true + properties: + password: + nullable: true + type: string + url: + nullable: true + type: string + username: + nullable: true + type: string + type: object + type: object + required: + - configuration + - sftpgoServerReference + type: object + status: + nullable: true + properties: + folder_id: + format: int32 + nullable: true + type: integer + last_name: + type: string + required: + - last_name + type: object + required: + - spec + title: SftpgoFolder + type: object + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: sftpgoadmins.sftpgo.digizuite.com +spec: + group: sftpgo.digizuite.com + names: + categories: [] + kind: SftpgoAdmin + plural: sftpgoadmins + shortNames: [] + singular: sftpgoadmin + scope: Namespaced + versions: + - additionalPrinterColumns: [] + name: v1alpha1 + schema: + openAPIV3Schema: + description: Auto-generated derived type for SftpgoAdminSpec via `CustomResource` + properties: + spec: + properties: + configuration: + properties: + description: + description: optional description, for example the admin full name + nullable: true + type: string + email: + nullable: true + type: string + enabled: + enum: + - Disabled + - Enabled + nullable: true + type: string + password: + description: Password of the user. Changes to this field will not propagate to the user after creation as we have no way of retrieving the password from the server. + type: string + permissions: + items: + enum: + - all + - add_users + - edit_users + - del_users + - view_users + - view_conns + - close_conns + - view_status + - manage_admins + - manage_groups + - manage_apikeys + - quota_scans + - manage_system + - manage_defender + - view_defender + - retention_checks + - metadata_checks + - view_events + - manage_event_rules + - manage_roles + - manage_ip_lists + type: string + type: array + role: + description: 'If set the admin can only administer users with the same role. Role admins cannot have the following permissions: "manage_admins", "manage_apikeys", "manage_system", "manage_event_rules", "manage_roles", "manage_ip_lists"' + nullable: true + type: string + username: + description: The username of the user + type: string + required: + - password + - permissions + - username + type: object + sftpgoServerReference: + properties: + connectionSecret: + nullable: true + properties: + name: + type: string + namespace: + nullable: true + type: string + required: + - name + type: object + name: + nullable: true + type: string + namespace: + nullable: true + type: string + overrideValues: + nullable: true + properties: + password: + nullable: true + type: string + url: + nullable: true + type: string + username: + nullable: true + type: string + type: object + type: object + required: + - configuration + - sftpgoServerReference + type: object + status: + nullable: true + properties: + admin_id: + format: int32 + nullable: true + type: integer + last_username: + type: string + required: + - last_username + type: object + required: + - spec + title: SftpgoAdmin + type: object + served: true + storage: true + subresources: + status: {} + +--- diff --git a/charts/sftpgo-operator/templates/operator.yaml b/charts/sftpgo-operator/templates/operator.yaml index 51a6c29..96d0642 100644 --- a/charts/sftpgo-operator/templates/operator.yaml +++ b/charts/sftpgo-operator/templates/operator.yaml @@ -62,7 +62,7 @@ rules: - watch - patch - apiGroups: - - sftpgo.zlepper.dk + - sftpgo.digizuite.com resources: - sftpgoservers - sftpgousers @@ -77,7 +77,7 @@ rules: - patch - delete - apiGroups: - - sftpgo.zlepper.dk + - sftpgo.digizuite.com resources: - sftpgoservers/finalizers - sftpgousers/finalizers @@ -87,7 +87,7 @@ rules: - update - patch - apiGroups: - - sftpgo.zlepper.dk + - sftpgo.digizuite.com resources: - sftpgoservers/status - sftpgousers/status @@ -110,7 +110,7 @@ metadata: namespace: {{ .Release.Namespace }} rules: - apiGroups: - - sftpgo.zlepper.dk + - sftpgo.digizuite.com resources: - sftpgoservers - sftpgousers @@ -162,7 +162,7 @@ spec: serviceAccountName: sftpgo-operator containers: - name: operator - image: zlepper/sftpgo-k8s-operator:master + image: ghcr.io/digizuite/sftpgo-k8s-operator:master imagePullPolicy: IfNotPresent env: - name: RUST_LOG diff --git a/charts/sftpgo-operator/templates/sftpgoadmins.sftpgo.zlepper.dk.yaml b/charts/sftpgo-operator/templates/sftpgoadmins.sftpgo.zlepper.dk.yaml deleted file mode 100644 index cbc6bb5..0000000 --- a/charts/sftpgo-operator/templates/sftpgoadmins.sftpgo.zlepper.dk.yaml +++ /dev/null @@ -1,135 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: sftpgoadmins.sftpgo.zlepper.dk -spec: - group: sftpgo.zlepper.dk - names: - categories: [] - kind: SftpgoAdmin - plural: sftpgoadmins - shortNames: [] - singular: sftpgoadmin - scope: Namespaced - versions: - - additionalPrinterColumns: [] - name: v1alpha1 - schema: - openAPIV3Schema: - description: Auto-generated derived type for SftpgoAdminSpec via `CustomResource` - properties: - spec: - properties: - configuration: - properties: - description: - description: optional description, for example the admin full name - nullable: true - type: string - email: - nullable: true - type: string - enabled: - enum: - - Disabled - - Enabled - nullable: true - type: string - password: - description: Password of the user. Changes to this field will not propagate to the user after creation as we have no way of retrieving the password from the server. - type: string - permissions: - items: - enum: - - all - - add_users - - edit_users - - del_users - - view_users - - view_conns - - close_conns - - view_status - - manage_admins - - manage_groups - - manage_apikeys - - quota_scans - - manage_system - - manage_defender - - view_defender - - retention_checks - - metadata_checks - - view_events - - manage_event_rules - - manage_roles - - manage_ip_lists - type: string - type: array - role: - description: 'If set the admin can only administer users with the same role. Role admins cannot have the following permissions: "manage_admins", "manage_apikeys", "manage_system", "manage_event_rules", "manage_roles", "manage_ip_lists"' - nullable: true - type: string - username: - description: The username of the user - type: string - required: - - password - - permissions - - username - type: object - sftpgoServerReference: - properties: - connectionSecret: - nullable: true - properties: - name: - type: string - namespace: - nullable: true - type: string - required: - - name - type: object - name: - nullable: true - type: string - namespace: - nullable: true - type: string - overrideValues: - nullable: true - properties: - password: - nullable: true - type: string - url: - nullable: true - type: string - username: - nullable: true - type: string - type: object - type: object - required: - - configuration - - sftpgoServerReference - type: object - status: - nullable: true - properties: - admin_id: - format: int32 - nullable: true - type: integer - last_username: - type: string - required: - - last_username - type: object - required: - - spec - title: SftpgoAdmin - type: object - served: true - storage: true - subresources: - status: {} diff --git a/charts/sftpgo-operator/templates/sftpgofolders.sftpgo.zlepper.dk.yaml b/charts/sftpgo-operator/templates/sftpgofolders.sftpgo.zlepper.dk.yaml deleted file mode 100644 index 3dbad37..0000000 --- a/charts/sftpgo-operator/templates/sftpgofolders.sftpgo.zlepper.dk.yaml +++ /dev/null @@ -1,184 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: sftpgofolders.sftpgo.zlepper.dk -spec: - group: sftpgo.zlepper.dk - names: - categories: [] - kind: SftpgoFolder - plural: sftpgofolders - shortNames: [] - singular: sftpgofolder - scope: Namespaced - versions: - - additionalPrinterColumns: [] - name: v1alpha1 - schema: - openAPIV3Schema: - description: Auto-generated derived type for SftpgoFolderSpec via `CustomResource` - properties: - spec: - properties: - configuration: - description: Defines the filesystem for the virtual folder and the used quota limits. The same folder can be shared among multiple users and each user can have different quota limits or a different virtual path. - properties: - description: - description: optional description - nullable: true - type: string - filesystem: - description: Storage filesystem details - oneOf: - - required: - - local - - required: - - azureBlobStorage - properties: - azureBlobStorage: - properties: - accessTier: - enum: - - Hot - - Cool - - Archive - nullable: true - type: string - authorization: - oneOf: - - required: - - sharedKey - - required: - - sharedAccessSignatureUrl - properties: - sharedAccessSignatureUrl: - type: string - sharedKey: - properties: - accountKey: - type: string - accountName: - type: string - container: - description: The name of the container to use. Sftpgo does not create this automatically, so make sure it exists before using it here. - type: string - required: - - accountKey - - accountName - - container - type: object - type: object - downloadConcurrency: - description: the number of parts to download in parallel. If this value is not set, the default value (5) will be used - format: int32 - nullable: true - type: integer - downloadPartSize: - description: the buffer size (in MB) to use for multipart downloads. If this value is not set, the default value (5MB) will be used. - format: int32 - nullable: true - type: integer - endpoint: - description: optional endpoint. Default is "blob.core.windows.net". If you use the emulator the endpoint must include the protocol, for example "http://127.0.0.1:10000" - nullable: true - type: string - keyPrefix: - description: key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole container contents will be available - nullable: true - type: string - uploadConcurrency: - description: the number of parts to upload in parallel. If this value is not set, the default value (5) will be used - format: int32 - nullable: true - type: integer - uploadPartSize: - description: the buffer size (in MB) to use for multipart uploads. If this value is not set, the default value (5MB) will be used. - format: int32 - nullable: true - type: integer - useEmulator: - nullable: true - type: boolean - required: - - authorization - type: object - local: - properties: - readBufferSize: - format: int32 - nullable: true - type: integer - writeBufferSize: - format: int32 - nullable: true - type: integer - type: object - type: object - mappedPath: - description: absolute filesystem path to use as virtual folder - nullable: true - type: string - name: - description: unique name for this virtual folder - type: string - required: - - filesystem - - name - type: object - sftpgoServerReference: - properties: - connectionSecret: - nullable: true - properties: - name: - type: string - namespace: - nullable: true - type: string - required: - - name - type: object - name: - nullable: true - type: string - namespace: - nullable: true - type: string - overrideValues: - nullable: true - properties: - password: - nullable: true - type: string - url: - nullable: true - type: string - username: - nullable: true - type: string - type: object - type: object - required: - - configuration - - sftpgoServerReference - type: object - status: - nullable: true - properties: - folder_id: - format: int32 - nullable: true - type: integer - last_name: - type: string - required: - - last_name - type: object - required: - - spec - title: SftpgoFolder - type: object - served: true - storage: true - subresources: - status: {} diff --git a/charts/sftpgo-operator/templates/sftpgousers.sftpgo.zlepper.dk.yaml b/charts/sftpgo-operator/templates/sftpgousers.sftpgo.zlepper.dk.yaml deleted file mode 100644 index aec251b..0000000 --- a/charts/sftpgo-operator/templates/sftpgousers.sftpgo.zlepper.dk.yaml +++ /dev/null @@ -1,274 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: sftpgousers.sftpgo.zlepper.dk -spec: - group: sftpgo.zlepper.dk - names: - categories: [] - kind: SftpgoUser - plural: sftpgousers - shortNames: [] - singular: sftpgouser - scope: Namespaced - versions: - - additionalPrinterColumns: [] - name: v1alpha1 - schema: - openAPIV3Schema: - description: Auto-generated derived type for SftpgoUserSpec via `CustomResource` - properties: - spec: - properties: - configuration: - properties: - enabled: - enum: - - Disabled - - Enabled - nullable: true - type: string - filesystem: - nullable: true - oneOf: - - required: - - local - - required: - - azureBlobStorage - properties: - azureBlobStorage: - properties: - accessTier: - enum: - - Hot - - Cool - - Archive - nullable: true - type: string - authorization: - oneOf: - - required: - - sharedKey - - required: - - sharedAccessSignatureUrl - properties: - sharedAccessSignatureUrl: - type: string - sharedKey: - properties: - accountKey: - type: string - accountName: - type: string - container: - description: The name of the container to use. Sftpgo does not create this automatically, so make sure it exists before using it here. - type: string - required: - - accountKey - - accountName - - container - type: object - type: object - downloadConcurrency: - description: the number of parts to download in parallel. If this value is not set, the default value (5) will be used - format: int32 - nullable: true - type: integer - downloadPartSize: - description: the buffer size (in MB) to use for multipart downloads. If this value is not set, the default value (5MB) will be used. - format: int32 - nullable: true - type: integer - endpoint: - description: optional endpoint. Default is "blob.core.windows.net". If you use the emulator the endpoint must include the protocol, for example "http://127.0.0.1:10000" - nullable: true - type: string - keyPrefix: - description: key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole container contents will be available - nullable: true - type: string - uploadConcurrency: - description: the number of parts to upload in parallel. If this value is not set, the default value (5) will be used - format: int32 - nullable: true - type: integer - uploadPartSize: - description: the buffer size (in MB) to use for multipart uploads. If this value is not set, the default value (5MB) will be used. - format: int32 - nullable: true - type: integer - useEmulator: - nullable: true - type: boolean - required: - - authorization - type: object - local: - properties: - readBufferSize: - format: int32 - nullable: true - type: integer - writeBufferSize: - format: int32 - nullable: true - type: integer - type: object - type: object - globalPermissions: - items: - enum: - - all - - list - - download - - upload - - overwrite - - create_dirs - - rename - - rename_files - - rename_dirs - - delete - - delete_files - - delete_dirs - - create_symlinks - - chmod - - chown - - chtimes - type: string - type: array - homeDir: - type: string - password: - description: Password of the user. Changes to this field will not propagate to the user after creation as we have no way of retrieving the password from the server. - type: string - perDirectoryPermissions: - items: - properties: - path: - type: string - permissions: - items: - enum: - - all - - list - - download - - upload - - overwrite - - create_dirs - - rename - - rename_files - - rename_dirs - - delete - - delete_files - - delete_dirs - - create_symlinks - - chmod - - chown - - chtimes - type: string - type: array - required: - - path - - permissions - type: object - nullable: true - type: array - username: - description: The username of the user - type: string - virtualFolders: - items: - properties: - name: - description: The kubernetes resource name of the virtual folder - type: string - namespace: - description: The kubernetes namespace the folder is defined in, if different from the namespace of this resource. - nullable: true - type: string - quotaFiles: - description: Quota as number of files. 0 means unlimited, , -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed - format: int32 - nullable: true - type: integer - quotaSize: - description: Quota as size in bytes. 0 means unlimited, -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed - format: int64 - nullable: true - type: integer - virtualPath: - description: The path to use inside the virtual folder. - type: string - required: - - name - - virtualPath - type: object - nullable: true - type: array - required: - - globalPermissions - - homeDir - - password - - username - type: object - disconnectOnChange: - description: This way you force the user to login again, if connected, and so to use the new configuration - nullable: true - type: boolean - sftpgoServerReference: - properties: - connectionSecret: - nullable: true - properties: - name: - type: string - namespace: - nullable: true - type: string - required: - - name - type: object - name: - nullable: true - type: string - namespace: - nullable: true - type: string - overrideValues: - nullable: true - properties: - password: - nullable: true - type: string - url: - nullable: true - type: string - username: - nullable: true - type: string - type: object - type: object - required: - - configuration - - sftpgoServerReference - type: object - status: - nullable: true - properties: - last_username: - type: string - user_id: - format: int32 - nullable: true - type: integer - required: - - last_username - type: object - required: - - spec - title: SftpgoUser - type: object - served: true - storage: true - subresources: - status: {} diff --git a/crds/src/admin.rs b/crds/src/admin.rs index bfa1722..26826b6 100644 --- a/crds/src/admin.rs +++ b/crds/src/admin.rs @@ -80,7 +80,7 @@ pub struct SftpgoAdminConfiguration { #[derive(CustomResource, Serialize, Deserialize, Debug, PartialEq, Clone, JsonSchema)] #[kube( - group = "sftpgo.zlepper.dk", + group = "sftpgo.digizuite.com", version = "v1alpha1", kind = "SftpgoAdmin", plural = "sftpgoadmins", diff --git a/crds/src/folder.rs b/crds/src/folder.rs index e9025fc..06003d7 100644 --- a/crds/src/folder.rs +++ b/crds/src/folder.rs @@ -21,7 +21,7 @@ pub struct SftpgoFolderConfiguration { #[derive(CustomResource, Serialize, Deserialize, Debug, PartialEq, Clone, JsonSchema)] #[kube( - group = "sftpgo.zlepper.dk", + group = "sftpgo.digizuite.com", version = "v1alpha1", kind = "SftpgoFolder", plural = "sftpgofolders", diff --git a/crds/src/server.rs b/crds/src/server.rs index b1bfe81..ae40132 100644 --- a/crds/src/server.rs +++ b/crds/src/server.rs @@ -599,7 +599,7 @@ pub struct SftpgoConfiguration { #[derive(CustomResource, Serialize, Deserialize, Debug, PartialEq, Clone, JsonSchema)] #[kube( - group = "sftpgo.zlepper.dk", + group = "sftpgo.digizuite.com", version = "v1alpha1", kind = "SftpgoServer", plural = "sftpgoservers", diff --git a/crds/src/user.rs b/crds/src/user.rs index e05e92b..f741e2f 100644 --- a/crds/src/user.rs +++ b/crds/src/user.rs @@ -80,7 +80,7 @@ pub struct SftpgoUserConfiguration { #[derive(CustomResource, Serialize, Deserialize, Debug, PartialEq, Clone, JsonSchema)] #[kube( - group = "sftpgo.zlepper.dk", + group = "sftpgo.digizuite.com", version = "v1alpha1", kind = "SftpgoUser", plural = "sftpgousers", diff --git a/examples/simple_ftp/server.yaml b/examples/simple_ftp/server.yaml index 4bb6562..4f81d9c 100644 --- a/examples/simple_ftp/server.yaml +++ b/examples/simple_ftp/server.yaml @@ -1,4 +1,4 @@ -apiVersion: sftpgo.zlepper.dk/v1alpha1 +apiVersion: sftpgo.digizuite.com/v1alpha1 kind: SftpgoServer metadata: name: sftpgo @@ -15,7 +15,7 @@ spec: - port: 2222 --- -apiVersion: sftpgo.zlepper.dk/v1alpha1 +apiVersion: sftpgo.digizuite.com/v1alpha1 kind: SftpgoUser metadata: name: sftpgo-user @@ -35,7 +35,7 @@ spec: overrideValues: url: http://localhost:50962/ --- -apiVersion: sftpgo.zlepper.dk/v1alpha1 +apiVersion: sftpgo.digizuite.com/v1alpha1 kind: SftpgoFolder metadata: name: sftpgo-folder @@ -54,7 +54,7 @@ spec: accountName: "dgz4120c3080183" name: crded-folder10 --- -apiVersion: sftpgo.zlepper.dk/v1alpha1 +apiVersion: sftpgo.digizuite.com/v1alpha1 kind: SftpgoAdmin metadata: name: sftpgo-admin diff --git a/operator/src/finalizers.rs b/operator/src/finalizers.rs index 5530fc6..7c24d28 100644 --- a/operator/src/finalizers.rs +++ b/operator/src/finalizers.rs @@ -19,7 +19,7 @@ where let finalizer = json!({ "metadata": { - "finalizers": ["sftpgo.zlepper.dk/finalizer"] + "finalizers": ["sftpgo.digizuite.com/finalizer"] } }); diff --git a/schema_generator/src/main.rs b/schema_generator/src/main.rs index 473c2e4..efdc6c4 100644 --- a/schema_generator/src/main.rs +++ b/schema_generator/src/main.rs @@ -1,22 +1,22 @@ use crds::{SftpgoAdmin, SftpgoFolder, SftpgoServer, SftpgoUser}; use kube::CustomResourceExt; +use std::fs::File; +use std::io::Write; fn main() { - write_crd::(); - write_crd::(); - write_crd::(); - write_crd::(); -} + let file_path = "charts/sftpgo-operator/templates/crds.yaml"; -fn write_crd() { - let crd = TResource::crd(); + let mut file = File::create(file_path).expect("Failed to create crd yaml file on disk"); - let file_path = format!( - "charts/sftpgo-operator/templates/{}.yaml", - crd.metadata.name.clone().unwrap() - ); + write_crd::(&mut file); + write_crd::(&mut file); + write_crd::(&mut file); + write_crd::(&mut file); +} - let file = std::fs::File::create(file_path).expect("Failed to create crd yaml file on disk"); +fn write_crd(mut file: &mut File) { + let crd = TResource::crd(); - serde_yaml::to_writer(file, &crd).expect("Failed to write CRD to disk"); + serde_yaml::to_writer(&mut file, &crd).expect("Failed to write CRD to disk"); + write!(file, "\n---\n").expect("Failed to write CRD to disk"); }