From 0cc79f0f80f16c1417861784b5ed92157d3ca7b1 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Tue, 21 May 2024 17:18:40 +0200 Subject: [PATCH 01/10] added the details to the 'Restore Trash-Bins Items' doc section' --- .../unreleased/update-storage-users-doc.md | 5 +++++ services/storage-users/README.md | 21 ++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 changelog/unreleased/update-storage-users-doc.md diff --git a/changelog/unreleased/update-storage-users-doc.md b/changelog/unreleased/update-storage-users-doc.md new file mode 100644 index 0000000000..e844cb9f65 --- /dev/null +++ b/changelog/unreleased/update-storage-users-doc.md @@ -0,0 +1,5 @@ +Enhancement: The storage-users doc updated + +The storage-users doc was updated, added the details to the 'Restore Trash-Bins Items' section. + +https://github.com/owncloud/ocis/pull/9228 diff --git a/services/storage-users/README.md b/services/storage-users/README.md index 41e7a7e039..b333f5988d 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -45,7 +45,7 @@ When using Infinite Scale as user storage, a directory named `storage/users/uplo Example cases for expired uploads: -* In the final step the upload blob is moved from the upload area to the final blobstore (e.g. S3). +* In the final step the upload blob is moved from the upload area to the final blobstore (e.g. S3). * If the bandwidth is limited and the file to transfer can't be transferred completely before the upload expiration time is reached, the file expires and can't be processed. @@ -173,32 +173,37 @@ ocis storage-users trash-bin purge-expired The behaviour of the `purge-expired` command can be configured by using the following environment variables. -* `STORAGE_USERS_PURGE_TRASH_BIN_USER_ID` +* `STORAGE_USERS_PURGE_TRASH_BIN_USER_ID` Used to obtain space trash-bin information and takes the system admin user as the default which is the `OCIS_ADMIN_USER_ID` but can be set individually. It should be noted, that the `OCIS_ADMIN_USER_ID` is only assigned automatically when using the single binary deployment and must be manually assigned in all other deployments. The command only considers spaces to which the assigned user has access and delete permission. -* `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE` +* `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE` Has a default value of `720h` which equals `30 days`. This means, the command will delete all files older than `30 days`. The value is human-readable, for valid values see the duration type described in the [Environment Variable Types](https://doc.owncloud.com/ocis/5.0/deployment/services/envvar-types-description.html). A value of `0` is equivalent to disable and prevents the deletion of `personal space` trash-bin files. -* `STORAGE_USERS_PURGE_TRASH_BIN_PROJECT_DELETE_BEFORE` +* `STORAGE_USERS_PURGE_TRASH_BIN_PROJECT_DELETE_BEFORE` Has a default value of `720h` which equals `30 days`. This means, the command will delete all files older than `30 days`. The value is human-readable, for valid values see the duration type described in the [Environment Variable Types](https://doc.owncloud.com/ocis/5.0/deployment/services/envvar-types-description.html). A value of `0` is equivalent to disable and prevents the deletion of `project space` trash-bin files. #### List and Restore Trash-Bins Items -The variable `STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE` defines a maximum number of attempts to rename a file when the admin restores the file with the CLI option `--option keep-both` to an existing destination with the same name. +Restoring is possible only at the original location. The personal or project spase ID `spaceID` is required for the items restoring. +To authenticate the cli tool use `OCIS_SERVICE_ACCOUNT_SECRET=` and `OCIS_SERVICE_ACCOUNT_ID=`. The `storage-users` cli tool uses the default address to establish the connection to the `gateway` service. If the connection is failed check your custom `gateway` +service `GATEWAY_GRPC_ADDR` configuration and set the same address to `storage-users` variable `OCIS_GATEWAY_GRPC_ADDR` or `STORAGE_USERS_GATEWAY_GRPC_ADDR`. * Print a list of all trash-bin items of a space ```bash - ocis storage-users trash-bin list + ocis storage-users trash-bin list [command options] ['spaceID' required] ``` +The restore option defines the behavior for an item to be restored, when the item name already exists in the target space. Supported options are: `skip`, `replace` and `keep-both`. The default value is `skip` +When the cli tool restores the item with the `replace` option, the existing item will be moved to a trash-bin. When the cli tool restores the item with the `keep-both` option and the designation item already exists, the name of the restored item will be changed by adding the numeric suffix in parentheses. The variable `STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE` defines a maximum number of attempts to rename an item. + * Restore all trash-bin items for a space ```bash - ocis storage-users trash-bin restore-all + ocis storage-users trash-bin restore-all [command options] ['spaceID' required] ``` * Restore a trash-bin item by ID ```bash - ocis storage-users trash-bin restore + ocis storage-users trash-bin restore [command options] ['spaceID' required] ['itemID' required] ``` ## Caching From 3a01ff8060b7f6aebe13b4b7aad2408987887311 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:18:48 +0200 Subject: [PATCH 02/10] Update services/storage-users/README.md Co-authored-by: Phil Davis --- services/storage-users/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index b333f5988d..cef4d9ebe8 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -184,7 +184,7 @@ Has a default value of `720h` which equals `30 days`. This means, the command wi #### List and Restore Trash-Bins Items -Restoring is possible only at the original location. The personal or project spase ID `spaceID` is required for the items restoring. +Restoring is possible only to the original location. The personal or project space ID `spaceID` is required for the items to be restored. To authenticate the cli tool use `OCIS_SERVICE_ACCOUNT_SECRET=` and `OCIS_SERVICE_ACCOUNT_ID=`. The `storage-users` cli tool uses the default address to establish the connection to the `gateway` service. If the connection is failed check your custom `gateway` service `GATEWAY_GRPC_ADDR` configuration and set the same address to `storage-users` variable `OCIS_GATEWAY_GRPC_ADDR` or `STORAGE_USERS_GATEWAY_GRPC_ADDR`. From 38379646b110494ab2d22ffdf2d5172dd97e436c Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:19:04 +0200 Subject: [PATCH 03/10] Update services/storage-users/README.md Co-authored-by: Phil Davis --- services/storage-users/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index cef4d9ebe8..f8826630c3 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -185,7 +185,7 @@ Has a default value of `720h` which equals `30 days`. This means, the command wi #### List and Restore Trash-Bins Items Restoring is possible only to the original location. The personal or project space ID `spaceID` is required for the items to be restored. -To authenticate the cli tool use `OCIS_SERVICE_ACCOUNT_SECRET=` and `OCIS_SERVICE_ACCOUNT_ID=`. The `storage-users` cli tool uses the default address to establish the connection to the `gateway` service. If the connection is failed check your custom `gateway` +To authenticate the cli tool use `OCIS_SERVICE_ACCOUNT_SECRET=` and `OCIS_SERVICE_ACCOUNT_ID=`. The `storage-users` cli tool uses the default address to establish the connection to the `gateway` service. If the connection fails, check your custom `gateway` service `GATEWAY_GRPC_ADDR` configuration and set the same address to `storage-users` variable `OCIS_GATEWAY_GRPC_ADDR` or `STORAGE_USERS_GATEWAY_GRPC_ADDR`. * Print a list of all trash-bin items of a space From 505c598d17a1e136bef90a2395b3fa375e4432b4 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:19:17 +0200 Subject: [PATCH 04/10] Update services/storage-users/README.md Co-authored-by: Phil Davis --- services/storage-users/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index f8826630c3..e8f9ecea47 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -194,7 +194,7 @@ service `GATEWAY_GRPC_ADDR` configuration and set the same address to `storage-u ``` The restore option defines the behavior for an item to be restored, when the item name already exists in the target space. Supported options are: `skip`, `replace` and `keep-both`. The default value is `skip` -When the cli tool restores the item with the `replace` option, the existing item will be moved to a trash-bin. When the cli tool restores the item with the `keep-both` option and the designation item already exists, the name of the restored item will be changed by adding the numeric suffix in parentheses. The variable `STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE` defines a maximum number of attempts to rename an item. +When the cli tool restores the item with the `replace` option, the existing item will be moved to a trash-bin. When the cli tool restores the item with the `keep-both` option and the designated item already exists, the name of the restored item will be changed by adding a numeric suffix in parentheses. The variable `STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE` defines a maximum number of attempts to rename an item. * Restore all trash-bin items for a space ```bash From a9ce0f76e851cd578764abf607792b9428092f85 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:19:29 +0200 Subject: [PATCH 05/10] Update services/storage-users/README.md Co-authored-by: Martin --- services/storage-users/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index e8f9ecea47..711646a742 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -45,7 +45,7 @@ When using Infinite Scale as user storage, a directory named `storage/users/uplo Example cases for expired uploads: -* In the final step the upload blob is moved from the upload area to the final blobstore (e.g. S3). +* In the final step, the upload blob is moved from the upload area to the final blobstore (e.g. S3). * If the bandwidth is limited and the file to transfer can't be transferred completely before the upload expiration time is reached, the file expires and can't be processed. From d4a42b991178e55ead4d271eb35b4378dad84916 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:20:23 +0200 Subject: [PATCH 06/10] Update services/storage-users/README.md Co-authored-by: Martin --- services/storage-users/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index 711646a742..641e9aa9ef 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -173,7 +173,7 @@ ocis storage-users trash-bin purge-expired The behaviour of the `purge-expired` command can be configured by using the following environment variables. -* `STORAGE_USERS_PURGE_TRASH_BIN_USER_ID` +* `STORAGE_USERS_PURGE_TRASH_BIN_USER_ID`\ Used to obtain space trash-bin information and takes the system admin user as the default which is the `OCIS_ADMIN_USER_ID` but can be set individually. It should be noted, that the `OCIS_ADMIN_USER_ID` is only assigned automatically when using the single binary deployment and must be manually assigned in all other deployments. The command only considers spaces to which the assigned user has access and delete permission. * `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE` From e36ceea5f1208db270a922120b15737a7a158da8 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:20:31 +0200 Subject: [PATCH 07/10] Update services/storage-users/README.md Co-authored-by: Martin --- services/storage-users/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index 641e9aa9ef..84d99ead6f 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -176,7 +176,7 @@ The behaviour of the `purge-expired` command can be configured by using the foll * `STORAGE_USERS_PURGE_TRASH_BIN_USER_ID`\ Used to obtain space trash-bin information and takes the system admin user as the default which is the `OCIS_ADMIN_USER_ID` but can be set individually. It should be noted, that the `OCIS_ADMIN_USER_ID` is only assigned automatically when using the single binary deployment and must be manually assigned in all other deployments. The command only considers spaces to which the assigned user has access and delete permission. -* `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE` +* `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE`\ Has a default value of `720h` which equals `30 days`. This means, the command will delete all files older than `30 days`. The value is human-readable, for valid values see the duration type described in the [Environment Variable Types](https://doc.owncloud.com/ocis/5.0/deployment/services/envvar-types-description.html). A value of `0` is equivalent to disable and prevents the deletion of `personal space` trash-bin files. * `STORAGE_USERS_PURGE_TRASH_BIN_PROJECT_DELETE_BEFORE` From 177f2c0c710f2ad8f7cc77983e173ad4dad63c5e Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:20:39 +0200 Subject: [PATCH 08/10] Update services/storage-users/README.md Co-authored-by: Martin --- services/storage-users/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index 84d99ead6f..4ef5af1a9e 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -179,7 +179,7 @@ Used to obtain space trash-bin information and takes the system admin user as th * `STORAGE_USERS_PURGE_TRASH_BIN_PERSONAL_DELETE_BEFORE`\ Has a default value of `720h` which equals `30 days`. This means, the command will delete all files older than `30 days`. The value is human-readable, for valid values see the duration type described in the [Environment Variable Types](https://doc.owncloud.com/ocis/5.0/deployment/services/envvar-types-description.html). A value of `0` is equivalent to disable and prevents the deletion of `personal space` trash-bin files. -* `STORAGE_USERS_PURGE_TRASH_BIN_PROJECT_DELETE_BEFORE` +* `STORAGE_USERS_PURGE_TRASH_BIN_PROJECT_DELETE_BEFORE`\ Has a default value of `720h` which equals `30 days`. This means, the command will delete all files older than `30 days`. The value is human-readable, for valid values see the duration type described in the [Environment Variable Types](https://doc.owncloud.com/ocis/5.0/deployment/services/envvar-types-description.html). A value of `0` is equivalent to disable and prevents the deletion of `project space` trash-bin files. #### List and Restore Trash-Bins Items From d83256e606ea73bb981e80bdb31317c81ef4be44 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 22 May 2024 09:22:28 +0200 Subject: [PATCH 09/10] Update services/storage-users/README.md Co-authored-by: Martin --- services/storage-users/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index 4ef5af1a9e..1cb9b911b8 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -193,7 +193,8 @@ service `GATEWAY_GRPC_ADDR` configuration and set the same address to `storage-u ocis storage-users trash-bin list [command options] ['spaceID' required] ``` -The restore option defines the behavior for an item to be restored, when the item name already exists in the target space. Supported options are: `skip`, `replace` and `keep-both`. The default value is `skip` +The restore option defines the behavior for an item to be restored, when the item name already exists in the target space. Supported options are: `skip`, `replace` and `keep-both`. The default value is `skip`. + When the cli tool restores the item with the `replace` option, the existing item will be moved to a trash-bin. When the cli tool restores the item with the `keep-both` option and the designated item already exists, the name of the restored item will be changed by adding a numeric suffix in parentheses. The variable `STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE` defines a maximum number of attempts to rename an item. * Restore all trash-bin items for a space From beca8cdf2aa3764819e69104a0c36359297e6982 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Wed, 22 May 2024 10:16:48 +0200 Subject: [PATCH 10/10] export example --- services/storage-users/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/storage-users/README.md b/services/storage-users/README.md index 1cb9b911b8..0767e2b3eb 100644 --- a/services/storage-users/README.md +++ b/services/storage-users/README.md @@ -188,6 +188,11 @@ Restoring is possible only to the original location. The personal or project spa To authenticate the cli tool use `OCIS_SERVICE_ACCOUNT_SECRET=` and `OCIS_SERVICE_ACCOUNT_ID=`. The `storage-users` cli tool uses the default address to establish the connection to the `gateway` service. If the connection fails, check your custom `gateway` service `GATEWAY_GRPC_ADDR` configuration and set the same address to `storage-users` variable `OCIS_GATEWAY_GRPC_ADDR` or `STORAGE_USERS_GATEWAY_GRPC_ADDR`. +* Export the gateway address if your configuration differs from the default + ```bash + export STORAGE_USERS_GATEWAY_GRPC_ADDR=127.0.0.1:9142 + ``` + * Print a list of all trash-bin items of a space ```bash ocis storage-users trash-bin list [command options] ['spaceID' required]