Compare commits

..
163 Commits
Author SHA1 Message Date
Phil Davis 58ecb2a1a9 Merge pull request #7174 from owncloud/backport-move-search-related-files
[tests-only][full-ci] Backport move search related files
2023-09-01 03:41:17 +00:00
Martin 7ad73cb7f9 Merge pull request #7133 from owncloud/fix_deprecation_version
Forgotten wrong deprecation version fix (3.1 --> 4.0.0)
2023-09-01 00:42:23 +00:00
Martin 6fcd88bb9a Merge pull request #7133 from owncloud/fix_deprecation_version
Forgotten wrong deprecation version fix (3.1 --> 4.0.0)
2023-08-31 00:43:21 +00:00
Martin 56398a3409 Merge pull request #7133 from owncloud/fix_deprecation_version
Forgotten wrong deprecation version fix (3.1 --> 4.0.0)
2023-08-30 01:17:54 +00:00
Martin 40e2ac15cd Merge pull request #7133 from owncloud/fix_deprecation_version
Forgotten wrong deprecation version fix (3.1 --> 4.0.0)
2023-08-29 01:15:10 +00:00
Martin 070cc2a209 Merge pull request #7133 from owncloud/fix_deprecation_version
Forgotten wrong deprecation version fix (3.1 --> 4.0.0)
2023-08-28 15:15:19 +00:00
Prarup Gurung 61e3422470 Merge pull request #7130 from owncloud/backport-update-file-by-fileid
[tests-only][full-ci] Backport added test to update file using file id
2023-08-28 06:08:41 +00:00
nirajacharya2 8b26ed1a72 Automated changelog update [skip ci] 2023-08-27 01:17:44 +00:00
nirajacharya2 87fecec8a9 refactored deprovisioning notification test (#7093) 2023-08-25 01:15:05 +00:00
nirajacharya2 b50ff09938 refactored deprovisioning notification test (#7093) 2023-08-24 00:47:51 +00:00
nirajacharya2 a0258ccc67 refactored deprovisioning notification test (#7093) 2023-08-23 09:16:51 +00:00
a048240c24 [tests-only][backport] Fix the test step ordering (#7101)
* Fix the test step ordering

* Fix spacing of scenario description

Co-authored-by: Sawjan Gurung <saw.jan.grg3e@gmail.com>

---------

Co-authored-by: Phil Davis <phil@jankaritech.com>
Co-authored-by: Sawjan Gurung <saw.jan.grg3e@gmail.com>
2023-08-23 06:50:58 +00:00
Swikriti Tripathi 58131b0878 Update expected to fail file to link failing tests to correct issue (#7090) 2023-08-23 00:47:21 +00:00
Swikriti Tripathi 55554e6ed8 Update expected to fail file to link failing tests to correct issue (#7090) 2023-08-22 09:54:10 +00:00
Nalem7 5771cb2dee adding skip on stable3.0 (#7086) 2023-08-22 07:35:38 +00:00
Nalem7 89496355bb refactoring the tag creating step using data table (#7074) 2023-08-22 00:46:32 +00:00
Nalem7 788512a1f7 refactoring the tag creating step using data table (#7074) 2023-08-21 07:30:37 +00:00
nirajacharya2 49823cad78 adding test for deprovisioning notification using date format (#7070) 2023-08-21 04:54:32 +00:00
Sawjan Gurung 298749136e ci: run sonarcloud on both success and failure (#7069) 2023-08-21 00:22:34 +00:00
Sawjan Gurung f67385bd1c ci: run sonarcloud on both success and failure (#7069) 2023-08-20 00:22:59 +00:00
Sawjan Gurung 9bbcfc56e2 ci: run sonarcloud on both success and failure (#7069) 2023-08-19 00:23:32 +00:00
Sawjan Gurung cc4dc555e9 ci: run sonarcloud on both success and failure (#7069) 2023-08-18 10:21:31 +00:00
Nalem7 c16327c635 add test for sharee searches project spaces files using a tag (#7066) 2023-08-18 08:31:54 +00:00
Prajwol Amatya 3ffe11727d added tests for reading content of a file by fileId using WebDav API (#7064) 2023-08-18 05:33:02 +00:00
Karun Atreya 58f7ba12b2 [tests-only][full-ci] Backport search inside folder shares and spaces (#7058)
* added test scenario for searching inside folder in space

* added scenario for searching inside folder in shares

* added skip on stabl3.0 and deleted api tag on search feature
2023-08-18 03:47:11 +00:00
Phil Davis 6430e9a855 Merge pull request #7047 from owncloud/api-tag-remove-stable
[tests-only][full-ci] removing @api tag from all acceptance tests feature files
2023-08-18 00:59:27 +00:00
Phil Davis 737a274ae0 Merge pull request #7047 from owncloud/api-tag-remove-stable
[tests-only][full-ci] removing @api tag from all acceptance tests feature files
2023-08-17 11:56:26 +00:00
Phil Davis 176c3be9e6 Merge pull request #7055 from owncloud/always-run-sonar-codacy
ci: do not skip sonar and codacy in ci (#7015)
2023-08-17 08:51:34 +00:00
Nalem7 72f67151fb add test for sharee searches project spaces files by content (#7054) 2023-08-17 08:22:43 +00:00
nirajacharya2 9355e74306 removing the scenario and adding a example table (#7053) 2023-08-17 07:53:25 +00:00
Phil Davisandjkoberg e00b841d34 bump sonarcloud (#7050)
Signed-off-by: jkoberg <jkoberg@owncloud.com>
Co-authored-by: jkoberg <jkoberg@owncloud.com>
2023-08-17 07:23:42 +00:00
Nalem7 d02326b1d5 add test for search project space files by content (#7037) 2023-08-17 00:23:58 +00:00
Nalem7 2f49890f01 add test for search version restored files by content (#7030) 2023-08-16 03:48:31 +00:00
Nalem7 d90c3bd8d2 add test for search version restored files by content (#7030) 2023-08-16 01:04:53 +00:00
Nalem7 c6c6776a5d add test for search version restored files by content (#7030) 2023-08-15 09:36:58 +00:00
Phil Davis 82a68409f8 Merge pull request #6996 from owncloud/backport-search-folder-by-tag-in-Project-space
[tests-only][full-ci]Backport search folder by tag in project space
2023-08-15 01:19:20 +00:00
Phil Davis 2d6f965852 Merge pull request #6996 from owncloud/backport-search-folder-by-tag-in-Project-space
[tests-only][full-ci]Backport search folder by tag in project space
2023-08-14 01:17:06 +00:00
Phil Davis 305e9756be Merge pull request #6996 from owncloud/backport-search-folder-by-tag-in-Project-space
[tests-only][full-ci]Backport search folder by tag in project space
2023-08-13 01:15:26 +00:00
Phil Davis a1472d32bc Merge pull request #6996 from owncloud/backport-search-folder-by-tag-in-Project-space
[tests-only][full-ci]Backport search folder by tag in project space
2023-08-12 01:17:20 +00:00
Phil Davis 60d7ea239f Merge pull request #6996 from owncloud/backport-search-folder-by-tag-in-Project-space
[tests-only][full-ci]Backport search folder by tag in project space
2023-08-11 03:59:27 +00:00
Phil Davis d58b5bf10d Merge pull request #6996 from owncloud/backport-search-folder-by-tag-in-Project-space
[tests-only][full-ci]Backport search folder by tag in project space
2023-08-11 00:36:31 +00:00
Phil Davis 9c512e0401 Merge pull request #6996 from owncloud/backport-search-folder-by-tag-in-Project-space
[tests-only][full-ci]Backport search folder by tag in project space
2023-08-10 04:29:24 +00:00
Nalem7 445e9aadd4 add test for search version restored files by tag (#6984) 2023-08-10 01:17:16 +00:00
Nalem7 1a50c50245 add test for search version restored files by tag (#6984) 2023-08-09 00:39:05 +00:00
Nalem7 337287950f add test for search version restored files by tag (#6984) 2023-08-08 11:18:04 +00:00
Karun Atreya c7845047d8 [tests-only][full-ci] Backport searching inside folder in personal space(#6949) (#6980)
* added test scenario for searching inside particular folder only

* added skip on stabl3.0
2023-08-08 06:31:27 +00:00
Nalem7 6ef932754e add api test for search files using tag in project spaces (#6969) 2023-08-08 04:20:31 +00:00
Nalem7 76423cb425 add api test for search files using tag in project spaces (#6969) 2023-08-08 01:27:32 +00:00
Nalem7 12bdff90c3 add api test for search files using tag in project spaces (#6969) 2023-08-07 11:24:52 +00:00
Prajwol Amatya badddc41f4 refactored acceptance test code to store response data related to public shares on single store (#6960) 2023-08-07 01:27:34 +00:00
Prajwol Amatya f4e147eff2 refactored acceptance test code to store response data related to public shares on single store (#6960) 2023-08-06 00:53:50 +00:00
Prajwol Amatya 257daddabe refactored acceptance test code to store response data related to public shares on single store (#6960) 2023-08-05 01:28:21 +00:00
Prajwol Amatya a62ef3579e refactored acceptance test code to store response data related to public shares on single store (#6960) 2023-08-04 08:28:17 +00:00
Swikriti Tripathi 1c354e0e6c Remove skipOnStable2.0 tag (#6963) 2023-08-04 06:45:55 +00:00
Karun Atreya 60403114e8 move resharing.feature from apiSpaces to apiReshare (#6942) 2023-08-04 00:43:32 +00:00
Karun Atreya 661b5ce6ad move resharing.feature from apiSpaces to apiReshare (#6942) 2023-08-03 00:05:54 +00:00
Karun Atreya 7cea02faff move resharing.feature from apiSpaces to apiReshare (#6942) 2023-08-02 13:27:31 +00:00
Phil Davis 545ad1ef83 Merge pull request #6943 from owncloud/tests/update-local-compose-port
[tests-only][full-ci] Update local test docker-compose setup to allow unicode preview tests (#6940)
2023-08-02 12:59:55 +00:00
Phil Davis 91500ea468 Merge pull request #6937 from owncloud/backport-disable-frotend-enable-resharing
[tests-only][full-ci] added scenarios for disabling frontend_enable_resharing (#6665)
2023-08-02 09:22:04 +00:00
Phil Davis b34b78a7aa Merge pull request #6932 from owncloud/test/fix-preview-test-stable
[tests-only][full-ci] Fix preview test scenario (#6931)
2023-08-02 04:31:04 +00:00
Phil Davis 3b162d291b Merge pull request #6903 from owncloud/refactor-tag-test-stable
[tests-only][full-ci] refactored the test so that it logs the response every time it fails
2023-08-02 03:57:18 +00:00
Phil Davis 4d741e3b15 Merge pull request #6903 from owncloud/refactor-tag-test-stable
[tests-only][full-ci] refactored the test so that it logs the response every time it fails
2023-08-01 00:49:45 +00:00
Phil Davis 91177bdc58 Merge pull request #6903 from owncloud/refactor-tag-test-stable
[tests-only][full-ci] refactored the test so that it logs the response every time it fails
2023-07-31 00:52:20 +00:00
Phil Davis 092a97ea57 Merge pull request #6903 from owncloud/refactor-tag-test-stable
[tests-only][full-ci] refactored the test so that it logs the response every time it fails
2023-07-30 00:50:34 +00:00
Phil Davis 0e0b6c17eb Merge pull request #6903 from owncloud/refactor-tag-test-stable
[tests-only][full-ci] refactored the test so that it logs the response every time it fails
2023-07-29 00:51:59 +00:00
Phil Davis 3f8c03f6e8 Merge pull request #6903 from owncloud/refactor-tag-test-stable
[tests-only][full-ci] refactored the test so that it logs the response every time it fails
2023-07-28 00:21:39 +00:00
Phil Davis 874ef5825c Merge pull request #6903 from owncloud/refactor-tag-test-stable
[tests-only][full-ci] refactored the test so that it logs the response every time it fails
2023-07-27 07:50:05 +00:00
Phil Davis 735b990902 Merge pull request #6898 from owncloud/backport-refactor-check-notification
[tests-only][full-ci] Backport refactor check notification and delete it
2023-07-27 00:22:39 +00:00
Phil Davis f25c316d25 Merge pull request #6898 from owncloud/backport-refactor-check-notification
[tests-only][full-ci] Backport refactor check notification and delete it
2023-07-26 12:29:46 +00:00
Prajwol Amatya c060bb2907 refactor acceptance code to store response data of user or group shares on single store (#6895) 2023-07-26 09:59:51 +00:00
Phil Davis b96fc0df2d Merge pull request #6892 from owncloud/backport-search-restored-files-using-context
[tests-only][full-ci]Backport of search restored files using context
2023-07-26 06:00:02 +00:00
Nalem7 5694967853 add test for search deleted file using context (#6889) 2023-07-26 04:54:37 +00:00
Nalem7 0c8d911062 add test for search files by sharee using content (#6882) 2023-07-26 03:53:25 +00:00
Nalem7 c1548dba23 add test for search files by sharee using content (#6882) 2023-07-26 00:54:28 +00:00
Nalem7 e5a1479d67 add test for search files by sharee using content (#6882) 2023-07-25 11:01:57 +00:00
Phil Davis 0b2e314a80 Merge pull request #6868 from owncloud/backport-search-files-by-context
[tests-only][full-ci]Backport-search files using content
2023-07-25 06:41:03 +00:00
Swikriti TripathiandViktor Scharf 91e18814d0 [full-ci][tests-only][backport] Check id file owner in response (#6873)
* check owner as spaceId in sharing response

* fix after review

* Update expected to fail

* remove space id

---------

Co-authored-by: Viktor Scharf <scharf.vi@gmail.com>
2023-07-24 14:27:59 +00:00
Amrita 022e164fa0 Add more tests coverage (#6854) 2023-07-24 10:29:24 +00:00
Swikriti Tripathi 4a32258bee [tests-only][full-ci]Retry listing notifications (#6839) (#6872)
* Retry listing notifications

* use loop instaed

* use loop instaed

* throw exception

* use do while loop
2023-07-24 08:46:42 +00:00
Nalem7 11e54bfef1 add api test for search file through tag (#6857) 2023-07-24 00:20:44 +00:00
Nalem7 06e3a6600f add api test for search file through tag (#6857) 2023-07-23 00:57:38 +00:00
Nalem7 1c42ba0d7c add api test for search file through tag (#6857) 2023-07-22 00:57:01 +00:00
Nalem7 2de34a526f add api test for search file through tag (#6857) 2023-07-21 10:20:34 +00:00
Salipa Gurungandamrita 0d060a8719 [tests-only] [full-ci] add test for downloading space (#6683)
* add test for downloading space

* Add hidden file also

---------

Co-authored-by: amrita <bunnycrestha34@gmail.com>
2023-07-21 00:23:12 +00:00
Salipa Gurungandamrita 0a64a7d85d [tests-only] [full-ci] add test for downloading space (#6683)
* add test for downloading space

* Add hidden file also

---------

Co-authored-by: amrita <bunnycrestha34@gmail.com>
2023-07-20 09:04:11 +00:00
Nalem7 3cdae957ed add test for search by deleted tag (#6845) 2023-07-20 00:20:07 +00:00
Nalem7 300d895250 add test for search by deleted tag (#6845) 2023-07-19 11:03:43 +00:00
Phil Davis 55856b66dd Merge pull request #6843 from owncloud/retry-409-for-given-step-upload-for-stable-3.0
[tests-only] Retry if 409 is received when uploading in a Given step
2023-07-19 04:53:04 +00:00
Phil Davis fb057fc1b3 Merge pull request #6841 from owncloud/backport-search-folder-tag
[tests-only][full-ci] Backport of add scenario for search folder tag
2023-07-19 00:23:31 +00:00
Phil Davis 459528026f Merge pull request #6841 from owncloud/backport-search-folder-tag
[tests-only][full-ci] Backport of add scenario for search folder tag
2023-07-18 12:01:01 +00:00
Amrita f9e74bf075 [tests-only][full-ci]Backport delete notification tests coverage (#6836)
* Add tests for space notification (#6372)

* Add tests for deleting specific notification
2023-07-18 10:41:10 +00:00
Michael Barz b0c51f69b6 fix the s3 secrets for license uploads 2023-07-18 10:32:32 +00:00
Prarup Gurung 18e9b8454d Merge pull request #6833 from owncloud/backport-6796-stable-3.0
[tests-only] [full-ci] retry on 409 - backport 6796 to stable-3.0
2023-07-18 08:56:10 +00:00
Nalem7 2e55bc5c05 add api test for search tag by user (#6834) 2023-07-18 08:22:43 +00:00
Sawjan Gurung f096d37629 ci: split e2e test pipeline (#6817) (#6822) 2023-07-18 00:58:21 +00:00
Sawjan Gurung b675ed2a53 ci: split e2e test pipeline (#6817) (#6822) 2023-07-17 11:24:22 +00:00
Viktor ScharfandJannik Stehle c8496c15ff Port6797 (#6827)
* chore: bump web to v7.1.0-alpha.2

* added FRONTEND_OCS_ENABLE_DENIALS to environment

* try to run full search in ocis CI

---------

Co-authored-by: Jannik Stehle <jannik.stehle@gmail.com>
2023-07-17 10:08:31 +00:00
Karun Atreya c4edba97cc refactor for intermittent test failures on coreApiTrashbin/trashbinDelete.feature (#6807) 2023-07-17 04:11:26 +00:00
Karun Atreya 208aa4bd1e refactor for intermittent test failures on coreApiTrashbin/trashbinDelete.feature (#6807) 2023-07-17 00:56:24 +00:00
Karun Atreya 0d417699b6 refactor for intermittent test failures on coreApiTrashbin/trashbinDelete.feature (#6807) 2023-07-16 00:21:17 +00:00
Karun Atreya 64197f4314 refactor for intermittent test failures on coreApiTrashbin/trashbinDelete.feature (#6807) 2023-07-15 00:57:34 +00:00
Karun Atreya ecfba4d8d3 refactor for intermittent test failures on coreApiTrashbin/trashbinDelete.feature (#6807) 2023-07-14 11:20:59 +00:00
Phil Davis dd75be75d7 Merge pull request #6802 from owncloud/backport/update_expected_to_failure
[tests-only][full-ci]Updated expected to failure for closed issue to new issue
2023-07-14 05:04:23 +00:00
Phil Davis 97cd140f59 Merge pull request #6788 from owncloud/remove-github-comment-from-ci-stable-3.0
[tests-only][full-ci]Remove GitHub comment from ci stable 3.0
2023-07-14 00:57:20 +00:00
Phil Davis f691988ac6 Merge pull request #6788 from owncloud/remove-github-comment-from-ci-stable-3.0
[tests-only][full-ci]Remove GitHub comment from ci stable 3.0
2023-07-13 07:15:34 +00:00
Sawjan Gurung df47efcfc7 bump hugo v0.115.2 for ci (#6789) 2023-07-13 05:44:21 +00:00
Amrita 63ea02a62c Add test for animated gif preview (#6693) 2023-07-11 06:12:15 +00:00
Phil Davis ef95252055 Merge pull request #6749 from owncloud/backpot-remove-special-drone-action-from-ci
[full-ci][tests-only] Backport drone update
2023-07-11 00:45:31 +00:00
Phil Davis c441fdca08 Merge pull request #6749 from owncloud/backpot-remove-special-drone-action-from-ci
[full-ci][tests-only] Backport drone update
2023-07-10 07:19:24 +00:00
nirajacharya2 bcfc6f5b84 added test for mail notification if space admin delete access to space (#6657) 2023-07-10 00:51:09 +00:00
nirajacharya2 06e4dbd155 added test for mail notification if space admin delete access to space (#6657) 2023-07-09 00:24:46 +00:00
nirajacharya2 19dd13a235 added test for mail notification if space admin delete access to space (#6657) 2023-07-08 00:37:37 +00:00
nirajacharya2 c14fbf660d added test for mail notification if space admin delete access to space (#6657) 2023-07-04 11:26:24 +00:00
Prajwol Amatya 3180fc53ad refactor scenario example table (#6711) 2023-07-04 11:16:01 +00:00
Nalem7 95dfc69e0c [tests-only][full-ci]Backport full search test (#6696)
* add api test for search file through tag

* add api test for search file through tag

* review addresses
2023-07-04 03:58:24 +00:00
Sabin Panta dbb5a95bb7 [tests-only] [full-ci] Refactoring unshare step definition code (#6608) (#6679)
*added unshare scenerio

* remove unshare keyword from step definition

* refactoring of step definition codes

* refactor
2023-07-03 06:28:48 +00:00
nirajacharya2 4972c1e224 added test for mail notification in diffrent languages when sharing resources (#6655) 2023-07-03 00:20:04 +00:00
nirajacharya2 6370758879 added test for mail notification in diffrent languages when sharing resources (#6655) 2023-07-02 00:18:53 +00:00
nirajacharya2 d6ef0bc955 added test for mail notification in diffrent languages when sharing resources (#6655) 2023-06-30 06:44:14 +00:00
Prajwol Amatya 6d5089c8e4 [tests-only][full-ci] Backport implementing code refactoring (#6650)
* implement DRY principle

* added response check after file download
2023-06-30 00:19:59 +00:00
Prajwol Amatya 21fda36169 [tests-only][full-ci] Backport implementing code refactoring (#6650)
* implement DRY principle

* added response check after file download
2023-06-29 00:54:09 +00:00
Prajwol Amatya 7ea51d31af [tests-only][full-ci] Backport implementing code refactoring (#6650)
* implement DRY principle

* added response check after file download
2023-06-28 07:19:19 +00:00
Prarup Gurung 95ae8dc37b Merge pull request #6644 from owncloud/bp-mail-group
[tests-only] [full-ci] Test for mail notification to group members if a space is shared
2023-06-28 04:18:11 +00:00
Prarup Gurung d595862515 Merge pull request #6638 from owncloud/test/sharee-checks-file-version
[tests-only] [full-ci] added different roles for sharee
2023-06-27 11:41:00 +00:00
Prarup Gurung 5ad0656405 Merge pull request #6639 from owncloud/bp-av-tests
[tests-only][full-ci] Back port PR's related to antivirus service api tests
2023-06-27 11:07:44 +00:00
Swikriti Tripathi 0af036bd1d [tests-only][full-ci]Add tests for checking response of REPORT request in project spaces (#6622)
* Add tests for checking response of REPORT request in project spaces

* add skip tag

* remove permission check
2023-06-27 07:24:34 +00:00
nirajacharya2andKarun Atreya 4b2d843219 [tests-only][full-ci]added scenario for overwrite file with virus content in a public link (#6586) (#6600) (#6610)
* added scenario for overwrite file with virus content in a public link

* changed sharer overwrite step with public overwrite

Co-authored-by: Karun Atreya <33852651+KarunAtreya@users.noreply.github.com>
2023-06-27 07:09:43 +00:00
Prajwol Amatya a6a872db97 [tests-only][full-ci] Backport enforce password test scenarios (#6598)
* api test to update public link to upload, edit or contribute permission with enforce password enabled

* added test to create public link with enforce password enabled
2023-06-27 00:16:46 +00:00
Prajwol Amatya 009cb35cd7 [tests-only][full-ci] Backport enforce password test scenarios (#6598)
* api test to update public link to upload, edit or contribute permission with enforce password enabled

* added test to create public link with enforce password enabled
2023-06-26 00:55:22 +00:00
Prajwol Amatya 43ed72918b [tests-only][full-ci] Backport enforce password test scenarios (#6598)
* api test to update public link to upload, edit or contribute permission with enforce password enabled

* added test to create public link with enforce password enabled
2023-06-25 00:18:43 +00:00
Prajwol Amatya 044dff2ad5 [tests-only][full-ci] Backport enforce password test scenarios (#6598)
* api test to update public link to upload, edit or contribute permission with enforce password enabled

* added test to create public link with enforce password enabled
2023-06-24 00:19:28 +00:00
Prajwol Amatya 4533e2a2d8 [tests-only][full-ci] Backport enforce password test scenarios (#6598)
* api test to update public link to upload, edit or contribute permission with enforce password enabled

* added test to create public link with enforce password enabled
2023-06-23 05:39:11 +00:00
Swikriti Tripathi 95e4eae0f7 Use different image of clamav in docker compose (#6592) 2023-06-23 00:19:36 +00:00
Swikriti Tripathi af732fb21d Use different image of clamav in docker compose (#6592) 2023-06-22 10:35:29 +00:00
Swikriti TripathiandViktor Scharf 55297d89c3 [tests-only][full-ci]Backport/antivirus refactoring pr (#6585)
* Change testing docs. Antivirus for mac  (#6566)

* run antivirus on mac for localy testing

* start docker withot volumes

* fix

* [tests-only][full-ci] use tcp for antivirus service in ci  (#6573)

* Test antivirus service in ci with different config

* enable other tests and update docker compose files

---------

Co-authored-by: Viktor Scharf <scharf.vi@gmail.com>
2023-06-22 05:23:49 +00:00
Sagar Gurung af51505879 [tests-only][full-ci]Backport spaces max quota second (#6551)
* Added scenarios for quota exceed with API

* skip test on stable-3.0
2023-06-22 00:19:08 +00:00
Sagar Gurung 616d43c872 [tests-only][full-ci]Backport spaces max quota second (#6551)
* Added scenarios for quota exceed with API

* skip test on stable-3.0
2023-06-21 00:17:10 +00:00
Sagar Gurung af9f6d3ac4 [tests-only][full-ci]Backport spaces max quota second (#6551)
* Added scenarios for quota exceed with API

* skip test on stable-3.0
2023-06-20 06:45:57 +00:00
Sabin Panta 057cdc8226 scenerio added only for Deutsch and Spanish language (#6523) (#6534) 2023-06-20 00:19:58 +00:00
Sabin Panta fb03cb4af2 scenerio added only for Deutsch and Spanish language (#6523) (#6534) 2023-06-19 06:52:35 +00:00
Viktor Scharf 0a8544fe6a [full-ci] Port prs from master to stable-3.0 (#6542)
* last space manager cannot change his role

* release template

* changed issue number in changelog

* fix code expectation

* fix

* using Graph instead Of Setting Method In Tests

* delete test

* remove tests from expected failures list
2023-06-19 06:37:20 +00:00
Nalem7andnabim777 a790660e43 [tests-only][full-ci]add test for creating a version file with virus content (#6521)
* add test for creating a version file with virus content

* rebasing

---------

Co-authored-by: nabim777 <“nabinalemagar019@gmail.com”>
2023-06-19 03:37:55 +00:00
Nalem7andnabim777 43069ffdd2 [tests-only][full-ci]add test for creating a version file with virus content (#6521)
* add test for creating a version file with virus content

* rebasing

---------

Co-authored-by: nabim777 <“nabinalemagar019@gmail.com”>
2023-06-19 00:19:45 +00:00
Nalem7andnabim777 b6eaff7f29 [tests-only][full-ci]add test for creating a version file with virus content (#6521)
* add test for creating a version file with virus content

* rebasing

---------

Co-authored-by: nabim777 <“nabinalemagar019@gmail.com”>
2023-06-18 00:20:23 +00:00
Nalem7andnabim777 dabb71feba [tests-only][full-ci]add test for creating a version file with virus content (#6521)
* add test for creating a version file with virus content

* rebasing

---------

Co-authored-by: nabim777 <“nabinalemagar019@gmail.com”>
2023-06-17 00:52:22 +00:00
Nalem7andnabim777 18e34f0b77 [tests-only][full-ci]add test for creating a version file with virus content (#6521)
* add test for creating a version file with virus content

* rebasing

---------

Co-authored-by: nabim777 <“nabinalemagar019@gmail.com”>
2023-06-16 00:54:57 +00:00
Nalem7andnabim777 70392cf7b7 [tests-only][full-ci]add test for creating a version file with virus content (#6521)
* add test for creating a version file with virus content

* rebasing

---------

Co-authored-by: nabim777 <“nabinalemagar019@gmail.com”>
2023-06-15 09:49:03 +00:00
Phil Davis 2acce695af Merge pull request #6508 from owncloud/backport/tests-related-to-antivirus-service
[tests-only][full-ci]Backport/tests related to antivirus service
2023-06-15 00:55:10 +00:00
Phil Davis 78ce27cec0 Merge pull request #6508 from owncloud/backport/tests-related-to-antivirus-service
[tests-only][full-ci]Backport/tests related to antivirus service
2023-06-14 10:47:27 +00:00
Phil Davis 33c1cc73ab Merge pull request #6527 from owncloud/backport_spaces_max_quota
[tests-only][full-ci]Back port spaces max quota feature
2023-06-14 09:37:43 +00:00
Michael Barz fbc2426019 Automated changelog update [skip ci] 2023-06-14 05:35:13 +00:00
Michael Barz 452143d3f1 Automated changelog update [skip ci] 2023-06-14 00:54:00 +00:00
Michael Barz 116bdf8c62 Automated changelog update [skip ci] 2023-06-13 00:16:05 +00:00
Michael Barz bdfe3edb0a Automated changelog update [skip ci] 2023-06-12 00:54:49 +00:00
Michael Barz 8845fbe75f Automated changelog update [skip ci] 2023-06-11 00:19:34 +00:00
Michael Barz a045280e97 Merge pull request #6487 from owncloud/update-web-tests-commit-id-stable
[full-ci] ci: bump web commit id for updated tests (to stable-3.0)
2023-06-10 21:07:13 +00:00
mmattel af2770d60e [docs-only] Fixing some envvar issues 2023-06-09 13:06:41 +02:00
Michael Barz 8ee22c1eab Automated changelog update [skip ci] 2023-06-09 03:23:09 +00:00
Michael Barz 3b0a3de7ed Automated changelog update [skip ci] 2023-06-08 00:19:35 +00:00
Michael Barz 84d397297d fix changelog push target branch 2023-06-07 18:19:03 +00:00
Michael Barz 6afa9195b3 refactor test dependencies 2023-06-07 18:12:41 +00:00
Michael Barz ea75eca6a3 fix changelog push target branch 2023-06-07 17:44:20 +00:00
Michael Barz c50811a669 refactor test dependencies 2023-06-07 17:37:53 +00:00
379 changed files with 6168 additions and 44619 deletions

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@ Before you start reading, if you are interested in:
- deployment examples,
- detailed settings and more
we would recommend to continue with the [ownCloud Admin Documentation for Infinite Scale](https://doc.owncloud.com/ocis/latest/).
we would recommend to continue with the [ownCloud Admin Documentation for Infinite Scale](https://doc.owncloud.com/ocis/next/).
## Developer Documentation
@@ -39,7 +39,7 @@ You can also find all client sources on [GitHub](https://github.com/owncloud/).
The [server repository](https://github.com/owncloud/ocis) on [GitHub](https://www.github.com) is a good entry point to the oCIS project. In addition to that there are also ownCloud projects for clients for [iOS](https://github.com/owncloud/ios-app), [Android](https://github.com/owncloud/android), the major [Desktop](https://github.com/owncloud/desktop) platforms and [ownCloud Web](https://github.com/owncloud/web).
To chat about development, join our public chat on [matrix: ownCloud Infinite Scale](https://matrix.to/#/#ocis:matrix.org).
To chat about development, [join our public chat](https://talk.owncloud.com/channel/ocis)
If you want to help and improve ownCloud or oCIS, start coding or open issues on GitHub in the related repository.
@@ -1,45 +0,0 @@
---
title: "ocis.messages.eventhistory.v0"
url: /apis/grpc_apis/ocis_messages_eventhistory_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/messages/eventhistory/v0/eventhistory.proto
### Event
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [string](#string) | | REQUIRED. |
| id | [string](#string) | | REQUIRED. |
| event | [bytes](#bytes) | | REQUIRED |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,104 +0,0 @@
---
title: "ocis.messages.policies.v0"
url: /apis/grpc_apis/ocis_messages_policies_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/messages/policies/v0/policies.proto
### Environment
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| stage | [Stage](#stage) | | |
| user | [User](#user) | | |
| request | [Request](#request) | | |
| resource | [Resource](#resource) | | |
### Request
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| method | [string](#string) | | |
| path | [string](#string) | | |
### Resource
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [Resource.ID](#resourceid) | | |
| name | [string](#string) | | |
| size | [uint64](#uint64) | | |
| url | [string](#string) | | |
### Resource.ID
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| storage_id | [string](#string) | | |
| opaque_id | [string](#string) | | |
| space_id | [string](#string) | | |
### User
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [User.ID](#userid) | | |
| username | [string](#string) | | |
| mail | [string](#string) | | |
| display_name | [string](#string) | | |
| groups | [string](#string) | repeated | |
### User.ID
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| opaque_id | [string](#string) | | |
### Stage
| Name | Number | Description |
| ---- | ------ | ----------- |
| STAGE_PP | 0 | |
| STAGE_HTTP | 1 | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,147 +0,0 @@
---
title: "ocis.messages.search.v0"
url: /apis/grpc_apis/ocis_messages_search_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/messages/search/v0/search.proto
### Audio
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| album | [string](#string) | optional | |
| albumArtist | [string](#string) | optional | |
| artist | [string](#string) | optional | |
| bitrate | [int64](#int64) | optional | |
| composers | [string](#string) | optional | |
| copyright | [string](#string) | optional | |
| disc | [int32](#int32) | optional | |
| discCount | [int32](#int32) | optional | |
| duration | [int64](#int64) | optional | |
| genre | [string](#string) | optional | |
| hasDrm | [bool](#bool) | optional | |
| isVariableBitrate | [bool](#bool) | optional | |
| title | [string](#string) | optional | |
| track | [int32](#int32) | optional | |
| trackCount | [int32](#int32) | optional | |
| year | [int32](#int32) | optional | |
### Entity
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ref | [Reference](#reference) | | |
| id | [ResourceID](#resourceid) | | |
| name | [string](#string) | | |
| etag | [string](#string) | | |
| size | [uint64](#uint64) | | |
| last_modified_time | [google.protobuf.Timestamp](#googleprotobuftimestamp) | | |
| mime_type | [string](#string) | | |
| permissions | [string](#string) | | |
| type | [uint64](#uint64) | | |
| deleted | [bool](#bool) | | |
| shareRootName | [string](#string) | | |
| parent_id | [ResourceID](#resourceid) | | |
| tags | [string](#string) | repeated | |
| highlights | [string](#string) | | |
| audio | [Audio](#audio) | | |
| location | [GeoCoordinates](#geocoordinates) | | |
| remote_item_id | [ResourceID](#resourceid) | | |
| image | [Image](#image) | | |
| photo | [Photo](#photo) | | |
### GeoCoordinates
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| altitude | [double](#double) | optional | |
| latitude | [double](#double) | optional | |
| longitude | [double](#double) | optional | |
### Image
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| width | [int32](#int32) | optional | |
| height | [int32](#int32) | optional | |
### Match
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| entity | [Entity](#entity) | | the matched entity |
| score | [float](#float) | | the match score |
### Photo
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| cameraMake | [string](#string) | optional | |
| cameraModel | [string](#string) | optional | |
| exposureDenominator | [float](#float) | optional | |
| exposureNumerator | [float](#float) | optional | |
| fNumber | [float](#float) | optional | |
| focalLength | [float](#float) | optional | |
| iso | [int32](#int32) | optional | |
| orientation | [int32](#int32) | optional | |
| takenDateTime | [google.protobuf.Timestamp](#googleprotobuftimestamp) | optional | |
### Reference
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| resource_id | [ResourceID](#resourceid) | | |
| path | [string](#string) | | |
### ResourceID
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| storage_id | [string](#string) | | |
| opaque_id | [string](#string) | | |
| space_id | [string](#string) | | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,322 +0,0 @@
---
title: "ocis.messages.settings.v0"
url: /apis/grpc_apis/ocis_messages_settings_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/messages/settings/v0/settings.proto
### Bool
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| default | [bool](#bool) | | @gotags: yaml:"default" |
| label | [string](#string) | | @gotags: yaml:"label" |
### Bundle
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | @gotags: yaml:"id" |
| name | [string](#string) | | @gotags: yaml:"name" |
| type | [Bundle.Type](#bundletype) | | @gotags: yaml:"type" |
| extension | [string](#string) | | @gotags: yaml:"extension" |
| display_name | [string](#string) | | @gotags: yaml:"display_name" |
| settings | [Setting](#setting) | repeated | @gotags: yaml:"settings" |
| resource | [Resource](#resource) | | @gotags: yaml:"resource" |
### CollectionOption
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | required<br><br>@gotags: yaml:"key" |
| int_value | [int64](#int64) | | @gotags: yaml:"int_value" |
| string_value | [string](#string) | | @gotags: yaml:"string_value" |
| bool_value | [bool](#bool) | | @gotags: yaml:"bool_value" |
### CollectionValue
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| values | [CollectionOption](#collectionoption) | repeated | @gotags: yaml:"values" |
### Identifier
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| extension | [string](#string) | | |
| bundle | [string](#string) | | |
| setting | [string](#string) | | |
### Int
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| default | [int64](#int64) | | @gotags: yaml:"default" |
| min | [int64](#int64) | | @gotags: yaml:"min" |
| max | [int64](#int64) | | @gotags: yaml:"max" |
| step | [int64](#int64) | | @gotags: yaml:"step" |
| placeholder | [string](#string) | | @gotags: yaml:"placeholder" |
### ListOption
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ListOptionValue](#listoptionvalue) | | @gotags: yaml:"value" |
| default | [bool](#bool) | | @gotags: yaml:"default" |
| display_value | [string](#string) | | @gotags: yaml:"display_value" |
### ListOptionValue
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| string_value | [string](#string) | | @gotags: yaml:"string_value" |
| int_value | [int64](#int64) | | @gotags: yaml:"int_value" |
| bool_value | [bool](#bool) | | @gotags: yaml:"bool_value" |
### ListValue
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| values | [ListOptionValue](#listoptionvalue) | repeated | @gotags: yaml:"values" |
### MultiChoiceCollection
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| options | [MultiChoiceCollectionOption](#multichoicecollectionoption) | repeated | @gotags: yaml:"options" |
### MultiChoiceCollectionOption
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [MultiChoiceCollectionOptionValue](#multichoicecollectionoptionvalue) | | @gotags: yaml:"value" |
| key | [string](#string) | | @gotags: yaml:"key" |
| attribute | [string](#string) | | @gotags: yaml:"attribute" |
| display_value | [string](#string) | | @gotags: yaml:"display_value" |
### MultiChoiceCollectionOptionValue
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| int_value | [Int](#int) | | @gotags: yaml:"int_value" |
| string_value | [String](#string) | | @gotags: yaml:"string_value" |
| bool_value | [Bool](#bool) | | @gotags: yaml:"bool_value" |
### MultiChoiceList
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| options | [ListOption](#listoption) | repeated | @gotags: yaml:"options" |
### Permission
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| operation | [Permission.Operation](#permissionoperation) | | @gotags: yaml:"operation" |
| constraint | [Permission.Constraint](#permissionconstraint) | | @gotags: yaml:"constraint" |
### Resource
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [Resource.Type](#resourcetype) | | |
| id | [string](#string) | | |
### Setting
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | @gotags: yaml:"id" |
| name | [string](#string) | | @gotags: yaml:"name" |
| display_name | [string](#string) | | @gotags: yaml:"display_name" |
| description | [string](#string) | | @gotags: yaml:"description" |
| int_value | [Int](#int) | | @gotags: yaml:"int_value" |
| string_value | [String](#string) | | @gotags: yaml:"string_value" |
| bool_value | [Bool](#bool) | | @gotags: yaml:"bool_value" |
| single_choice_value | [SingleChoiceList](#singlechoicelist) | | @gotags: yaml:"single_choice_value" |
| multi_choice_value | [MultiChoiceList](#multichoicelist) | | @gotags: yaml:"multi_choice_value" |
| permission_value | [Permission](#permission) | | @gotags: yaml:"permission_value" |
| multi_choice_collection_value | [MultiChoiceCollection](#multichoicecollection) | | @gotags: yaml:"multi_choice_collection_value" |
| resource | [Resource](#resource) | | @gotags: yaml:"resource" |
### SingleChoiceList
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| options | [ListOption](#listoption) | repeated | @gotags: yaml:"options" |
### String
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| default | [string](#string) | | @gotags: yaml:"default" |
| required | [bool](#bool) | | @gotags: yaml:"required" |
| min_length | [int32](#int32) | | @gotags: yaml:"min_length" |
| max_length | [int32](#int32) | | @gotags: yaml:"max_length" |
| placeholder | [string](#string) | | @gotags: yaml:"placeholder" |
### UserRoleAssignment
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | id is generated upon saving the assignment |
| account_uuid | [string](#string) | | |
| role_id | [string](#string) | | the role_id is a bundle_id internally |
### UserRoleAssignmentFilter
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [UserRoleAssignmentFilter.Type](#userroleassignmentfiltertype) | | |
| account_uuid | [string](#string) | | |
| role_id | [string](#string) | | |
### Value
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | id is the id of the Value. It is generated on saving it.<br><br>@gotags: yaml:"id" |
| bundle_id | [string](#string) | | @gotags: yaml:"bundle_id" |
| setting_id | [string](#string) | | setting_id is the id of the setting from within its bundle.<br><br>@gotags: yaml:"setting_id" |
| account_uuid | [string](#string) | | @gotags: yaml:"account_uuid" |
| resource | [Resource](#resource) | | @gotags: yaml:"resource" |
| bool_value | [bool](#bool) | | @gotags: yaml:"bool_value" |
| int_value | [int64](#int64) | | @gotags: yaml:"int_value" |
| string_value | [string](#string) | | @gotags: yaml:"string_value" |
| list_value | [ListValue](#listvalue) | | @gotags: yaml:"list_value" |
| collection_value | [CollectionValue](#collectionvalue) | | @gotags: yaml:"collection_value" |
### ValueWithIdentifier
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| identifier | [Identifier](#identifier) | | |
| value | [Value](#value) | | |
### Bundle.Type
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNKNOWN | 0 | |
| TYPE_DEFAULT | 1 | |
| TYPE_ROLE | 2 | |
### Permission.Constraint
| Name | Number | Description |
| ---- | ------ | ----------- |
| CONSTRAINT_UNKNOWN | 0 | |
| CONSTRAINT_OWN | 1 | |
| CONSTRAINT_SHARED | 2 | |
| CONSTRAINT_ALL | 3 | |
### Permission.Operation
| Name | Number | Description |
| ---- | ------ | ----------- |
| OPERATION_UNKNOWN | 0 | |
| OPERATION_CREATE | 1 | |
| OPERATION_READ | 2 | |
| OPERATION_UPDATE | 3 | |
| OPERATION_DELETE | 4 | |
| OPERATION_WRITE | 5 | WRITE is a combination of CREATE and UPDATE |
| OPERATION_READWRITE | 6 | READWRITE is a combination of READ and WRITE |
### Resource.Type
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNKNOWN | 0 | |
| TYPE_SYSTEM | 1 | |
| TYPE_FILE | 2 | |
| TYPE_SHARE | 3 | |
| TYPE_SETTING | 4 | |
| TYPE_BUNDLE | 5 | |
| TYPE_USER | 6 | |
| TYPE_GROUP | 7 | |
### UserRoleAssignmentFilter.Type
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNKNOWN | 0 | |
| TYPE_ACCOUNT | 1 | |
| TYPE_ROLE | 2 | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,120 +0,0 @@
---
title: "ocis.messages.store.v0"
url: /apis/grpc_apis/ocis_messages_store_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/messages/store/v0/store.proto
### DeleteOptions
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| database | [string](#string) | | |
| table | [string](#string) | | |
### Field
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [string](#string) | | type of value e.g string, int, int64, bool, float64 |
| value | [string](#string) | | the actual value |
### ListOptions
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| database | [string](#string) | | |
| table | [string](#string) | | |
| prefix | [string](#string) | | |
| suffix | [string](#string) | | |
| limit | [uint64](#uint64) | | |
| offset | [uint64](#uint64) | | |
### ReadOptions
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| database | [string](#string) | | |
| table | [string](#string) | | |
| prefix | [bool](#bool) | | |
| suffix | [bool](#bool) | | |
| limit | [uint64](#uint64) | | |
| offset | [uint64](#uint64) | | |
| where | [ReadOptions.WhereEntry](#readoptionswhereentry) | repeated | |
### ReadOptions.WhereEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [Field](#field) | | |
### Record
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | key of the recorda |
| value | [bytes](#bytes) | | value in the record |
| expiry | [int64](#int64) | | time.Duration (signed int64 nanoseconds) |
| metadata | [Record.MetadataEntry](#recordmetadataentry) | repeated | the associated metadata |
### Record.MetadataEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [Field](#field) | | |
### WriteOptions
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| database | [string](#string) | | |
| table | [string](#string) | | |
| expiry | [int64](#int64) | | time.Time |
| ttl | [int64](#int64) | | time.Duration |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,65 +0,0 @@
---
title: "ocis.messages.thumbnails.v0"
url: /apis/grpc_apis/ocis_messages_thumbnails_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/messages/thumbnails/v0/thumbnails.proto
### CS3Source
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| path | [string](#string) | | |
| authorization | [string](#string) | | |
### WebdavSource
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| url | [string](#string) | | REQUIRED. |
| is_public_link | [bool](#bool) | | REQUIRED. |
| webdav_authorization | [string](#string) | | OPTIONAL. |
| reva_authorization | [string](#string) | | OPTIONAL. |
| public_link_token | [string](#string) | | OPTIONAL. |
### ThumbnailType
The file types to which the thumbnail can be encoded to.
| Name | Number | Description |
| ---- | ------ | ----------- |
| PNG | 0 | Represents PNG type |
| JPG | 1 | Represents JPG type |
| GIF | 2 | Represents GIF type |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,68 +0,0 @@
---
title: "ocis.services.eventhistory.v0"
url: /apis/grpc_apis/ocis_services_eventhistory_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/services/eventhistory/v0/eventhistory.proto
### GetEventsForUserRequest
A request to retrieve events belonging to a userID
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| userID | [string](#string) | | the userID of the events we want to get |
### GetEventsRequest
A request to retrieve events
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ids | [string](#string) | repeated | the ids of the events we want to get |
### GetEventsResponse
The service response
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| events | [ocis.messages.eventhistory.v0.Event](/apis/grpc_apis/ocis_messages_eventhistory_v0/#event) | repeated | |
### EventHistoryService
A Service for storing events
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| GetEvents | [GetEventsRequest](#geteventsrequest) | [GetEventsResponse](#geteventsresponse) | returns the specified events |
| GetEventsForUser | [GetEventsForUserRequest](#geteventsforuserrequest) | [GetEventsResponse](#geteventsresponse) | returns all events for the specified userID |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,60 +0,0 @@
---
title: "ocis.services.policies.v0"
url: /apis/grpc_apis/ocis_services_policies_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/services/policies/v0/policies.proto
### EvaluateRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| query | [string](#string) | | |
| environment | [ocis.messages.policies.v0.Environment](/apis/grpc_apis/ocis_messages_policies_v0/#environment) | | |
### EvaluateResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| result | [bool](#bool) | | |
### policiesProvider
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Evaluate | [EvaluateRequest](#evaluaterequest) | [EvaluateResponse](#evaluateresponse) | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,108 +0,0 @@
---
title: "ocis.services.search.v0"
url: /apis/grpc_apis/ocis_services_search_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/services/search/v0/search.proto
### IndexSpaceRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| space_id | [string](#string) | | |
| user_id | [string](#string) | | |
### IndexSpaceResponse
### SearchIndexRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page_size | [int32](#int32) | | Optional. The maximum number of entries to return in the response |
| page_token | [string](#string) | | Optional. A pagination token returned from a previous call to `Get`<br>that indicates from where search should continue |
| query | [string](#string) | | |
| ref | [ocis.messages.search.v0.Reference](/apis/grpc_apis/ocis_messages_search_v0/#reference) | | |
### SearchIndexResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| matches | [ocis.messages.search.v0.Match](/apis/grpc_apis/ocis_messages_search_v0/#match) | repeated | |
| next_page_token | [string](#string) | | Token to retrieve the next page of results, or empty if there are no<br>more results in the list |
| total_matches | [int32](#int32) | | |
### SearchRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page_size | [int32](#int32) | | Optional. The maximum number of entries to return in the response |
| page_token | [string](#string) | | Optional. A pagination token returned from a previous call to `Get`<br>that indicates from where search should continue |
| query | [string](#string) | | |
| ref | [ocis.messages.search.v0.Reference](/apis/grpc_apis/ocis_messages_search_v0/#reference) | | |
### SearchResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| matches | [ocis.messages.search.v0.Match](/apis/grpc_apis/ocis_messages_search_v0/#match) | repeated | |
| next_page_token | [string](#string) | | Token to retrieve the next page of results, or empty if there are no<br>more results in the list |
| total_matches | [int32](#int32) | | |
### IndexProvider
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Search | [SearchIndexRequest](#searchindexrequest) | [SearchIndexResponse](#searchindexresponse) | |
### SearchProvider
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Search | [SearchRequest](#searchrequest) | [SearchResponse](#searchresponse) | |
| IndexSpace | [IndexSpaceRequest](#indexspacerequest) | [IndexSpaceResponse](#indexspaceresponse) | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,312 +0,0 @@
---
title: "ocis.services.settings.v0"
url: /apis/grpc_apis/ocis_services_settings_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/services/settings/v0/settings.proto
### AddSettingToBundleRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
| setting | [ocis.messages.settings.v0.Setting](/apis/grpc_apis/ocis_messages_settings_v0/#setting) | | |
### AddSettingToBundleResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| setting | [ocis.messages.settings.v0.Setting](/apis/grpc_apis/ocis_messages_settings_v0/#setting) | | |
### AssignRoleToUserRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| account_uuid | [string](#string) | | |
| role_id | [string](#string) | | the role_id is a bundle_id internally |
### AssignRoleToUserResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| assignment | [ocis.messages.settings.v0.UserRoleAssignment](/apis/grpc_apis/ocis_messages_settings_v0/#userroleassignment) | | |
### GetBundleRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
### GetBundleResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle | [ocis.messages.settings.v0.Bundle](/apis/grpc_apis/ocis_messages_settings_v0/#bundle) | | |
### GetPermissionByIDRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission_id | [string](#string) | | |
### GetPermissionByIDResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission | [ocis.messages.settings.v0.Permission](/apis/grpc_apis/ocis_messages_settings_v0/#permission) | | |
### GetValueByUniqueIdentifiersRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| account_uuid | [string](#string) | | |
| setting_id | [string](#string) | | |
### GetValueRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | |
### GetValueResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ocis.messages.settings.v0.ValueWithIdentifier](/apis/grpc_apis/ocis_messages_settings_v0/#valuewithidentifier) | | |
### ListBundlesRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_ids | [string](#string) | repeated | |
| locale | [string](#string) | | |
### ListBundlesResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundles | [ocis.messages.settings.v0.Bundle](/apis/grpc_apis/ocis_messages_settings_v0/#bundle) | repeated | |
### ListPermissionsByResourceRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| resource | [ocis.messages.settings.v0.Resource](/apis/grpc_apis/ocis_messages_settings_v0/#resource) | | |
### ListPermissionsByResourceResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permissions | [ocis.messages.settings.v0.Permission](/apis/grpc_apis/ocis_messages_settings_v0/#permission) | repeated | |
### ListPermissionsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| account_uuid | [string](#string) | | |
### ListPermissionsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permissions | [string](#string) | repeated | |
### ListRoleAssignmentsFilteredRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| filters | [ocis.messages.settings.v0.UserRoleAssignmentFilter](/apis/grpc_apis/ocis_messages_settings_v0/#userroleassignmentfilter) | repeated | |
### ListRoleAssignmentsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| account_uuid | [string](#string) | | |
### ListRoleAssignmentsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| assignments | [ocis.messages.settings.v0.UserRoleAssignment](/apis/grpc_apis/ocis_messages_settings_v0/#userroleassignment) | repeated | |
### ListValuesRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
| account_uuid | [string](#string) | | |
### ListValuesResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| values | [ocis.messages.settings.v0.ValueWithIdentifier](/apis/grpc_apis/ocis_messages_settings_v0/#valuewithidentifier) | repeated | |
### RemoveRoleFromUserRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | |
### RemoveSettingFromBundleRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
| setting_id | [string](#string) | | |
### SaveBundleRequest
---
requests and responses for settings bundles
---
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle | [ocis.messages.settings.v0.Bundle](/apis/grpc_apis/ocis_messages_settings_v0/#bundle) | | |
### SaveBundleResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle | [ocis.messages.settings.v0.Bundle](/apis/grpc_apis/ocis_messages_settings_v0/#bundle) | | |
### SaveValueRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ocis.messages.settings.v0.Value](/apis/grpc_apis/ocis_messages_settings_v0/#value) | | |
### SaveValueResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ocis.messages.settings.v0.ValueWithIdentifier](/apis/grpc_apis/ocis_messages_settings_v0/#valuewithidentifier) | | |
### BundleService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| SaveBundle | [SaveBundleRequest](#savebundlerequest) | [SaveBundleResponse](#savebundleresponse) | |
| GetBundle | [GetBundleRequest](#getbundlerequest) | [GetBundleResponse](#getbundleresponse) | |
| ListBundles | [ListBundlesRequest](#listbundlesrequest) | [ListBundlesResponse](#listbundlesresponse) | |
| AddSettingToBundle | [AddSettingToBundleRequest](#addsettingtobundlerequest) | [AddSettingToBundleResponse](#addsettingtobundleresponse) | |
| RemoveSettingFromBundle | [RemoveSettingFromBundleRequest](#removesettingfrombundlerequest) | [.google.protobuf.Empty](#googleprotobufempty) | |
### PermissionService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ListPermissions | [ListPermissionsRequest](#listpermissionsrequest) | [ListPermissionsResponse](#listpermissionsresponse) | |
| ListPermissionsByResource | [ListPermissionsByResourceRequest](#listpermissionsbyresourcerequest) | [ListPermissionsByResourceResponse](#listpermissionsbyresourceresponse) | |
| GetPermissionByID | [GetPermissionByIDRequest](#getpermissionbyidrequest) | [GetPermissionByIDResponse](#getpermissionbyidresponse) | |
### RoleService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ListRoles | [ListBundlesRequest](#listbundlesrequest) | [ListBundlesResponse](#listbundlesresponse) | |
| ListRoleAssignments | [ListRoleAssignmentsRequest](#listroleassignmentsrequest) | [ListRoleAssignmentsResponse](#listroleassignmentsresponse) | |
| ListRoleAssignmentsFiltered | [ListRoleAssignmentsFilteredRequest](#listroleassignmentsfilteredrequest) | [ListRoleAssignmentsResponse](#listroleassignmentsresponse) | |
| AssignRoleToUser | [AssignRoleToUserRequest](#assignroletouserrequest) | [AssignRoleToUserResponse](#assignroletouserresponse) | |
| RemoveRoleFromUser | [RemoveRoleFromUserRequest](#removerolefromuserrequest) | [.google.protobuf.Empty](#googleprotobufempty) | |
### ValueService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| SaveValue | [SaveValueRequest](#savevaluerequest) | [SaveValueResponse](#savevalueresponse) | |
| GetValue | [GetValueRequest](#getvaluerequest) | [GetValueResponse](#getvalueresponse) | |
| ListValues | [ListValuesRequest](#listvaluesrequest) | [ListValuesResponse](#listvaluesresponse) | |
| GetValueByUniqueIdentifiers | [GetValueByUniqueIdentifiersRequest](#getvaluebyuniqueidentifiersrequest) | [GetValueResponse](#getvalueresponse) | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,138 +0,0 @@
---
title: "ocis.services.store.v0"
url: /apis/grpc_apis/ocis_services_store_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/services/store/v0/store.proto
### DatabasesRequest
### DatabasesResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| databases | [string](#string) | repeated | |
### DeleteRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| options | [ocis.messages.store.v0.DeleteOptions](/apis/grpc_apis/ocis_messages_store_v0/#deleteoptions) | | |
### DeleteResponse
### ListRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| options | [ocis.messages.store.v0.ListOptions](/apis/grpc_apis/ocis_messages_store_v0/#listoptions) | | |
### ListResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| keys | [string](#string) | repeated | |
### ReadRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| options | [ocis.messages.store.v0.ReadOptions](/apis/grpc_apis/ocis_messages_store_v0/#readoptions) | | |
### ReadResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| records | [ocis.messages.store.v0.Record](/apis/grpc_apis/ocis_messages_store_v0/#record) | repeated | |
### TablesRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| database | [string](#string) | | |
### TablesResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| tables | [string](#string) | repeated | |
### WriteRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| record | [ocis.messages.store.v0.Record](/apis/grpc_apis/ocis_messages_store_v0/#record) | | |
| options | [ocis.messages.store.v0.WriteOptions](/apis/grpc_apis/ocis_messages_store_v0/#writeoptions) | | |
### WriteResponse
### Store
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Read | [ReadRequest](#readrequest) | [ReadResponse](#readresponse) | |
| Write | [WriteRequest](#writerequest) | [WriteResponse](#writeresponse) | |
| Delete | [DeleteRequest](#deleterequest) | [DeleteResponse](#deleteresponse) | |
| List | [ListRequest](#listrequest) | [ListResponse](#listresponse) stream | |
| Databases | [DatabasesRequest](#databasesrequest) | [DatabasesResponse](#databasesresponse) | |
| Tables | [TablesRequest](#tablesrequest) | [TablesResponse](#tablesresponse) | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
@@ -1,67 +0,0 @@
---
title: "ocis.services.thumbnails.v0"
url: /apis/grpc_apis/ocis_services_thumbnails_v0
date: 2026-03-23T00:10:32Z
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
---
{{< toc >}}
## ocis/services/thumbnails/v0/thumbnails.proto
### GetThumbnailRequest
A request to retrieve a thumbnail
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| filepath | [string](#string) | | The path to the source image |
| thumbnail_type | [ocis.messages.thumbnails.v0.ThumbnailType](/apis/grpc_apis/ocis_messages_thumbnails_v0/#thumbnailtype) | | The type to which the thumbnail should get encoded to. |
| width | [int32](#int32) | | The width of the thumbnail |
| height | [int32](#int32) | | The height of the thumbnail |
| processor | [string](#string) | | Indicates which image processor to use |
| webdav_source | [ocis.messages.thumbnails.v0.WebdavSource](/apis/grpc_apis/ocis_messages_thumbnails_v0/#webdavsource) | | |
| cs3_source | [ocis.messages.thumbnails.v0.CS3Source](/apis/grpc_apis/ocis_messages_thumbnails_v0/#cs3source) | | |
### GetThumbnailResponse
The service response
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| data_endpoint | [string](#string) | | The endpoint where the thumbnail can be downloaded. |
| transfer_token | [string](#string) | | The transfer token to be able to download the thumbnail. |
| mimetype | [string](#string) | | The mimetype of the thumbnail |
### ThumbnailService
A Service for handling thumbnail generation
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| GetThumbnail | [GetThumbnailRequest](#getthumbnailrequest) | [GetThumbnailResponse](#getthumbnailresponse) | Generates the thumbnail and returns it. |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |
-142
View File
@@ -1,142 +0,0 @@
---
title: Authorization
weight: 40
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/
geekdocFilePath: authorization.md
---
In its default configuration, Infinite Scale supports three authentication methods as outlined on the [OIDC official site](https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3):
1. Authorization Code Flow
2. Implicit Flow
3. Hybrid Flow
For detailed information on Infinite Scale's support for OpenID Connect (OIDC), please consult the [OIDC section](https://owncloud.dev/ocis/identity-provider/oidc).
To authenticate a client app using OIDC, both `client_id` and `client_secret` are essential. Infinite Scale does not offer dynamic registration. The required data for the default [ownCloud clients](https://doc.owncloud.com/server/next/admin_manual/configuration/user/oidc/oidc.html#client-ids-secrets-and-redirect-uris) can be found in the link and are availble for the following apps:
- Desktop
- Android
- iOS
While selecting an ownCloud client for authentication, take note of specific limitations such as the `Redirect URI`:
| Source | Redirect URI |
|------|--------|
|Android|oc://android.owncloud.com|
|iOS|oc://ios.owncloud.com|
|Desktop|http://127.0.0.1 <br> http://localhost |
In this example, the desktop app's `client_id` and `client_secret` are being used.
```bash
client_id=xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69
client_secret=UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh
```
## Authorization Code Flow
1. Requesting authorization
To initiate the OIDC Code Flow, you can use tools like curl and a web browser.
The user should be directed to a URL to authenticate and give their consent (bypassing consent is against the standard):
```plaintext
https://ocis.test/signin/v1/identifier/_/authorize?client_id=client_id&scope=openid+profile+email+offline_access&response_type=code&redirect_uri=http://path-to-redirect-uri
```
After a successful authentication, the browser will redirect to a URL that looks like this:
```plaintext
http://path-to-redirect-uri?code=mfWsjEL0mc8gx0ftF9LFkGb__uFykaBw&scope=openid%20profile%20email%20offline_access&session_state=32b08dd...&state=
```
For the next step extract the code from the URL.
In the above example,
the code is `mfWsjEL0mc8gx0ftF9LFkGb__uFykaBw`
2. Requesting an access token
The next step in the OIDC Code Flow involves an HTTP POST request
to the token endpoint of the **Infinite Scale Identity Server**.
```bash
curl -vk -X POST https://ocis.test/konnect/v1/token \
-d "grant_type=authorization_code" \
-d "code=3a3PTcO-WWXfN3l1mDN4u7G5PzWFxatU" \
-d "redirect_uri=http:path-to-redirect-uri" \
-d "client_id=client_id" \
-d "client_secret=client_secret"
```
Response looks like this:
```json
{
"access_token": "eyJhbGciOid...",
"token_type": "Bearer",
"id_token": "eyJhbGciOi...",
"refresh_token": "eyJhbGciOiJ...",
"expires_in": 300
}
```
3. Refreshing an access token
If the access token has expired, you can get a new one using the refresh token.
```bash
curl -vk -X POST https://ocis.test/konnect/v1/token \
-d "grant_type=refresh_token" \
-d "refresh_token=eyJhbGciOiJ..." \
-d "redirect_uri=http://path-to-redirect-uri" \
-d "client_id=client_id" \
-d "client_secret=client_secret"
```
Response looks like this:
```json
{
"access_token": "eyJhbGciOi...",
"token_type": "Bearer",
"expires_in": 300
}
```
## Implicit Code Flow
When using the implicit flow, tokens are provided in a URI fragment of the redirect URL.
Valid values for the `response_type` request parameter are:
- token
- id_token token
{{< hint type=warning title="Important Warning" >}}
If you are using the implicit flow, `nonce` parameter is required in the initial `/authorize` request.
`nonce=pL3UkpAQPZ8bTMGYOmxHY/dQABin8yrqipZ7iN0PY18=`
bash command to generate cryptographically random value
```bash
openssl rand -base64 32
```
{{< /hint >}}
The user should be directed to a URL to authenticate and give their consent (bypassing consent is against the standard):
```bash
https://ocis.test/signin/v1/identifier/_/authorize?client_id=client_id&scope=openid+profile+email+offline_access&response_type=id_token+token&redirect_uri=http://path-to-redirect-uri&nonce=pL3UkpAQPZ8bTMGYOmxHY/dQABin8yrqipZ7iN0PY18=
```
After a successful authentication, the browser will redirect to a URL that looks like this:
```bash
http://path-to-redirect-uri#access_token=eyJhbGciOiJQUzI...&expires_in=300&id_token=eyJhbGciOiJ...&scope=email%20openid%20profile&session_state=c8a1019f5e054d...&state=&token_type=Bearer
```
For the next step, extract the access_token from the URL.
```bash
access_token = 'eyJhbGciOiJQ...'
```
## Hybrid Flow
The Hybrid Flow in OpenID Connect melds features from both the Implicit and Authorization Code flows. It allows clients to directly retrieve certain tokens from the Authorization Endpoint, yet also offers the option to acquire additional tokens from the Token Endpoint.
The Authorization Server redirects back to the client with appropriate parameters in the response, based on the value of the response_type request parameter:
- code token
- code id_token
- code id_token token
-184
View File
@@ -1,184 +0,0 @@
---
title: Permissions
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/graph
geekdocFilePath: permissions.md
---
{{< toc >}}
## Permissions API
The Permissions API is implementing a subset of the functionality of the
[MS Graph Permission resource](https://learn.microsoft.com/en-us/graph/api/resources/permission?view=graph-rest-1.0).
### Example Permissions
The JSON representation of a Drive, as handled by the Spaces API, looks like this:
````json
{
"@libre.graph.permissions.roles.allowedValues": [
{
"id": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5",
"description": "Allows reading the shared file or folder",
"displayName": "Viewer",
"@libre.graph.weight": 1
},
{
"id": "fb6c3e19-e378-47e5-b277-9732f9de6e21",
"description": "Allows reading and writing the shared file or folder",
"displayName": "Editor",
"@libre.graph.weight": 2
},
{
"id": "312c0871-5ef7-4b3a-85b6-0e4074c64049",
"description": "Allows managing a space",
"displayName": "Manager",
"@libre.graph.weight": 3
},
{
"id": "4916f47e-66d5-49bb-9ac9-748ad00334b",
"description": "Allows creating new files",
"displayName": "File Drop",
"@libre.graph.weight": 4
}
],
"@libre.graph.permissions.actions.allowedValues": [
"libre.graph/driveItem/basic/read",
"libre.graph/driveItem/permissions/read",
"libre.graph/driveItem/upload/create",
"libre.graph/driveItem/standard/allTasks",
"libre.graph/driveItem/upload/create"
],
"value": [
{
"id": "67445fde-a647-4dd4-b015-fc5dafd2821d",
"link": {
"type": "view",
"webUrl": "https://cloud.example.org/s/fhGBMIkKFEHWysj"
}
},
{
"id": "34646ab6-be32-43c9-89e6-987e0c237e9b",
"roles": [
"b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
],
"grantedToV2": [
{
"user": {
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"displayName": "Albert Einstein"
}
}
]
},
{
"id": "81d5bad3-3eff-410a-a2ea-eda2d14d4474",
"roles": [
"b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
],
"grantedToV2": [
{
"user": {
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"displayName": "Albert Einstein"
}
}
]
},
{
"id": "b470677e-a7f5-4304-8ef5-f5056a21fff1",
"roles": [
"b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
],
"grantedToV2": [
{
"user": {
"id": "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c",
"displayName": "Marie Skłodowska Curie"
}
}
]
},
{
"id": "453b02be-4ec2-4e7d-b576-09fc153de812",
"roles": [
"fb6c3e19-e378-47e5-b277-9732f9de6e21"
],
"grantedToV2": [
{
"user": {
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"displayName": "Albert Einstein"
}
}
],
"expirationDateTime": "2018-07-15T14:00:00.000Z"
},
{
"id": "86765c0d-3905-444a-9b07-76201f8cf7df",
"roles": [
"312c0871-5ef7-4b3a-85b6-0e4074c64049"
],
"grantedToV2": [
{
"group": {
"id": "167cbee2-0518-455a-bfb2-031fe0621e5d",
"displayName": "Philosophy Haters"
}
}
]
},
{
"id": "c42b5cbd-2d65-42cf-b0b6-fb6d2b762256",
"grantedToV2": [
{
"user": {
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"displayName": "Albert Einstein"
}
}
],
"@libre.graph.permissions.actions": [
"libre.graph/driveItem/basic/read",
"libre.graph/driveItem/path/update"
]
}
]
}
````
## Creating Share Invitation / Link
### Create a link share `POST /drives/{drive-id}/items/{item-id}/createLink`
https://owncloud.dev/libre-graph-api/#/drives.permissions/CreateLink
### Create a user/group share `POST /drives/{drive-id}/items/{item-id}/invite`
https://owncloud.dev/libre-graph-api/#/drives.permissions/Invite
## Reading Permissions
### List the effective sharing permissions on a driveitem `GET /drives/{drive-id}/items/{item-id}/permissions`
https://owncloud.dev/libre-graph-api/#/drives.permissions/ListPermissions
### List Get sharing permission for a file or folder `GET /drives/{drive-id}/items/{item-id}/permissions/{perm-id}`
https://owncloud.dev/libre-graph-api/#/drives.permissions/GetPermission
## Updating Permissions
### Updating sharing permission `POST /drives/{drive-id}/items/{item-id}/permissions/{perm-id}`
https://owncloud.dev/libre-graph-api/#/drives.permissions/UpdatePermission
### Set password of permission `POST /drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword`
https://owncloud.dev/libre-graph-api/#/drives.permissions/SetPermissionPassword
### Deleting permission `DELETE /drives/{drive-id}/items/{item-id}/permissions/{perm-id}`
https://owncloud.dev/libre-graph-api/#/drives.permissions/DeletePermission
-38
View File
@@ -1,38 +0,0 @@
---
title: Role
weight: 60
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/graph
geekdocFilePath: permissions.md
---
{{< toc >}}
## Role API
The Roles API is implementing a subset of the functionality of the
[MS Graph Role Management](https://learn.microsoft.com/en-us/graph/api/resources/rolemanagement?view=graph-rest-1.0).
## Role Management
### List roleDefinitions `GET /v1beta1/roleManagement/permissions/roleDefinitions`
https://owncloud.dev/libre-graph-api/#/roleManagement/ListPermissionRoleDefinitions
### Get unifiedRoleDefinition `GET /drives/{drive-id}/items/{item-id}/permissions/{perm-id}`
https://owncloud.dev/libre-graph-api/#/roleManagement/GetPermissionRoleDefinition
## Role Assignment
### Get appRoleAssignments of a user `GET /v1.0/users/{user-id}/appRoleAssignments`
https://owncloud.dev/libre-graph-api/#/user.appRoleAssignment/user.ListAppRoleAssignments
### Grant an appRoleAssignment to a user `POST /v1.0/users/{user-id}/appRoleAssignments`
https://owncloud.dev/libre-graph-api/#/user.appRoleAssignment/user.CreateAppRoleAssignments
### Delete the appRoleAssignment from a user `DELETE /v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id}`
https://owncloud.dev/libre-graph-api/#/user.appRoleAssignment/user.DeleteAppRoleAssignments
+180 -34
View File
@@ -93,11 +93,67 @@ The JSON representation of a Drive, as handled by the Spaces API, looks like thi
### Create a single space `POST /drives`
https://owncloud.dev/libre-graph-api/#/drives/CreateDrive
Create a new space with properties.
### Create a space item (Enable sync) `POST /drives/{drive-id}/root/children`
{{< tabs "create-space" >}}
{{< tab "Request" >}}
https://owncloud.dev/libre-graph-api/#/drives.root/CreateDriveItem
```shell
curl -L -X POST 'https://localhost:9200/graph/v1.0/drives/' \
-H 'Content-Type: application/json' \
--data-raw '{
"Name": "Marketing",
"description": "Marketing team resources",
"quota": {
"total": 5368709120
}
}'
```
{{< /tab >}}
{{< tab "Response - 201 Created" >}}
```json {hl_lines=[2,7,15]}
{
"description":"Marketing team resources",
"driveAlias":"project/marketing",
"driveType":"project",
"id":"storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff",
"lastModifiedDateTime":"2023-01-18T17:13:48.385204589+01:00",
"name":"Marketing",
"owner":{
"user":{
"displayName":"",
"id":"535aa42d-a3c7-4329-9eba-5ef48fcaa3ff"
}
},
"quota":{
"total":5368709120
},
"root":{
"eTag":"\"f91e56554fd9305db81a93778c0fae96\"",
"id":"storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff",
"permissions":[
{
"grantedToIdentities":[
{
"user":{
"displayName":"Admin",
"id":"some-admin-user-id-0000-000000000000"
}
}
],
"roles":[
"manager"
]
}
],
"webDavUrl":"https://localhost:9200/dav/spaces/storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff"
},
"webUrl":"https://localhost:9200/f/storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff"
}
```
{{< /tab >}}
{{< /tabs >}}
## Reading Spaces
@@ -130,7 +186,127 @@ The "Space Manager" is a user which is a regular member of a space because he ha
### List My Spaces `GET /me/drives`
https://owncloud.dev/libre-graph-api/#/me.drives/ListMyDrives
Returns a list of all spaces where the user is a regular member of.
{{< tabs "list-drives" >}}
{{< tab "Request" >}}
`curl -L -k -X GET 'https://localhost:9200/graph/v1.0/me/drives/'`
{{< /tab >}}
{{< tab "Response - 200 OK" >}}
```json
{
"value": [
{
"driveAlias": "personal/admin",
"driveType": "personal",
"id": "storage-users-1$some-admin-user-id-0000-000000000000",
"lastModifiedDateTime": "2023-01-17T21:37:17.692033183+01:00",
"name": "Admin",
"owner": {
"user": {
"displayName": "",
"id": "some-admin-user-id-0000-000000000000"
}
},
"quota": {
"remaining": 4497686528,
"state": "normal",
"total": 0,
"used": 0
},
"root": {
"eTag": "\"4b65d2cbce79b2ecc45f876cc6e460d8\"",
"id": "storage-users-1$some-admin-user-id-0000-000000000000",
"webDavUrl": "https://localhost:9200/dav/spaces/storage-users-1$some-admin-user-id-0000-000000000000"
},
"webUrl": "https://localhost:9200/f/storage-users-1$some-admin-user-id-0000-000000000000"
},
{
"driveAlias": "virtual/shares",
"driveType": "virtual",
"id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668",
"name": "Shares",
"quota": {
"remaining": 0,
"state": "exceeded",
"total": 0,
"used": 0
},
"root": {
"eTag": "DECAFC00FEE",
"id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668",
"webDavUrl": "https://localhost:9200/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668"
},
"webUrl": "https://localhost:9200/f/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668"
}
]
}
```
{{< /tab >}}
{{< /tabs >}}
### List my spaces with filters `GET /me/drives/$filter=<attribute> <comparison operator> <value>`
Returns a list of all project spaces where the user is a regular member of. The filter query parameter supports the `eq`(equals) comparison operator. Possible filter attributes are:
| Attribute | Description |
|-----------|--------------------------------------------------------------------------------|
| driveType | The space type. Values could be `project`, `personal`, `virtual`, `mountpoint` |
| id | The space id. The value needs to be a space ID |
#### Example filters
{{< tabs "filter-drives" >}}
{{< tab "Filter by space type project" >}}
`curl -L -k -X GET 'https://localhost:9200/graph/v1.0/me/drives/$filter=driveType eq project'`
This returns a list of spaces of type `project`.
{{< /tab >}}
{{< tab "Filter by space type mountpoint" >}}
`curl -L -k -X GET 'https://localhost:9200/graph/v1.0/me/drives/$filter=driveType eq mountpoint'`
This returns a list of spaces of type `mountpoint`.
{{< /tab >}}
{{< tab "Filter by space id" >}}
`curl -L -k -X GET 'https://localhost:9200/graph/v1.0/me/drives/$filter=id eq some-space-id'`
This returns one space with the id from the filter if it exists.
{{< /tab >}}
{{< /tabs >}}
### List my spaces with ordering `GET /me/drives/$orderby=<key> <order>`
Returns a list of all spaces ordered by the specified key. Possible order keys are
| key | Description |
|-----------------------|----------------------------------------------|
| name | The space name |
| lastModifiedDateTime | The last modified date and time of the space |
Both sort orders are supported, `asc` (ascending) and `desc` (descending).
#### Ordering examples
{{< tabs "sort-drives" >}}
{{< tab "Sort by name" >}}
`curl -L -k -X GET 'https://localhost:9200/graph/v1.0/me/drives/$orderby=name asc'`
This returns a list of spaces ordered by name ascending.
{{< /tab >}}
{{< tab "Sort by date" >}}
`curl -L -k -X GET 'https://localhost:9200/graph/v1.0/me/drives/$orderby=lastModifiedDateTime desc'`
This returns a list of spaces ordered by the last modified date starting with the latest one.
{{< /tab >}}
{{< /tabs >}}
## Modifying Spaces
@@ -462,33 +638,3 @@ The space to be deleted was not disabled before.
```
{{< /tab >}}
{{< /tabs >}}
## Sharing Space
### Add member to space `POST /drives/{drive-id}/root/invite`
https://owncloud.dev/libre-graph-api/#/drives.permissions/Invite
### Sharing space as a link `POST /drives/{drive-id}/root/createLink`
https://owncloud.dev/libre-graph-api/#/drives.root/CreateLinkSpaceRoot
## Reading Space Permissions
### Listing permissions of a space `GET /drives/{drive-id}/root/permissions`
https://owncloud.dev/libre-graph-api/#/drives.root/ListPermissionsSpaceRoot
## Modifying / Deleting Space Permissions
### Update permissions of a drive `PATCH /drives/{drive-id}/root/permissions/{perm-id}`
https://owncloud.dev/libre-graph-api/#/drives.root/UpdatePermissionSpaceRoot
### Set password of a link share `POST /drives/{drive-id}/root/permissions/{perm-id}/setPassword`
https://owncloud.dev/libre-graph-api/#/drives.root/SetPermissionPasswordSpaceRoot
### Removing acess to a space `DELETE /drives/{drive-id}/root/permissions/{perm-id}`
https://owncloud.dev/libre-graph-api/#/drives.root/DeletePermissionSpaceRoot
-247
View File
@@ -1,247 +0,0 @@
---
title: "Resumable Upload"
date: 2023-10-10T00:00:00+00:00
weight: 21
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http
geekdocFilePath: tus_upload.md
geekdocCollapseSection: true
---
Infinite Scale supports the tus resumable-upload protocol, which is a robust, modular, and open protocol designed to resume large file uploads reliably over HTTP.
In situations where file uploads might be interrupted due to network issues, browser crashes, or other unforeseen interruptions,
tus ensures that uploads can be resumed from the point of failure without losing data.
This documentation shows some basic examples, refer [tus official site](https://tus.io/protocols/resumable-upload) for more details.
## Supported tus Features
The backend announces certain tus features to clients. WebDAV responses come with tus HTTP headers for the offical tus features, and additional, ownCloud specific features are announced via the capabilities endpoint (e.g. `https://localhost:9200/ocs/v1.php/cloud/capabilities?format=json`).
The following snippet shows the relevant part of the server capabilities of Infinite Scale that concerns the tus upload:
```json
{
"ocs": {
"data": {
"capabilities": {
"files": {
"tus_support": {
"version": "1.0.0",
"resumable": "1.0.0",
"extension": "creation,creation-with-upload",
"max_chunk_size": 10000000,
"http_method_override": ""
}
}
}
}
}
}
}
```
| Parameter | Environment Variable | Default Value | Description |
| -------------- | ------------------------------ | ------------- | ------------------------------------------------------------------- |
| max_chunk_size | FRONTEND_UPLOAD_MAX_CHUNK_SIZE | 10000000 | Announces the max chunk sizes in bytes for uploads via the clients. |
## Upload in Chunks
### Create an Upload URL
The client must send a POST request against a known upload creation URL to request a new upload resource.
The filename has to be provided in base64-encoded format.
Example:
```shell
# base64 encoded filename 'tustest.txt' is 'dHVzdGVzdC50eHQ='
echo -n 'tustest.txt' | base64
```
{{< tabs "create-upload-url" >}}
{{< tab "Request" >}}
```shell
curl -ks -XPOST https://ocis.test/remote.php/dav/spaces/8d72036d-14a5-490f-889e-414064156402$196ac304-7b88-44ce-a4db-c4becef0d2e0 \
-H "Authorization: Bearer eyJhbGciOiJQUzI..."\
-H "Tus-Resumable: 1.0.0" \
-H "Upload-Length: 10" \
-H "Upload-Metadata: filename dHVzdGVzdC50eHQ="
```
{{< /tab >}}
{{< tab "Response - 201 Created" >}}
```
< HTTP/1.1 201 Created
< Access-Control-Allow-Headers: Tus-Resumable, Upload-Length, Upload-Metadata, If-Match
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Tus-Resumable, Upload-Offset, Location
< Content-Length: 0
< Content-Security-Policy: default-src 'none';
< Date: Mon, 16 Oct 2023 08:49:39 GMT
< Location: https://ocis.test/data/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNjk3NTMyNTc5LCJpYXQiOjE2OTc0NDYxNzksInRhcmdldCI6Imh0dHA6Ly9sb2NhbGhvc3Q6OTE1OC9kYXRhL3R1cy8zYTU3ZWZlMS04MzE0LTQ4MGEtOWY5Ny04N2Q1YzBjYTJhMTgifQ.FbrlY7mdOfsbFgMrP8OtcHlCEq72a2ZVnPD2iBo9MfM
< Tus-Extension: creation,creation-with-upload,checksum,expiration
< Tus-Resumable: 1.0.0
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Request-Id: xxxxxxxxxxxxxxxxxxxxxx
< X-Robots-Tag: none
<
* Connection #0 to host localhost left intact
```
{{< /tab >}}
{{< /tabs >}}
The server will return a temporary upload URL in the location header of the response:
```
< Location: https://ocis.test/data/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNjk3NTMyNTc5LCJpYXQiOjE2OTc0NDYxNzksInRhcmdldCI6Imh0dHA6Ly9sb2NhbGhvc3Q6OTE1OC9kYXRhL3R1cy8zYTU3ZWZlMS04MzE0LTQ4MGEtOWY5Ny04N2Q1YzBjYTJhMTgifQ.FbrlY7mdOfsbFgMrP8OtcHlCEq72a2ZVnPD2iBo9MfM
```
### Upload the First Chunk
Once a temporary upload URL has been created, a client can send a PATCH request to upload a file. The file content should be sent in the body of the request:
{{< tabs "upload-the-first-chunk" >}}
{{< tab "Request" >}}
```shell
curl -ks -XPATCH https://temporary-upload-url \
-H "Authorization: Bearer eyJhbGciOiJQUzI..." \
-H "Tus-Resumable: 1.0.0" \
-H "Upload-Offset: 0" \
-H "Content-Type: application/offset+octet-stream" -d "01234"
```
{{< /tab >}}
{{< tab "Response - 204 No Content" >}}
```
< HTTP/1.1 204 No Content
< Date: Tue, 17 Oct 2023 04:10:52 GMT
< Oc-Fileid: 8d72036d-14a5-490f-889e-414064156402$73bb5450-816b-4cae-90aa-1f96adc95bd4!84e319e4-de1d-4dd8-bbd0-e51d933cdbcd
< Tus-Resumable: 1.0.0
< Upload-Expires: 1697602157
< Upload-Offset: 5
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Request-Id: xxxxxxxxxxxxxxxxxxxxxx
<
* Connection #0 to host localhost left intact
```
{{< /tab >}}
{{< /tabs >}}
### Upload Further Chunks
After the first chunk is uploaded, the second chunk can be uploaded by pointing `Upload-Offset` to exact position that was returned in the first response.
Upload process will not be marked as complete until the total uploaded content size matches the `Upload-Length` specified during the creation of the temporary URL.
{{< tabs "upload-the-second-chunk" >}}
{{< tab "Request" >}}
```shell
curl -ks -XPATCH https://temporary-upload-url \
-H "Authorization: Bearer eyJhbGciOiJQUzI..." \
-H "Tus-Resumable: 1.0.0" \
-H "Upload-Offset: 5" \
-H "Content-Type: application/offset+octet-stream" -d "56789"
```
{{< /tab >}}
{{< tab "Response - 204 No Content" >}}
```
< HTTP/1.1 204 No Content
< Date: Tue, 17 Oct 2023 04:11:00 GMT
< Oc-Fileid: 8d72036d-14a5-490f-889e-414064156402$73bb5450-816b-4cae-90aa-1f96adc95bd4!84e319e4-de1d-4dd8-bbd0-e51d933cdbcd
< Tus-Resumable: 1.0.0
< Upload-Expires: 1697602157
< Upload-Offset: 10
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Request-Id: xxxxxxxxxxxxxxxxxxxxxx
<
* Connection #0 to host localhost left intact
```
{{< /tab >}}
{{< /tabs >}}
{{< hint type=warning title="Important Warning" >}}
`Upload-Offset` header indicates the byte position in the target file where the server should start writing the upload content.
It ensures data integrity and order during the upload process.
{{< /hint >}}
## Creation with Upload
{{< tabs "creation-with-upload" >}}
{{< tab "Request" >}}
```shell
curl -ks -XPOST https://ocis.test/remote.php/dav/spaces/{space-id} \
-H "Authorization: Bearer eyJhbGciOiJQUzI..." \
-H "Tus-Resumable: 1.0.0" \
-H "Upload-Length: 14" \
-H "Content-Type: application/offset+octet-stream" \
-H "Upload-Metadata: filename dGVzdC50eHQ=" \
-H "Tus-Extension: creation-with-upload" \
-d "upload content"
```
{{< /tab >}}
{{< tab "Response - 201 Created" >}}
```shell
< HTTP/1.1 201 Created
< Access-Control-Allow-Headers: Tus-Resumable, Upload-Length, Upload-Metadata, If-Match
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Tus-Resumable, Upload-Offset, Location
< Content-Length: 0
< Content-Security-Policy: default-src 'none';
< Content-Type: text/plain
< Date: Mon, 16 Oct 2023 04:18:25 GMT
< Etag: "372c96743f68bc40e789124d30567371"
< Last-Modified: Mon, 16 Oct 2023 04:18:25 +0000
< Location: https://ocis.test/data/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNjk3NTE2MzA1LCJpYXQiOjE2OTc0Mjk5MDUsInRhcmdldCI6Imh0dHA6Ly9sb2NhbGhvc3Q6OTE1OC9kYXRhL3R1cy82NjlhODBlZi1hN2VjLTQwYTAtOGNmOS05MTgwNTVhYzlkZjAifQ.yq-ofJYnJ9FLML7Z_jki1FJQ7Ulbt9O_cmLe6V411A4
< Oc-Etag: "372c96743f68bc40e789124d30567371"
< Oc-Fileid: 44d3e1e0-6c01-4b94-9145-9d0068239fcd$446bdad4-4b27-41f1-afce-0881f202a214!d7c292a6-c395-4e92-bf07-2c1663aec8dd
< Oc-Perm: RDNVWZP
< Tus-Extension: creation,creation-with-upload,checksum,expiration
< Tus-Resumable: 1.0.0
< Upload-Expires: 1697516305
< Upload-Offset: 14
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
< X-Permitted-Cross-Domain-Policies: none
< X-Request-Id: xxxxxxxxxxxxxxxxxxxxxx
< X-Robots-Tag: none
<
* Connection #0 to host localhost left intact
```
{{< /tab >}}
{{< /tabs >}}
{{< hint type=warning title="Important Warning" >}}
The `Upload-Length` header of the request has to contain the exact size of the upload content in byte.
{{< /hint >}}
## Supported Upload-Metadata
Upload-metadata key-value pairs aren't specified in the general tus docs. The following ones are supported in the ownCloud ecosystem:
| Parameter (key) | Example (value, MUST be Base64 encoded) | Description |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `name` OR `filename` (mandatory) | example.pdf | Filename |
| `mtime` (recommended) | 1701708712 | Modification time (Unix time format) |
| `checksum` (recommended) | SHA1 a330de5886e5a92d78fb3f8d59fe469857759e72 | Checksum, computed from the client |
| `type` OR `filetype` | application/pdf | MIME Type, sent by the web UI |
| `relativePath` | undefined | File path relative to the folder that is being uploaded, including the filename. Sent by the web UI |
| `spaceId` | 8748cddf-66b7-4b85-91a7-e6d08d8e1639$a9778d63-21e7-4d92-9b47-1b81144b9993 | Sent by the web UI |
| `spaceName` | Personal | Sent by the web UI |
| `driveAlias` | personal/admin | Sent by the web UI |
| `driveType` | personal | Sent by the web UI |
| `currentFolder` | / | Sent by the web UI |
| `currentFolderId` | 8748cddf-66b7-4b85-91a7-e6d08d8e1639$a9778d63-21e7-4d92-9b47-1b81144b9993!a9778d63-21e7-4d92-9b47-1b81144b9993 | Sent by the web UI |
| `uppyId` | uppy-example/pdf-1e-application/pdf-238300 | Sent by the web UI |
| `relativeFolder` | | File path relative to the folder that is being uploaded, without filename. Sent by the web UI. |
| `tusEndpoint` | https://ocis.ocis-traefik.latest.owncloud.works/remote.php/dav/spaces/8748cddf-66b7-4b85-91a7-e6d08d8e1639$a9778d63-21e7-4d92-9b47-1b81144b9993 | Sent by the web UI |
| `uploadId` | 71d5f878-a96c-4d7b-9627-658d782c93d7 | Sent by the web UI |
| `topLevelFolderId` | undefined | Sent by the web UI |
| `routeName` | files-spaces-generic | Sent by the web UI |
| `routeDriveAliasAndItem` | cGVyc29uYWwvYWRtaW4= | Sent by the web UI |
| `routeShareId` | | Share ID when uploading into a received folder share. Sent by the web UI |
-547
View File
@@ -1,547 +0,0 @@
---
title: "WebDAV"
date: 2023-07-02T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/webdav
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
{{< toc >}}
**Web** **D**istributed **A**uthoring and **V**ersioning (WebDAV) consists of a set of methods, headers, and content-types extending HTTP/1.1 for the management of resources and -properties, creation and management of resource collections, URL namespace manipulation, and resource locking (collision avoidance). WebDAV is one of the central APIs that ownCloud uses for handling file resources, metadata and locks.
{{< hint type=info title="RFC" >}}
**WebDAV RFCs**
RFC 2518 was published in February 1999. [RFC 4918](https://datatracker.ietf.org/doc/html/rfc4918), published in June 2008 obsoletes RFC 2518 with minor revisions mostly due to interoperability experience.
{{< /hint >}}
## Calling the WebDAV API
### Request URI
```sh
{HTTP method} https://ocis.url/{webdav-base}/{resourceID}/{path}
```
The request URI consists of:
| Component | Description |
|---------------|--------------------------------------------------------------------------------------------------------|
| {HTTP method} | The HTTP method which is used in the request. |
| {webdav-base} | The WebDAV base path component. Possible options are |
| | `dav/spaces/` This is the default and optimized endpoint for all WebDAV requests. |
| | `remote.php/dav/spaces/`* |
| | `remote.php/webdav/`* |
| | `webdav/`* |
| | `dav/`* |
| {resourceID} | This resourceID is used as the WebDAV root element. All children are accessed by their relative paths. |
| {path} | The relative path to the WebDAV root. In most of the casese, this is the space root. |
\* these dav endpoints are implemented for legacy reasons and should not be used. Note: The legacy endpoints **do not take the resourceID as an argument.**
### HTTP methods
| Method | Description |
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| PROPFIND | Retrieve properties as XML from a web resource. It is also overloaded to retrieve the collection structure (a.k.a. directory hierarchy) of a remote system. |
| PROPPATCH | Process instructions specified in the request body to set and/or remove properties defined on the resource identified by the request uri. |
| MKCOL | Create a WebDAV collection (folder) at the location specified by the request uri. |
| GET | Retrieve a WebDAV resource. |
| HEAD | Retrieve a WebDAV resource without reading the body. |
| PUT | A PUT performed on an existing resource replaces the GET response entity of the resource. |
| POST | Not part of the WebDAV rfc and has no effect on a WebDAV resource. However, this method is used in the TUS protocol for uploading resources. |
| PATCH | Not part of the WebDAV rfc and has no effect on a WebDAV resource. However, this method is used in the TUS protocol for uploading resources. |
| COPY | Creates a duplicate of the source resource identified by the Request-URI, in the destination resource identified by the URI in the Destination header. |
| MOVE | The MOVE operation on a non-collection resource is the logical equivalent of a copy (COPY), followed by consistency maintenance processing, followed by a delete of the source, where all three actions are performed in a single operation. | |
| DELETE | Delete the resource identified by the Request-URI. |
| LOCK | A LOCK request to an existing resource will create a lock on the resource identified by the Request-URI, provided the resource is not already locked with a conflicting lock. |
| UNLOCK | The UNLOCK method removes the lock identified by the lock token in the Lock-Token request header. The Request-URI must identify a resource within the scope of the lock. |
The methods `MKCOL`, `GET`, `HEAD`, `LOCK`, `COPY`, `MOVE`, `UNLOCK` and `DELETE` need no request body.
The methods `PROPFIND`, `PROPPATCH`, `PUT` require a request body, normally in XML format to provide the needed values.
{{< hint type=tip title="Tooling" >}}
**WebDAV is not REST**
The WebDAV protocol was created before the REST paradigm has become the de-facto standard for API design. WebDAV uses http methods which are not part of REST. Therefore all the tooling around API design and documentation is not usable (like OpenApi 3.0 / Swagger or others).
{{< /hint >}}
### Authentication
For development purposes the examples in the developer documentation use Basic Auth. It is disabled by default and should only be enabled by setting `PROXY_ENABLE_BASIC_AUTH` in [the proxy](../../../services/proxy/configuration/#environment-variables) for development or test instances.
To authenticate with a Bearer token or OpenID Connect access token replace the `-u user:password` Basic Auth option of curl with a `-H 'Authorization: Bearer <token>'` header. A `<token>` can be obtained by copying it from a request in the browser, although it will time out within minutes. To automatically refresh the OpenID Connect access token an ssh-agent like solution like [oidc-agent](https://github.com/indigo-dc/oidc-agent) should be used.
## Listing Properties
This method is used to list the properties of a resource in xml. This method can also be used to retrieve the listing of a WebDAV collection which means the content of a remote directory.
{{< tabs "list-properties" >}}
{{< tab "Curl" >}}
```shell
curl -L -X PROPFIND 'https://localhost:9200/dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/' \
-H 'Depth: 1' \
-d '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
<d:prop>
<oc:permissions />
<oc:favorite />
<oc:fileid />
<oc:owner-id />
<oc:owner-display-name />
<oc:share-types />
<oc:privatelink />
<d:getcontentlength />
<oc:size />
<d:getlastmodified />
<d:getetag />
<d:getcontenttype />
<d:resourcetype />
<oc:downloadURL />
</d:prop>
</d:propfind>'
```
{{< /tab >}}
{{< tab "HTTP" >}}
```shell
PROPFIND /dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/ HTTP/1.1
Host: localhost:9200
Origin: https://localhost
Access-Control-Request-Method: PROPFIND
Depth: 1
Content-Type: application/xml
Authorization: Basic YWRtaW46YWRtaW4=
Content-Length: 436
<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
<d:prop>
<oc:permissions />
<oc:favorite />
<oc:fileid />
<oc:owner-id />
<oc:owner-display-name />
<oc:share-types />
<oc:privatelink />
<d:getcontentlength />
<oc:size />
<d:getlastmodified />
<d:getetag />
<d:getcontenttype />
<d:resourcetype />
<oc:downloadURL />
</d:prop>
</d:propfind>
```
{{< /tab >}}
{{< /tabs >}}
The request consists of a request body and an optional `Depth` Header.
{{< hint type=tip title="PROPFIND usage" >}}
**Metadata and Directory listings**
Clients can use the `PROPFIND` method to retrieve properties of resources (metadata) and to list the content of a directories.
{{< /hint >}}
### Response
{{< tabs "response list properties" >}}
{{< tab "207 - Multistatus" >}}
#### Multi Status Response
A Multi-Status response conveys information about multiple resources
in situations where multiple status codes might be appropriate. The
default Multi-Status response body is an application/xml
HTTP entity with a `multistatus` root element. Further elements
contain `200`, `300`, `400`, and `500` series status codes generated during
the method invocation.
Although `207` is used as the overall response status code, the
recipient needs to consult the contents of the multistatus response
body for further information about the success or failure of the
method execution. The response MAY be used in success, partial
success and also in failure situations.
The `multistatus` root element holds zero or more `response` elements
in any order, each with information about an individual resource.
#### Body
```xml
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
<d:response>
<d:href>/dav/spaces/storage-users-1$some-admin-user-id-0000-000000000000/</d:href>
<d:propstat>
<d:prop>
<oc:permissions>RDNVCKZP</oc:permissions>
<oc:favorite>0</oc:favorite>
<oc:fileid>storage-users-1$some-admin-user-id-0000-000000000000!some-admin-user-id-0000-000000000000</oc:fileid>
<oc:id>storage-users-1$some-admin-user-id-0000-000000000000!some-admin-user-id-0000-000000000000</oc:id>
<oc:owner-id>admin</oc:owner-id>
<oc:owner-display-name>Admin</oc:owner-display-name>
<oc:privatelink>https://localhost:9200/f/storage-users-1$some-admin-user-id-0000-000000000000%21some-admin-user-id-0000-000000000000</oc:privatelink>
<oc:size>10364682</oc:size>
<d:getlastmodified>Mon, 04 Sep 2023 20:10:09 GMT</d:getlastmodified>
<d:getetag>"c4d3610dfe4fac9b44e1175cfc44b12b"</d:getetag>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
<d:propstat>
<d:prop>
<oc:checksums></oc:checksums>
<oc:share-types></oc:share-types>
<d:getcontentlength></d:getcontentlength>
<d:getcontenttype></d:getcontenttype>
</d:prop>
<d:status>HTTP/1.1 404 Not Found</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/dav/spaces/storage-users-1$some-admin-user-id-0000-000000000000/New%20file.txt</d:href>
<d:propstat>
<d:prop>
<oc:permissions>RDNVWZP</oc:permissions>
<oc:checksums>
<oc:checksum>SHA1:1c68ea370b40c06fcaf7f26c8b1dba9d9caf5dea MD5:2205e48de5f93c784733ffcca841d2b5 ADLER32:058801ab</oc:checksum>
</oc:checksums>
<oc:favorite>0</oc:favorite>
<oc:fileid>storage-users-1$some-admin-user-id-0000-000000000000!90cc3e73-0c6c-4346-9c4d-f529976d4990</oc:fileid>
<oc:id>storage-users-1$some-admin-user-id-0000-000000000000!90cc3e73-0c6c-4346-9c4d-f529976d4990</oc:id>
<oc:owner-id>admin</oc:owner-id>
<oc:owner-display-name>Admin</oc:owner-display-name>
<oc:share-types>
<oc:share-type>0</oc:share-type>
<oc:share-type>1</oc:share-type>
<oc:share-type>3</oc:share-type>
</oc:share-types>
<oc:privatelink>https://localhost:9200/f/storage-users-1$some-admin-user-id-0000-000000000000%2190cc3e73-0c6c-4346-9c4d-f529976d4990</oc:privatelink>
<d:getcontentlength>5</d:getcontentlength>
<oc:size>5</oc:size>
<d:getlastmodified>Mon, 28 Aug 2023 20:45:03 GMT</d:getlastmodified>
<d:getetag>"75115347c74701a3be9c635ddebbf5c4"</d:getetag>
<d:getcontenttype>text/plain</d:getcontenttype>
<d:resourcetype></d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/dav/spaces/storage-users-1$some-admin-user-id-0000-000000000000/NewFolder/</d:href>
<d:propstat>
<d:prop>
<oc:permissions>RDNVCKZP</oc:permissions>
<oc:favorite>0</oc:favorite>
<oc:fileid>storage-users-1$some-admin-user-id-0000-000000000000!5c73ecd9-d9f4-44f4-b685-ca4cb40aa6b7</oc:fileid>
<oc:id>storage-users-1$some-admin-user-id-0000-000000000000!5c73ecd9-d9f4-44f4-b685-ca4cb40aa6b7</oc:id>
<oc:owner-id>admin</oc:owner-id>
<oc:owner-display-name>Admin</oc:owner-display-name>
<oc:privatelink>https://localhost:9200/f/storage-users-1$some-admin-user-id-0000-000000000000%215c73ecd9-d9f4-44f4-b685-ca4cb40aa6b7</oc:privatelink>
<oc:size>0</oc:size>
<d:getlastmodified>Mon, 28 Aug 2023 20:45:10 GMT</d:getlastmodified>
<d:getetag>"e83367534cc595a45d706857fa5f03d8"</d:getetag>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
<d:propstat>
<d:prop>
<oc:checksums></oc:checksums>
<oc:share-types></oc:share-types>
<d:getcontentlength></d:getcontentlength>
<d:getcontenttype></d:getcontenttype>
</d:prop>
<d:status>HTTP/1.1 404 Not Found</d:status>
</d:propstat>
</d:response>
</d:multistatus>
```
{{< /tab >}}
{{< tab "400 - Bad Request" >}}
#### Body
```xml
<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
<s:message>Invalid Depth header value: 3</s:message>
</d:error>
```
This can occur if the request is malformed e.g. due to an invalid xml request body or an invalid depth header value.
{{< /tab >}}
{{< tab "404 - Not Found" >}}
#### Body
```xml
<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
<s:message>Resource not found</s:message>
</d:error>
```
{{< /tab >}}
{{< /tabs >}}
### Request Body
The `PROPFIND` Request can include an XML request body containing a list of namespaced property names.
### Namespaces
When building the body of your DAV request, you will request properties that are available under a specific namespace URI. It is usual to declare prefixes for those namespace in the `d:propfind` element of the body.
Available namespaces:
| URI | Prefix |
|-------------------------------------------|--------|
| DAV: | d |
| http://sabredav.org/ns | s |
| http://owncloud.org/ns | oc |
| http://open-collaboration-services.org/ns | ocs |
| http://open-cloud-mesh.org/ns | ocm |
### Request Example with declared namespaces
```xml
<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
</d:propfind>
```
### Supported WebDAV Properties
| Property | Desription | Example |
| ----------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `<d:getlastmodified />` | The latest modification time. | `Fri, 30 Dec 2022 14:22:43 GMT` |
| `<d:getetag />` | The file's etag. | `"c3a1ee4a0c28edc15b9635c3bf798013"` |
| `<d:getcontenttype />` | The mime type of the file. | `image/jpeg` |
| `<d:resourcetype />` | Specifies the nature of the resource. | `<d:collection />` for a folder |
| `<d:getcontentlength />` | The size if it is a file in bytes. | `5` bytes |
| `<d:lockdiscovery />` | Describes the active locks on a resource. | Detailed Example in [Locking]() |
| `<oc:id />` | The globally unique ID of the resource. | `storage-1$27475553-7fb7-4689-b4cf-bbb635daff79!27475553-7fb7-4689-b4cf-bbb635daff79` |
| `<oc:fileid />` | The globally unique ID of the resource. | `storage-1$27475553-7fb7-4689-b4cf-bbb635daff79!27475553-7fb7-4689-b4cf-bbb635daff79` |
| `<oc:downloadURL />` | Direct URL to download a file from. | Not implemented. |
| `<oc:permissions />` | Determines the actions a user can take on the resource. | The value is a string containing letters that clients can use to determine available actions. |
| | | `S`: Shared |
| | | `M`: Mounted |
| | | `D`: Deletable |
| | | `NV`: Updateable, Renameable, Moveable |
| | | `W`: Updateable (file) |
| | | `CK`: Creatable (folders only) |
| | | `Z`: Deniable |
| | | `P`: Trashbin Purgable |
| | | `X`: Securely Viewable |
| | | In the early stages this was indeed a list of permissions. Over time, more flags were added and the term permissions no longer really fits well. |
| `<oc:tags />` | List of user specified tags. | `<oc:tag>test</oc:tag>` |
| `<oc:favorite /> ` | The favorite state. | `0` for not favourited, `1` for favourited |
| `<oc:owner-id />` | The user id of the owner of a resource. Project spaces have no owner. | `einstein` |
| `<oc:owner-display-name />` | The display name of the owner of a resource. Project spaces have no owner. | `Albert Einstein` |
| `<oc:share-types />` | List of share types. | `0` = User Share |
| | | `1` = Group Share |
| | | `2` = Public Link |
| `<oc:checksums />` | | `<oc:checksum>`<br/>`SHA1:1c68ea370b40c06fcaf7f26c8b1dba9d9caf5dea MD5:2205e48de5f93c784733ffcca841d2b5 ADLER32:058801ab`<br /> `</oc:checksum>` |
| | | Due to a bug in the very early development of ownCloud, this value is not an array, but a string separated by whitespaces. |
| `<oc:size />` | Similar to `getcontentlength` but it also works for folders. | `10` bytes |
| `<oc:shareid />` | The ID of the share if the resource is part of such. | `storage-1$27475553-7fb7-4689-b4cf-bbb635daff79!27475553-7fb7-4689-b4cf-bbb635daff79` |
| `<oc:shareroot />` | The root path of the shared resource if the resource is part of such. | `/shared-folder` |
| `<oc:remoteItemId />` | The ID of the shared resource if the resource is part of such. | `storage-1$27475553-7fb7-4689-b4cf-bbb635daff79!27475553-7fb7-4689-b4cf-bbb635daff79` |
| `<oc:public-link-item-type />` | The type of the resource if it's a public link. | `folder` |
| `<oc:public-link-permission />` | The share permissions of the resource if it's a public link. | `1` |
| `<oc:public-link-expiration />` | The expiration date of the public link. | `Tue, 14 May 2024 12:44:29 GMT` |
| `<oc:public-link-share-datetime />` | The date the public link was created. | `Tue, 14 May 2024 12:44:29 GMT` |
| `<oc:public-link-share-owner />` | The username of the user who created the public link. | `admin` |
| `<oc:trashbin-original-filename />` | The original name of the resource before it was deleted. | `some-file.txt` |
| `<oc:trashbin-original-location />` | The original location of the resource before it was deleted. | `some-file.txt` |
| `<oc:trashbin-delete-datetime />` | The date the resource was deleted. | `Tue, 14 May 2024 12:44:29 GMT` |
| `<oc:audio />` | Audio meta data if the resource contains such. | `<oc:artist>Metallica</oc:artist><oc:album>Metallica</oc:album><oc:title>Enter Sandman</oc:title>` |
| `<oc:location />` | Location meta data if the resource contains such. | `<oc:latitude>51.504106</oc:latitude><oc:longitude>-0.074575</oc:latitude>` |
### Request Headers
A client executing a `PROPFIND` request MUST submit a Depth Header value. In practice, support for infinite-depth requests MAY be disabled, due to the performance and security concerns associated with this behavior. Servers SHOULD treat a
request without a Depth header as if a `Depth: infinity` header was included. Infinite depth requests are disabled by default in ocis.
| Name | Value |
|-------------------------------------------|---------------------------------------------------------------------------------------|
| Depth | `0` = Only return the desired resource. |
| | `1` = Return the desired resource and all resources one level below in the hierarchy. |
| | `infinity` = Return all resources below the root. |
{{< hint type=caution title="Use the Depth header with caution" >}}
**Depth: infinity**
Using the `Depth: infinity` header value can cause heavy load on the server, depending on the size of the file tree.
The request can run into a timeout and the server performance could be affected for other users.
{{< /hint >}}
## Create a Directory
Clients create directories (WebDAV collections) by executing a `MKCOL` request at the location specified by the request url.
{{< tabs "create-folder" >}}
{{< tab "Curl" >}}
```shell
curl -L -X MKCOL 'https://localhost:9200/dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/NewFolder/' \
-H 'Authorization: Basic YWRtaW46YWRtaW4='
```
{{< /tab >}}
{{< tab "HTTP" >}}
```shell
MKCOL /dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/NewFolder/ HTTP/1.1
Host: localhost:9200
Authorization: Basic YWRtaW46YWRtaW4=
```
{{< /tab >}}
{{< /tabs >}}
### Response
{{< tabs "response create folder" >}}
{{< tab "201 - Created" >}}
This indicates that the Resource has been created successfully.
#### Body
The response has no body.
{{< /tab >}}
{{< tab "403 - Forbidden" >}}
#### Body
```xml
<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
<s:message></s:message>
</d:error>
```
{{< /tab >}}
{{< tab "405 - Method not allowed" >}}
#### Body
```xml
<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\MethodNotAllowed</s:exception>
<s:message>The resource you tried to create already exists</s:message>
</d:error>
```
{{< /tab >}}
{{< /tabs >}}
## Upload File
To upload files to the remote server, clients can use the `PUT` method to create or fully replace the content of the remote file.
### Request Headers
| Name | Usage |
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `X-OC-Mtime` | Send the last modified <br> time of the file to the server in unixtime format. The server applies this mtime to the resource rather than the actual time. |
| `OC-Checksum` | Provide the checksum of the <br> file content to the server. <br> This is used to prevent corrupted data transfers. |
| `If-Match` | The If-Match request-header field is used with a method to make it <br> conditional. A client that has one or more entities previously <br> obtained from the resource can verify that one of those entities is <br> current by including a list of their associated entity tags in the <br> If-Match header field. |
{{< tabs "upload-file" >}}
{{< tab "Curl" >}}
```shell
curl -L -X PUT 'https://localhost:9200/dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/test.txt' \
-H 'X-OC-Mtime: 1692369418' \
-H 'OC-Checksum: SHA1:40bd001563085fc35165329ea1ff5c5ecbdbbeef' \
-H 'If-Match: "4436aef907f41f1ac7dfd1ac3d0d455f"' \
-H 'Content-Type: text/plain' \
-H 'Authorization: Basic YWRtaW46YWRtaW4=' \
-d '123'
```
{{< /tab >}}
{{< tab "HTTP" >}}
```shell
PUT /dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/test.txt HTTP/1.1
Host: localhost:9200
X-OC-Mtime: 1692369418
OC-Checksum: SHA1:40bd001563085fc35165329ea1ff5c5ecbdbbeef
If-Match: "4436aef907f41f1ac7dfd1ac3d0d455f"
Content-Type: text/plain
Authorization: Basic YWRtaW46YWRtaW4=
Content-Length: 3
123
```
{{< /tab >}}
{{< /tabs >}}
### Response
{{< tabs "response upload file" >}}
{{< tab "201 - Created" >}}
This indicates that the Resource has been created successfully.
#### Body
The response has no body.
#### Headers
```yaml
Oc-Etag: "4436aef907f41f1ac7dfd1ac3d0d455f"
Oc-Fileid: storage-users-1$some-admin-user-id-0000-000000000000!07452b22-0ba9-4539-96e1-3511aff7fd2f
Last-Modified: Fri, 18 Aug 2023 14:36:58 +0000
X-Oc-Mtime: accepted
```
{{< /tab >}}
{{< tab "204 - No Content" >}}
This indicates that the Resource has been updated successfully.
#### Body
The response has no body.
#### Headers
```yaml
Oc-Etag: "4436aef907f41f1ac7dfd1ac3d0d455f"
Oc-Fileid: storage-users-1$some-admin-user-id-0000-000000000000!07452b22-0ba9-4539-96e1-3511aff7fd2f
Last-Modified: Fri, 18 Aug 2023 14:36:58 +0000
X-Oc-Mtime: accepted
```
{{< /tab >}}
{{< tab "400 - Bad Request" >}}
This indicates that the checksum, which was sent by the client, does not match the computed one after all bytes have been received by the server.
#### Body
```xml
<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
<s:message>The computed checksum does not match the one received from the client.</s:message>
</d:error>
```
{{< /tab >}}
{{< tab "403 - Forbidden" >}}
The user cannot create files in that remote location.
{{< /tab >}}
{{< tab "404 - Not Found" >}}
The remote target space cannot be found.
{{< /tab >}}
{{< tab "409 - Conflict" >}}
This error can occur when the request cannot be executed due to a missing precondition. One example is a PUT into a non-existing remote folder. It can also happen when the client sends the wrong etag in the `If-Match` header.
{{< /tab >}}
{{< /tabs >}}
+3 -4
View File
@@ -1,11 +1,10 @@
---
title: Architecture
date: 2023-12-06T13:00:00+01:00
weight: 10
title: "Architecture"
date: 2020-03-03T10:34:00+01:00
weight: 25
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/architecture
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
In the architecture part of the documentation we collect useful developer documentation on different aspects of the architecture. We are using mermaid.js to collaborate on the necessary diagrams.
-111
View File
@@ -1,111 +0,0 @@
---
title: "Collaborative Storage"
date: 2023-11-09T12:35:00+01:00
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/storage-backends/
geekdocFilePath: collaborative-storage.md
---
{{< toc >}}
One of the envisioned design goals of Infinite Scale is to work with so called _collaborative storage_, which means that the file system it is running on is not exclusive for Infinite Scale, but can be manipulated in parallel through third party tools. Infinite Scale is expected to monitor the changes that happen independently and react in a consistent and user friendly way.
A real world example of that would be a third party "data producer" that submits data directly into a file system path, not going through Infinite Scale APIs.
This document outlines a few challenges and design concepts for collaborative storage. It is also the base "checklist" for custom storage provider implementations for certain storages, ie. for Ceph- or IBM Storage Scale which provide features that allow more sophisticated and efficient implementations of this goal.
# Storage Driver Components
This discusses a few components and sub functions of the storage driver that have relevance for the collaborative storage.
## Path Locations
What is called "the oCIS file system" is defined as the entire filetree underneath a special path in the local POSIX file system, which might either be a real local file system or a mounted net filesystem. It is expected that oCIS is the only consumer of that file tree, except what is expected behaviour with a collaborative file system, that adds and edits files in that tree.
Underneath the oCIS file system root, there is an collection of different folders containing oCIS specific data. Specific storage driver data is in the directory `storage/users`, organized by spaces.
(TODO: Check again how different storage drivers work together without overwriting data of each other)
## Spaces
Infinite Scale provides spaces as an additional organization organizational unit for data. Each space is a separate entity with its own attributes such as access patterns and quota.
A storage driver has to model the separation of spaces and provide a list of spaces in general and also a list of spaces a user can access. Furthermore, it needs to be able to create different types of spaces (Home- or Project space).
On POSIX, each space could for example be mapped to it's own directory in a special spaces folder under the oCIS root folder.
## ID to Path Lookup
Infinite Scale uses file IDs to efficiently identify files within a file tree. The lookup from a given ID to a path within the oCIS file tree is a very basic function that more or less defines the Infinite Scale performance. The functionality to for example query the file path for a given Inode number (which is the nearest equivalent for the Infinite Scale file ID) can not be done with standard POSIX system calls.
The interface defining the collaborative storage needs an abstraction for this particular function, returning the file id for a given path, and returning the path for given id.
## Change Notification
When a file is changed by a process outside of oCIS, this needs to be monitored by oCIS to quickly maintain internal caches and data structures as required.
The collaborative storage driver needs a way to achieve that. The easiest way for an POSIX based collaborative storage is inotify, that needs to be set up recursively on a file tree to record changes. Additional it is a challenge to destinguish between changes that were done from external activity and the ones that oCIS creates by its own file operations.
For GPFS, there is a subsystem called delivering that:
https://www.ibm.com/docs/en/storage-scale/5.1.9?topic=reference-clustered-watch-folder]
## ETag Propagation
ownCloud requires that changes which happen "down" in a tree, can be detected in the root element of the tree. That happens through the change of the ETag metadata of each file and/or directory. An ETag is a random, text based tag, that only has one requirement: It has to change its content if a resource further down in the file tree has changed either its content or its metadata. (See [this issue](https://github.com/owncloud/ocis/issues/3782) for further discussion about the ETag/CTag).
POSIX file systems do not maintain a change flag like the ETag by default. The file time stamps (atime, ctime, mtime) in general are not fine granular enough (only seconds for some file systems) and depend on the server time, which renders them useless in a distributed environment.
Infinite Scale needs to implement ETag propagation "up". For the collaborative storage, that needs to be combined with the change notification described above.
Certain file systems implement this functionality either independently from Infinite Scale (EOS) or at least support proper change notifications (Ceph, GPFS?).
## Metadata Management
Metadata are data "snippets" that are as tightly attached to files as ever possible. In best case, a rename of a file silently keeps the metadata as well. In POSIX, this can be achieved by extended file attributes with certain limitations.
## Quota
Each space has it's own quota, thus a storage driver implementation needs to consider that.
For GPFS for example, there is support for quota handling in the file system.
https://www.ibm.com/docs/en/gpfs/4.1.0.4?topic=interfaces-gpfs-quotactl-subroutine
Other systems store quota data in the metadata storage and implement propagation of used quota similar to the ETag propagation.
## User Management
With user management it is meant how to handle the users and groups within oCIS and how that reflects to the file system where data is stored.
### Exclusive Environment
In exclusive environments (aka. decomposedFS) all files of oCIS (ie. the entire oCIS filetree) belongs to a system user with the name `ocis` typically.
### Collaborative Storage
For collaborative storages, the approach described above does not longer work because users are supposed to be able to manipulate data in "their" file tree parts, and that is identified by ACLs and the owner of the files.
That requires a few prerequisites that have to be fulfilled:
1. oCIS as one "client" changing data and the system that allows to access the file tree directly have to use the same user provider, to ensure that each user that is available on a shell is also available in oCIS. That ensures that changes are authenticated through system ACLs and users. LDAP based authentication on the system via PAM and the same LDAP as source for the oCIS IDP should be a sufficient setup.
2. oCIS must be able to write as a "different" user than the ocis system user. That means that we somehow have to impersonate file changing ooperations and run these as the user that is authenticated in oCIS.
Example: There is a user ben. It has to have an entry in the LDAP that is used by IDP which oCIS is running "behind". With that, ben is able to authenticate through the IDP and work in the oCIS web app. The oCIS linux process will do writes and other changes impersonated as user ben.
For the access of data on the commandline, the logins to the linux system must be authenticated against the same LDAP - so that ben can authenticate on a terminal using username and password. With that, the user can interactively change data that belongs to user ben (simplified said).
To give permissions to groups, the linux group management must work accordingly. The same is true for file permissions.
## Trashbin
When a user deletes a file in oCIS it is moved to a so called trashbin that allows to restore the file if the deletion was accidentailly.
## Versions
When an existing file is changed, the former file state is to be preserved with data and metadata by oCIS. Some file system types provide this functionality via snapshots on partition or even file level. Other do not and have to implement that via a hidden directory keeping old file versions.
-207
View File
@@ -1,207 +0,0 @@
---
title: "PosixFS Storage Driver"
date: 2024-05-27T14:31:00+01:00
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/architecture
geekdocFilePath: posixfs-storage-driver.md
---
{{< toc >}}
The Posix FS Storage Driver is a new storage driver for Infinite Scale.
The scope of this document is to give a high level overview to the technical aspects of the Posix FS Storage Driver and guide the setup.
## Introduction
The Posix FS Storage Driver is a backend component that manages files on the server utilizing a "real" file tree that represents the data with folders and files in the file system as users are used to it. That is the big difference compared to Decomposed FS which is the default storage driver in Infinite Scale.
This does not mean that Infinite Scale is trading any of its benefits to this new feature: It still implements simplicity by running without a database, it continues to store metadata in the file system and adds them transparently to caches and search indexes, and it also features the full spaces concept as before, just to name a few examples.
The architecture of Infinite Scale allows configuring different storage drivers for specific storage types and purposes on a space granularity. The Posix FS Storage Driver is an alternative to the default driver called Decomposed FS.
However, the clarity of the file structure in the underlying file system is not the only benefit of the Posix FS Storage Driver. This new technology allows users to manipulate the data directly in the file system, and any changes made to files outside of Infinite Scale are monitored and directly reflected in Infinite Scale. For example, a scanner could store its output directly to the Infinite Scale file system, which immediately gets picked up in Infinite Scale.
For the first time ever with feature rich open source file sync & share systems, users can either choose to work with their data through the clients of the system, its APIs or even directly in the underlying file system on the server.
That is another powerful vector for integration and enables a new spectrum of use cases across all domains.
## Technical Aspects
The Posix FS Storage Driver uses a few features of the underlying file system, which are mandatory and directly contributing to the performance of the system.
While the simplest form of Posix FS Storage Driver runs with default file systems of every modern Linux system which are directly mounted and thus support inotify, the full power of this unfolds with more capable file systems such as IBM Storage Scale or Ceph. These are recommended as reliable foundations for big installations of Infinite Scale.
This chapter describes some technical aspects of this storage driver.
### Path Locations
The file tree that is used as storage path for both data and metadata is located under the local path on the machine that is running Infinite Scale. That might either be a real local file system or a mounted net filesystem. It is expected that oCIS is the only consumer of that file tree, except what is expected behaviour with a collaborative file system, that works with files in that tree.
Underneath the Infinite Scale file system root, there is a collection of different folders containing Infinite Scale specific data storing personal spaces, project spaces and indexes.
### Metadata
Infinite Scale is highly dependent on the efficient usage of meta data which are attached to file resources, but also logical elements such as spaces.
Metadata is stored in extended attributes (as also supported by decompsed FS) which poses the benefit that metadata is always directly attached to the actual resources. As a result, care has to be taken that extended attributes are considered when working with the file tree however, e.g. when creating or restoring backups.
Note: The maximum number and size of extended attributes are limited depending on the filesystem and block size. See [GPFS Specifics](#gpfs-specifics) for more details on GPFS file systems.
All indexing and caching of metadata is implemented in higher system levels than the storage driver, and thus are not different to the components used with other storage drivers like the decomposed FS.
### Monitoring
To get information about changes such as new files added, files edited or removed, Infinite Scale uses a monitoring system to directly watch the file system. This starts with the Linux inotify system and ranges to much more sophisticated services as for example in Spectrum Scale (see [GPFS Specifics](#gpfs-specifics) for more details on GPFS file systems).
Based on the information transmitted by the watching service, Infinite Scale is able to "register" new or changed files into its own caches and internal management structures. This enables Infinite Scale to deliver resource changes through the "traditional" channels such as APIs and clients.
Since the most important metadata is the file tree structure itself, it is impossible for the "split brain" situation between data and metadata to cause trouble.
### Automatic ETag Propagation
The ETag of a resource can be understood as a content fingerprint of any file- or folder resource in Infinite Scale. It is mainly used by clients to detect changes of resources. The rule is, that if the content of a file changed the ETag has to change as well, as well as the ETag of all parent folders up to the root of the space.
Infinite Scale uses a built in mechanism to maintain the ETag for each resource in the file meta data, and also propagates it automatically.
A sophisticated underlying file system could provide an attribute that fulfills this requirement and changes whenever content or metadata of a resource changes, and - which is most important - also changes the attribute of the parent resource and the parent of the parent etc.
### Automatic Tree Size Propagation
Similar to the ETag propagation described before, Infinite Scale also tracks the accumulated tree size in all nodes of the file tree. A change to any file requires a re-calculation of the size attribute in all parent folders.
Infinite Scale would benefit from file systems with native tree size propagation.
### Quota
Each space has it's own quota, thus every storage driver implementation needs to consider that.
For example, IBM Spectrum Scale supports quota handling directly in the file system.
Other systems store quota data in the metadata storage and implement propagation of used quota similar to the tree size propagation.
### File ID Resolution
Infinite Scale uses an ID based approach to work with resources, rather than a file path based mechanism. The reason for that is, that ID based lookups can be done way more efficiently compared to tree traversals, just to name one reason.
The most important component of the ID is a unique file ID that identifies the resource within a space. Ideally the Inode of a file could be used here. However, some file systems re-use inodes which must be avoided. Infinite Scale thus does not use the file Inode, but generates a UUID instead.
ID based lookups utilize an ID cache which needs to be shared between all storageprovider and dataprovider instances. During startup a scan of the whole file tree is performed to detect and cache new entities.
In the future a powerful underlying file system could support Infinite Scale by providing an API that
1. Provides the ID for a given file path referenced resource
2. Provides the path for a given ID.
These two operations are very crucial for the performance of the entire system.
### User Management
With the requirement that data can be manipulated either through the filesystem or the Infinite Scale system, the question under which UID the manipulation happens is important.
There are a few possible ways for user management:
1. Changes can either be only accepted by the same user that Infinite Scale is running under, for example the user `ocis`. All manipulations in the filesystem have to be done by, and only by this user.
2. Group based: All users who should be able to manipulate files have to be in a unix group. The Infinite Scale user has also to be member of that group. The default umask in the directory used has to allow group writing all over the place.
3. Impersonation: Infinite Scale impersonates the user who owns the folder on the file system to mimic the access as the user.
All possibilities have pros and cons for operations.
One for all, it seems reasonable to use LDAP to manage users which is the base for the Infinite Scale IDP as well as the system login system via PAM.
### GID Based Space Access
The Posix FS Storage Driver supports GID based space access to support the problem that project spaces might have to be accessible by multiple users on disk. In order to enable this feature the `ocis` binary needs to have the `setgid` capability and `STORAGE_USERS_POSIX_USE_SPACE_GROUPS` needs to be set to `true`. Inifinite Scale will then use the space GID (the gid of the space root) for all file system access using the `setfsgid` syscall, i.e. all files and directories created by Infinite Scale will belong to the same group as the space root.
## Advanced Features
Depending on the capabilities of the underlying file system, the Posix FS Storage Driver can benefit from more advanced functionality described here.
### Versioning
If the underlying file system is able to create versions of single resources (imagine a git based file system) this functionality could directly be used by Infinite Scale.
In the current state of the Posix FS Storage Driver, versioning is not supported.
### Trashbin
If the underlying file system handles deleted files in a trash bin that allows restoring of previously removed files, this functionality could directly be used by Infinite Scale.
If not available it will follow the [the Free Desktop Trash specificaton](https://specifications.freedesktop.org/trash-spec/trashspec-latest.html).
## Limitations
As of Q2/2024 the Posix FS Storage Driver is not officially supported and in technical preview state.
The tech preview comes with the following limitations:
1. Only inotify and GPFS file system change notification methods are supported
1. Versioning is not supported yet
1. The space/project folders in the filesystem are named after the UUID, not the real space name
1. No CephFS support yet
1. Postprocessing (ie. anti virus check) does not happen for file actions outside of Infinite Scale
## Setup
This describes the steps to use the Posix FS Storage Driver storage driver with Infinite Scale.
It is possible to use different storage drivers in the same Infinite Scale installation. For example it is possible to set up one space running on Posix FS Storage Driver while others run Decomposed FS.
### Prerequisites
To use the Posix FS Storage Driver, the following prerequisites have to be fulfilled:
1. There must be storage available to store meta data and blobs, available under a root path.
1. When using inotify, the storage must be local on the same machine. Network mounts do not work with inotify. `inotifywait` needs to be installed.
1. The storage root path must be writeable and executable by the same user Infinite Scale is running under.
1. An appropiate version of Infinite Scale is installed, version number 5.0.5 and later.
1. `nats-js-kv` as cache service
### Setup Configuration
This is an example configuration with environment variables that configures Infinite Scale to use Posix FS Storage Driver for all spaces it works with, ie. Personal and Project Spaces:
```
export STORAGE_USERS_DRIVER="posix"
export STORAGE_USERS_POSIX_ROOT="/home/kf/tmp/posix-storage"
export STORAGE_USERS_POSIX_WATCH_TYPE="inotifywait"
export STORAGE_USERS_ID_CACHE_STORE="nats-js-kv"
export STORAGE_USERS_ID_CACHE_STORE_NODES="localhost:9233"
# Optionally enable gid based space access
export STORAGE_USERS_POSIX_USE_SPACE_GROUPS="true"
```
## GPFS Specifics
When using GPFS as the underlying filesystem the machine running the according `storage-users` service needs to have the GPFS filesystem mounted locally. The mount path is given to ocis as the `STORAGE_USERS_POSIX_ROOT` path.
Other than that there a few other points to consider:
### Extended Attributes
As described above metadata is stored as extended attributes of the according entities and thus is suspect to their limitations. In GPFS extended attributes are first stored in the inode itself but can then also use an overflow block which is at least 64KB and up to the metadata block size. Inode and metadata block size should be chosen accordingly.
### FS Watcher
The Posix FS Storage Driver supports two different watchers for detecting changes to the filesystem. The watchfolder watcher is better tested and supported at that point.
#### GPFS File Audit Logging
The `gpfsfileauditlogging` watcher tails a GPFS file audit log and parses the JSON events to detect relevant changes.
```
export STORAGE_USERS_POSIX_WATCH_TYPE="gpfsfileauditlogging"
export STORAGE_USERS_POSIX_WATCH_PATH="/path/to/current/audit/log"
```
#### GPFS Watchfolder
The `gpfswatchfolder` watcher connects to a kafka cluster which is being filled with filesystem events by the GPFS watchfolder service.
```
export STORAGE_USERS_POSIX_WATCH_TYPE="gpfswatchfolder"
export STORAGE_USERS_POSIX_WATCH_PATH="fs1_audit" # the kafka topic to watch
export STORAGE_USERS_POSIX_WATCH_FOLDER_KAFKA_BROKERS="192.168.1.180:29092"
```
+25 -37
View File
@@ -27,9 +27,8 @@ sequenceDiagram
Client->>+ocdav: PUT /dav/spaces/{spaceid}/newfile.bin
ocdav->>+storageprovider: InitiateFileUpload
storageprovider-->>-ocdav: OK, Protocol simple, UploadEndpoint: /data, Token: {jwt}
Note right of ocdav: The {jwt} contains the internal actual target, eg.: http://localhost:9158/data/simple/91cc9882-db71-4b37-b694-a522850fcee1
ocdav->>+dataprovider: PUT /data
Note right of dataprovider: X-Reva-Transfer: {jwt}
Note right of ocdav: The {jwt} contains the internal actual target, eg.:<br>http://localhost:9158/data/simple/91cc9882-db71-4b37-b694-a522850fcee1
ocdav->>+dataprovider: PUT /data<br>X-Reva-Transfer: {jwt}
dataprovider-->>-ocdav: 201 Created
ocdav-->>-Client: 201 Created
@@ -49,18 +48,19 @@ sequenceDiagram
participant datagateway
participant dataprovider
Client->>+ocdav: POST /dav/spaces/{spaceid}\nUpload-Metadata: {base64 encoded filename etc}\nTUS-Resumable: 1.0.0
Client->>+ocdav: POST /dav/spaces/{spaceid}<br>Upload-Metadata: {base64 encoded filename etc}<br>TUS-Resumable: 1.0.0
ocdav->>+storageprovider: InitiateFileUpload
storageprovider-->>-ocdav: OK, Protocol tus, UploadEndpoint: /data, Token: {jwt}
Note right of ocdav: The {jwt} contains the internal actual target, eg.:\nhttp://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
ocdav-->>-Client: 201 Created\nLocation: /data/{jwt}\nTUS-Resumable: 1.0.0
Note right of ocdav: The {jwt} contains the internal actual target, eg.:<br>http://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
ocdav-->>-Client: 201 Created<br>Location: /data/{jwt}<br>TUS-Resumable: 1.0.0
Client->>+datagateway: PATCH /data/{jwt}\nTUS-Resumable: 1.0.0\nUpload-Offset: 0
Client->>+datagateway: PATCH /data/{jwt}<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 0
Note over datagateway: unwrap the {jwt} target
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160\nX-Reva-Transfer: {jwt}
Note over dataprovider: storage driver\nhandles request
dataprovider-->>-datagateway: 204 No Content\nTUS-Resumable: 1.0.0\nUpload-Offset: 363976
datagateway-->>-Client: 204 No Content\nTUS-Resumable: 1.0.0\nUpload-Offset: 363976
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160<br>X-Reva-Transfer: {jwt}
Note over dataprovider: storage driver<br>handles request
dataprovider-->>-datagateway: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
datagateway-->>-Client: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
{{</mermaid>}}
@@ -81,47 +81,35 @@ sequenceDiagram
participant datagateway
participant dataprovider
participant nats
participant processing
Client->>+ocdav: POST /dav/spaces/{spaceid}
Note left of Client: Upload-Metadata: {base64 encoded filename etc}\nTUS-Resumable: 1.0.0
Client->>+ocdav: POST /dav/spaces/{spaceid}<br>Upload-Metadata: {base64 encoded filename etc}<br>TUS-Resumable: 1.0.0
ocdav->>+storageprovider: InitiateFileUpload
storageprovider-->>-ocdav: OK, Protocol tus, UploadEndpoint: /data, Token: {jwt}
Note right of ocdav: The {jwt} contains the internal actual target, eg.: http://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
ocdav-->>-Client: 201 Created
Note right of Client: Location: /data/{jwt}
Note right of Client: TUS-Resumable: 1.0.0
Note right of ocdav: The {jwt} contains the internal actual target, eg.:<br>http://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
ocdav-->>-Client: 201 Created<br>Location: /data/{jwt}<br>TUS-Resumable: 1.0.0
Client->>+datagateway: PATCH /data/{jwt}
Note right of datagateway: TUS-Resumable: 1.0.0\nUpload-Offset: 0
Client->>+datagateway: PATCH /data/{jwt}<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 0
Note over datagateway: unwrap the {jwt} target
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
Note over dataprovider: X-Reva-Transfer: {jwt}
Note over dataprovider: storage driver
Note over dataprovider: handles request
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160<br>X-Reva-Transfer: {jwt}
Note over dataprovider: storage driver<br>handles request
dataprovider-)nats: emit all-bytes-received event
nats-)processing: all-bytes-received({uploadid}) event
Note over dataprovider: TODO: A lot of time may pass here, we could use the `Prefer: respond-async` header to return early with a 202 Accepted status and a Location header to a websocket endpoint
Note over dataprovider: TODO: A lot of time may pass here, we could use<br> the `Prefer: respond-async` header to return early<br>with a 202 Accepted status and a Location header<br>to a websocket endpoint
alt success
processing-)nats: emit processing-finished({uploadid}) event
processing-)nats: emit processing-finished({uploadid}) event
nats-)dataprovider: processing-finished({uploadid}) event
dataprovider-->>-datagateway: 204 No Content
Note over datagateway: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
datagateway-->>-Client: 204 No Content
Note over Client: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
dataprovider-->>-datagateway: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
datagateway-->>-Client: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
else failure
activate dataprovider
activate datagateway
processing-)nats: emit processing-aborted({uploadid}) event
nats-)dataprovider: processing-aborted({uploadid}) event
Note over dataprovider: FIXME: What HTTP status code should we report?
Note over dataprovider: 422 Unprocessable Content is just a proposal
Note over dataprovider: see https://httpwg.org/specs/rfc9110.html#status.422
dataprovider-->>-datagateway: 422 Unprocessable Content
Note over datagateway: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
datagateway-->>-Client: 422 Unprocessable Content
Note over Client: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
Note over dataprovider: FIXME: What HTTP status code should we report?<br>422 Unprocessable Content is just a proposal, see<br>https://httpwg.org/specs/rfc9110.html#status.422
dataprovider-->>-datagateway: 422 Unprocessable Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
datagateway-->>-Client: 422 Unprocessable Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
end
{{</mermaid>}}
-14
View File
@@ -1,14 +0,0 @@
---
title: oCIS CLI Commands
date: 2025-11-13T00:00:00+00:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/cli-commands/
geekdocFilePath: _index.md
geekdocCollapseSection: true
weight: 20
---
{{< toc-tree >}}
CLI commands can either be embedded in a service or operate independently.
-22
View File
@@ -1,22 +0,0 @@
---
title: Create a New CLI Command
date: 2025-11-13T00:00:00+00:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/cli-commands/
geekdocFilePath: create-new-cli-command.md
weight: 20
---
{{< toc >}}
{{< hint info >}}
Existing commands should be checked for commonly used options whenever a new CLI command is created, regardless of whether it is embedded in a service or not. For an example you can see the [Service Independent CLI]({{< ref "./service_independent_cli.md" >}}) documentation.
{{< /hint >}}
## CLI Embedded in a Service
These commands are usually located in the `<service-name>/pkg/command` subfolder.
## CLI Independent of a Service
These commands are located in the `ocis/pkg/command` subfolder.
-33
View File
@@ -1,33 +0,0 @@
---
title: Document CLI Commands
date: 2025-11-13T00:00:00+00:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/cli-commands/
geekdocFilePath: document-cli-commands.md
weight: 20
---
{{< toc >}}
Any CLI command that is added to Infinite Scale must be documented here in the dev docs and the [admin docs](https://doc.owncloud.com/ocis/latest/maintenance/commands/commands.html). Note that the admin docs primarily distinguish between online and offline commands because the structure of the documentation is different. Typically, any command documented in the developer documentation is integrated into the admin documentation and adapted according to the target audience. The description here is for developers; the admin docs are derived from it.
{{< hint info >}}
Note that any CLI command requires documentation. However, it may be decided that a CLI command will not be included in the admin documentation. In such a case, the reasons should be valid.
{{< /hint >}}
## Type of CLI Commands
There are three types of CLI commands that require different documentation locations:
1. Commands that are embedded in a service such as:\
`ocis storage-users uploads`
2. Commands that are service independent such as:\
`ocis trash purge-empty-dirs` or `ocis revisions purge`
3. `curl` commands that can be one of the above.
## Rules
* **Service dependent** CLI commands:\
Add any CLI command into the repsective `README.md` **of the service**. Use as "template" an existing one such as in `services/storage-users/README.md` or `services/auth-app/README.md`. The content created will be transferred automatically to the service in the [Services]({{< ref "../services/" >}}) section.
* **Service independent** CLI commands:\
Add any CLI command into the [Service Independent CLI]({{< ref "./service_independent_cli.md" >}}) documentation. See the link for an example how to do so.
-41
View File
@@ -1,41 +0,0 @@
---
title: Service Dependent CLI
date: 2025-11-13T00:00:00+00:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/cli-commands/
geekdocFilePath: service_dependent_cli.md
---
This document describes ocis CLI commands that are **embedded in a service**.
{{< toc >}}
## Common Parameters
The ocis package offers a variety of CLI commands for monitoring or repairing ocis installations. Most of these commands have common parameters such as:
* `--help` (or `-h`)\
Use to print all available options.
* `--basePath` (or `-p`)\
Needs to point to a storage provider, paths can vary depending on your ocis installation. Example paths are:
```bash
.ocis/storage/users # bare metal installation
/var/tmp/ocis/storage/users # docker installation
...
```
* `--dry-run`\
This parameter, when available, defaults to `true` and must explicitly set to `false`.
* `--verbose` (or `-v`)\
Get a more verbose output.
## List of CLI Commands
For CLI commands that are **embedded in a service**, see the following services:
* [Auth-App]({{< ref "../services/auth-app/" >}})
* [Graph]({{< ref "../services/graph/" >}})
* [Postprocessing]({{< ref "../services/postprocessing/" >}})
* [Storage-Users]({{< ref "../services/storage-users/" >}})
-226
View File
@@ -1,226 +0,0 @@
---
title: Service Independent CLI
date: 2025-11-13T00:00:00+00:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/cli-commands/
geekdocFilePath: service_independent_cli.md
---
This document describes ocis CLI commands that are **service independent**.
{{< toc >}}
For **service dependent** CLI commands, see the following services:
* [Auth-App]({{< ref "../services/auth-app/" >}})
* [Graph]({{< ref "../services/graph/" >}})
* [Postprocessing]({{< ref "../services/postprocessing/" >}})
* [Storage-Users]({{< ref "../services/storage-users/" >}})
## Common Parameters
The ocis package offers a variety of CLI commands for monitoring or repairing ocis installations. Most of these commands have common parameters such as:
* `--help` (or `-h`)\
Use to print all available options.
* `--basePath` (or `-p`)\
Needs to point to a storage provider, paths can vary depending on your ocis installation. Example paths are:
```bash
.ocis/storage/users # bare metal installation
/var/tmp/ocis/storage/users # docker installation
...
```
* `--dry-run`\
This parameter, when available, defaults to `true` and must explicitly set to `false`.
* `--verbose` (or `-v`)\
Get a more verbose output.
## List of CLI Commands
### Backup CLI
The backup command allows inspecting the consistency of an ocis storage:
```bash
ocis backup consistency -p /base/path/storage/users
```
This will check the consistency of the storage and output a list of inconsistencies. Inconsistencies can be:
* **Orphaned Blobs**\
A blob in the blobstore that is not referenced by any file metadata.
* **Missing Blobs**\
A blob referenced by file metadata that is not present in the blobstore.
* **Missing Nodes**\
A node that is referenced by a symlink but doesn't exist.
* **Missing Link**\
A node that is not referenced by any symlink but should be.
* **Missing Files**\
A node that is missing essential files (such as the `.mpk` metadata file).
* **Missing/Malformed Metadata**\
A node that doesn't have any (or malformed) metadata.
This command provides additional options:
* `-b` / `--blobstore`\
Allows specifying the blobstore to use. Defaults to `ocis`. Empty blobs will not be checked. Can also be switched to `s3ng`, but needs addtional envvar configuration (see the `storage-users` service for more details).
* `--fail`\
Exits with non-zero exit code if inconsistencies are found. Useful for automation.
### Cleanup Orphaned Grants
Detect and optionally delete storage grants that have no corresponding share-manager entry.
Sharing in ocis relies on two truths. The share manager and the grants. When a share is created, ocis will
1. Create a grant for the specific file or folder.\
This grant is _checked when access to the file is requested_.
2. Create an entry in the `created.json`/`received.json` files of the specific user.\
These files are _checked whenever shares are listed_.
The process for creating a share is as follows: first, ocis creates the grant, and then adds the share entry. The reverse order is followed when deleting a share. This means that if the second step fails, the grant will still be present. This can be visually confirmed in the webUI. The webUI details of the "share" section will show an error fetching information for orphan grants.
The following command fixes the problem of orhaned grants.
Usage:
```bash
ocis shares clean-orphaned-grants \
--service-account-id "<id>" \
--service-account-secret "<secret>" \
[--force] \
[--space-id "<space-opaque-id>"] \
[--dry-run=false]
```
Notes:
- `--dry-run`\
Defaults to `true` (no deletions). Set to `false` to remove orphaned grants.
- `--space-id`\
Limit the scan to a specific storage space (opaque ID).
- `--force`\
Force removal of suspected orphans even when listing shares fails.
- Public links are not touched.
### Cleanup Orphaned Shares
When a shared space or directory got deleted, use the `shares cleanup` command to remove those share orphans. This can't be done automatically at the moment.
```bash
ocis shares cleanup
```
### List Unified Roles
This command simplifies the process of finding out which UID belongs to which role. The command using markdown as output format is:
```bash
ocis graph list-unified-roles --output-format md
```
The output of this command includes the following information for each role:
* `Name`\
The human readable name of the role.
* `UID`\
The unique identifier of the role.
* `Enabled`\
Whether the role is enabled or not.
* `Description`\
A short description of the role.
* `Condition`
* `Allowed Resource Actions`
**Example output (shortned)**
| # | LABEL | UID | ENABLED | DESCRIPTION | CONDITION | ALLOWED RESOURCE ACTIONS |
|:--:|:--------------------------------:|:------------------------------------:|:--------:|:------------------------------------------------------------------------------------:|:---------------------------------------------------------:|:----------------------------------------:|
| 1 | Viewer | b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5 | enabled | View and download. | exists @Resource.File | libre.graph/driveItem/path/read |
| | | | | | exists @Resource.Folder | libre.graph/driveItem/quota/read |
| | | | | | exists @Resource.File && @Subject.UserType=="Federated" | libre.graph/driveItem/content/read |
| | | | | | exists @Resource.Folder && @Subject.UserType=="Federated" | libre.graph/driveItem/children/read |
| | | | | | | libre.graph/driveItem/deleted/read |
| | | | | | | libre.graph/driveItem/basic/read |
| 2 | ViewerListGrants | d5041006-ebb3-4b4a-b6a4-7c180ecfb17d | disabled | View, download and show all invite
### Move Stuck Uploads
In some cases of saturated disk usage, Infinite Scale metadata may become stuck. This can occur when file metadata is being moved to its final destination after file operations. This issue was primarily seen with shares, where uploaded files could not be accessed. The required filename parameter aligns with Infinite Scale's internal processes and is used to complete the formerly stuck move action.
```bash
ocis shares move-stuck-upload-blobs [--dry-run=false] -p /base/path/storage/users
```
This command provides additional options:
* `--dry-run` (default: `true`)\
Only print found files stuck in transition.\
Note: This is a safety measure. You must specify `--dry-run=false` for the command to be effective.
* `--filename` value (default: "received.json")\
File to move from `uploads/` to share manager metadata `blobs/`
### Revisions CLI
The revisions command allows removing the revisions of files in the storage.
```bash
ocis revisions purge -p /base/path/storage/users
```
It takes the `--resource-id` (or `--r`) parameter which specify the scope of the command:
* An empty string (default) removes all revisions from all spaces.
* A spaceID (like `d419032c-65b9-4f4e-b1e4-0c69a946181d\$44b5a63b-540c-4002-a674-0e9c833bbe49`) removes all revisions in that space.
* A resourceID (e.g. `d419032c-65b9-4f4e-b1e4-0c69a946181d\$44b5a63b-540c-4002-a674-0e9c833bbe49\!e8a73d49-2e00-4322-9f34-9d7f178577b2`) removes all revisions from that specific file.
This command provides additional options:
* `--dry-run` (default: `true`)\
Do not remove any revisions but print the revisions that would be removed.
* `-b` / `--blobstore`\
Allows specifying the blobstore to use. Defaults to `ocis`. Can be switched to `s3ng` but needs addtional envvar configuration (see the `storage-users` service for more details).
* `-v` / `--verbose`\
Prints additional information about the revisions that are removed.
* `--glob-mechanism` (default: `glob`\
(advanced) Allows specifying the mechanism to use for globbing. Can be `glob`, `list` or `workers`. In most cases the default `glob` does not need to be changed. If large spaces need to be purged, `list` or `workers` can be used to improve performance at the cost of higher cpu and ram usage. `list` will spawn 10 threads that list folder contents in parallel. `workers` will use a special globbing mechanism and multiple threads to achieve the best performance for the highest cost.
### Service Health
The service health CLI command allows checking the health status of a service. If there are no issues found, nothing health related will get printed.
```bash
ocis <service-name> health
```
**Examples**
* The `collaboration` service has been started but not configured and is therefore not in a healthy state:
```bash
ocis collaboration health
The WOPI secret has not been set properly in your config for collaboration. Make sure your /root/.ocis/config config contains the proper values (e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in the config/corresponding environment variable).
```
* The `antivirus` service has not been started, the health check responds accordingly:
```bash
ocis antivirus health
{"level":"fatal","service":"antivirus","error":"Get \"http://127.0.0.1:9277/healthz\": dial tcp 127.0.0.1:9277: connect: connection refused","time":"2024-10-28T17:47:54+01:00","message":"Failed to request health check"}
```
### Trash CLI
The trash cli allows removing empty folders from the trashbin. This should be used to speed up trash bin operations.
```bash
ocis trash purge-empty-dirs -p /base/path/storage/users
```
This command provides additional options:
* `--dry-run` (default: `true`)\
Do not remove any empty folders but print the empty folders that would be removed.
-9
View File
@@ -1,9 +0,0 @@
---
title: Clients
date: 2023-12-06T13:00:00+01:00
weight: 10
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/clients/
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
+1 -1
View File
@@ -37,7 +37,7 @@ If you have dynamic client registration enabled on your OpenID Connect identity
If you're using a dedicated OpenID Connect client for the OIDC-agent, we recommend a public one with the following two redirect URIs: `http://127.0.0.1:*` and `http://localhost:*`. Alternatively you also may use the already existing OIDC client of the ownCloud Desktop Client (`--client-id=xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69` and `--client-secret=UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh`, no `--pub` set, request specific scope for offline access), e.g.:
``` bash
oidc-gen \
oidc-gen /
--client-id=xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69 \
--client-secret=UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh \
--issuer https://cloud.ocis.test \
+257
View File
@@ -0,0 +1,257 @@
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"reflect"
"regexp"
"strings"
"text/template"
"time"
"sort"
{{- range $key, $value := .}}
pkg{{$key}} "{{$value}}"
{{- end}}
)
// ConfigField is the representation of one configuration field
type ConfigField struct {
EnvVars []string
DefaultValue string
Type string
Description string
VersionInfo string
DeprecationLink string
}
// DeprecationField holds information about deprecation
type DeprecationField struct {
DeprecationVersion string
DeprecationInfo string
DeprecationReplacement string
RemovalVersion string
}
// EnvVar holds information about one envvar
type EnvVar struct {
Name string
DefaultValue string
Type string
Description string
Services []string
}
type templateData struct {
ExtensionName string
Fields []ConfigField
Deprecations []DeprecationField
HasDeprecations bool
Timestamp string
}
func main() {
fmt.Println("Generating adoc documentation for environment variables:")
adoc, err := os.ReadFile("../../docs/templates/ADOC.tmpl")
if err != nil {
log.Fatal(err)
}
dpr, err := os.ReadFile("../../docs/templates/ADOC_deprecation.tmpl")
if err != nil {
log.Fatal(err)
}
replacer := strings.NewReplacer(
"github.com/owncloud/ocis/v2/services/", "",
"/pkg/config/defaults", "",
)
var (
fields []ConfigField
deprecations []DeprecationField
adocFile *os.File
dprFile *os.File
)
adoctpl := template.Must(template.New("").Parse(string(adoc)))
dprtpl := template.Must(template.New("").Parse(string(dpr)))
m := map[string]interface{}{
{{- range $key, $value := .}}
"{{$value}}": *pkg{{$key}}.FullDefaultConfig(),
{{- end }}
}
targetFolder := "../../docs/services/_includes/adoc/"
all := make(map[string]EnvVar)
for pkg, conf := range m {
service := replacer.Replace(pkg)
timestamp := time.Now().Format("2006-01-02-15-04-05")
fields, deprecations = GetAnnotatedVariables(conf, timestamp)
var hasDeprecations bool
if len(deprecations) > 0 {
hasDeprecations = true
}
for _, f := range fields {
for _, e := range f.EnvVars {
if env, ok := all[e]; ok {
env.Services = append(env.Services, service)
sort.Slice(env.Services, func(i, j int) bool {
return env.Services[i] < env.Services[j]
})
all[e] = env
} else {
all[e] = EnvVar{
Name: e,
Description: f.Description,
Type: f.Type,
DefaultValue: f.DefaultValue,
Services: []string{service},
}
}
}
}
if len(fields) > 0 || len(deprecations) > 0 {
fmt.Printf("... %s\n", pkg)
td := templateData{
ExtensionName: service,
Fields: fields,
Deprecations: deprecations,
HasDeprecations: hasDeprecations,
Timestamp: timestamp,
}
adocFile, err = os.Create(filepath.Join(targetFolder, service + "_configvars.adoc"))
if err != nil {
log.Fatalf("Failed to create target file: %s", err)
}
defer adocFile.Close()
if err := adoctpl.Execute(adocFile, td); err != nil {
log.Fatalf("Failed to execute template: %s", err)
}
dprFile, err = os.Create(filepath.Join(targetFolder, service + "_deprecation.adoc"))
if err != nil {
log.Fatalf("Failed to create target file: %s", err)
}
defer dprFile.Close()
if err := dprtpl.Execute(dprFile, td); err != nil {
log.Fatalf("Failed to execute template: %s", err)
}
}
}
// render global env vars
tmplValues := make([]map[string]interface{}, 0)
for _, env := range all {
if len(env.Services) > 1 {
tmplValues = append(tmplValues, map[string]interface{}{
"Name": env.Name,
"Services": env.Services,
"Description": env.Description,
"DefaultValue": env.DefaultValue,
"Type": env.Type,
})
}
}
// sort
sort.Slice(tmplValues, func(i, j int) bool {
return tmplValues[i]["Name"].(string) < tmplValues[j]["Name"].(string)
})
glc, err := os.ReadFile("../../docs/templates/ADOC_global.tmpl")
if err != nil {
log.Fatal(err)
}
gltpl := template.Must(template.New("").Parse(string(glc)))
glfile, err := os.Create(filepath.Join(targetFolder, "global_configvars.adoc"))
if err != nil {
log.Fatalf("Failed to create target file: %s", err)
}
if err := gltpl.Execute(glfile, tmplValues); err != nil {
log.Printf("Failed to execute template: %s", err)
}
fmt.Println("done")
}
func GetAnnotatedVariables(s interface{}, timestamp string) ([]ConfigField, []DeprecationField) {
t := reflect.TypeOf(s)
v := reflect.ValueOf(s)
var fields []ConfigField
var deprecations []DeprecationField
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
value := v.Field(i)
switch value.Kind() {
default:
desc := field.Tag.Get("desc")
env, ok := field.Tag.Lookup("env")
deprecationLink := ""
if !ok {
continue
}
deprecationVersion, _ := field.Tag.Lookup("deprecationVersion")
removalVersion, _ := field.Tag.Lookup("removalVersion")
deprecationInfo, _ := field.Tag.Lookup("deprecationInfo")
deprecationReplacement, _ := field.Tag.Lookup("deprecationReplacement")
if deprecationVersion != "" ||
removalVersion != "" ||
deprecationInfo != "" ||
deprecationReplacement != "" {
deprecationLink = fmt.Sprintf("xref:deprecation-note-%s[Deprecation Note]", timestamp)
}
v := fmt.Sprintf("%v", value.Interface())
td := strings.Split(env, ";")
// re := regexp.MustCompile(`^(https?:\/\/)`)
// v = re.ReplaceAllString(v,"\\$1")
re := regexp.MustCompile(`(https?:\/\/)`)
desc = re.ReplaceAllString(desc, "\\$1")
re = regexp.MustCompile(`(\|)`)
v = re.ReplaceAllString(v, "\\$1")
typeName := value.Type().Name()
if typeName == "" {
typeName = value.Type().String()
}
fields = append(fields,
ConfigField{
EnvVars: td,
DefaultValue: v,
Description: desc,
Type: typeName,
DeprecationLink: deprecationLink,
})
if deprecationLink != "" {
deprecations = append(deprecations,
DeprecationField{
DeprecationVersion: deprecationVersion,
DeprecationInfo: deprecationInfo,
DeprecationReplacement: deprecationReplacement,
RemovalVersion: removalVersion,
})
}
case reflect.Ptr:
// PolicySelectors in the Proxy are being skipped atm
// they are not configurable via env vars, if that changes
// they are probably added to the Sanitize() function
// and this should not be an issue then
if !value.IsZero() && value.Elem().CanInterface() {
f, d := GetAnnotatedVariables(value.Elem().Interface(), timestamp)
fields = append(fields, f...)
deprecations = append(deprecations, d...)
}
case reflect.Struct:
f, d := GetAnnotatedVariables(value.Interface(), timestamp)
fields = append(fields, f...)
deprecations = append(deprecations, d...)
}
}
return fields, deprecations
}
-230
View File
@@ -1,230 +0,0 @@
import yaml
import sys
import os
from datetime import date
from urllib.request import urlopen
## this python script generates based on defined variables adoc files for added, removed and deprecated
## envvars based on the env_vars.yaml that must exist in each referenced version.
## it is CRUCIAL that the version compared TO is actual - do required updates first!
## note that env_vars.yaml has been introduced with v6.0.0, comparing earlier is not possible
## note that we are always comparing from github sources and NOT local files
## when the files got created, you MUST do some post work manually like referencing services with xref:
## when running, files get recreated, existing content gets overwritten!!
## !! you MUST run this script from the local ocis repo root !!
## like: python3 docs/helpers/changed_envvars.py
## create a branch to prepare the changes
# CHANGE according your needs
# old is the base version to compare from which is always a tagged release
# new is the target version to compare to and can be a branch or tagged
# tagged versions must be of format: 'tags/v7.1.0'
# branches are different, master or stable-x.y: 'heads/master'
# stick with master because the follow up process is much easier and you avoid confusion
versionOld: str = 'tags/v7.3.0'
versionNew: str = 'heads/master'
# CHANGE according your needs
from_version: str = '7.3.0'
to_version: str = '8.0.0'
# CHANGE according your needs
# this will create files like 5.0.0-7.0.0-added and 5.0.0-7.0.0-removed
# this should match which versions you compare. master is ok if that is the base for a named release
nameComponent: str = '7.3.0-8.0.0'
# ADD new elements when a new version has been published so that it gets excluded
# array of version patterns to be excluded for added items. we dont need patch versions
excludePattern: list[str] = ['pre5.0', '5.0', '6.0', '6.0.0', '6.0.1', '6.1.0', '6.7', '7.0', '7.0.0', '7.1.0', '7.2.0', '7.3.0']
# DO NOT CHANGE
# this is the path the added/removed result is written to
adocWritePath: str = 'docs/services/general-info/envvars/env-var-deltas'
# define root sources from github
git_left_dir: str = 'https://raw.githubusercontent.com/owncloud/ocis/refs/'
git_right_dir: str ='/docs/helpers/env_vars.yaml'
def check_path() -> None:
# check which path the script started. we can do this because the target path must be present
# exit if not present
if not os.path.exists(adocWritePath):
print('Path not found: ' + adocWritePath)
sys.exit()
def get_sources(versionOld: str, versionNew: str) -> (str, str):
urlOld = git_left_dir + versionOld + git_right_dir
urlNew = git_left_dir + versionNew + git_right_dir
try:
fileOld = urlopen(urlOld).read().decode('utf-8')
fileNew = urlopen(urlNew).read().decode('utf-8')
return yaml.safe_load(fileOld), yaml.safe_load(fileNew)
except Exception as e:
print(e)
sys.exit()
def get_added(fileNew: str, excludePattern: list[str]) -> set[str]:
# create dict with added items
addedWith: set[str] = {}
for key, value in fileNew.items():
if not fileNew[key]['introductionVersion'] in str(excludePattern):
addedWith[key] = value
return addedWith
def get_removed(fileOld: str, fileNew: str) -> set[str]:
# create dict with removed items
removedWith: set[str] = {}
for key, value in fileOld.items():
if not key in fileNew:
removedWith[key] = value
return removedWith
def get_deprecated(fileNew: str) -> set[str]:
# create dict with deprecated items
deprecatedWith: set[str] = {}
for key, value in fileNew.items():
if value['removalVersion']:
deprecatedWith[key] = value
return deprecatedWith
def create_adoc_start(type_text: str, from_version: str, to_version: str, creation_date: str, columns: str, closing: str) -> str:
# create the page/table header
# 'closing' contains variable column names dependen if added/removed ir deprecated
a: str = '''// # {ftype} Variables between oCIS {ffrom} and oCIS {fto}
// commenting the headline to make it better includable
// table created per {fdate}
// the table should be recreated/updated on source () changes
[width="100%",cols="{fcolumns}",options="header"]
|===
| Service | Variable | Description | {fclosing}
'''.format(ftype = type_text, ffrom = from_version, fto = to_version, fdate = creation_date, fcolumns = columns, fclosing = closing)
return a
def create_adoc_end() -> str:
# close the table
a: str = '''|===
'''
return a
def add_adoc_line_1(service: str, variable: str, description: str, value: str) -> str:
# add a table line for added/removed
# the dummy values are only here to have the same number of parameters as add_adoc_line_2
a: str = '''| {fservice}
| {fvariable}
| {fdescription}
| {fvalue}
'''.format(fservice = service, fvariable = variable, fdescription = description, fvalue = value)
return a
def add_adoc_line_2(service, variable, description, removalVersion, deprecationInfo):
# add a table line for deprecated, this has different columns
a: str = '''| {fservice}
| {fvariable}
| {fdescription}
| {fremovalVersion}
| {fdeprecationInfo}
'''.format(fservice = service, fvariable = variable, fdescription = description, fremovalVersion = removalVersion, fdeprecationInfo = deprecationInfo)
return a
def create_table(type_text: str, source_dict: set[str], from_version: str, to_version: str, date_today: str, type: bool = False) -> str:
# get the table header
columns: str = '~,~,~,~' if type == False else '~,~,~,~,~'
closing: str = 'Default' if type == False else 'Removal Version | Deprecation Info'
a: str = create_adoc_start(type_text, from_version, to_version, date_today, columns, closing)
if not type:
# added and removed envvars
# first add all ocis_
for key, value in source_dict.items():
if key.startswith('OCIS_'):
a += add_adoc_line_1(
# note that any envvar starting with ocis cant be assigned to a service automatically
# the xref must be corrected in the output file manually
'xref:deployment/services/env-vars-special-scope.adoc[Special Scope Envvars]',
key,
value['description'],
value['defaultValue']
)
# then add all others
for key, value in source_dict.items():
if not key.startswith('OCIS_'):
a += add_adoc_line_1(
'xref:{s-path}/xxx.adoc[xxx]',
key,
value['description'],
value['defaultValue']
)
else:
# deprecated envvars
# first add all ocis_
for key, value in source_dict.items():
if key.startswith('OCIS_'):
a += add_adoc_line_2(
'xref:deployment/services/env-vars-special-scope.adoc[Special Scope Envvars]',
key,
value['description'],
value['removalVersion'],
value['deprecationInfo']
)
# then add all others
for key, value in source_dict.items():
if not key.startswith('OCIS_'):
a += add_adoc_line_2(
'xref:{s-path}/xxx.adoc[xxx]',
key,
value['description'],
value['removalVersion'],
value['deprecationInfo']
)
# finally close the table
a += create_adoc_end()
return a
def write_output(a: str, type_text: str) -> None:
# write the content to a file
try:
with open(adocWritePath + '/' + nameComponent + '-' + type_text + '.adoc', 'w') as file:
file.write(a)
except Exception as e:
print('Failed creating ' + type_text + ' file')
print(e)
sys.exit()
def main() -> None:
## here are the tasks in sequence
fileOld: str = ''
fileNew: str = ''
addedWith: set[str] = {}
removedWith: set[str] = {}
deprecatedWith: set[str] = {}
check_path()
fileOld, fileNew = get_sources(versionOld, versionNew)
addedWith = get_added(fileNew, excludePattern)
removedWith = get_removed(fileOld, fileNew)
deprecatedWith = get_deprecated(fileNew)
a: str = create_table('Added', addedWith, from_version, to_version, date.today().strftime('%Y.%m.%d'))
r: str = create_table('Removed', removedWith, from_version, to_version, date.today().strftime('%Y.%m.%d'))
d: str = create_table('Deprecated', deprecatedWith, from_version, to_version, date.today().strftime('%Y.%m.%d'), True)
write_output(a, 'added')
write_output(r, 'removed')
write_output(d, 'deprecated')
print('Success, see files created in: ' + adocWritePath)
if __name__ == '__main__':
main()
+9 -21
View File
@@ -7,16 +7,14 @@ import (
"os/exec"
"path"
"path/filepath"
"runtime"
"strings"
"text/template"
)
var targets = map[string]string{
"templates/adoc-generator.go.tmpl": "output/adoc/adoc-generator.go",
"templates/example-config-generator.go.tmpl": "output/exampleconfig/example-config-generator.go",
"templates/environment-variable-docs-generator.go.tmpl": "output/env/environment-variable-docs-generator.go",
"templates/envar-delta-table.go.tmpl": "output/env/envvar-delta-table.go",
"adoc-generator.go.tmpl": "output/adoc/adoc-generator.go",
"example-config-generator.go.tmpl": "output/exampleconfig/example-config-generator.go",
"environment-variable-docs-generator.go.tmpl": "output/env/environment-variable-docs-generator.go",
}
// RenderTemplates does something with templates
@@ -39,10 +37,7 @@ func RenderTemplates() {
runIntermediateCode(output)
}
fmt.Println("Cleaning up")
err = os.RemoveAll("output")
if err != nil {
fmt.Println(err)
}
os.RemoveAll("output")
}
func generateIntermediateCode(templatePath string, intermediateCodePath string, paths []string) {
@@ -68,19 +63,12 @@ func generateIntermediateCode(templatePath string, intermediateCodePath string,
func runIntermediateCode(intermediateCodePath string) {
fmt.Println("Running intermediate go code for " + intermediateCodePath)
defaultConfigPath := "/etc/ocis"
defaultDataPath := "/var/lib/ocis"
os.Setenv("OCIS_BASE_DATA_PATH", defaultDataPath)
os.Setenv("OCIS_CONFIG_DIR", defaultConfigPath)
// Set AUTOMEMLIMIT_EXPERIMENT=system on non-Linux systems to avoid cgroups errors
if runtime.GOOS != "linux" {
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
}
out, err := exec.Command("go", "run", intermediateCodePath).CombinedOutput()
defaultPath := "~/.ocis"
os.Setenv("OCIS_BASE_DATA_PATH", defaultPath)
os.Setenv("OCIS_CONFIG_DIR", path.Join(defaultPath, "config"))
out, err := exec.Command("go", "run", intermediateCodePath).Output()
if err != nil {
log.Fatal(string(out), err)
log.Fatal(err)
}
fmt.Println(string(out))
}
-122
View File
@@ -1,122 +0,0 @@
package main
import (
"fmt"
"github.com/rogpeppe/go-internal/semver"
"gopkg.in/yaml.v2"
"log"
"os"
"path/filepath"
"text/template"
)
const envVarYamlSource = "env_vars.yaml"
var envVarOutPutTemplates = map[string]string{
"added": "templates/env-vars-added.md.tmpl",
"removed": "templates/env-vars-removed.md.tmpl",
"deprecated": "templates/env-vars-deprecated.md.tmpl",
}
// ConfigField represents the env-var annotation in the code
type ConfigField struct {
Name string `yaml:"name"`
DefaultValue string `yaml:"defaultValue"`
Type string `yaml:"type"`
Description string `yaml:"description"`
IntroductionVersion string `yaml:"introductionVersion"`
DeprecationVersion string `yaml:"deprecationVersion"`
RemovalVersion string `yaml:"removalVersion"`
DeprecationInfo string `yaml:"deprecationInfo"`
}
type TemplateData struct {
StartVersion string
EndVersion string
DeltaFields []*ConfigField
}
// RenderEnvVarDeltaTable generates tables for env-var deltas
func RenderEnvVarDeltaTable(osArgs []string) {
if !semver.IsValid(osArgs[2]) {
log.Fatalf("Start version invalid semver: %s", osArgs[2])
}
if !semver.IsValid(osArgs[3]) {
log.Fatalf("Target version invalid semver: %s", osArgs[3])
}
if semver.Compare(osArgs[2], osArgs[3]) >= 0 {
log.Fatalf("Start version %s is not smaller than target version %s", osArgs[2], osArgs[3])
}
if semver.Compare(osArgs[2], "v5.0.0") < 0 {
log.Fatalf("This tool does not support versions prior v5.0.0, (given %s)", osArgs[2])
}
startVersion := osArgs[2]
endVersion := osArgs[3]
fmt.Printf("Generating tables for env-var deltas between version %s and %s...\n", startVersion, endVersion)
curdir, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
fullYamlPath := filepath.Join(curdir, envVarYamlSource)
configFields := make(map[string]*ConfigField)
variableList := map[string][]*ConfigField{
"added": {},
"removed": {},
"deprecated": {},
}
fmt.Printf("Reading existing variable definitions from %s\n", fullYamlPath)
yfile, err := os.ReadFile(fullYamlPath)
if err == nil {
err := yaml.Unmarshal(yfile, configFields)
if err != nil {
log.Fatal(err)
}
}
fmt.Printf("Success, found %d entries\n", len(configFields))
for _, field := range configFields {
if field.IntroductionVersion != "" &&
field.IntroductionVersion != "pre5.0" &&
!semver.IsValid(field.IntroductionVersion) &&
field.IntroductionVersion[0] != 'v' {
field.IntroductionVersion = "v" + field.IntroductionVersion
}
if field.IntroductionVersion != "pre5.0" && !semver.IsValid(field.IntroductionVersion) {
fmt.Printf("Invalid semver for field %s: %s\n", field.Name, field.IntroductionVersion)
os.Exit(1)
}
//fmt.Printf("Processing field %s dv: %s, iv: %s\n", field.Name, field.DeprecationVersion, field.IntroductionVersion)
if semver.IsValid(field.RemovalVersion) && semver.Compare(startVersion, field.RemovalVersion) < 0 && semver.Compare(endVersion, field.RemovalVersion) >= 0 {
variableList["removed"] = append(variableList["removed"], field)
}
if semver.IsValid(field.DeprecationVersion) && semver.Compare(startVersion, field.DeprecationVersion) <= 0 && semver.Compare(endVersion, field.DeprecationVersion) > 0 {
variableList["deprecated"] = append(variableList["deprecated"], field)
}
if semver.IsValid(field.IntroductionVersion) && semver.Compare(startVersion, field.IntroductionVersion) <= 0 && semver.Compare(endVersion, field.IntroductionVersion) >= 0 {
fmt.Printf("Adding field %s iv: %s\n", field.Name, field.IntroductionVersion)
variableList["added"] = append(variableList["added"], field)
}
}
for templateName, templatePath := range envVarOutPutTemplates {
content, err := os.ReadFile(templatePath)
if err != nil {
log.Fatal(err)
}
tpl := template.Must(template.New(templateName).Parse(string(content)))
err = os.MkdirAll("output/env-deltas", 0700)
if err != nil {
log.Fatal(err)
}
targetFile, err := os.Create(filepath.Join("output/env-deltas", fmt.Sprintf("%s-%s-%s.md", startVersion, endVersion, templateName)))
if err != nil {
log.Fatal(err)
}
err = tpl.Execute(targetFile, TemplateData{
StartVersion: startVersion,
EndVersion: endVersion,
DeltaFields: variableList[templateName],
})
if err != nil {
log.Fatal(err)
}
}
}
-16804
View File
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,97 @@
package main
import (
"fmt"
"html"
"log"
"os"
"path/filepath"
"reflect"
"strings"
"text/template"
{{- range $key, $value := .}}
pkg{{$key}} "{{$value}}"
{{- end}})
type ConfigField struct {
Name string
DefaultValue string
Type string
Description string
}
func main() {
fmt.Println("Generating documentation for environment variables:")
content, err := os.ReadFile("../../docs/templates/CONFIGURATION.tmpl")
if err != nil {
log.Fatal(err)
}
replacer := strings.NewReplacer(
"github.com/owncloud/ocis/v2/services/", "",
"/pkg/config/defaults", "",
)
var fields []ConfigField
var targetFile *os.File
tpl := template.Must(template.New("").Parse(string(content)))
m := map[string]interface{}{
{{- range $key, $value := .}}
"{{$value}}": *pkg{{$key}}.FullDefaultConfig(),
{{- end }}
}
targetFolder := "../../docs/services/_includes/"
for pkg, conf := range m {
fields = GetAnnotatedVariables(conf)
if len(fields) > 0 {
fmt.Printf("... %s\n", pkg)
targetFile, err = os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "_configvars.md"))
if err != nil {
log.Fatalf("Failed to create target file: %s", err)
}
defer targetFile.Close()
if err := tpl.Execute(targetFile, fields); err != nil {
log.Fatalf("Failed to execute template: %s", err)
}
}
}
fmt.Println("done")
}
func GetAnnotatedVariables(s interface{}) []ConfigField {
t := reflect.TypeOf(s)
v := reflect.ValueOf(s)
var fields []ConfigField
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
value := v.Field(i)
switch value.Kind() {
default:
desc := field.Tag.Get("desc")
env, ok := field.Tag.Lookup("env")
if !ok {
continue
}
v := fmt.Sprintf("%v", value.Interface())
typeName := value.Type().Name()
if typeName == "" {
typeName = value.Type().String()
}
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: typeName})
case reflect.Ptr:
// PolicySelectors in the Proxy are being skipped atm
// they are not configurable via env vars, if that changes
// they are probably added to the Sanitize() function
// and this should not be an issue then
if !value.IsZero() && value.Elem().CanInterface() {
fields = append(fields, GetAnnotatedVariables(value.Elem().Interface())...)
}
case reflect.Struct:
fields = append(fields, GetAnnotatedVariables(value.Interface())...)
}
}
return fields
}
+50
View File
@@ -0,0 +1,50 @@
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"strings"
"gopkg.in/yaml.v2"
{{- range $key, $value := .}}
pkg{{$key}} "{{$value}}"
{{- end}}
)
func main() {
replacer := strings.NewReplacer(
"github.com/owncloud/ocis/v2/services/", "",
"/pkg/config/defaults", "",
)
cfg := map[string]string{
{{- range $key, $value := .}}
replacer.Replace("{{$value}}"): func() string {
fmt.Println("Generating example YAML config for {{ $value -}}")
c := pkg{{$key}}.FullDefaultConfig()
yml, err := yaml.Marshal(c)
if err != nil {
log.Fatalf("Marshalling yaml for pkg0 failed: %s\n", err)
}
return fmt.Sprintf("# Autogenerated\n# Filename: %s-config-example.yaml\n\n%s", replacer.Replace("{{ $value }}"),string(yml))
}(),
{{- end}}
}
for pkg, yml := range cfg {
targetFolders := []string{
// TODO: comment in when it is clear how to commit this to the structure of the master|main branch
// filepath.Join("../../", pkg, "/config"),
"../../docs/services/_includes/",
}
for _, targetFolder := range targetFolders {
os.MkdirAll(targetFolder, 0700)
targetYamlFile, err := os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "-config-example.yaml"))
if err != nil {
log.Fatalf("Failed to create target file for : %s", err)
}
defer targetYamlFile.Close()
targetYamlFile.WriteString(yml)
}
}
}
+14 -45
View File
@@ -68,23 +68,8 @@ func GetRogueEnvs() {
if err := os.Chdir("../../"); err != nil {
log.Fatal(err)
}
// Option to process a specific directory, for faster development iteration
processDir := os.Getenv("DIR")
if processDir == "" {
processDir = "."
}
fmt.Printf("Processing directory: %s\n", processDir)
// Old command `grep -RHn os.Getenv $DIR --exclude-dir=vendor | grep -v extendedEnv.go | grep \\.go`
// New command, 10x faster than direct grep:
// C_ALL=C - Sets locale to C for consistent output
// find %s -type f -name '*.go' - Finds all .go files in the specified directory
// xargs -0 -P $(getconf _NPROCESSORS_ONLN) - Processes files in parallel using all available CPU cores
// grep -F -Hn 'os.Getenv' - Searches for literal "os.Getenv" with filename and line number output
grepCmd := fmt.Sprintf("C_ALL=C find %s -type f -name '*.go' -not -path '*/vendor/*' -print0 | xargs -0 -P $(getconf _NPROCESSORS_ONLN) grep -F -Hn 'os.Getenv' | grep -v extendedEnv.go", processDir)
out, err := exec.Command("sh", "-c", grepCmd).Output()
fmt.Println("Gathering variable definitions from source")
out, err := exec.Command("sh", "-c", "grep -RHn os.Getenv --exclude-dir=vendor | grep -v extendedEnv.go |grep \\.go").Output()
if err != nil {
log.Fatal(err)
}
@@ -92,45 +77,29 @@ func GetRogueEnvs() {
// find current vars
currentVars := make(map[string]Variable)
totalLines := len(lines)
fmt.Printf("Processing %d lines...\n", totalLines)
for _, l := range lines {
if l == "" {
continue
}
fmt.Printf("Parsing %s\n", l)
r := strings.SplitN(l, ":", 3)
if len(r) != 3 || r[0] == "" || r[2] == "" {
r := strings.SplitN(l, ":\t", 2)
if len(r) != 2 || r[0] == "" || r[1] == "" {
continue
}
// Remove ./ prefix from path if it exists
path := strings.TrimPrefix(r[0], "./")
path = path + ":" + r[1] // Reconstruct path:line
content := r[2]
res := re.FindAllSubmatch([]byte(content), -1)
if len(res) < 1 {
fmt.Printf(" No envvar found in content: %s\n", content)
res := re.FindAllSubmatch([]byte(r[1]), -1)
if len(res) != 1 || len(res[0]) < 2 {
fmt.Printf("Error envvar not matching pattern: %s", r[1])
continue
}
for _, m := range res {
name := strings.Trim(string(m[1]), "\"")
fmt.Printf(" Found envvar: %s at %s\n", name, path)
currentVars[path+name] = Variable{
RawName: name,
Path: path,
FoundInCode: true,
Name: name,
}
path := r[0]
name := strings.Trim(string(res[0][1]), "\"")
currentVars[path+name] = Variable{
RawName: name,
Path: path,
FoundInCode: true,
Name: name,
}
}
fmt.Printf("Found %d current variables\n", len(currentVars))
// adjust existing vars
for i, v := range vars.Variables {
_, ok := currentVars[v.Path+v.RawName]
+22 -135
View File
@@ -1,6 +1,6 @@
variables:
- rawname: CS3_GATEWAY
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:77
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:76
foundincode: true
name: CS3_GATEWAY
type: ""
@@ -8,66 +8,16 @@ variables:
description: ""
do_ignore: true
- rawname: CS3_MACHINE_AUTH_API_KEY
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:78
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:77
foundincode: true
name: CS3_MACHINE_AUTH_API_KEY
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: DAYS
path: tests/qa-activity-report/generate-qa-activity-report.go:94
foundincode: true
name: DAYS
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: _registryRegisterIntervalEnv
path: ocis-pkg/registry/expiry.go:19
foundincode: true
name: EXPERIMENTAL_REGISTER_INTERVAL
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: _registryRegisterTTLEnv
path: ocis-pkg/registry/expiry.go:28
foundincode: true
name: EXPERIMENTAL_REGISTER_TTL
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: GITHUB_TOKEN
path: tools/ci-reporter/cmd/list-failed-commits/main.go:116
foundincode: true
name: GITHUB_TOKEN
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: _serverMaxConnectionAgeEnv
path: ocis-pkg/service/grpc/keepalive.go:19
foundincode: true
name: GRPC_MAX_CONNECTION_AGE
type: Duration
default_value: "9223372036854775807"
description: Timeout for GRPC connections. After timeout, a new connection will
be established automatically. The default value is in ns and is about 2.5 mio
h.
do_ignore: false
- rawname: MICRO_LOG_LEVEL
path: ocis-pkg/log/log.go:34
foundincode: true
name: MICRO_LOG_LEVEL
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: MICRO_LOG_LEVEL
path: ocis-pkg/log/log.go:31
foundincode: false
foundincode: true
name: MICRO_LOG_LEVEL
type: string
default_value: Error
@@ -75,118 +25,55 @@ variables:
on supervision of ownCloud Support.
do_ignore: false
- rawname: MICRO_LOG_LEVEL
path: ocis-pkg/log/log.go:30
path: ocis-pkg/log/log.go:35
foundincode: true
name: MICRO_LOG_LEVEL
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: _registryEnv
path: ocis-pkg/registry/registry.go:88
- rawname: registryEnv
path: ocis-pkg/registry/registry.go:44
foundincode: true
name: MICRO_REGISTRY
type: string
default_value: nats-js-kv
description: 'The Go micro registry type to use. Supported types are: ''memory''
and ''nats-js-kv'' (default). Only change on supervision of ownCloud Support.'
do_ignore: false
- rawname: _registryAddressEnv
path: ocis-pkg/registry/registry.go:92
foundincode: true
name: MICRO_REGISTRY_ADDRESS
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: _registryAddressEnv
path: ocis-pkg/natsjsregistry/registry.go:206
description: 'Go micro registry type to use. Supported types are: ''nats'', ''kubernetes'',
''etcd'', ''consul'' and ''memory''. Will be selected automatically. Only change
on supervision of ownCloud Support.'
do_ignore: false
- rawname: registryAddressEnv
path: ocis-pkg/registry/registry.go:42
foundincode: true
name: MICRO_REGISTRY_ADDRESS
type: string
default_value: 127.0.0.1:9233
default_value: ""
description: The bind address of the internal go micro framework. Only change on
supervision of ownCloud Support.
do_ignore: false
- rawname: _registryPasswordEnv
path: ocis-pkg/natsjsregistry/registry.go:234
foundincode: true
name: MICRO_REGISTRY_AUTH_PASSWORD
type: string
default_value: ""
description: Optional when using nats to authenticate with the nats cluster.
do_ignore: false
- rawname: _registryUsernameEnv
path: ocis-pkg/natsjsregistry/registry.go:234
foundincode: true
name: MICRO_REGISTRY_AUTH_USERNAME
type: string
default_value: ""
description: Optional when using nats to authenticate with the nats cluster.
do_ignore: false
- rawname: MONTH
path: tests/qa-activity-report/generate-qa-activity-report.go:92
foundincode: true
name: MONTH
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: OCIS_BASE_DATA_PATH
path: ocis-pkg/config/defaults/paths.go:23
foundincode: true
name: OCIS_BASE_DATA_PATH
type: string
default_value: ""
default_value: '''/var/lib/ocis'' or ''$HOME/.ocis/'''
description: The base directory location used by several services and for user data.
See the General Info section in the documentation for more details on defaults.
Services can have, if available, an individual setting with an own environment
variable.
Predefined to '/var/lib/ocis' for container images (inside the container) or '$HOME/.ocis/'
for binary releases. Services can have, if available, an individual setting with
an own environment variable.
do_ignore: false
- rawname: OCIS_BASE_DATA_PATH
path: ocis/pkg/command/shares.go:50
foundincode: true
name: OCIS_BASE_DATA_PATH
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: OCIS_CONFIG_DIR
path: ocis-pkg/config/defaults/paths.go:56
foundincode: true
name: OCIS_CONFIG_DIR
type: string
default_value: ""
description: The default directory location for config files. See the General Info
section in the documentation for more details on defaults.
default_value: '''/etc/ocis'' or ''$HOME/.ocis/config'''
description: The default directory location for config files. Predefined to '/etc/ocis'
for container images (inside the container) or '$HOME/.ocis/config' for binary
releases.
do_ignore: false
- rawname: OCIS_INSECURE
path: ocis-pkg/service/grpc/client.go:77
foundincode: true
name: OCIS_INSECURE
type: bool
default_value: "false"
description: Insecure TLS mode is only allowed in development environments with
OCIS_INSECURE=true
do_ignore: false
- rawname: RUN_CMD_TEST
path: internal/testenv/test.go:32
foundincode: true
name: RUN_CMD_TEST
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: YEAR
path: tests/qa-activity-report/generate-qa-activity-report.go:93
foundincode: true
name: YEAR
type: ""
default_value: ""
description: ""
do_ignore: true
- rawname: parts[0]
path: ocis-pkg/config/envdecode/envdecode.go:396
path: ocis-pkg/config/envdecode/envdecode.go:382
foundincode: true
name: parts[0]
type: ""
+19
View File
@@ -0,0 +1,19 @@
---
title: {{ .ServiceName }}
date: {{ .CreationTime }}
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/services/{{ .service }}
geekdocFilePath: README.md
geekdocCollapseSection: true
---
<!-- Do not edit this file, it is autogenerated. Edit the service README.md instead -->
## Abstract
{{ .Abstract }}
## Table of Contents
{{ .TocTree }}
{{ .Content }}
+4 -41
View File
@@ -1,45 +1,8 @@
package main
import (
"fmt"
"os"
)
func main() {
if len(os.Args) > 1 {
switch os.Args[1] {
case "templates":
RenderTemplates()
case "rogue":
GetRogueEnvs()
case "globals":
RenderGlobalVarsTemplate()
case "service-index":
GenerateServiceIndexMarkdowns()
case "env-var-delta-table":
// This step is not covered by the all or default case, because it needs explicit arguments
if len(os.Args) != 4 {
fmt.Println("Needs two arguments: env-var-delta-table <first-version> <second-version>")
fmt.Println("Example: env-var-delta-table v5.0.0 v6.0.0")
fmt.Println("Will not generate usable results for versions Prior to v5.0.0")
} else {
RenderEnvVarDeltaTable(os.Args)
}
case "all":
RenderTemplates()
GetRogueEnvs()
RenderGlobalVarsTemplate()
GenerateServiceIndexMarkdowns()
case "help":
fallthrough
default:
fmt.Printf("Usage: %s [templates|rogue|globals|service-index|env-var-delta-table|all|help]\n", os.Args[0])
}
} else {
// Left here, even though present in the switch case, for backwards compatibility
RenderTemplates()
GetRogueEnvs()
RenderGlobalVarsTemplate()
GenerateServiceIndexMarkdowns()
}
RenderTemplates()
GetRogueEnvs()
RenderGlobalVarsTemplate()
GenerateServiceIndexMarkdowns()
}
+3 -8
View File
@@ -53,7 +53,7 @@ func generateMarkdown(filepath string, servicename string) error {
Content: fmt.Sprintf(_configMarkdown, servicename, servicename),
})
tpl := template.Must(template.ParseFiles("templates/index.tmpl"))
tpl := template.Must(template.ParseFiles("index.tmpl"))
b := bytes.NewBuffer(nil)
if err := tpl.Execute(b, map[string]interface{}{
"ServiceName": head.Header,
@@ -66,11 +66,6 @@ func generateMarkdown(filepath string, servicename string) error {
return err
}
path := fmt.Sprintf("../../docs/services/%s", servicename)
if err := os.Mkdir(path, os.ModePerm); err != nil && !os.IsExist(err) {
return err
}
return os.WriteFile(path+"/_index.md", b.Bytes(), os.ModePerm)
targetFile := fmt.Sprintf("../../docs/services/%s/_index.md", servicename)
return os.WriteFile(targetFile, b.Bytes(), os.ModePerm)
}
-1
View File
@@ -5,7 +5,6 @@ weight: -10
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
{{< figure class="floatright" src="/media/is.png" width="70%" height="auto" >}}
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0001-introduce-accounts-service.md
---
* Status: superseded by [ADR-0003]({{< ref "0003-external-user-management.md" >}})
* Deciders: [@butonic](https://github.com/butonic), [@felixboehm](https://github.com/felixboehm), [@micbar](https://github.com/micbar), [@pmaier1](https://github.com/pmaier1)
* Deciders: @butonic, @felixboehm, @micbar, @pmaier1
* Date: [2020-06-15](https://github.com/owncloud/ocis-accounts/pull/34/commits/2fd05e2b6fe2a47c687bd0c0bc5e1b5c48a585b2)
Technical Story: [persist accounts](https://github.com/owncloud/ocis-accounts/pull/34)
@@ -8,7 +8,7 @@ geekdocFilePath: 0002-persist-accounts-using-cs3-storage.md
---
* Status: accepted
* Deciders: [@butonic](https://github.com/butonic), [@felixboehm](https://github.com/felixboehm)
* Deciders: @butonic, @felixboehm
* Date: 2020-08-21
Technical Story: [File system based indexing](https://github.com/owncloud/ocis-accounts/pull/92)
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0003-external-user-management.md
---
* Status: superseded by [17. Allow read only external User Management]({{< ref "0017-allow-read-only-external-user-management.md" >}})
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@hodyroff](https://github.com/hodyroff), [@pmaier1](https://github.com/pmaier1)
* Deciders: @butonic, @micbar, @dragotin, @hodyroff, @pmaier1
* Date: 2022-02-08
Technical Story: [Skip account-service by talking to CS3 user-api](https://github.com/owncloud/ocis/pull/1020)
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0004-support-hot-migration.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@hodyroff](https://github.com/hodyroff), [@pmaier1](https://github.com/pmaier1)
* Deciders: @butonic, @micbar, @dragotin, @hodyroff, @pmaier1
* Date: 2021-03-16
Technical Story: \[description | ticket/issue URL\]
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0005-cs3-api-account-management.md
---
* Status: proposed
* Deciders: [@refs](https://github.com/refs), [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@pmaier1](https://github.com/pmaier1)
* Deciders: @refs, @butonic, @micbar, @dragotin, @pmaier1
* Date: 2021-04-12
Technical Story: [Write only management API for User and Group resources](https://github.com/cs3org/cs3apis/pull/119)
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0006-service-discovery.md
---
* Status: accepted
* Deciders: [@refs](https://github.com/refs), [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@pmaier1](https://github.com/pmaier1)
* Deciders: @refs, @butonic, @micbar, @dragotin, @pmaier1
* Date: 2021-04-19
Technical Story: [Introduce Named Services.](https://github.com/cs3org/reva/pull/1509)
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0007-api-for-spaces.md
---
* Status: accepted
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@hodyroff](https://github.com/hodyroff), [@pmaier1](https://github.com/pmaier1)
* Deciders: @butonic, @micbar, @dragotin, @hodyroff, @pmaier1
* Date: 2021-03-19
Technical Story: API to enable the concept of [Spaces](https://github.com/owncloud/enterprise/issues/3863)
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0008-configuration.md
---
* Status: proposed
* Deciders: [@refs](https://github.com/refs), [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@pmaier1](https://github.com/pmaier1)
* Deciders: @refs, @butonic, @micbar, @dragotin, @pmaier1
* Date: 2021-05-03
## Context and Problem Statement
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0009-extension-template.md
---
* Status: proposed
* Deciders: [@c0rby](https://github.com/c0rby) <!-- optional -->
* Deciders: @c0rby <!-- optional -->
* Date: 2021-06-10
Technical Story: [description | ticket/issue URL] <!-- optional -->
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0010-policy-enforcement.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@hodyroff](https://github.com/hodyroff), [@pmaier1](https://github.com/pmaier1), [@fschade](https://github.com/fschade)
* Deciders: @butonic, @micbar, @dragotin, @hodyroff, @pmaier1, @fschade
* Date: 2021-06-30
## Context and Problem Statement
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0011-global-url-format.md
---
* Status: accepted
* Deciders: [@refs](https://github.com/refs), [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@hodyroff](https://github.com/hodyroff), [@pmaier1](https://github.com/pmaier1), [@fschade](https://github.com/fschade), [@tbsbdr](https://github.com/tbsbdr), [@kulmann](https://github.com/kulmann)
* Deciders: @refs, @butonic, @micbar, @dragotin, @hodyroff, @pmaier1, @fschade, @tbsbdr, @kulmann
* Date: 2021-07-07
## Context and Problem Statement
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0012-tracing.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@mstingl](https://github.com/mstingl) [@pmaier1](https://github.com/pmaier1), [@fschade](https://github.com/fschade)
* Deciders: @butonic, @micbar, @dragotin, @mstingl, @pmaier1, @fschade
* Date: 2021-08-17
## Context and Problem Statement
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0013-locking.md
---
- Status: accepted
- Deciders: [@hodyroff](https://github.com/hodyroff), [@pmaier1](https://github.com/pmaier1), [@jojowein](https://github.com/jojowein), [@dragotin](https://github.com/dragotin), [@micbar](https://github.com/micbar), [@tbsbdr](https://github.com/tbsbdr), [@wkloucek](https://github.com/wkloucek)
- Deciders: @hodyroff, @pmaier1, @jojowein, @dragotin, @micbar, @tbsbdr, @wkloucek
- Date: 2021-11-03
## Context and Problem Statement
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0014-microservices-runtime.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@mstingl](https://github.com/mstingl) [@pmaier1](https://github.com/pmaier1), [@fschade](https://github.com/fschade)
* Deciders: @butonic, @micbar, @dragotin, @mstingl, @pmaier1, @fschade
* Date: 2022-01-21
## Context and Problem Statement
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0015-events.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@c0rby](https://github.com/c0rby), [@wkloucek](https://github.com/wkloucek)
* Deciders: @butonic, @micbar, @dragotin, @c0rby, @wkloucek
* Date: 2022-01-21
## Context and Problem Statement
+2 -2
View File
@@ -7,8 +7,8 @@ geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0016-files-metadata.md
---
* Status: superseded by [ADR-0024]({{< ref "0024-msgpack-metadata.md" >}})
* Deciders: [@butonic](https://github.com/butonic), [@dragotin](https://github.com/dragotin), [@micbar](https://github.com/micbar), [@c0rby](https://github.com/c0rby)
* Status: proposed
* Deciders: @butonic, @dragotin, @micbar, @C0rby
* Date: 2022-02-04
## Context and Problem Statement
@@ -8,7 +8,7 @@ geekdocFilePath: 0017-allow-read-only-external-user-management.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@rhafer](https://github.com/rhafer)
* Deciders: @butonic, @micbar, @rhafer
* Date: 2022-02-08
## Context and Problem Statement
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0018-file-search-api.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@c0rby](https://github.com/c0rby)
* Deciders: @butonic, @micbar, @dragotin, @C0rby
* Date: 2022-03-18
## Context and Problem Statement
+2 -2
View File
@@ -7,8 +7,8 @@ geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0019-file-search-index.md
---
* Status: accepted
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@c0rby](https://github.com/c0rby)
* Status: proposed
* Deciders: @butonic, @micbar, @dragotin, @C0rby
* Date: 2022-03-18
## Context and Problem Statement
+8 -22
View File
@@ -1,15 +1,15 @@
---
title: "20. File Search Query Language"
date: 2022-06-23T09:00:00+01:00
date: 2022-03-18T09:00:00+01:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0020-file-search-query-language.md
---
* Status: accepted
* Deciders: [@butonic](https://github.com/butonic), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin), [@c0rby](https://github.com/c0rby), [@kulmann](https://github.com/kulmann), [@felix-schwarz](https://github.com/felix-schwarz), [@JammingBen](https://github.com/JammingBen)
* Date: 2023-06-23
* Status: proposed
* Deciders: @butonic, @micbar, @dragotin, @C0rby
* Date: 2022-03-18
## Context and Problem Statement
@@ -28,7 +28,6 @@ From the users perspective, the interface to search is just a single form field
## Considered Options
* [KQL - Keyword Query Language](#keyword-query-language)
* [Simple Query](#simplified-query)
* [Lucene Query Language](#lucene-query-language)
* [Solr Query Language](#solr-query-language)
@@ -36,31 +35,19 @@ From the users perspective, the interface to search is just a single form field
## Decision Outcome
Chosen option: [KQL - Keyword Query Language](#keyword-query-language), because it enables advanced search across all platforms.
Chosen option: [Simple Query](#simplified-query), because it is a suitable MVP.
### Positive Consequences
* We can use the same query language in all clients
* We can do a quick implementation
### Negative consequences
* We need to build and maintain a backend connector
* We cannot specify terms or other search criteria
* We will need to find a good point in time to use a query language before we start working around it
## Pros and Cons of the Options
### Keyword Query Language
The Keyword Query Language (KQL) is used by Microsoft Share Point and other Microsoft Services. It uses very simple query elements, property restrictions and operators.
* Good, because we can fulfill all our current needs
* Good, because it is very similar to the used query language in iOS
* Good, because it supports date time keywords like "today", "this week" and more
* Good, because it can be easily extended to use "shortcuts" for eg. document types like `:presentation` which combine multiple mime types.
* Good, because it is successfully implemented and used in similar use cases
* Good, because it gives our clients the freedom to always use the same query language across all platforms
* Good, because Microsoft Graph API is using it, we will have an easy transition in the future
* Bad, because we need to build and maintain a connector to different search backends (bleve, elasticsearch or others)
### Simplified Query
Implement a very simple search approach: Return all files which contain at least one of the keywords in their name, path, alias or selected metadata.
@@ -103,7 +90,6 @@ Elasticsearch provides a full Query DSL (Domain Specific Language) based on JSON
* [Search API](0018-file-search-api.md)
* [Search Indexing](0019-file-search-index.md)
* [KQL](https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference)
* [Apache Lucene](https://lucene.apache.org/)
* [Apache Solr](https://solr.apache.org/)
* [Elastic Search](https://solr.apache.org/)
+1 -1
View File
@@ -8,7 +8,7 @@ geekdocFilePath: 0021-service-accounts.md
---
* Status: proposed
* Deciders: [@butonic](https://github.com/butonic), [@c0rby](https://github.com/c0rby)
* Deciders: @butonic, @C0rby
* Date: 2023-01-18
## Context and Problem Statement
@@ -1,87 +0,0 @@
---
title: "22. Sharing and Space Management API"
date: 2023-09-08T02:29:00+01:00
weight: 22
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0022-sharing-and-space-management-api.md
---
* Status: accepted
* Deciders: [@JammingBen](https://github.com/JammingBen) [@butonic](https://github.com/butonic) [@theonering](https://github.com/theonering) [@kobergj](https://github.com/kobergj) [@micbar](https://github.com/micbar)
* Date: 2023-08-08
Technical Story: [Public issue](https://github.com/owncloud/ocis/issues/6993)
## Context and Problem Statement
In the early days of the rewrite of ownCloud it was an important goal to keep all important APIs compatible with ownCloud 10. Infinite Scale embraced that goal until version 1.0.0.
After that first release, the focus changed.
Infinite Scale started the spaces feature which brings a whole new set of APIs and concepts. We made the conscious decision to keep the sharing API as it was, live with its shortcomings and create workarounds to support spaces. We have come a long way so far. Now we need to move on. The Web Client has made the decision to drop the support of ownCloud 10 and keep version 7.0 alive for ownCloud 10 to keep the easy migration path intact.
The desktop and mobile client platforms were suffering from poor support from the server and can now move forward with a new API implementation. By using openApi 3 and all the needed tooling around it developing the LibreGraph specification, documentaion and SDKs, we now feel confident to move on.
## Decision Drivers
* The Path based nature of the OCS API lacks spaces support
* The permissions bitmask is no longer working when using sharing roles
* We want to support server announced sharing roles which are different per instance or scope
* We need to get rid of the currently hardcoded sharing roles in our clients
* New sharing roles and permissions are needed to support secure view and other new features
* Space Memberships are not shares and need to have different semantics
* Elevation of permissions in subfolders or full denials should be possible without creating a new share
* Third party integrations need generated SDKs in different languages to speed up the development
## Considered Options
* [New OCS Api Version](#new-ocs-api-version)
* [Sharing via LibreGraph](#sharing-via-libregraph)
## Decision Outcome
Chosen option: "[LibreGraph](#sharing-via-libregraph)"
### Positive Consequences:
* We can create a new clean API which fits the spaces concept
* LibreGraph embraces OData which is a known API pattern
* Sharing will be integrated in the existing SDKs and documentation
* Removing the OCS Api reduces complexity
* Removing the OCS Api makes the clients codebases smaller and removes manually maintained parts of the SDKs
* The extra error handling for the OCS API can be dropped from our clients
### Negative Consequences:
* We need to deprecate and remove the OCS API
* Existing third party integrations need to do some refactoring
## Pros and Cons of the Options
### New OCS Api Version
To overcome the limitations of the OCS 2.0 API we could create a new major version with the spaces concept in mind. This would give us the opportunity to create a new openApi Spec.
* Good, because the workarounds from version 2.0 could be dropped
* Bad, because we would need to deprecate the version 2.0
* Bad, because we would need to maintain a separate specification / repository
* Bad, because it would create the need to use two different SDKs in our clients
* Bad, because we would need to implement query parameters and filters on our own
* Bad, because sharing information could not be included in the spaces API via queries or filters
### Sharing via LibreGraph
Integrate Sharing into the [LibreGraph API](https://github.com/owncloud/libre-graph-api) by using the already existing toolchain and documentation flows.
* Good, because that reduces the number of SDKs
* Good, because it reduces the number of APIs
* Good, because spaces and shares can be used together in queries and filters
* Good, because we would use the existing OData pattern
* Bad, because we need to deprecate the OCS API
## Links <!-- optional -->
* [LibreGraph API](https://github.com/owncloud/libre-graph-api)
* [OData](https://www.odata.org/documentation/)
* [OpenAPI Standard](https://www.openapis.org/)
-79
View File
@@ -1,79 +0,0 @@
---
title: "23. Index and store metadata"
date: 2023-10-17T15:15:00+01:00
weight: 23
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0023-index-and-store-metadata.md
---
* Status: accepted
* Deciders: [@butonic](https://github.com/butonic), [@theonering](https://github.com/dschmidt), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin)
* Date: 2023-10-17
## Context and Problem Statement
ownCloud Infinite Scale is supposed to become a data platform and as such it needs to provide access to metadata.
Currently only metadata common to all file types (filesize, mime-type, ...) is stored in the index and the metadata storage.
We want to make other file type specific metadata available to consumers of our internal and external APIs.
Simple examples would be audio metadata like artist, album and title or exif metadata in images.
## Decision Drivers <!-- optional -->
## Considered Options
* [Store subset of extracted metadata required for graph api](#store-subset-of-extracted-metadata-required-for-graph-api)
* [Store subset of extracted metadata specified by another standard](#store-subset-of-extracted-metadata-specified-by-another-standard)
* [Store everything from extractors](#store-everything-from-extractors)
## Decision Outcome
Chosen option: "[store only subset of extracted metadata required for graph api](#store-subset-of-extracted-metadata-required-for-graph-api)", because Graph API is a simple common denominator and we want to avoid putting the complexity of mapping non-standardized data from potentially different extractors in several areas of the code base. Storage and index keys are determined by facet and property name, e.g. `audio.artist` for the artist in a music file. Storage keys are additionally prefixed with `libre.graph.`, i.e. `libre.graph.audio.artist`.
Handling Graph API specific metadata is a first step towards handling metadata. More generic and extensible handling of arbitrary metadata can be added later.
### Positive Consequences:
* Graph API endpoint implementation is trivial
* Documented public api and stored data are the same
* Reasonable complexity for the initial implementation
### Negative Consequences:
* Graph API is limited, so not *all* available metadata can be accessed
* Switching the internal format and adding more metadata later will require re-indexing
## Pros and Cons of the Options <!-- optional -->
### Store Subset of Extracted Metadata Required for Graph API
Use Graph API facets and properties for determining the subset of stored metadata and the storage key.
The index key for the `artist` property of the `audio` facet is `audio.artist`, the storage key is additionally prefixed with `libre.graph.`.
* Good, because central mapping of values happens consistently and only once in a central place
- it happens in the extractor (integration) which likely knows best how to map metadata to standard properties
* Good, because when multiple extractors share a common set of provided values, applications can rely on the mapping and the complexity is kept low
* Bad, because not all metadata is available, not everything can be searched
* Good, because Graph API already chose a reasonable subset of most interesting properties
### Store Subset of Extracted Metadata Specified by Another Standard
There are a bunch of metadata standards but none of them is really universal. There is always something that is only supported in one or the other standard. Tika for example extracts audio metadata using a mixture of Dublin Core and XMP Dynamic Media keys.
- Bad, because it makes implementing a new extractor integration harder
- Bad, because it makes using the stored data more complicated than a simple standard like discussed above
### Store Everything from Extractors
- Good, because all metadata is available and searchable
- Good, because consuming applications can decide how to map data
- Good, because extractor implementation becomes more trivial
- Bad, because all applications become dependent on the extractor and need to handle different extractors on their own
## Links <!-- optional -->
* https://github.com/owncloud/libre-graph-api/pull/120 / https://learn.microsoft.com/de-de/graph/api/resources/audio?view=graph-rest-1.0
* https://github.com/owncloud/libre-graph-api/pull/122 / https://learn.microsoft.com/en-us/graph/api/resources/photo?view=graph-rest-1.0
* https://github.com/owncloud/libre-graph-api/pull/123 / https://learn.microsoft.com/en-us/graph/api/resources/geoCoordinates?view=graph-rest-1.0
* https://developer.adobe.com/xmp/docs/XMPNamespaces/xmpDM/
* https://www.dublincore.org/schemas/
-83
View File
@@ -1,83 +0,0 @@
---
title: "24. Messagepack metadata"
date: 2024-02-09T14:57:00+01:00
weight: 24
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0024-msgpack-metadata.md
---
* Status: accepted
* Deciders: [@butonic](https://github.com/butonic), [@aduffeck](https://github.com/aduffeck), [@micbar](https://github.com/micbar), [@dragotin](https://github.com/dragotin)
* Date: [2023-03-15](https://github.com/cs3org/reva/pull/3711/commits/204253eee9dbb8e7fa93a01f3f94a2d28ce40a06)
## Context and Problem Statement
File metadata management is an important aspect for oCIS as a data platform. While using extended attributes to store metadata allows attaching the metadata to the actual file it causes a significant amount of syscalls that outweigh the benefits. Furthermore, filesystems are subject to different limitations in the number of extended attributes or the value size that is available.
## Decision Drivers <!-- optional -->
Performance of reading extended attributes suffers from the syscall overhead when listing and reading all attributes. Getting rid of limitations imposed by the filesystem used to store decomposedfs metadata.
## Considered Options
Going back to the original [ADR-0016 Storage for Files Metadata]({{< ref "0016-files-metadata.md" >}}) we decided to use a dedicated file for metadata storage next to the decomposedfs file representing the node. Several options for the data format were considered:
* Use JSON files to store metadata
* Use INI files to store metadata
* Use msgpack files to store metadata
* Use protobuf messages to store metadata
## Decision Outcome
Chosen option: "[msgpack files](#msgpack-files)", because we want to stay with a self describing binary format. This is a performance tradeoff that is faster and more efficient than text based formats and more flexible but less efficient than protobuf.
Note: directory listings are still read from the storage and remain uncached.
### Positive Consequences:
* Way less syscalls
* Node metadata can easily be cached, avoiding all trips to the storage until a file changes.
### Negative Consequences:
* We need to migrate existing metadata
* We need to build tooling that allows manipulating metadata similar to `setfattr` and `getfattr`.
## Pros and Cons of the Options <!-- optional -->
### Ini files
* Good, human readable
* Good, self describing
* Good, widely used and well understood
* Good, suited for key value like content - exactly what we need for extended attributes
* Bad, slower and less efficient than binary formats
### JSON files
* Good, human readable
* Good, self describing
* Good, widely used and well understood
* Good, could be used for more than just key value
* Bad, slower and less efficient than binary formats
### Msgpack files
* Good, self describing
* Good, efficient because it is binary encoded
* Good, could be used for more than just key value
* Bad, not human readable - requires tooling to manipulate safely
### protobuf files
* Good, very efficient because it is binary encoded
* Good, could be used for more than just key value
* Bad, not human readable
* Bad, not self describing - requires tooling to evolve the messages
## Links <!-- optional -->
* supersedes [ADR-0016 Storage for Files Metadata]({{< ref "0016-files-metadata.md" >}})
* [The need for speed — Experimenting with message serialization](https://medium.com/@hugovs/the-need-for-speed-experimenting-with-message-serialization-93d7562b16e4)
-76
View File
@@ -1,76 +0,0 @@
---
title: "25. Distributed Search Index"
date: 2024-02-09T16:27:00+01:00
weight: 25
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0025-distributed-search-index.md
---
* Status: draft
* Deciders: [@butonic](https://github.com/butonic), [@fschade](https://github.com/fschade), [@aduffeck](https://github.com/aduffeck)
* Date: 2024-02-09
## Context and Problem Statement
Search is currently implemented with [blevesearch](https://github.com/blevesearch/bleve), which internally uses bbolt. bbolt writes to a local file, which prevents scaling out the service.
The initial implementation used a single blevesearch index for all spaces. While this makes querying all spaces easy because the results do not need to be aggregated from multiple indexes, the single node becomes a bottleneck when answering search queries. Furthermore, indexing is also part of the search service and has to share the resources.
## Decision Drivers <!-- optional -->
* Indexing should be decoupled from the search service
* The search service should be able to scale horizontally
* The solution needs to be embeddable in the single binary
## Considered Options
* one index per space
* [elasticsearch](https://github.com/elastic/elasticsearch) (java)
* [dgraph](https://github.com/dgraph-io/dgraph) (go)
* [manticore](https://github.com/manticoresoftware/manticoresearch/) (C++)
* [meilisearch](https://github.com/meilisearch/meilisearch) (Rust)
## Decision Outcome
Chosen option: *???*
### Positive Consequences:
* TODO
### Negative Consequences:
* TODO
## Pros and Cons of the Options <!-- optional -->
### one index per space
Instead of using a single index (current implementation) or a distributed search index like elasticsearch the search service should aggregate queries from dedicated indexes per space. The api to a space index provider should be able to take multiple space ids in the request, similar to how a storage provider can handle multiple spaces. When treating spaces and the corresponding search index to belong together we can also treat them as a single unit for backup and restore. In federated deployments we can send the search queries to all search providers / spaces that the user has access to.
How a search provider is implemented then depends on the requirements. For a single node deployment bleve might be fine, for a kubernetes deployment a dedicated service might be the better fit.
### elasticsearch
* Good, commercial support available at https://www.elastic.co/de/pricing
* Good, industry standard
* Bad, nobody seems to like it
* Bad, not embeddable (Java)
### dgraph
* Good, commercial support available at https://dgraph.io/pricing
* Good, embeddable? (go) - TODO verify
### manticore
* Good, commercial support available at https://manticoresearch.com/services/
* Bad, not embeddable (C++)
### meilisearch
* Good, commercial support available at https://www.meilisearch.com/pricing
* Bad, not embeddable (Rust)
## Links <!-- optional -->
* supersedes [ADR-0019 File Search Index]({{< ref "0019-file-search-index.md" >}})
@@ -1,93 +0,0 @@
---
title: "26. Application based user settings"
date: 2024-02-09T17:30:00+01:00
weight: 26
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0026-application-based-user-settings.md
---
* Status: draft
* Deciders: [@butonic](https://github.com/butonic), [@fschade](https://github.com/fschade), [@kulmann](https://github.com/kulmann)
* Date: 2024-02-09
## Context and Problem Statement
To share user settings across devices applications want to store user specific settings on the server. The ePUB app wants to remember which page the user is on. The iOS app wants to rember search queries. The Caldav app needs a space to store data.
## Decision Drivers <!-- optional -->
## Considered Options
* OCS provisioning API
* settings service
* libregraph API
## Decision Outcome
Chosen option: *???*
### Positive Consequences:
* TODO
### Negative Consequences:
* TODO
## Pros and Cons of the Options <!-- optional -->
### OCS provisioning API
Nextcloud added a `/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}` endpoint
* Bad, legacy API we want to get rid of
### settings service
- Bad, yet another API. Always uses POST requests.
### libregraph API
The MS Graph API has [a special approot driveItem](https://learn.microsoft.com/en-us/graph/api/drive-get-specialfolder?view=graph-rest-1.0&tabs=http) that apps can use to store arbitrary files. See also:
[Using an App Folder to store user content without access to all files](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/special-folders-appfolder?view=odsp-graph-online) and a blog post with the section [Store data in the application’s personal folder](https://blog.mastykarz.nl/easiest-store-user-settings-microsoft-365-app/#store-data-in-the-applications-personal-folder).
It basically uses the `/me/drive/special/approot:/{filename}` endpoint to
```http
PUT https://graph.microsoft.com/v1.0/me/drive/special/approot:/settings.json:/content
content-type: text/plain
authorization: Bearer abc
{"key": "value"}
```
or
```http
GET https://graph.microsoft.com/v1.0/me/drive/special/approot:/settings.json:/content
authorization: Bearer abc
```
On single page apps you need two requests:
```http
GET https://graph.microsoft.com/v1.0/me/drive/special/approot:/settings.json?select=@microsoft.graph.downloadUrl
authorization: Bearer abc
```
followed by
```http
GET <url from the response['@microsoft.graph.downloadUrl'] property>
```
Currently, applications have no dedicated tokens that we could use to derive the `appid` from. All apps should have an `appid` and [be discoverable under](https://learn.microsoft.com/en-us/graph/api/application-list?view=graph-rest-1.0&tabs=http)
```http
GET /applications
```
In any case for libregraph we could introduce a `LIBRE_GRAPH_APPID` header to make these requests possible rather soon.
Then we can decide if we want to store these files in the users personal drive, or if we create a space for every app that then uses the userid as a folder that contains all the files for the user.
- Good, because clients can remain in libregraph API land
- Bad, we currently have no application tokens
## Links <!-- optional -->
-94
View File
@@ -1,94 +0,0 @@
---
title: "27. New Share Jail"
date: 2024-02-21T15:19:00+01:00
weight: 27
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0027-new-share-jail.md
---
* Status: draft
* Deciders: [@butonic](https://github.com/butonic), [@rhafer](https://github.com/rhafer), [@dragotin](https://github.com/dragotin)
* Date: 2024-02-21
## Context and Problem Statement
The oCIS share jail is a space that contains all accepted / synced shares of a user. In contrast to a personal or project space that contains actual resources, the share jail space only contains references pointing to shared resources. The root directory only consists of mountpoints that actually represent resources in other spaces. On the WebDAV API clients expect an `oc:fileid` property to identify resources in other API endpoints, eg. the libregraph `/me/sharedWithMe` endpoint.
Currently, we construct the `oc:fileid` from the pattern `{shareproviderid}${sharespaceid}!{sharemountid}`. `{shareproviderid}`and `{sharespaceid}` are both hardcoded to `a0ca6a90-a365-4782-871e-d44447bbc668`. The `{sharemountid}` itself uses the pattern `{shared-resource-providerid}:{shared-resource-spaceid}:{shareid}`.
Since a resource can be shared to the same user in multiple ways (a group share and a user share) we deduplicate the two shares and only show one mountpoint in the share jail root. This is where this solution starts to fall apart:
* When accepting, mounting or syncing a share we implicitly have to accept all shares
* Each share has a different `{shareid}`, so we currently look up the oldest share and use it to build the `oc:fileid`
* Consequently, when the oldest share is revoked the `oc:fileid` changes.
We need to build the `oc:fileid` from a more stable pattern.
### Shareid
The WebDAV PROPFIND response also contains a `oc:shareid` which currently is derived from the path when the spaceid matches the share jail. The jsoncs3 implementation of the share manager currently is the only one using the `{shared-resource-providerid}:{shared-resource-spaceid}:{shareid}` pattern, where `{shareid}` is a uuid that is generated when creating the share.
Again, the problem is that a resource can be shared multiple times.
## Decision Drivers <!-- optional -->
* We need to change the `oc:fileid` pattern without breaking clients.
* We need to be able to correlate files from WebDAV and the Graph API.
## Considered Options
* [Share based id](#share-based-id)
* [Resource based id](#resource-based-id)
* [Permission based id](#permission-based-id)
* [Use graph for file metadata](#use-graph-for-file-metadata)
## Decision Outcome
Resource based id: it correctly reflects the semantic meaning of a mount point, by indirectly pointing to the resource, not the share. The permissions on the share have to be checked in the storageprovider itself, anyway. Switching to graph requires more effort and the transition can happen gradually ofter changing the `oc:fileid` pattern in the sharejail.
### Positive Consequences:
* We get rid of mixing share ids with fileids, preventing unexpected `oc:fileid` changes.
### Negative Consequences:
* We need to teach clients about a new share jail space that uses the new `oc:fileid` pattern. They may need to implement a migration strategy to switch from the old share jail space to a new share jail space by replacing the fileid in their internal database. The might be able to just switch over, because the only `oc:fileid` that changes is the one from the mountpoints. The other nodes in the subtree already use the resourceid of the shared resource.
* Clients relying on `oc:shareid` to correlate share jail entries in PROPFIND responses need to either deal with multiple `oc:shareid` as a resource can be shared multiple times, or we deprecate `oc:shareid` and only use the `oc:fileid`. *jfd: Who is using this? why? Please explain and add to the decision drivers above!*
* The graph api also needs to be able to list entries from the new share jail. *jfd: clients could use a filter to ask for the new share jail id*
## Pros and Cons of the Options <!-- optional -->
### Share based id
Follow the pattern `{shareproviderid}${sharespaceid}!{sharemountid}`, where `{sharemountid}` is `{shared-resource-providerid}:{shared-resource-spaceid}:{shareid}`.
Combined patter `{shareproviderid}${sharespaceid}!{shared-resource-providerid}:{shared-resource-spaceid}:{shareid}`.
`{shareproviderid}` and `{sharespaceid}`are both hardcodet to `a0ca6a90-a365-4782-871e-d44447bbc668` to route all id based requests for mountpoints to the share jail space.
+ Good, the `{shared-resource-providerid}` and `{shared-resource-spaceid}` are used to shard the shares per space.
- Bad, `oc:fileid` changes if the oldest received share to a resource is revoked.
### Resource based id
Follow the pattern `{shareproviderid}${sharespaceid}!{shared-resource-providerid}:{shared-resource-spaceid}:{shared-resource-opaqueid}`.
Hardcode `756e6cdf-5630-4b66-9380-55a85188e0f6` as a new `{sharespaceid}` to allow clients to detect the new share jail and change it at their own pace.
+ Good, stable `oc:fileid` that remains the same, regardless of permission changes.
+ Good, clients can detect the new share jail and deal with it on their terms.
### Permission based id
Follow the pattern `{shareproviderid}${sharespaceid}!{shared-resource-providerid}:{shared-resource-spaceid}:{shared-resource-opaqueid}:{permission-id}`.
- Bad, same instability as the share id
- Bad, we don't even have a permission id. We could construct one from the grantee, but this leads nowhere.
### Use graph for file metadata
Instead of using WebDAV to correlate files with shares fully embrace libregraph to manage file metadata.
Follow the pattern `{shareproviderid}${sharespaceid}!{shared-resource-providerid}:{shared-resource-spaceid}:{shared-resource-opaqueid}`.
WebDAV can be stripped of any ownCloud specific properties and will only be used for file up and download.
- Bad, more effort
+ Good, clean way of representing mountpoints and the shared resource in one `driveItem` that can include the resource based id.
+ Good, pagination, sorting and filtering cleanly specified
+ Good, WebDAV can be stripped down.
+ Good, Clients could get rid of WebDAV client and XML libs as all endpoints use JSON (all OCS endpoins return JSON when appending a `format=json` query parameter)
## Links <!-- optional -->
-106
View File
@@ -1,106 +0,0 @@
---
title: "28. Activity Service"
date: 2024-05-16T15:00:00+01:00
weight: 28
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0028-activities-service.md
---
* Status: draft
* Deciders: [@kobergj](https://github.com/kobergj), [@fschade](https://github.com/fschade)
* Date: 2024-05-16
## Context and Problem Statement
The user should be able to see all activities for a resource.
Besides the current resource, the user should also be able to decide if he wants to include child resource activities or not.
## Decision Drivers <!-- optional -->
* The user should be able to see all activities for a resource.
* The user should be able to decide if he wants to include child resource activities.
* Activities should be stored space efficiently.
* Activities should be stored in a way that they can be queried efficiently.
* Activities should stay in place even if the resource is gone.
* Activities reflect the state at a given point in time and not the current state.
* The Service should only store a configurable number of activities per resource.
## Considered Options
### Activity store
* Use a go-micro store to store the individual activities.
* Use a time series database to store the activities.
* Use a graph database to store the activities.
* Use a relational database to store the activities.
* Use the file system to store the activities.
### Activity format
* Normalize the activities before storing them.
* Only store relevant data to get the related event from the event-history service when needed, e.g.,
```go
package pseudo_code
import (
"time"
)
type Activity struct {
ResourceId string
EventID string
Depth int64
Timestamp time.Time
}
```
* Store the activity in a human-readable way e.g. "resource A has been shared with user B."
* Store each activity only on the resource itself.
* Store each activity only on the resource itself and all its parents.
## Decision Outcome
* Activity store:
* Use a go-micro store to store the individual activities.
* Activity format:
* Store each activity only on the resource itself and all its parents.
* Only store event ids and get the related event from the event-history service when needed.
### Positive Consequences:
* Activity store (go-micro store):
* Reuse existing technology.
* We can use nats-js-kv store which already proved reliable in production.
* No need to introduce any kind of new technology, e.g., a time series database, a relational database.
* Activity Format:
* Having each activity stored on each resource (the resource itself and its parents)
makes it easy to retrieve the timeline of activities for a resource and its children.
* Only storing the event id and getting the related event from the event-history we benefit
from the event-history services capabilities to store and query events.
* Walking the resource tree from the resource to the root is a linear operation and can be done efficiently.
### Negative Consequences:
* Activity store:
* Other database types might be more efficient for storing activities.
* Using the go-micro-store only allows storing the activity in a key-value format.
* Activity Format:
* Storing only the event ids and getting the related data from the event-history service when needed
might introduce additional latency when querying activities.
* Adding each event-id to each resource parent leads to a lot of duplicated data.
## Pros and Cons of the Options <!-- optional -->
* Activity store:
* (PRO) Introducing a new database type might be more efficient for storing activities.
* (CON) Introducing a new database type brings extra complexity and maintenance overhead.
* (CON) Using the file system to store the activities might be inefficient and could be problematic especially in a distributed environment.
* Activity format:
* (PRO) Normalizing the activities before storing them might make it easier and more efficient to query them.
* (PRO) Storing each activity only on the resource itself is more space-efficient.
* (CON) Storing each activity only on the resource itself increases the complexity of querying activities.
* (CON) Storing each activity in a human-readable format is not space-efficient.
## Links <!-- optional -->
* [Story](https://github.com/owncloud/ocis/issues/8881)
-229
View File
@@ -1,229 +0,0 @@
---
title: "Backup Considerations"
date: 2024-05-07T10:31:00+01:00
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis
geekdocFilePath: backup.md
---
This small guide aims to shed some light on the internal Infinite Scale data structure. You can refer to it when you are trying to optimize your backups or if you are just curious about how Infinite Scale stores its data.
Note, as a prerequisite backing up Infinite Scale, the instance has to be fully shut down for the time being.
## Ocis Data Structure
Ocis stores its data in a folder that can be configured via the environment variable `OCIS_BASE_DATA_PATH`. Without further configuration, services derive from that path when they store data, though individual settings for certain data types can be configured.
The default value for the `OCIS_BASE_DATA_PATH` variable is `$HOME/.ocis` (or `/var/lib/ocis` when using the docker container. Note: Configuration data is by default stored in `/etc/ocis/` in the container.).
Inside this folder, Infinite Scale will store all its data in separate subdirectories. That includes metadata, configurations, queues and stores etc. The actual bytes of files (blobs) are handled by a so called blobstore, which also stores here by default. Depending on the used blobstore, the blobs need to be backed up separately, for example if S3 is used. Note: See special case for the `config` folder in a docker container.
### Base Data Path Overview
Listing the contents of the folder will return the following:
```bash
~/.ocis/:tree -L 1
.
├── config
├── idm
├── idp
├── nats
├── proxy
├── search
├── storage
├── thumbnails
└── web
10 directories, 0 files
```
The following sections describe the content and background of the subdirectories to decide if a backup is required or recommended and its effect when it is not backed up.
### `config`
Contains basic Infinite Scale configuration created by `ocis init`(Note: The location of the configuration folder can be specified with the `OCIS_CONFIG_DIR` environment variable, but for this document we will assume this variable is not set and the default is used.)
```bash
~/.ocis/config/:tree
.
└── ocis.yaml
1 directory, 1 file
```
* `ocis.yaml`:\
BACKUP RECOMMENDED. Holds Infinite Scale configuration data. The contents can vary depending on your environment variables. In general, most of this file can be recreated again by running `ocis init`. This will recreate secrets and certificates. However, if not backed up completely, some fields MUST be copied over from the old config manually to regain data access after a restore:
| Field Name | Envvar Name | Description | If not backed up |
| --- | --- | --- | --- |
| `idp.ldap.bind_password` | `OCIS_LDAP_BIND_PASSWORD` | Password for the idp | no logins possible |
| `idm.service_user_passwords.idp_password`| `IDM_IDPSVC_PASSWORD` | Same as above | no logins possible |
| `system_user_id` | `OCIS_SYSTEM_USER_ID` | The id of storage-system user | no logins possible |
| `idm.service_user_passwords.reva_password`| `IDM_REVASVC_PASSWORD` | The reva password | no logins possible |
| `auth_basic.auth_providers.ldap.bind_password` | `AUTH_BASIC_LDAP_BIND_PASSWORD` | Same as above | no logins possible |
| `users.drivers.ldap.bind_password` | `USERS_LDAP_BIND_PASSWORD` | Same as above | no logins possible |
| `groups.drivers.ldap.bind_password` | `GROUPS_LDAP_BIND_PASSWORD` | Same as above | no logins possible |
| `storage_users.mount_id` | `STORAGE_USERS_MOUNT_ID` | The mountid of the storage_users service | sharing data lost |
| `gateway.storage_registry.storage_users_mount_id` | `GATEWAY_STORAGE_USERS_MOUNT_ID` | Same as above | sharing data lost |
### `idm`
Note: This folder will not appear if you use an external idm. Refer to your idms documentation for backup details in this case.
Contains the data for the internal Infinite Scale identity management. See the [IDM README]({{< ref "../services/idm/_index.md" >}}) for more details.
```bash
~/.ocis/idm/:tree
.
├── ldap.crt
├── ldap.key
└── ocis.boltdb
1 directory, 3 files
```
* `ocis.boltdb`:\
BACKUP REQUIRED. This is the boltdb database that stores user data. Use `IDM_DATABASE_PATH` to specify its path. If not backed up, Infinite Scale will have no users, therefore also all data is lost.
* `ldap.crt`:\
BACKUP OPTIONAL. This is the certificate for the idm. Use `IDM_LDAPS_CERT` to specify its path. Will be auto-generated if not backed up.
* `ldap.key`:\
BACKUP OPTIONAL. This is the certificate key for the idm. Use `IDM_LDAPS_KEY` to specify its path. Will be auto-generated if not backed up.
### `idp`
Note: This folder will not appear if you use an external idp. Refer to your idp's documentation for backup details in this case.
Contains the data for the internal Infinite Scale identity provider. See the [IDP README]({{< ref "../services/idp/_index.md" >}}) for more details.
```bash
~/.ocis/idp/:tree
.
├── encryption.key
├── private-key.pem
└── tmp
└── identifier-registration.yaml
2 directories, 3 files
```
* `encryption.key`:\
BACKUP RECOMMENDED. This is the encryption secret. Use `IDP_ENCRYPTION_SECRET_FILE` to specify its paths. Not backing this up will force users to relogin.
* `private-key.pem`:\
BACKUP RECOMMENDED. This is the encryption key. Use `IDP_SIGNING_PRIVATE_KEY_FILES` to specify its paths. Not backing this up will force users to relogin.
* `identifier-registration.yml`:\
BACKUP OPTIONAL. It holds configuration for oidc clients (web, desktop, ios, android). Will be recreated if not backed up.
### `nats`
Note: This folder will not appear if you use an external nats installation. In that case, data has to secured in alignment with the external installation.
Contains nats data for streams and stores. See the [NATS README]({{< ref "../services/nats/_index.md" >}}) for more details.
```bash
~/.ocis/nats/:tree -L 1
.
└── jetstream
```
* `jetstream`:\
BACKUP RECOMMENDED. This folder contains nats data about streams and key-value stores. Use `NATS_NATS_STORE_DIR` to specify its path. Not backing it up can break history for multiple (non-vital) features such as history or notifications. The Infinite Scale functionality is not impacted if omitted.
### `proxy`
Contains proxy service data. See the [PROXY README]({{< ref "../services/proxy/_index.md" >}}) for more details.
```bash
~/.ocis/proxy/:tree
.
├── server.crt
└── server.key
1 directory, 2 files
```
* `server.crt`:\
BACKUP OPTIONAL. This is the certificate for the http services. Use `PROXY_TRANSPORT_TLS_CERT` to specify its path.
* `server.key`:\
BACKUP OPTIONAL. This is the certificate key for the http services. Use `PROXY_TRANSPORT_TLS_KEY` to specify its path.
### `search`
Contains the search index. See the [SEARCH README]({{< ref "../services/search/_index.md" >}}) for more details.
```bash
~/.ocis/search/:tree -L 1
.
└── bleve
2 directories, 0 files
```
* `bleve`:\
BACKUP RECOMMENDED/OPTIONAL. This contains the search index. Can be specified via `SEARCH_ENGINE_BLEVE_DATA_PATH`. If not backed up, the search index needs to be recreated. This can take a long time depending on the amount of files.
### `storage`
Contains Infinite Scale meta (and blob) data, depending on the blobstore. See the [STORAGE-USERS README]({{< ref "../services/storage-users/_index.md" >}}) for more details.
```bash
~/.ocis/storage/:tree -L 1
.
├── metadata
├── ocm
└── users
4 directories, 0 files
```
* `metadata`:\
BACKUP REQUIRED. Contains system data. Path can be specified via `STORAGE_SYSTEM_OCIS_ROOT`. Not backing it up will remove shares from the system and will also remove custom settings.
* `ocm`:\
BACKUP REQUIRED/OMITABLE. Contains ocm share data. When not using ocm sharing, this folder does not need to be backed up.
* `users`:\
BACKUP REQUIRED. Contains user data. Path can be specified via `STORAGE_USERS_OCIS_ROOT`. Not backing it up will remove all spaces and all files. As result, you will have a configured but empty Infinite Scale instance, which is fully functional accepting new data. Old data is lost.
### `thumbnails`
Contains thumbnails data. See the [THUMBNAILS README]({{< ref "../services/thumbnails/_index.md" >}}) for more details.
```bash
~/.ocis/thumbnails/:tree -L 1
.
└── files
```
* `files`:\
OPTIONAL/RECOMMENDED. This folder contains prerendered thumbnails. Can be specified via `THUMBNAILS_FILESYSTEMSTORAGE_ROOT`. If not backed up, thumbnails will be regenerated automatically on access which leads to some load on the thumbnails service.
### `web`
Contains web assets such as custom logos, themes etc. See the [WEB README]({{< ref "../services/web/_index.md" >}}) for more details.
```bash
~/.ocis/web/:tree -L 1
.
└── assets
2 directories, 0 files
```
* `assets`:\
BACKUP RECOMMENDED/OMITABLE. This folder contains custom web assets. Can be specified via `WEB_ASSET_CORE_PATH`. If no custom web assets are used, there is no need for a backup. If those exist but are not backed up, they need to be reuploaded.
### `external services`
When using an external idp/idm/nats or blobstore, its data needs to be backed up separately. Refer to your idp/idm/nats/blobstore documentation for backup details.
## Backup Consistency Command
Infinite Scale now allows checking an existing backup for consistency. Use the command:
```bash
ocis backup consistency -p "<path-to-base-folder>"
```
`path-to-base-folder` needs to be replaced with the path to the storage providers base path. Should be same as the `STORAGE_USERS_OCIS_ROOT`
Use the `-b s3ng` option when using an external (s3) blobstore. Note: When using this flag, the path to the blobstore must be configured via envvars or a yaml file to match the configuration of the original instance. Consistency checks for other blobstores than `ocis` and `s3ng` are not supported at the moment.
-79
View File
@@ -1,79 +0,0 @@
---
title: "Documentation"
date: 2020-07-27T08:39:38+00:00
weight: 8
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: build-docs.md
---
{{< toc >}}
## Overview
The documentation:
* Is based on the [HUGO](https://gohugo.io/) framework written in Go. The underlaying language is markdown plus the extensions provided by hugo.
* The framwork including the theme used is maintained in the following [repo](https://github.com/owncloud/owncloud.github.io).
* The hugo version, currently at `0.129.0` must match the image version defined in the root makefile and the framework repo, defined in `.drone.yml`.\
{{< hint info >}}
* Building the theme is part of the loaded framework while building the documentation is done using a separate container.
* Any intended upgrade of the hugo version implies a check if the theme builds correctly and must be applied to all doc sourcing repos. On errors, stick on the current hugo version or update the theme accordingly!
{{< /hint >}}
* The documentation sources are distributed over several repos such as `ocis`, `web` and others. When building, these sources act individually and only those sources are build and pushed to the web that come from the respective repo. The definition what is going where is defined in the [framework repo](https://github.com/owncloud/owncloud.github.io/blob/main/.batchfile). This means, each merge of a docs change in one of the sourcing repos only pushes that change to the site. There is no global build process and inter doc links must be treated therefore very carefully !
* The documentation setup is, with only a few exceptions, identical for both the `ocis` and the `web` repo. This means, for example, running commands locally are the same, the documentation process section below applies for both; only drone uses some specifics.
* {{< hint info >}}
Any files or folders that need to be excluded from the build process must be defined in the referenced framework repository above, in the file `config.yaml`.
{{< /hint >}}
## Documentation Process
When building the ocis documentation, the process differes slightly when building locally or when merging. Though both processes generate they docs, the end up in different locations.
* **General**\
Beside building docs, some additional files/folders will be copied required for the process, see the makefile for details.
* **Locally**\
The rendered build stays in the branch that is currently active and is NOT part of a git change, though additional changed files show up and may need to be committed. The build can be viewed normally, for details see below.
* **Merge**\
When a docs PR gets merged, the content of the `docs/` folder gets "copied". For master the target is the `docs` branch or a respective `docs-stable-` branch otherwise. The latter must be configured on new stable versions. The docs branch is the source of truth for the developer documentation.
## Building the Documentation
{{< hint info >}}
* For building the documentation locally, you need to have `make`, `docker` and `go` installed.\
See the [oCIS README](https://github.com/owncloud/ocis/#use-the-ocis-repo-as-source) for more details and minimum versions required.
* Regulary, at least once after cloning, branching or rebasing, run `make generate` to update the assets. This ensures that all data that is accessed by the docs build process is up-to-date.
* Run the make commands from the oCIS root, the makefile contains all required targets.\
Use `make help` for more details.
{{< /hint >}}
* **For any changes**, you must fully build the documentation first to preview it.\
For ease of working, open two terminals and change to the oCIS root. The terminals are numberd as (1) and (2).
* At first start, from any terminal, run `sudo make docs-clean` to have a clean build environment.\
sudo is required for deletion, because files generated by hugo, which runs in a container, are created by root.
* Do all the doc changes required in the docs repository.
* Run (1) `make docs-local`. This will run all steps locally as drone would do but without branch copying or pushing to the web. When omitting this step and just serving content, the documentation might build locally but may fail when creating a PR.
* Run (2) `make docs-serve` to serve the documentation. You can now view the built result in the browser.
* On any more changes made, run (1) `make docs-copy`. The changes will be built on the fly via the running docs-serve command.
* **To preview the documentation locally** without changing content, run the following commands in order.\
This builds the documentation without artifacts and makes it available on [localhost:1313](http://localhost:1313).
* `sudo make docs-clean`
* `make docs-local`
* `make docs-serve`
## Remarks
{{< hint info >}}
Note that you may get files changed reported like `env_vars.yaml` by just running the make docs commands. You can discard any of these as they come from an internal helper process step necessary. To take care on those changed files, see the [Environment Variables]({{< ref "../services/general-info/envvars/" >}}) documentation.
{{< /hint >}}
Please keep this documentation in sync with the oCIS source code of the master branch.
Changes on the documentation are automatically applied to [this site]({{< ref "../" >}}) when merged to the master branch.
+1 -16
View File
@@ -44,7 +44,7 @@ Let's explore with examples this approach.
- docker images: `/etc/ocis/`
- binary releases: `$HOME/.ocis/config/`
followed by the `<extension name>.yaml`, e.g. `proxy.yaml` for the extension configuration. You also can put an `ocis.yaml` config file to the expected loading location to use a single config file.
followed by the `<extension name>.yaml`, eg `proxy.yaml` for the extension configuration. You also can put an `ocis.yaml` config file to the expected loading location to use a single config file.
You can set another directory as config path in the environment variable `OCIS_CONFIG_DIR`. It will then pick the same file names, but from the folder you configured.
@@ -99,21 +99,6 @@ log:
level: info
```
#### Substitute ENV variables in configuration files
Environment variables can be used in the configurations files and will be replaced by oCIS when loading these.
Default values can be specified after a `|` character - see below.
```yaml
proxy:
http:
addr: ${PROXY_HTTP_ADDR|localhost:4321}
log:
pretty: true
color: true
level: info
```
### Workflows
Since one can run an extension using the runtime (supervised) or not (unsupervised), we ensure correct behavior in both modes, expecting the same outputs.
+3 -1
View File
@@ -17,9 +17,11 @@ This section handles deployments and operations for admins and people who are in
oCIS deployments are super simple, yet there are many configurations possible for advanced setups.
- [Basic oCIS setup]({{< ref "basic-remote-setup" >}}) - configure domain, certificates and port
- [oCIS setup with Traefik for SSL termination]({{< ref "ocis_traefik" >}})
- [oCIS setup with Keycloak as identity provider]({{< ref "ocis_keycloak" >}})
- [Flexible oCIS setup with WebOffice and Search capabilities]({{< ref "ocis_full" >}})
- [oCIS setup with WOPI server to open office documents in your browser]({{< ref "ocis_wopi" >}})
- [Parallel deployment of oC10 and oCIS]({{< ref "oc10_ocis_parallel" >}})
- [oCIS with S3 storage backend (MinIO)]({{< ref "ocis_s3" >}})
- [oCIS with the Hello extension example]({{< ref "ocis_hello" >}})
+88 -45
View File
@@ -11,56 +11,67 @@ geekdocFilePath: continuous_deployment.md
We are continuously deploying the following deployment examples. Every example is deployed in two flavors:
- Master: reflects the current master branch state of oCIS and will be updated with every commit to master
- Rolling: reflects the latest rolling release of oCIS and will be updated with every rolling release
- Production: reflects the latest production release of oCIS and will be updated with every production release
- Latest: reflects the current master branch state of oCIS and will be updated with every commit to master
- Daily: reflects the master branch state of oCIS as of the time of deployment
- Released: reflects the newest release state (currently latest release of version 1) and will be updated with every release
The configuration for the continuous deployment can be found in the [oCIS repository](https://github.com/owncloud/ocis/tree/master/deployments/continuous-deployment-config).
# oCIS with Web Office
This deployment is based on our modular [ocis_full Example](ocis_full.md) and uses the default configuration with Collabora Online as the office suite, traefik reverse proxy, cloudimporter and the mailpit mail catching server to showcase the full feature set of oCIS.
# oCIS with Traefik
Credentials:
- oCIS: see [default demo users]({{< ref "../getting-started#login-to-owncloud-web" >}})
## Master
## Latest
- oCIS: [ocis.ocis.master.owncloud.works](https://ocis.ocis.master.owncloud.works)
- Mail: [mail.ocis.master.owncloud.works](https://mail.ocis.master.owncloud.works)
- oCIS: [ocis.ocis-traefik.latest.owncloud.works](https://ocis.ocis-traefik.latest.owncloud.works)
- Mail: [mail.ocis-traefik.latest.owncloud.works](https://mail.ocis-traefik.latest.owncloud.works)
## Rolling Release
## Daily
- oCIS: [ocis.ocis.rolling.owncloud.works](https://ocis.ocis.rolling.owncloud.works)
- Mail: [mail.ocis.rolling.owncloud.works](https://mail.ocis.rolling.owncloud.works)
- oCIS: [ocis.ocis-traefik.daily.owncloud.works](https://ocis.ocis-traefik.daily.owncloud.works)
- Mail: [mail.ocis-traefik.daily.owncloud.works](https://mail.ocis-traefik.daily.owncloud.works)
## Production Release
## Released
- oCIS: [ocis.ocis.production.owncloud.works](https://ocis.ocis.production.owncloud.works)
- Mail: [mail.ocis.production.owncloud.works](https://mail.ocis.production.owncloud.works)
- oCIS: [ocis.ocis-traefik.released.owncloud.works](https://ocis.ocis-traefik.released.owncloud.works)
- Mail: [mail.ocis-traefik.released.owncloud.works](https://mail.ocis-traefik.released.owncloud.works)
## Master with OnlyOffice
This example is using OnlyOffice as the office suite.
- oCIS: [ocis.ocis-onlyoffice.master.owncloud.works](https://ocis.ocis-onlyoffice.master.owncloud.works)
## Rolling Release with OnlyOffice
This example is using OnlyOffice as the office suite.
- oCIS: [ocis.ocis-onlyoffice.rolling.owncloud.works](https://ocis.ocis-onlyoffice.rolling.owncloud.works)
# oCIS and ownCloud Web with both most recent development versions
# oCIS with WOPI server
Credentials:
- oCIS: see [default demo users]({{< ref "../getting-started#login-to-owncloud-web" >}})
## Master branches
## Latest
- oCIS: [ocis.ocis-web.master.owncloud.works](https://ocis.ocis-web.master.owncloud.works)
- oCIS: [ocis.ocis-wopi.latest.owncloud.works](https://ocis.ocis-wopi.latest.owncloud.works)
- Mail: [mail.ocis-wopi.latest.owncloud.works](https://mail.ocis-wopi.latest.owncloud.works)
## Daily
- oCIS: [ocis.ocis-wopi.daily.owncloud.works](https://ocis.ocis-wopi.daily.owncloud.works)
- Mail: [mail.ocis-wopi.daily.owncloud.works](https://mail.ocis-wopi.daily.owncloud.works)
## Released
- oCIS: [ocis.ocis-wopi.released.owncloud.works](https://ocis.ocis-wopi.released.owncloud.works)
- Mail: [mail.ocis-wopi.released.owncloud.works](https://mail.ocis-wopi.released.owncloud.works)
# oCIS with latest ownCloud Web
Credentials:
- oCIS: see [default demo users]({{< ref "../getting-started#login-to-owncloud-web" >}})
## Latest
- oCIS: [ocis.ocis-web.latest.owncloud.works](https://ocis.ocis-web.latest.owncloud.works)
## Daily
- oCIS: [ocis.ocis-web.daily.owncloud.works](https://ocis.ocis-web.daily.owncloud.works)
# oCIS with Keycloak
@@ -71,19 +82,48 @@ Credentials:
- username: admin
- password: admin
## Rolling Release
## Latest
- oCIS: [ocis.ocis-keycloak.rolling.owncloud.works](https://ocis.ocis-keycloak.rolling.owncloud.works)
- Keycloak admin access: [keycloak.ocis-keycloak.rolling.owncloud.works](https://keycloak.ocis-keycloak.rolling.owncloud.works)
- Keycloak account management: [keycloak.ocis-keycloak.rolling.owncloud.works/realms/oCIS/account/#/](https://keycloak.ocis-keycloak.rolling.owncloud.works/realms/oCIS/account/#/)
- oCIS: [ocis.ocis-keycloak.latest.owncloud.works](https://ocis.ocis-keycloak.latest.owncloud.works)
- Keycloak admin access: [keycloak.ocis-keycloak.latest.owncloud.works](https://keycloak.ocis-keycloak.latest.owncloud.works)
- Keycloak account management: [keycloak.ocis-keycloak.latest.owncloud.works/realms/oCIS/account/#/](https://keycloak.ocis-keycloak.latest.owncloud.works/realms/oCIS/account/#/)
## Released
- oCIS: [ocis.ocis-keycloak.released.owncloud.works](https://ocis.ocis-keycloak.released.owncloud.works)
- Keycloak: [keycloak.ocis-keycloak.released.owncloud.works](https://keycloak.ocis-keycloak.released.owncloud.works)
- Keycloak account management: [keycloak.ocis-keycloak.released.owncloud.works/realms/oCIS/account/#/](https://keycloak.ocis-keycloak.released.owncloud.works/realms/oCIS/account/#/)
# Parallel deployment of oC10 and oCIS
Credentials:
- oC10 / oCIS: see [default demo users]({{< ref "../getting-started/demo-users/" >}})
- Keycloak:
- username: admin
- password: admin
- LDAP management:
- username: cn=admin,dc=owncloud,dc=com
- password: admin
## Latest
- oC10 / oCIS: [cloud.oc10-ocis-parallel.latest.owncloud.works](https://cloud.oc10-ocis-parallel.latest.owncloud.works)
- LDAP management: [ldap.oc10-ocis-parallel.latest.owncloud.works](https://ldap.oc10-ocis-parallel.latest.owncloud.works)
- Keycloak: [keycloak.oc10-ocis-parallel.latest.owncloud.works](https://keycloak.oc10-ocis-parallel.latest.owncloud.works)
# oCIS with Hello extension
Credentials:
- oCIS: see [default demo users]({{< ref "../getting-started/demo-users/" >}})
## Latest
- oCIS: [ocis.ocis-hello.latest.owncloud.works](https://ocis.ocis-hello.latest.owncloud.works)
# oCIS with S3 storage backend (MinIO)
This deployment is based on our modular [ocis_full Example](ocis_full.md), see the [oCIS with Web Office](#ocis-with-web-office) description for the feature set. In addition to that, we deployed a MinIO S3 storage backend. oCIS stores the data in the S3 server and the metadata on the local disk by using the `s3ng` storage driver.
The MinIO server provides a powerful Web UI for browser-based access to the storage which makes it possible to manage the data stored in the S3 server and understand how different policies and configurations affect the data.
Credentials:
- oCIS: see [default demo users]({{< ref "../getting-started/demo-users/" >}})
@@ -91,11 +131,10 @@ Credentials:
- access key: ocis
- secret access key: ocis-secret-key
## Rolling Release
## Latest
- oCIS: [ocis.ocis-s3.rolling.owncloud.works](https://ocis.ocis-s3.rolling.owncloud.works)
- MinIO: [minio.ocis-s3.rolling.owncloud.works](https://minio.ocis-s3.rolling.owncloud.works)
- Mail: [mail.ocis-s3.rolling.owncloud.works](https://mail.ocis-s3.rolling.owncloud.works)
- oCIS: [ocis.ocis-s3.latest.owncloud.works](https://ocis.ocis-s3.latest.owncloud.works)
- MinIO: [minio.ocis-s3.latest.owncloud.works](https://minio.ocis-s3.latest.owncloud.works)
# oCIS with LDAP for users and groups
@@ -106,8 +145,12 @@ Credentials:
- username: cn=admin,dc=owncloud,dc=com
- password: admin
## Rolling Release
## Latest
- oCIS: [ocis.ocis-ldap.rolling.owncloud.works](https://ocis.ocis-ldap.rolling.owncloud.works)
- LDAP admin: [ldap.ocis-ldap.rolling.owncloud.works](https://ldap.ocis-ldap.rolling.owncloud.works)
- oCIS: [ocis.ocis-ldap.latest.owncloud.works](https://ocis.ocis-ldap.latest.owncloud.works)
- LDAP admin: [ldap.ocis-ldap.latest.owncloud.works](https://ldap.ocis-ldap.latest.owncloud.works)
## Released
- oCIS: [ocis.ocis-ldap.released.owncloud.works](https://ocis.ocis-ldap.released.owncloud.works)
- LDAP admin: [ldap.ocis-ldap.released.owncloud.works](https://ldap.ocis-ldap.released.owncloud.works)
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file with editors other than diagrams.net -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1651px" height="816px" viewBox="-0.5 -0.5 1651 816" content="&lt;mxfile host=&quot;Electron&quot; modified=&quot;2023-01-02T15:53:47.179Z&quot; agent=&quot;5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.7.4 Chrome/106.0.5249.199 Electron/21.3.3 Safari/537.36&quot; etag=&quot;3g1Ld0YoR6MTAWI36Y9D&quot; version=&quot;20.7.4&quot; type=&quot;device&quot;&gt;&lt;diagram id=&quot;n2S8zIRfchnmVBpZdI-E&quot; name=&quot;Seite-1&quot;&gt;7V1bc5u6Fv4t5yEz7YMZhLg+Jmmc9vSSNElv56WDMbbZwUCB2M7+9UcSF4MkMHawTWPcTmsLWeC1lj6tm5bO4OV8dR2aweyzP7bdM0kcr87guzNJApoG0X+45TlpUWWQNExDZ5x2WjfcO//aaaOYtj45YzsqdYx9342doNxo+Z5nW3GpzQxDf1nuNvHd8l0Dc2ozDfeW6bKtP5xxPEtadUlbt7+3neksuzNQjeTK3Mw6p78kmpljf1logldn8DL0/Th5N19d2i4mXkaX5HvDiqv5g4W2Fzf5wh0MFkttcf3lx+ev50/xIvgYiIN0lIXpPqU/OH3Y+DmjQOg/eWMbDyKewYvlzInt+8C08NUl4jlqm8VzF30C6C37UNkd7DC2V4Wm9CGvbX9ux+Ez6pJeHQA5pVgqMkr6cbmmvwzTtlmB9pKaNpopz6f52GuyoDcpZbagkrKZSrY3Psfihj5ZrhlFjlUmTJmKUWyGMdufNA8dN/sSImL4/BN/RxB1I2v4RRoMVcsa3q3SYZNPz8VPt3boICLYYda4cuJkRAPA9DMeEAiiBNLP6/Hwh+fCB3q0SnZH/lNopaT58vsRjm+n13cf/1yu/oBfz/oPcwCzyWyGUztu0NEelyYqKz4F8VA40pG1hbZrxs6iPL15EpPe4dZ30G/LpTMHplQ4IaSELvnl6beK05EaCIjUQCI1UEIZZiAkNeZzoVuAO0Q1D0zNJkkX659L27K/WNsfvUmeeD37cp41mpAP2p+Ldz//fJcfoPXh2VE00zvnwJYVQTNw2GmJpOaTOUKLUmk2mq4z9fDUQ3KLhfkCw5ODUP88vTB3xmM8xkVoR86/5oiMhyU+JTcaXLk4U95x50AthtA4mC9d6U1KqwMPH0UBSIpSonlGjxfKtiyXRqW+708mkR1TvN2Wm/xFSOfy7T796IfxzJ/6nulerVspQF33+eT7Qcrlf+w4fk5VCvMp9ssysEZCHYICEg4Q2AJlayhsCOmNEJNPJbUhEL5QCqoAoG1gUin8k7fDJar/i3FmeX/19BGC638+3KgTaz53P11/5apHqosYdzFCb6b4jRkEhOZTJyJkTS6ju+U9OqBRURgNAKtSAYmzaLahUXEJKx9zxhdnuyjUT/UdNDUxb/iVwouyi6bWCCm4xJVY1epaDr5dXqkP0c+flrx6WPy6HjwOQFPV6oWIAikVBBjNEIUdyKAG0g1B1cX1S22ki22LVJDS+SSxHqro/qBllYivJ4uVWBUFpleabOqfJ2x1Xkx8Lx5EZLqcow5AClZE8MSRaT1OyXwbWL7rh8n1cDp6I8losUZPKEqykb5RxLfkW9moa9wbEnAcuggaC8CYPE7WJ4XT8CgP2A36+IHtVdKnCwptHYS/XKHFCpdiSK2osJm1mBtVe9BhudRQj6rCbrGg5SsVtUptWqPa1G+brlp1OlnLi9a2awJtVW9YEugV8BDKq8YsCJmRvMbcHIkwRiM0irgXMUARqOosGKktghEwJLXErZbMa6lsXhuHgiapUjHITZRJiFY62xt30nwBtDqlHdt6yRTnYzkslCLet2G+7I7a+l+F2gMatumYyXb99+R0YCdsDXAnngc77DY+g6pZvxNAawYsI0Ir+FxWHTOH7f7x2TgKmOQOi+3UwDUIgSQAlaudhq4e1WnaFJ64zlWjG/Ckl+FGNWrgZuO3oUStfxXukNZwi/VAXF89nOGnGM78KHa8KXo3diLLRzCAXaXmHGsL3igKum3qGm2BlyioYpY60Cp2Qb28Tu0jdsNn+nE8uWt3K4RqEcGwM0ECm0CsPjKuQ5lCNvj3ItuewkaNoY2KkzeEMomCsl2j7PQ4CjVOhee5tdnByxwZOn7m9RMEocOwB1pz8SG9wjAoiGoF98pjDg5mU+scvnIDg0HoL5yxHfIta1qffxPgnuLSRn1E9PSOZb9lBOTo4UMJGIKWkvoQNjg3BYQ3sygOTHFKIktkRN2xuWDbfSv6K/wfxgHdH9wlBR5lyT9A8HbAid6CtX7RevS2TrC7E72FlPtNbraGcnRUBBtlzypQREGTGy3tLw3agg2uHqZ/qlLvNWh7FOV521lBTQhpk4ugUvQ35npm6tK+RVqFaKKr67SBsudHMdCPBI2EkhlZkbD9oWqaAkSITL2yn0pFC6dqaKoGVVnUoUi5mFpKrFIopVcx6iWf7q+mbNir5HMV4wgvo4jyw4nvC2PfWnGnx8GV47qp21LEiUroTAd/qUOTyhKlgLYV7ZhLG5Vh7rcIK7YUM6OZGeC3T3P33Ir9It8Ij2/9yIkdH/Nv5MexP+cwNvYphct/il3Hsy/z/SC1kNRcC0Mztg4ztDVmFPQynlpGL5+7qGVcqmt/4WKivfbFRNX2tpgggdSwl1eFigFUg5rde1pMVG3LxUQ+wGLCs8aTxQS/GZlh1xeTLFWjjcVEAmJLy4d0qPUCHNWiJFZf2eO73hGwIYlKFAxDKUOaLu3qfd6nD7kWIjdj6X7iY6zIQUOQxSos1SRdMNirbW+YojYmqEo94tH9tTSzZ6+Il7tm15A3cVwbfQdBRoeBLpvp7SAdsqFaQToqyyNzcB0A+AyGjT+I7/eG+H4ZRh7a9UjtuVH1A7oe+QTrNr1o6DhkplpdXkNX6aVQ9FKPLV/Zzcq5V36IMxeWfuAgM3bBsWQPHpKhfLKyfGxBA6zN30nCUVCfFxI4HuGOuhVum1zSgtJbUnk3ZVvsfWdsCnLHSoVgtVhDFspxDhUown6cvXRwUN2wjZYxzw+wW19ioAEjAlfsu7FXv73EB6Slwsy3u6tU5bsQ9pHUxdeyRC5zDpXUtZ+dSdwKLaix2CVHRVGUSg4BoB2yOArPLu9w2ioDKmADBtH9t0pzBRXf3j4eXfHYe8iX5euarDGT2/BmN9CxFh1aQUdZg9LL4DHX7Kj8/cOh5XF3A5VwquneTzbPRVV2yprtkI/yMModnQ6j71wASjIEXTPyl1qO1mqiIciF2gbSXtRH2vWlwg3QTfVHT9mq/sjnLKtA5kA56jJQtrnpSdKg2gpQgoN5NyU2yeO15wGoyvHzAAC78ZtJjb30Xdcc+aHJzXjF1Szo7NgJ4guW2/R7RAAx2jpYtCIb4b7vcXaPm/Q2nwix7ZHgMOIQHmKEP2TzmUmInoSI3YiWyGC8D623+Leju4iebePVk7MhsrIla7jx3OfM/dnwt+PVd45+soVZaHpjl2xloqQYyU+8P8jBj5BUIknTLkL/EQk3qT3yzvM9PAoioks1tSDwSOIFo/gqC7ymCIAV+KzkTUniAa1gtybykFWlHUJzLJrhAvE6IsI7nz95iAEETF7kihyb0Yz0zT7cmjG6n0daJBJNboH0elklkCDSGDh59xqP1usU/ZdQO/rufX0ff7ox7V/vv88u7+KfYdCkHOruxNyPEA8Arbaxfl8ZcOiYQ3frVGQd5ib5EoLFyBnbNG5SwisuHBNrxTMMoUHor57Xso7evSHbxcWpGdtL85ndQ8KCVVNEaQ5qPK6X5aINxhrlOcIpFpyXHyvyldbad2GrPB+o5rfL6w+KP374r62NHrXpgA3Mc8xD13WCqIpGxRUkChLlZeKsMNVKDDmT4ETBf86SSlWF9uTFcBVdUclrM4K1FRDFkEVxSK5QkfLW0vxj0+daYxWLYyyQnRCrahVbTWIn1hFYxqq2nNqxJ8MyuiaqoqiCJDKq2nFZxiZncgpenAzLFKyXFXLYxHKgUOFUZj0Cz9i0EU59u5PhGaQqdynZinZcJnHqbXByCU6GS3gLRo1jxuiK1pF7Bdds46Q/92xLV7TOsE1i2MbZcHMybAP0QiaVp5vELRFwDL5Bhm/glBUQiDgjgyp3HgBkAwkzHY/MQ9aozk9V6nnI8FDHbsLCS+8ED1lrm7ft52R4iBYUaqpRp68YhqBoneMi67XkpT+cDhcptzIERjlYIneCa6zbhJfidzpco/e1yJ3RVlhvSaZ4niSngLbmDF3WckN8vY3ADZ9HrHcEnLIpgMOSJcyjClwqXZlcnM09mVZykozbpILoFF+7wUTWfcI7P+5kmLhh9nWTh6wvhbcN6mR4OKB8KbAcMQWcZIVjcI3jSTnlsIAql81sqrQdmpfKoW02bqFAzhJ30ArNAOFzKdVcRBrUDqnmWA7S+0mNSwNxKZJizb5TxWWtvJ6q9EmaLZU6pO+jbdh/o8Da/i9O4uaiB+s4OOnEGBmhR8mFV0aPjqRbSKzj9ZQVZlkFdUxTFMjLzzwC5LM6Msu19XbINLOvREMqPbNMzjUvfqQ/U2LWjEpyd+Qgd5mqPQHpHf5N9/EMJPrcDXqk9orMc5nNKtM9szcwW6HPAdiZ2cxIe2Y2q4P76V4G0QwCtyq5vZObE2iFjnxOnxm0ANcDyWCYJcgSA9D5ecRtb8+pUz4LHJzFcRCRjSdD8jfZfoKpcUZ23KSLine truncated

Before

Width:  |  Height:  |  Size: 92 KiB

-415
View File
@@ -1,415 +0,0 @@
---
title: "Full modular oCIS with WebOffice"
date: 2024-06-25T00:00:00+01:00
weight: 24
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/deployment
geekdocFilePath: ocis_full.md
---
{{< toc >}}
## Overview
* oCIS, the collaboration service, Collabora or OnlyOffice running behind Traefik as reverse proxy
* Collabora or OnlyOffice enable you to edit office documents in your browser
* The collaboration server acts as a bridge to make the oCIS storage accessible to Collabora and OnlyOffice
* Traefik generating self-signed certificates for local setup or obtaining valid SSL certificates for a server setup
* The whole deployment acts as a modular toolkit to use different flavors of office suites and ocis features
[Find this example on GitHub](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full)
## Easy Default
The Infinite Scale Team and product management are providing a default setup for oCIS.
### Goal:
- provide a good starting point for a production deployment
- minimal effort to get started with an opinionated setup
- keep it adjustable it to your needs.
### Default Components
- Infinite Scale
- Full Text Search
- Collabora Online Web Office
- Prepared for LetsEncrypt SSL certificates via Traefik Reverse Proxy
### Optional Components
- ClamAV Virusscanner
- Cloud Importer (Experimental)
- OnlyOffice as an alternative to Collabora
- S3 Storage config to connect to an S3 storage backend
- S3 Minio Server as a local S3 storage backend for debugging and development
### Important Note
If you deviate from the configuration setup and let the `collaboration` service run in its own container, you MUST
ensure the ocis configuration is shared as shown in the example deployment. This is because secrets generated
must be accessible for all services.
## Server Deployment
### Requirements
* Linux server with docker and docker-compose installed
* Three domains set up and pointing to your server
* ocis.* for serving oCIS
* collabora.* for serving Collabora
* onlyoffice.* for serving OnlyOffice
* wopiserver.* for serving the WOPI server
* traefik.* for serving the Traefik dashboard
* companion.* for serving the uppy companion app
See also [example server setup]({{< ref "preparing_server" >}})
### Install oCIS and Traefik
* Clone oCIS repository
`git clone https://github.com/owncloud/ocis.git --depth 1`
* Go to the deployment example
`cd ocis/deployments/examples/ocis_full`
* Open the `.env` file in a text editor.
The file by default looks like this:
```shell {linenos=table,hl_lines=[8,24,48,50,135,138]}
## Basic Settings ##
# Define the docker compose log driver used.
# Defaults to local
LOG_DRIVER=
# If you're on an internet facing server, comment out following line.
# It skips certificate validation for various parts of Infinite Scale and is
# needed when self signed certificates are used.
INSECURE=true
## Traefik Settings ##
# Note: Traefik is always enabled and can't be disabled.
# Serve Traefik dashboard.
# Defaults to "false".
TRAEFIK_DASHBOARD=
# Domain of Traefik, where you can find the dashboard.
# Defaults to "traefik.owncloud.test"
TRAEFIK_DOMAIN=
# Basic authentication for the traefik dashboard.
# Defaults to user "admin" and password "admin" (written as: "admin:admin").
TRAEFIK_BASIC_AUTH_USERS=
# Email address for obtaining LetsEncrypt certificates.
# Needs only be changed if this is a public facing server.
TRAEFIK_ACME_MAIL=
# Set to the following for testing to check the certificate process:
# "https://acme-staging-v02.api.letsencrypt.org/directory"
# With staging configured, there will be an SSL error in the browser.
# When certificates are displayed and are emitted by # "Fake LE Intermediate X1",
# the process went well and the envvar can be reset to empty to get valid certificates.
TRAEFIK_ACME_CASERVER=
## Infinite Scale Settings ##
# Beside Traefik, this service must stay enabled.
# Disable only for testing purposes.
# Note: the leading colon is required to enable the service.
OCIS=:ocis.yml
# The oCIS container image.
# For production releases: "owncloud/ocis"
# For rolling releases: "owncloud/ocis-rolling"
# Defaults to production if not set otherwise
OCIS_DOCKER_IMAGE=owncloud/ocis-rolling
# The oCIS container version.
# Defaults to "latest" and points to the latest stable tag.
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend.
# Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=
# oCIS admin user password. Defaults to "admin".
ADMIN_PASSWORD=
# Demo users should not be created on a production instance,
# because their passwords are public. Defaults to "false".
# Also see: https://doc.owncloud.com/ocis/latest/deployment/general/general-info.html#demo-users-and-groups
DEMO_USERS=
# Define the oCIS loglevel used.
# For more details see:
# https://doc.owncloud.com/ocis/latest/deployment/services/env-vars-special-scope.html
LOG_LEVEL=
# Define the kind of logging.
# The default log can be read by machines.
# Set this to true to make the log human readable.
# LOG_PRETTY=true
#
# Define the oCIS storage location. Set the paths for config and data to a local path.
# Note that especially the data directory can grow big.
# Leaving it default stores data in docker internal volumes.
# For more details see:
# https://doc.owncloud.com/ocis/next/deployment/general/general-info.html#default-paths
# OCIS_CONFIG_DIR=/your/local/ocis/config
# OCIS_DATA_DIR=/your/local/ocis/data
# S3 Storage configuration - optional
# Infinite Scale supports S3 storage as primary storage.
# Per default, S3 storage is disabled and the local filesystem is used.
# To enable S3 storage, uncomment the following line and configure the S3 storage.
# For more details see:
# https://doc.owncloud.com/ocis/next/deployment/storage/s3.html
# Note: the leading colon is required to enable the service.
#S3NG=:s3ng.yml
# Configure the S3 storage endpoint. Defaults to "http://minio:9000" for testing purposes.
S3NG_ENDPOINT=
# S3 region. Defaults to "default".
S3NG_REGION=
# S3 access key. Defaults to "ocis"
S3NG_ACCESS_KEY=
# S3 secret. Defaults to "ocis-secret-key"
S3NG_SECRET_KEY=
# S3 bucket. Defaults to "ocis"
S3NG_BUCKET=
#
# For testing purposes, add local minio S3 storage to the docker-compose file.
# The leading colon is required to enable the service.
#S3NG_MINIO=:minio.yml
# Minio domain. Defaults to "minio.owncloud.test".
MINIO_DOMAIN=
# Define SMPT settings if you would like to send Infinite Scale email notifications.
# For more details see:
# https://doc.owncloud.com/ocis/latest/deployment/services/s-list/notifications.html
# NOTE: when configuring mail server, these settings have no effect, see mailserver.yml for details.
# SMTP host to connect to.
SMTP_HOST=
# Port of the SMTP host to connect to.
SMTP_PORT=
# An eMail address that is used for sending Infinite Scale notification eMails
# like "ocis notifications <noreply@yourdomain.com>".
SMTP_SENDER=
# Username for the SMTP host to connect to.
SMTP_USERNAME=
# Password for the SMTP host to connect to.
SMTP_PASSWORD=
# Authentication method for the SMTP communication.
SMTP_AUTHENTICATION=
# Allow insecure connections to the SMTP server. Defaults to false.
SMTP_INSECURE=
## Default Enabled Services ##
### Apache Tika Content Analysis Toolkit ###
# Tika (search) is enabled by default, comment if not required.
# Note: the leading colon is required to enable the service.
TIKA=:tika.yml
# Set the desired docker image tag or digest.
# Defaults to "latest"
TIKA_IMAGE=
### Collabora Settings ###
# Collabora web office is default enabled, comment if not required.
# Note: the leading colon is required to enable the service.
COLLABORA=:collabora.yml
# Domain of Collabora, where you can find the frontend.
# Defaults to "collabora.owncloud.test"
COLLABORA_DOMAIN=
# Domain of the wopiserver which handles OnlyOffice.
# Defaults to "wopiserver.owncloud.test"
WOPISERVER_DOMAIN=
# Admin user for Collabora.
# Defaults to "admin".
# Collabora Admin Panel URL:
# https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html
COLLABORA_ADMIN_USER=
# Admin password for Collabora.
# Defaults to "admin".
COLLABORA_ADMIN_PASSWORD=
# Set to true to enable SSL for Collabora Online. Default is true if not specified.
COLLABORA_SSL_ENABLE=false
# If you're on an internet-facing server, enable SSL verification for Collabora Online.
# Please comment out the following line:
COLLABORA_SSL_VERIFICATION=false
...
```
#### Reverse Proxy and SSL
{{< hint type=important >}}
**Domains and SSL**\
Though it may sound strange, most of the setups are failing due to a misconfiguration regarding domains and SSL. Please make sure that you have set up the domains correctly and that they are pointing to your server. Also, make sure that you have set up the email address for the LetsEncrypt certificates in `TRAEFIK_ACME_MAIL=`.
{{< /hint >}}
You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`.
Traefik will issue certificates with LetsEncrypt and therefore you must set an email address in `TRAEFIK_ACME_MAIL=`.
#### Infinite Scale Release and Version
By default oCIS will be started in the `latest` rolling version. Please note that this deployment does currently not work with the 5.x productions releases.
The oCIS "collaboration" service, which is required by this deployment, is not part of the 5.x releases.
If you want to use a specific version of oCIS, set the version to a dedicated tag like `OCIS_DOCKER_TAG=6.3.0`. The minimal required oCIS Version to run this deployment is 6.3.0. Available production versions can be found on [Docker Hub Production](https://hub.docker.com/r/owncloud/ocis/tags?page=1&ordering=last_updated) and available rolling releases can be found on [Docker Hub Rolling](https://hub.docker.com/r/owncloud/ocis-rolling/tags?page=1&ordering=last_updated)
{{< hint type=info title="oCIS Releases" >}}
You can read more about the different oCIS releases in the [oCIS Release Lifecycle](../release_roadmap.md).
{{< /hint >}}
Set your domain for the oCIS frontend in `OCIS_DOMAIN=`, e.g. `OCIS_DOMAIN=ocis.owncloud.test`.
Set the initial admin user password in `ADMIN_PASSWORD=`, it defaults to `admin`.
Web Office needs a public domain for the WOPI server to be set in `WOPISERVER_DOMAIN=`, where the office suite can work on the files via the WOPI protocol.
Now it's time to set up Collabora and you need to configure the domain of Collabora in `COLLABORA_DOMAIN=`.
If you want to use the Collabora admin panel you need to set the username and password for the administrator in `COLLABORA_ADMIN_USER=` and `COLLABORA_ADMIN_PASSWORD=`.
* Start the docker stack
`docker-compose up -d`
* You now can visit oCIS and are able to open an office document in your browser. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
## Local Setup
This docker stack can also be run locally. One downside is that Traefik can not obtain valid SSL certificates and therefore will create self-signed ones. This means that your browser will show scary warnings. Another downside is that you can not point DNS entries to your localhost. So you have to add static host entries to your computer.
On Linux and macOS you can add them to your `/etc/hosts` file and on Windows to `C:\Windows\System32\Drivers\etc\hosts` file like this:
```
127.0.0.1 ocis.owncloud.test
127.0.0.1 traefik.owncloud.test
127.0.0.1 collabora.owncloud.test
127.0.0.1 onlyoffice.owncloud.test
127.0.0.1 wopiserver.owncloud.test
127.0.0.1 mail.owncloud.test
127.0.0.1 companion.owncloud.test
127.0.0.1 minio.owncloud.test
```
After that, you're ready to start the application stack:
`docker-compose pull && docker-compose up -d`
Open https://collabora.owncloud.test in your browser and accept the invalid certificate warning.
Open https://ocis.owncloud.test in your browser and accept the invalid certificate warning. You are now able to open an office document in your browser. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
## Additional services
### Clamav Virusscanner
You can add a Clamav Virusscanner to the stack. The service is disabled by default. To enable it, uncomment the `CLAMAV` line in the `.env` file.
```shell {linenos=table,hl_lines=[3]}
## Clamav Settings ##
# The leading colon is required to enable the service.
CLAMAV=:clamav.yml
```
After enabling that service, you can add the service to the stack with `docker-compose up -d` again.
### Traefik Dashboard
If you want to use the Traefik dashboard, set TRAEFIK_DASHBOARD to `true` (default is `false` and therefore not active). If you activate it, you must set a domain for the Traefik dashboard in `TRAEFIK_DOMAIN=` e.g. `TRAEFIK_DOMAIN=traefik.owncloud.test`.
The Traefik dashboard is secured by basic auth. Default credentials are the user `admin` with the password `admin`. To set your own credentials, generate a htpasswd (e.g. by using [an online tool](https://htpasswdgenerator.de/) or a cli tool).
```shell {linenos=table,hl_lines=[4,7,10]}
### Traefik Settings ###
# Serve Traefik dashboard.
# Defaults to "false".
TRAEFIK_DASHBOARD=true
# Domain of Traefik, where you can find the dashboard.
# Defaults to "traefik.owncloud.test"
TRAEFIK_DOMAIN=
# Basic authentication for the traefik dashboard.
# Defaults to user "admin" and password "admin" (written as: "admin:admin").
TRAEFIK_BASIC_AUTH_USERS=
```
### Cloud Importer
Cloud importer can provide an Upload Interface to your oCIS instance. It is a separate service that can be enabled in the `.env` file.
```shell {linenos=table,hl_lines=[3]}
## Uppy Companion Settings ##
# The leading colon is required to enable the service.
CLOUD_IMPORTER=:cloudimporter.yml
## The docker image to be used for uppy companion.
# owncloud has built a container with public link import support.
COMPANION_IMAGE=
# Domain of Uppy Companion. Defaults to "companion.owncloud.test".
COMPANION_DOMAIN=
# Provider settings, see https://uppy.io/docs/companion/#provideroptions for reference.
# Empty by default, which disables providers.
COMPANION_ONEDRIVE_KEY=
COMPANION_ONEDRIVE_SECRET=
```
After Enabling that servive by uncommenting the `CLOUD_IMPORTER` line, you can add the service to the stack with `docker-compose up -d` again.
### S3 Storage
You can use an S3 compatible Storage as the primary data store. The metadatata of the files will still be stored on the local filesystem.
{{<hint type="info">}}
The endpoint, region and keys for your S3 Server need to be provided by the service or company who operates it. Normally you can get these via web portal.
{{</hint>}}
```shell {linenos=table,hl_lines=[8,10,12,14,16,18]}
# S3 Storage configuration - optional
# Infinite Scale supports S3 storage as primary storage.
# Per default, S3 storage is disabled and the local filesystem is used.
# To enable S3 storage, uncomment the following line and configure the S3 storage.
# For more details see:
# https://doc.owncloud.com/ocis/next/deployment/storage/s3.html
# Note: the leading colon is required to enable the service.
# S3NG=:s3ng.yml
# Configure the S3 storage endpoint. Defaults to "http://minio:9000" for testing purposes.
S3NG_ENDPOINT=
# S3 region. Defaults to "default".
S3NG_REGION=
# S3 access key. Defaults to "ocis"
S3NG_ACCESS_KEY=
# S3 secret. Defaults to "ocis-secret-key"
S3NG_SECRET_KEY=
# S3 bucket. Defaults to "ocis"
S3NG_BUCKET=
```
#### Use a Local Minio S3 Storage Backend
For testing purposes, you can use a local minio S3 storage backend. To enable it, uncomment the `S3NG_MINIO` line in the `.env` file.
The frontend for the minio server is available at `http://minio.owncloud.test` and the access key is `ocis` and the secret key is `ocis-secret`.
## Local Setup for Web Development
In case you want to run ownCloud Web from a development branch together with this deployment example (e.g. for feature development for the app provider frontend) you can use this deployment example with the local setup and some additional steps as described below.
1. Clone the [ownCloud Web repository](https://github.com/owncloud/web) on your development machine.
2. Run `pnpm i && pnpm build:w` for `web`, so that it creates and continuously updates the `dist` folder for web.
3. Add the dist folder as read only volume to `volumes` section of the `ocis` service in the `docker-compose.yml` file:
```yaml
- /your/local/path/to/web/dist/:/web/dist:ro
```
Make sure to point to the `dist` folder inside your local copy of the web repository.
4. Set the oCIS environment variables `WEB_ASSET_CORE_PATH` and `WEB_ASSET_APPS_PATH` in the `environment` section of the `ocis` service, so that it uses your mounted dist folder for the web assets, instead of the assets that are embedded into oCIS.
```yaml
WEB_ASSET_CORE_PATH: "/web/dist"
WEB_ASSET_APPS_PATH: "/web/dist"
```
5. Start the deployment example as described above in the `Local setup` section.
For app provider frontend development in `web` you can find the source code in `web/packages/web-app-external`. Some parts of the integration live in `web/packages/web-app-files`.
## Using Podman
Podman doesn't have a "local" log driver. Also it's docker-compatibility socket does live in a different location, especially when running a rootless podman.
Using the following settings you can run the deployment with a recent podman version:
```bash
LOG_DRIVER=journald \
DOCKER_SOCKET_PATH=/run/user/1000/podman/podman.sock \
podman compose start
```
+2
View File
@@ -19,6 +19,8 @@ geekdocFilePath: ocis_hello.md
The docker stack consists of 3 containers. One of them is Traefik, a proxy which is terminating SSL and forwards the requests to oCIS in the internal docker network.
The next container is oCIS itself in a configuration like the [oCIS with Traefik example]({{< ref "ocis_traefik" >}}), except that for this example a custom proxy and web UI configuration is used to enable the oCIS Hello extension.
The oCIS Hello extension is running in another container and enables you to use its functionality from within ownCloud Web.
## Server Deployment
+136
View File
@@ -0,0 +1,136 @@
---
title: "oCIS with S3 storage backend (MinIO)"
date: 2020-10-12T14:04:00+01:00
weight: 24
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/deployment
geekdocFilePath: ocis_s3.md
---
{{< toc >}}
## Overview
* oCIS running behind Traefik as reverse proxy
* MinIO as S3 compatible storage provider
* oCIS is configured to use S3 as user storage provider
* Traefik generating self-signed certificates for local setup or obtaining valid SSL certificates for a server setup
[Find this example on GitHub](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_s3)
The docker stack consists 3 containers. One of them is Traefik, a proxy which is terminating SSL and forwards the requests to oCIS in the internal docker network.
The next container is oCIS itself in a configuration like the [oCIS with Traefik example]({{< ref "ocis_traefik" >}}), except that it will use S3 as user storage.
The last container is MinIO, providing a S3 compatible API, where oCIS will store its data.
## Server Deployment
### Requirements
* Linux server with docker and docker-compose installed
* Three domains set up and pointing to your server
- ocis.* for serving oCIS
- minio.* for accessing the MinIO S3 bucket in the browser
- traefik.* for serving the Traefik dashboard
See also [example server setup]({{< ref "preparing_server" >}})
### Install oCIS and Traefik
* Clone oCIS repository
`git clone https://github.com/owncloud/ocis.git`
* Go to the deployment example
`cd ocis/deployments/examples/ocis_s3`
* Open the `.env` file in a text editor.
The file by default looks like this:
```bash
# If you're on a internet facing server please comment out following line.
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
INSECURE=true
### Traefik settings ###
# Serve Traefik dashboard. Defaults to "false".
TRAEFIK_DASHBOARD=
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
TRAEFIK_DOMAIN=
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin"
TRAEFIK_BASIC_AUTH_USERS=
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
TRAEFIK_ACME_MAIL=
### oCIS settings ###
# oCIS version. Defaults to "latest"
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=
# oCIS admin user password. Defaults to "admin".
ADMIN_PASSWORD=
# The demo users should not be created on a production instance
# because their passwords are public. Defaults to "false".
DEMO_USERS=
### MINIO / S3 settings ###
# Domain of MinIO where the Web UI is accessible. Defaults to "minio.owncloud.test".
MINIO_DOMAIN=
# S3 bucket name, where oCIS stores its data in. Defaults to "ocis-bucket".
MINIO_BUCKET=
# S3 bucket access key, which oCIS uses to authenticate. Defaults to "ocis".
MINIO_ACCESS_KEY=
# S3 bucket access key secret, which oCIS uses to authenticate. Defaults to "ocis-secret-key".
MINIO_SECRET_KEY=
```
You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`.
If you want to use the Traefik dashboard, set TRAEFIK_DASHBOARD to `true` (default is `false` and therefore not active). If you activate it, you must set a domain for the Traefik dashboard in `TRAEFIK_DOMAIN=` e.g. `TRAEFIK_DOMAIN=traefik.owncloud.test`.
The Traefik dashboard is secured by basic auth. Default credentials are the user `admin` with the password `admin`. To set your own credentials, generate a htpasswd (e.g. by using [an online tool](https://htpasswdgenerator.de/) or a cli tool).
Traefik will issue certificates with LetsEncrypt and therefore you must set an email address in `TRAEFIK_ACME_MAIL=`.
By default oCIS will be started in the `latest` version. If you want to start a specific version of oCIS set the version to `OCIS_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis/tags?page=1&ordering=last_updated).
Set your domain for the oCIS frontend in `OCIS_DOMAIN=`, e.g. `OCIS_DOMAIN=ocis.owncloud.test`.
Set the initial admin user password in `ADMIN_PASSWORD=`, it defaults to `admin`.
Set your domain for the MinIO frontend in `MINIO_DOMAIN=`, e.g. `MINIO_DOMAIN=minio.owncloud.test`. If you are using other S3-compatible providers you need to configure the respective endpoint here.
If you like you can change the default name of the S3 bucket by setting `MINIO_BUCKET=` to a different value.
You also must override the S3 bucket credentials in `MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` in order to secure your MinIO instance. Choose some random strings e.g. from the output of `openssl rand -base64 32`.
Now you have configured everything and can save the file.
* Start the docker stack
`docker-compose up -d`
* You now can visit oCIS and are able to use it just normally. If you log into the web UI of MinIO, you will see blobs of files you uploaded. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
## Local setup
For a more simple local ocis setup see [Getting started]({{< ref "../getting-started" >}})
This docker stack can also be run locally. One downside is that Traefik can not obtain valid SSL certificates and therefore will create self-signed ones. This means that your browser will show scary warnings. Another downside is that you can not point DNS entries to your localhost. So you have to add static host entries to your computer.
On Linux and macOS you can add them to your `/etc/hosts` file and on Windows to `C:\Windows\System32\Drivers\etc\hosts` file like this:
```
127.0.0.1 ocis.owncloud.test
127.0.0.1 traefik.owncloud.test
127.0.0.1 minio.owncloud.test
```
After that you're ready to start the application stack:
`docker-compose up -d`
Open https://ocis.owncloud.test in your browser and accept the invalid certificate warning. You now can use oCIS normally and should now upload a file. Open https://minio.owncloud.test in your browser and accept the invalid certificate warning, after that you will see blobs of files you have uploaded to oCIS. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
+122
View File
@@ -0,0 +1,122 @@
---
title: "oCIS with Traefik"
date: 2020-10-12T14:04:00+01:00
weight: 24
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/deployment
geekdocFilePath: ocis_traefik.md
---
{{< toc >}}
## Overview
* oCIS running behind Traefik as reverse proxy
* Traefik generating self-signed certificates for local setup or obtaining valid SSL certificates for a server setup
[Find this example on GitHub](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_traefik)
The docker stack consists of three containers. One of them is Traefik, a proxy which is terminating ssl and forwards the requests to oCIS in the internal docker network.
The other one is oCIS itself running all extensions in one container. In this example, oCIS uses its internal IDP [LibreGraph Connect]({{< ref "../../services/idp" >}}) and the [oCIS storage driver]({{< ref "../storage/storagedrivers" >}})
The last one is [Inbucket](https://inbucket.org) a mail service to view the notification mails oCIS generates.
## Server Deployment
### Requirements
* Linux server with docker and docker-compose installed
* Three domains set up and pointing to your server
- ocis.* for serving oCIS
- traefik.* for serving the Traefik dashboard
- mail.* for serving the Inbucket mail service
See also [example server setup]({{< ref "preparing_server" >}})
### Install oCIS and Traefik
* Clone oCIS repository
`git clone https://github.com/owncloud/ocis.git`
* Go to the deployment example
`cd ocis/deployments/examples/ocis_traefik`
* Open the `.env` file in a text editor.
The file by default looks like this:
```bash
# If you're on a internet facing server please comment out following line.
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
INSECURE=true
### Traefik settings ###
# Serve Traefik dashboard. Defaults to "false".
TRAEFIK_DASHBOARD=
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
TRAEFIK_DOMAIN=
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin"
TRAEFIK_BASIC_AUTH_USERS=
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
TRAEFIK_ACME_MAIL=
### oCIS settings ###
# oCIS version. Defaults to "latest"
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=
# oCIS admin user password. Defaults to "admin".
ADMIN_PASSWORD=
# The demo users should not be created on a production instance
# because their passwords are public. Defaults to "false".
DEMO_USERS=
### Email / Inbucket settings ###
# Inbucket / Mail domain. Defaults to "mail.owncloud.test"
INBUCKET_DOMAIN=
```
You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`.
If you want to use the Traefik dashboard, set TRAEFIK_DASHBOARD to `true` (default is `false` and therefore not active). If you activate it, you must set a domain for the Traefik dashboard in `TRAEFIK_DOMAIN=` e.g. `TRAEFIK_DOMAIN=traefik.owncloud.test`.
The Traefik dashboard is secured by basic auth. Default credentials are the user `admin` with the password `admin`. To set your own credentials, generate a htpasswd (e.g. by using [an online tool](https://htpasswdgenerator.de/) or a cli tool).
Traefik will issue certificates with LetsEncrypt and therefore you must set an email address in `TRAEFIK_ACME_MAIL=`.
By default ocis will be started in the `latest` version. If you want to start a specific version of oCIS set the version to `OCIS_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis/tags?page=1&ordering=last_updated).
Set your domain for the oCIS frontend in `OCIS_DOMAIN=`, e.g. `OCIS_DOMAIN=ocis.owncloud.test`.
Set the initial admin user password in `ADMIN_PASSWORD=`, it defaults to `admin`.
Now you have configured everything and can save the file.
* Start the docker stack
`docker-compose up -d`
* You now can visit oCIS, Traefik dashboard and Inbucket on your configured domains. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
## Local setup
For a more simple local ocis setup see [Getting started]({{< ref "../getting-started" >}})
This docker stack can also be run locally. One downside is that Traefik can not obtain valid SSL certificates and therefore will create self-signed ones. This means that your browser will show scary warnings. Another downside is that you can not point DNS entries to your localhost. So you have to add static host entries to your computer.
On Linux and macOS you can add them to your `/etc/hosts` file and on Windows to `C:\Windows\System32\Drivers\etc\hosts` file like this:
```
127.0.0.1 ocis.owncloud.test
127.0.0.1 traefik.owncloud.test
127.0.0.1 mail.owncloud.test
```
After that you're ready to start the application stack:
`docker-compose up -d`
Open https://ocis.owncloud.test in your browser and accept the invalid certificate warning. You now can login to oCIS with the default users, which also can be found here: [Getting started]({{< ref "../getting-started#login-to-ocis-web" >}}). You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
+178
View File
@@ -0,0 +1,178 @@
---
title: "oCIS with WOPI server"
date: 2020-10-12T14:04:00+01:00
weight: 24
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/deployment
geekdocFilePath: ocis_wopi.md
---
{{< toc >}}
## Overview
* oCIS, Wopi server, Collabora and OnlyOffice running behind Traefik as reverse proxy
* Collabora and OnlyOffice enable you to edit documents in your browser
* Wopi server acts as a bridge to make the oCIS storage accessible to Collabora and OnlyOffice
* Traefik generating self-signed certificates for local setup or obtaining valid SSL certificates for a server setup
[Find this example on GitHub](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_wopi)
The docker stack consists of 10 containers. One of them is Traefik, a proxy which is terminating SSL and forwards the requests to oCIS in the internal docker network.
The next container is oCIS itself in a configuration like the [oCIS with Traefik example]({{< ref "ocis_traefik" >}}), except that for this example a custom mimetype configuration is used.
There are three oCIS app driver containers that register Collabora and OnlyOffice at the app registry.
The last four containers are the WOPI server, Collabora and OnlyOffice.
## Server Deployment
### Requirements
* Linux server with docker and docker-compose installed
* Three domains set up and pointing to your server
* ocis.* for serving oCIS
* collabora.* for serving Collabora
* onlyoffice.* for serving OnlyOffice
* wopiserver.* for serving the WOPI server
* traefik.* for serving the Traefik dashboard
See also [example server setup]({{< ref "preparing_server" >}})
### Install oCIS and Traefik
* Clone oCIS repository
`git clone https://github.com/owncloud/ocis.git`
* Go to the deployment example
`cd ocis/deployments/examples/ocis_wopi`
* Open the `.env` file in a text editor.
The file by default looks like this:
```bash
# If you're on a internet facing server please comment out following line.
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
INSECURE=true
### Traefik settings ###
# Serve Traefik dashboard. Defaults to "false".
TRAEFIK_DASHBOARD=
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
TRAEFIK_DOMAIN=
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin"
TRAEFIK_BASIC_AUTH_USERS=
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
TRAEFIK_ACME_MAIL=
### oCIS settings ###
# oCIS version. Defaults to "latest"
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=
# oCIS admin user password. Defaults to "admin".
ADMIN_PASSWORD=
# The demo users should not be created on a production instance
# because their passwords are public. Defaults to "false".
DEMO_USERS=
### Wopi server settings ###
# cs3org wopi server version. Defaults to "v8.3.3"
WOPISERVER_DOCKER_TAG=
# cs3org wopi server domain. Defaults to "wopiserver.owncloud.test"
WOPISERVER_DOMAIN=
# JWT secret which is used for the documents to be request by the Wopi client from the cs3org Wopi server. Must be change in order to have a secure Wopi server. Defaults to "LoremIpsum567"
WOPI_JWT_SECRET=
### Collabora settings ###
# Domain of Collabora, where you can find the frontend. Defaults to "collabora.owncloud.test"
COLLABORA_DOMAIN=
# Admin user for Collabora. Defaults to blank, provide one to enable access
COLLABORA_ADMIN_USER=
# Admin password for Collabora. Defaults to blank, provide one to enable access
COLLABORA_ADMIN_PASSWORD=
### OnlyOffice settings ###
# Domain of OnlyOffice, where you can find the frontend. Defaults to "onlyoffice.owncloud.test"
ONLYOFFICE_DOMAIN=
```
You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`.
If you want to use the Traefik dashboard, set TRAEFIK_DASHBOARD to `true` (default is `false` and therefore not active). If you activate it, you must set a domain for the Traefik dashboard in `TRAEFIK_DOMAIN=` e.g. `TRAEFIK_DOMAIN=traefik.owncloud.test`.
The Traefik dashboard is secured by basic auth. Default credentials are the user `admin` with the password `admin`. To set your own credentials, generate a htpasswd (e.g. by using [an online tool](https://htpasswdgenerator.de/) or a cli tool).
Traefik will issue certificates with LetsEncrypt and therefore you must set an email address in `TRAEFIK_ACME_MAIL=`.
By default oCIS will be started in the `latest` version. If you want to start a specific version of oCIS set the version to `OCIS_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis/tags?page=1&ordering=last_updated).
Set your domain for the oCIS frontend in `OCIS_DOMAIN=`, e.g. `OCIS_DOMAIN=ocis.owncloud.test`.
Set the initial admin user password in `ADMIN_PASSWORD=`, it defaults to `admin`.
By default the CS3Org WOPI server will also be started in the `latest` version. If you want to start a specific version of it, you can set the version to `WOPISERVER_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/cs3org/wopiserver/tags?page=1&ordering=last_updated).
Set your domain for the CS3Org WOPI server in `WOPISERVER_DOMAIN=`, where all office suites can download the files via the WOPI protocol.
You also must override the default WOPI JWT secret in order to have a secure setup. Do this by setting `WOPI_JWT_SECRET` to a long and random string.
Now it's time to set up Collabora and you need to configure the domain of Collabora in `COLLABORA_DOMAIN=`.
If you want to use the Collabora admin panel you need to set the username and password for the administrator in `COLLABORA_ADMIN_USER=` and `COLLABORA_ADMIN_PASSWORD=`.
Next up is OnlyOffice, which also needs a domain in `ONLYOFFICE_DOMAIN=`.
Now you have configured everything and can save the file.
* Start the docker stack
`docker-compose up -d`
* You now can visit oCIS and are able to open an office document in your browser. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
## Local setup
For a more simple local ocis setup see [Getting started]({{< ref "../getting-started" >}})
This docker stack can also be run locally. One downside is that Traefik can not obtain valid SSL certificates and therefore will create self-signed ones. This means that your browser will show scary warnings. Another downside is that you can not point DNS entries to your localhost. So you have to add static host entries to your computer.
On Linux and macOS you can add them to your `/etc/hosts` file and on Windows to `C:\Windows\System32\Drivers\etc\hosts` file like this:
```
127.0.0.1 ocis.owncloud.test
127.0.0.1 traefik.owncloud.test
127.0.0.1 collabora.owncloud.test
127.0.0.1 onlyoffice.owncloud.test
127.0.0.1 wopiserver.owncloud.test
```
After that you're ready to start the application stack:
`docker-compose up -d`
Open https://collabora.owncloud.test, https://onlyoffice.owncloud.test and https://wopiserver.owncloud.test in your browser and accept the invalid certificate warning.
Open https://ocis.owncloud.test in your browser and accept the invalid certificate warning. You are now able to open an office document in your browser. You may need to wait some minutes until all services are fully ready, so make sure that you try to reload the pages from time to time.
## Local setup for web development
In case you want to run ownCloud Web from a development branch together with this deployment example (e.g. for feature development for the app provider frontend) you can use this deployment example with the local setup and some additional steps as described below.
1. Clone the [ownCloud Web repository](https://github.com/owncloud/web) on your development machine.
2. Run `pnpm && pnpm build:w` for `web`, so that it creates and continuously updates the `dist` folder for web.
3. Add the dist folder as read only volume to `volumes` section of the `ocis` service in the `docker-compose.yml` file:
```yaml
- /your/local/path/to/web/dist/:/web/dist:ro
```
Make sure to point to the `dist` folder inside your local copy of the web repository.
4. Set the oCIS environment variable `WEB_ASSET_PATH` in the `environment` section of the `ocis` service, so that it uses your mounted dist folder for the web assets, instead of the assets that are embedded into oCIS.
```yaml
WEB_ASSET_PATH: "/web/dist"
```
5. Start the deployment example as described above in the `Local setup` section.
For app provider frontend development in `web` you can find the source code in `web/packages/web-app-external`. Some parts of the integration live in `web/packages/web-app-files`.
-144
View File
@@ -1,144 +0,0 @@
---
title: "Installing ownCloud Infinite Scale at Ubernauten"
date: 2023-12-04T14:04:00+01:00
weight: 100
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/deployment
geekdocFilePath: ubernauten.md
---
{{< toc >}}
## Uberspace and ownCloud Infinite Scale in 50 seconds
This howto shows how to set up ownCloud Infinite Scale for a quick test. For convenience, we will use the free service from the Ubernauten -- Join us here: [Uberspace Registration Page](https://dashboard.uberspace.de/register?lang=en). They offer free of charge (for the first month) web hosting.
In this documentation, we are assuming you already have an account there and it is configured for SSH access. This guide is using "ocis.uber.space" as a domain at Uberspace, version 4.0.3 of Infinite Scale and the local user "owncloud". Make sure you adapt the example code and scripts mentioned in this page to your needs Both username and domain will be set when you sign in to Uberspace.
Installing ownCloud Infinite Scale on Ubernauten is pretty straigt-forward, you can do it in three steps that take less than a minute: Here's a short video that shows how fast the whole process actually is - thanks to Infinite Scale's cloud native architecture. [ownCloud Infinite Scale in 50 seconds](/ocis/deployment/ubernauten_media/001-OCIS-in-50-seconds-2023-10-17.mkv)
### Three Steps to your Infinite UberSpace
* Download the Infinite Scale binary and make it executable
```
curl https://download.owncloud.com/ocis/ocis/stable/4.0.3/ocis-4.0.3-linux-amd64 --output ocis
chmod +x ocis
```
* Set some environment variables related to Uberspace (**Make sure you fill in YOUR domain!**)
```
uberspace web backend set / --http --port 9200
export OCIS_URL=https://ocis.uber.space
export PROXY_TLS=false
export PROXY_HTTP_ADDR=0.0.0.0:9200
export PROXY_LOG_LEVEL=debug
```
* Start the `ocis` binary, first with the parameter `init` for initial configuration. This will also give you your unique login password for the user `admin`. Once finished, call `ocis start`:
```
./ocis init
./ocis server
```
Wait a few seconds, now you can visit the url of your uberspace server and login:
{{< figure src="/ocis/deployment/ubernauten_media/login.png" width="70%" height="auto" >}}
To make it easier (and faster), here's the commands in a script called `ocis.install`:
```
#!/bin/bash
# This file is named ocis.install
# It downloads ocis, configures the environment varibles and starts
# ownCloud Infinite Scale on a ubernauten account. You can run it in your home directory
curl https://download.owncloud.com/ocis/ocis/stable/4.0.3/ocis-4.0.3-linux-amd64 --output ocis
chmod +x ocis
uberspace web backend set / --http --port 9200
export OCIS_URL=https://ocis.uber.space
export PROXY_TLS=false
export PROXY_HTTP_ADDR=0.0.0.0:9200
export PROXY_LOG_LEVEL=debug
./ocis init
./ocis server
```
### Service Management with Supervisord
If you want `ocis` to run continuously, you need to configure `supervisord` (http://supervisord.org) which is the tool Uberspace is using for service management.
You can start and stop services with `supervisorctl`, it will (re)read configuration files it finds in your home directory, under `etc/services.d/`, in `.ini` files. The content of these files is very simple, you only have to enter three lines, here is the example for Infinite Scale in `/home/owncloud/etc/services.d/ocis.ini`.
```
[program:ocis]
command="/home/owncloud/ocis.start"
startsecs=60
```
`ocis.start` is a script that combines all of the commands above except for the download of the ocis binary. It looks like this:
```
#!/bin/bash
# This file is named ocis.start.
# It sets environment variables needed for uber.space needed for Infinite Scale
/usr/bin/uberspace web backend set / --http --port 9200 &
export OCIS_URL=https://ocis.uber.space
export PROXY_TLS=false
export PROXY_HTTP_ADDR=0.0.0.0:9200
export PROXY_LOG_LEVEL=debug
/home/owncloud/ocis server
```
There are four supervisorctl commands that you will find useful (many more can be found in its documentation). You can use `supervisorctl status` to check which services managed by supervisorctl are running, a `supervisorctl reread` will be necessary after you changed the `ini` files, an `update` is applying changes, and `supervisorctl stop` will stop a running service:
```
[owncloud@ocis ~]$ supervisorctl status
ocis RUNNING pid 9813, uptime 0:01:40
[owncloud@ocis ~]$ supervisorctl reread
No config updates to processes
[owncloud@ocis ~]$ supervisorctl update
```
You can find all information on Supervisord and `supervisorctl` on its website: [Running Supervisord](http://supervisord.org/running.html).
### Updating ownCloud Infinite Scale
Updating the ocis binary is simple: When a new version comes to life, just download the new `ocis` binary from the download server, replacing the old `ocis` executable on your uberspace server.
Make a backup of your data and make sure you have read and understood the release notes of your new version , especially the "breaking changes" section before starting the binary.
Don't worry, you can always go back to the older version you had installed, there's a long list of older versions available for download.
Mind that if you want to re-configure, re-install or start a new version of ocis, make sure you have stopped supervisorctl from restarting ocis. Enter `supervisorctl stop ocis`, followed by a `killall -9 ocis` to make sure no ocis version is still running.
### Wiping and Clean Restart from Scratch
This little script is removing your ocis installation (and **all of your data!**), replacing it with a new, clean ocis installation. Be careful and only use it for testing purposes. Specify your desired ocis version in the curl command.
```
#!/bin/bash
# This file is named ocis.reinstall
# It deletes the old ocis installation, fetches a new binary and starts ocis.
rm -rf .ocis
curl https://download.owncloud.com/ocis/ocis/stable/4.0.3/ocis-4.0.3-linux-amd64 --output ocis
chmod +x ocis
uberspace web backend set / --http --port 9200
export OCIS_URL=https://ocis.uber.space
export PROXY_TLS=false
export PROXY_HTTP_ADDR=0.0.0.0:9200
export PROXY_LOG_LEVEL=debug
./ocis init
./ocis server
```
### Troubleshooting
* SSL/TLS Certificates: Every Uberspace comes with its own HTTPS certificate via Let's Encrypt. See the [Uberspace - HTTPS](https://manual.uberspace.de/web-https/) documentation for more details.
* Error message about `jwt_secret`: If you get the following error message, then you probably forgot to run the `ocis init` command. If `ocis server` find an configuration hasn't been set up, it will complain like this:
```
[owncloud@ocis ~]$ ./ocis server
The jwt_secret has not been set properly in your config for ocis.
Make sure your /home/mfeilner/.ocis/config config contains the proper values
(e.g. by running ocis init or setting it manually in the config/corresponding
environment variable).
```
Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

+1 -1
View File
@@ -1,7 +1,7 @@
---
title: "Beta testplan"
date: 2022-03-24T00:00:00+00:00
weight: 20
weight: 37
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: beta-testplan.md
+24
View File
@@ -0,0 +1,24 @@
---
title: "Documentation"
date: 2020-07-27T08:39:38+00:00
weight: 99
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: build-docs.md
---
{{< toc >}}
## Build the documentation
{{< hint info >}}
For building the documentation you need to have Make and Go 1.14 or higher installed.
{{< /hint >}}
Just run `make -C docs docs-serve` from within the root level of the oCIS git repository. This will make documentation available on [localhost:1313](http://localhost:1313) and also do a hot reload if you change something in the (non autogenerated) documentation files.
## Add changes to the documentation
Please keep this documentation in sync with the oCIS source code.
Changes on the documentation are automatically applied to [this site]({{< ref "../" >}}) when merged to the master branch.
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: "Build"
date: 2020-02-27T20:35:00+01:00
weight: 20
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: build.md
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: "Continuous Integration"
date: 2020-10-01T20:35:00+01:00
weight: 20
weight: 100
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: continuous-integration.md
+1 -56
View File
@@ -1,7 +1,7 @@
---
title: "Debugging"
date: 2020-03-19T08:21:00+01:00
weight: 20
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: debugging.md
@@ -134,61 +134,6 @@ bin/ocis --log-level=$LOG_LEVEL proxy &
4. Start the service you are interested in debug mode. When using make to build the binary there is already a `bin/ocis-debug` binary for you. When running an IDE tell it which service to start by providing the corresponding sub command, e.g. `bin\ocis-debug reva-frontend`.
### Debugging the ocis in a docker container
Remote debugging is the debug mode commonly used to work with a debugger and target running on a remote machine or a container for example a wopi stack `deployments/examples/ocis_full/docker-compose.yml`. Docker compose lets us define a compose application model through multiple compose files. When doing so, compose follows certain rules to merge compose files. See [Merge and override](https://docs.docker.com/compose/compose-file/13-merge/) in the Compose Specification. Based on this rules, we added the extra files `deployments/examples/ocis_full/debug-ocis.yml`, `deployments/examples/ocis_full/debug-collaboration-collabora.yml`, `deployments/examples/ocis_full/debug-collaboration-onlyoffice.yml` that overwrites the `command` attribute and extends the `ports` attribute.
Below we describe the steps how to build the image, run the docker-compose and connect via remote debugger.
1. Build the image:
```bash
cd github.com/owncloud/ocis/ocis
make debug-docker
```
2. Change the tag label:
```bash
export OCIS_DOCKER_TAG=debug
```
3. Run docker compose
Building the docker compose command depends on what you want to debug, for example `ocis` and `collaboration` with the `collabora` supports.
```bash
docker compose -f docker-compose.yml -f ocis.yml -f collabora.yml -f debug-ocis.yml -f debug-collaboration-collabora.yml up -d
```
4. Connect to remote `delve`
* For the VS Code add the configuration to the `.vscode/launch.json` [https://github.com/golang/vscode-go/wiki/debugging#remote-debugging](https://github.com/golang/vscode-go/wiki/debugging#remote-debugging)
```json
{
"name": "Debug remote ocis :40000",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 40000,
"host": "localhost", // optional
"trace": "verbose", // optional
"showLog": true // optional
},
{
"name": "Debug remote collaboration collabora :40001",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 40001,
"host": "localhost", // optional
"trace": "verbose", // optional
"showLog": true // optional
},
{
"name": "Debug remote collaboration onlyoffice :40002",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 40002,
"host": "localhost", // optional
"trace": "verbose", // optional
"showLog": true // optional
},
```
* For the Jetbrains Goland add the configuration following the docs [https://www.jetbrains.com/help/go/go-remote.html](https://www.jetbrains.com/help/go/go-remote.html)
### Gather error messages
We recommend you collect all related information in a single file or in a GitHub issue. Let us start with an error that pops up in the Web UI:
+39
View File
@@ -0,0 +1,39 @@
---
title: "Deprecating Variables"
date: 2022-11-29T15:41:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: deprecating-variables.md
---
{{< toc >}}
## Deprecating Environment Variables
Sometimes it is necessary to deprecate environment to align their naming with
conventions. We therefore added annotations to automate the documentation
process. It is necessary to know when the variable is going to be deprecated,
when it is going to be removed and why.
### Example
```golang
// Nats is the nats config
type Nats struct {
Host string `yaml:"host" env:"NATS_HOST_ADDRESS;NATS_NATS_HOST" desc:"Bind address." deprecationVersion:"1.6.2" removalVersion:"1.7.5" deprecationInfo:"NATS_NATS_HOST is confusing" deprecationReplacement:"NATS_HOST_ADDRESS"`
...
}
```
There are four different annotation variables that need to be filled:
| Annotation |Description| Format|
|---|---|---|
| deprecationVersion| The version the variable will be deprecated| semver (e.g. 1.6.2)|
| removalVersion| The version the variable will be removed from the codebase. Note that according to semver, a removal can only be made in a major version change| semver (e.g. 4.0.0)|
| deprecationInfo| Information why the variable is deprecated, must start with the name of the variable in order to avoid confusion, when there are multiple options in the `env:`-field | string (e.g. NATS_NATS_HOST is confusing) |
| deprecationReplacement | The name of the variable that is going to replace the deprecated one.| string (e.g. NATS_HOST_ADDRESS)|
### What happens next?
Once a variable has been finally removed, the annotations must be removed again from the code, since they do not serve any purpose from this point.
-13
View File
@@ -1,13 +0,0 @@
---
title: "Environment Variables"
date: 2024-08-22T15:41:00+01:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: envvars.md
---
Environment variables are an essential part of configuring services.
If you are going to create new ones or deprecate existing ones, you must read the [Envvar Naming Scope]({{< ref "services/general-info/envvars/envvar-naming-scopes.md" >}}) and the
[Deprecating Variables]({{< ref "services/general-info/envvars/deprecating-variables.md" >}}) documentation for more details first before doing so.
+1 -1
View File
@@ -16,7 +16,7 @@ So we are trying to reflect this in the tooling. It should be kept simple and qu
Besides standard development tools like git and a text editor, you need the following software for development:
- Go >= v1.22 ([install instructions](https://golang.org/doc/install))
- Go >= v1.20 ([install instructions](https://golang.org/doc/install))
- pnpm ([install instructions](https://pnpm.io/installation))
- docker ([install instructions](https://docs.docker.com/get-docker/))
- docker-compose ([install instructions](https://docs.docker.com/compose/install/))
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: "Profiling"
date: 2021-08-24T12:32:20+01:00
weight: 20
weight: 56
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: profiling.md
+94 -212
View File
@@ -1,7 +1,7 @@
---
title: 'Acceptance Testing'
date: 2026-03-18T00:00:00+00:00
weight: 20
title: "Testing"
date: 2018-05-02T00:00:00+00:00
weight: 37
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development
geekdocFilePath: testing.md
@@ -10,13 +10,10 @@ geekdocFilePath: testing.md
{{< toc >}}
To run tests in the test suite you have two options. You may go the easy way and just run the test suite in docker. But for some tasks you could also need to install the test suite natively, which requires a little more setup since PHP and some dependencies need to be installed.
{{< hint info >}}
To run the tests PHP version ">= 8.2.0" is required.
{{< /hint >}}
Both ways to run tests with the test suites are described here.
## Running Test Suite in Docker
## Testing With Test Suite in Docker
Let's see what is available. Invoke the following command from within the root of the oCIS repository.
@@ -65,7 +62,7 @@ While running the tests, oCIS server is started with [ociswrapper](https://githu
```bash
WITH_WRAPPER=false \
BEHAT_FEATURE='tests/acceptance/features/apiGraphUser/createUser.feature:26' \
BEHAT_FEATURE='tests/acceptance/features/apiGraph/createUser.feature:26' \
make -C tests/acceptance/docker test-ocis-feature-ocis-storage
```
@@ -77,19 +74,7 @@ To run the tests that require an email server (tests tagged with `@email`), you
```bash
START_EMAIL=true \
OCIS_ADD_RUN_SERVICES=notifications \
BEHAT_FEATURE='tests/acceptance/features/apiNotification/notification.feature' \
make -C tests/acceptance/docker test-ocis-feature-ocis-storage
```
{{< /hint >}}
{{< hint info >}}
To run the tests that require tika service (tests tagged with `@tikaServiceNeeded`), you need to provide `START_TIKA=true` while running the tests.
```bash
START_TIKA=true \
BEHAT_FEATURE='tests/acceptance/features/apiSearchContent/contentSearch.feature' \
BEHAT_FEATURE='tests/acceptance/features/apiNotification/emailNotification.feature' \
make -C tests/acceptance/docker test-ocis-feature-ocis-storage
```
@@ -122,7 +107,7 @@ The tests for a single feature (a feature file) can also be run against the diff
For example;
```bash
BEHAT_FEATURE='tests/acceptance/features/apiGraphUser/createUser.feature' \
BEHAT_FEATURE='tests/acceptance/features/apiGraph/createUser.feature' \
make -C tests/acceptance/docker test-ocis-feature-ocis-storage
```
@@ -133,11 +118,11 @@ make -C tests/acceptance/docker test-ocis-feature-ocis-storage
And to run a single scenario in a feature, you can do:
{{< hint info >}}
A specific scenario from a feature can be run by adding `:<line-number>` at the end of the feature file path. For example, to run the scenario at line 26 of the feature file `apiGraphUser/createUser.feature`, simply add the line number like this: `apiGraphUser/createUser.feature:26`. Note that the line numbers mentioned in the examples might not always point to a scenario, so always check the line numbers before running the test.
A specific scenario from a feature can be run by adding `:<line-number>` at the end of the feature file path. For example, to run the scenario at line 26 of the feature file `apiGraph/createUser.feature`, simply add the line number like this: `apiGraph/createUser.feature:26`. Note that the line numbers mentioned in the examples might not always point to a scenario, so always check the line numbers before running the test.
{{< /hint >}}
```bash
BEHAT_FEATURE='tests/acceptance/features/apiGraphUser/createUser.feature:26' \
BEHAT_FEATURE='tests/acceptance/features/apiGraph/createUser.feature:26' \
make -C tests/acceptance/docker test-ocis-feature-ocis-storage
```
@@ -145,11 +130,11 @@ Similarly, with S3 storage;
```bash
# run a whole feature
BEHAT_FEATURE='tests/acceptance/features/apiGraphUser/createUser.feature' \
BEHAT_FEATURE='tests/acceptance/features/apiGraph/createUser.feature' \
make -C tests/acceptance/docker test-ocis-feature-s3ng-storage
# run a single scenario
BEHAT_FEATURE='tests/acceptance/features/apiGraphUser/createUser.feature:26' \
BEHAT_FEATURE='tests/acceptance/features/apiGraph/createUser.feature:26' \
make -C tests/acceptance/docker test-ocis-feature-s3ng-storage
```
@@ -161,7 +146,7 @@ BEHAT_FEATURE='tests/acceptance/features/coreApiAuth/webDavAuth.feature' \
make -C tests/acceptance/docker test-core-feature-ocis-storage
# run a single scenario
BEHAT_FEATURE='tests/acceptance/features/coreApiAuth/webDavAuth.feature:15' \
BEHAT_FEATURE='tests/acceptance/features/coreApiAuth/webDavAuth.feature:13' \
make -C tests/acceptance/docker test-core-feature-ocis-storage
```
@@ -198,7 +183,13 @@ During testing we start a redis and oCIS docker container. These will not be sto
make -C tests/acceptance/docker clean
```
## Running Test Suite in Local Environment
## Testing With Test Suite Natively Installed
We have two sets of tests:
- `test-acceptance-api` set was created for oCIS. Mainly for testing spaces features.
- `test-acceptance-from-core-api` set was transferred from [ownCloud core](https://github.com/owncloud/core) repository. The suite name of all tests transferred from the ownCloud core repository starts with `coreApi`
### Run oCIS
@@ -216,11 +207,22 @@ ocis/bin/ocis server
`PROXY_ENABLE_BASIC_AUTH` will allow the acceptance tests to make requests against the provisioning api (and other endpoints) using basic auth.
#### Run Local oCIS Tests (prefix `api`) and Tests Transferred From ownCloud Core (prefix `coreApi`)
#### Run Local oCIS Tests (prefix `api`)
```bash
make test-acceptance-api \
TEST_SERVER_URL=https://localhost:9200 \
TEST_WITH_GRAPH_API=true \
TEST_OCIS=true \
```
#### Run Tests Transferred From ownCloud Core (prefix `coreApi`)
```bash
make test-acceptance-from-core-api \
TEST_SERVER_URL=https://localhost:9200 \
TEST_WITH_GRAPH_API=true \
TEST_OCIS=true \
```
Useful environment variables:
@@ -230,16 +232,16 @@ Useful environment variables:
`BEHAT_FEATURE`: to run a single feature
{{< hint info >}}
A specific scenario from a feature can be run by adding `:<line-number>` at the end of the feature file path. For example, to run the scenario at line 26 of the feature file `apiGraphUser/createUser.feature`, simply add the line number like this: `apiGraphUser/createUser.feature:26`. Note that the line numbers mentioned in the examples might not always point to a scenario, so always check the line numbers before running the test.
A specific scenario from a feature can be run by adding `:<line-number>` at the end of the feature file path. For example, to run the scenario at line 26 of the feature file `apiGraph/createUser.feature`, simply add the line number like this: `apiGraph/createUser.feature:26`. Note that the line numbers mentioned in the examples might not always point to a scenario, so always check the line numbers before running the test.
{{< /hint >}}
> Example:
>
> BEHAT_FEATURE=tests/acceptance/features/apiGraphUser/createUser.feature
> BEHAT_FEATURE=tests/acceptance/features/apiGraph/createUser.feature
>
> Or
>
> BEHAT_FEATURE=tests/acceptance/features/apiGraphUser/createUser.feature:13
> BEHAT_FEATURE=tests/acceptance/features/apiGraph/createUser.feature:12
`BEHAT_SUITE`: to run a single suite
@@ -253,15 +255,9 @@ A specific scenario from a feature can be run by adding `:<line-number>` at the
>
> STORAGE_DRIVER=owncloudsql
`STOP_ON_FAILURE`: to stop running tests after the first failure
> Example:
>
> STOP_ON_FAILURE=true
### Use Existing Tests for BDD
As a lot of scenarios are written for oC10, we can use those tests for Behaviour driven development in oCIS.
As a lot of scenarios from `test-acceptance-from-core-api` are written for oC10, we can use those tests for Behaviour driven development in oCIS.
Every scenario that does not work in oCIS with "ocis" storage, is listed in `tests/acceptance/expected-failures-API-on-OCIS-storage.md` with a link to the related issue.
Those scenarios are run in the ordinary acceptance test pipeline in CI. The scenarios that fail are checked against the
@@ -276,10 +272,12 @@ If you want to work on a specific issue
E.g.:
```bash
make test-acceptance-api \
make test-acceptance-from-core-api \
TEST_SERVER_URL=https://localhost:9200 \
TEST_OCIS=true \
TEST_WITH_GRAPH_API=true \
STORAGE_DRIVER=OCIS \
BEHAT_FEATURE='tests/acceptance/features/coreApiVersions/fileVersions.feature:141'
BEHAT_FEATURE='tests/acceptance/features/coreApiVersions/fileVersions.feature:147'
```
2. the tests will fail, try to understand how and why they are failing
@@ -288,16 +286,6 @@ If you want to work on a specific issue
5. remove those tests from the expected failures file
6. make a PR that has the fixed code, and the relevant lines removed from the expected failures file.
## Running Tests With And Without `remote.php`
By default, the tests are run with `remote.php` enabled. If you want to run the tests without `remote.php`, you can disable it by setting the environment variable `WITH_REMOTE_PHP=false` while running the tests.
```bash
WITH_REMOTE_PHP=false \
TEST_SERVER_URL="https://localhost:9200" \
make test-acceptance-api
```
## Running ENV Config Tests (@env-Config)
Test suites tagged with `@env-config` are used to test the environment variables that are used to configure oCIS. These tests are special tests that require the oCIS server to be run using [ociswrapper](https://github.com/owncloud/ocis/blob/master/tests/ociswrapper/README.md).
@@ -324,6 +312,8 @@ PROXY_ENABLE_BASIC_AUTH=true \
```bash
OCIS_WRAPPER_URL=http://localhost:5200 \
TEST_WITH_GRAPH_API=true \
TEST_OCIS=true \
TEST_SERVER_URL="https://localhost:9200" \
BEHAT_FEATURE=tests/acceptance/features/apiAsyncUpload/delayPostprocessing.feature \
make test-acceptance-api
@@ -339,14 +329,14 @@ While writing tests for a new oCIS ENV configuration, please make sure to follow
## Running Test Suite With Email Service (@email)
Test suites that are tagged with `@email` require an email service. We use mailpit as the email service in our tests.
Test suites that are tagged with `@email` require an email service. We use inbucket as the email service in our tests.
### Setup Mailpit
### Setup Inbucket
Run the following command to setup mailpit
Run the following command to setup inbucket
```bash
docker run -d --restart unless-stopped --name=mailpit -p 8025:8025 -p 1025:1025 axllent/mailpit:v1.22.3
docker run -d -p9000:9000 -p2500:2500 --name inbucket inbucket/inbucket
```
### Run oCIS
@@ -360,11 +350,9 @@ ocis/bin/ocis init --insecure true
# run oCIS
PROXY_ENABLE_BASIC_AUTH=true \
OCIS_ADD_RUN_SERVICES=notifications \
NOTIFICATIONS_SMTP_HOST=localhost \
NOTIFICATIONS_SMTP_PORT=1025 \
NOTIFICATIONS_SMTP_PORT=2500 \
NOTIFICATIONS_SMTP_INSECURE=true \
NOTIFICATIONS_SMTP_SENDER="owncloud <noreply@example.com>" \
ocis/bin/ocis server
```
@@ -373,100 +361,101 @@ ocis/bin/ocis server
Run the acceptance test with the following command:
```bash
TEST_WITH_GRAPH_API=true \
TEST_OCIS=true \
TEST_SERVER_URL="https://localhost:9200" \
EMAIL_HOST="localhost" \
EMAIL_PORT=8025 \
BEHAT_FEATURE="tests/acceptance/features/apiNotification/notification.feature" \
EMAIL_PORT=9000 \
BEHAT_FEATURE="tests/acceptance/features/apiNotification/emailNotification.feature" \
make test-acceptance-api
```
## Running Test Suite With Tika Service (@tikaServiceNeeded)
## Running Tests for Parallel Deployment
Test suites that are tagged with `@tikaServiceNeeded` require tika service.
### Setup the Parallel Deployment Environment
### Setup Tika Service
Instruction on setup is available [here](https://owncloud.dev/ocis/deployment/oc10_ocis_parallel/#local-setup)
Run the following docker command to setup tika service
Edit the `.env` file and uncomment this line:
```bash
docker run -d -p 127.0.0.1:9998:9998 apache/tika
COMPOSE_FILE=docker-compose.yml:testing/docker-compose-additions.yml
```
### Run oCIS
Documentation related to the content based search and tika extractor can be found [here](https://doc.owncloud.com/ocis/next/deployment/services/s-list/search.html#content-extraction)
Start the docker stack with the following command:
```bash
# init oCIS
IDM_ADMIN_PASSWORD=admin \
ocis/bin/ocis init --insecure true
# run oCIS
PROXY_ENABLE_BASIC_AUTH=true \
OCIS_INSECURE=true \
SEARCH_EXTRACTOR_TYPE=tika \
SEARCH_EXTRACTOR_TIKA_TIKA_URL=http://localhost:9998 \
SEARCH_EXTRACTOR_CS3SOURCE_INSECURE=true \
ocis/bin/ocis server
docker-compose up -d
```
### Run the Acceptance Test
### Getting the Test Helpers
Run the acceptance test with the following command:
All the test helpers are located in the core repo.
```bash
TEST_SERVER_URL="https://localhost:9200" \
BEHAT_FEATURE="tests/acceptance/features/apiSearchContent/contentSearch.feature" \
make test-acceptance-api
git clone https://github.com/owncloud/core.git
```
### Run the Acceptance Tests
Run the acceptance tests with the following command from the root of the oCIS repository:
```bash
make test-paralleldeployment-api \
TEST_SERVER_URL="https://cloud.owncloud.test" \
TEST_OC10_URL="http://localhost:8080" \
TEST_PARALLEL_DEPLOYMENT=true \
TEST_OCIS=true \
TEST_WITH_LDAP=true \
PATH_TO_CORE="<path_to_core>" \
SKELETON_DIR="<path_to_core>/apps/testing/data/apiSkeleton"
```
Replace `<path_to_core>` with the actual path to the root directory of core repo that you have cloned earlier.
In order to run a single test, use the `BEHAT_FEATURE` environment variable.
```bash
make test-paralleldeployment-api \
... \
BEHAT_FEATURE="tests/parallelDeployAcceptance/features/apiShareManagement/acceptShares.feature"
```
## Running Test Suite With Antivirus Service (@antivirus)
Test suites that are tagged with `@antivirus` require antivirus service. The available antivirus and the configuration related to them can be found [here](https://doc.owncloud.com/ocis/next/deployment/services/s-list/antivirus.html). This documentation is only going to use `clamAv` as antivirus.
### Setup clamAV
#### 1. Setup Locally
##### Linux OS User
##### Linux OS user
Run the following command to set up calmAV and clamAV daemon
```bash
sudo apt install clamav clamav-daemon -y
```
Make sure that the clamAV daemon is up and running
Make sure that the clamAV daemon is up and running
```bash
sudo service clamav-daemon status
```
{{< hint info >}}
The commands are ubuntu specific and may differ according to your system. You can find information related to installation of clamAV in their official documentation [here](https://docs.clamav.net/manual/Installing/Packages.html).
{{< /hint>}}
##### Mac OS User
##### Mac OS user
Install ClamAV using [here](https://gist.github.com/mendozao/3ea393b91f23a813650baab9964425b9)
Start ClamAV daemon
Start ClamAV daemon
```bash
/your/location/to/brew/Cellar/clamav/1.1.0/sbin/clamd
```
#### 2. Setup clamAV With Docker
##### Linux OS User
##### Linux OS user
Run `clamAV` through docker
```bash
docker run -d -p 3310:3310 owncloudci/clamavd
```
##### Mac OS User
##### Mac OS user
```bash
docker run -d -p 3310:3310 -v /your/local/filesystem/path/to/clamav/:/var/lib/clamav mkodockx/docker-clamav:alpine
```
@@ -476,20 +465,15 @@ docker run -d -p 3310:3310 -v /your/local/filesystem/path/to/clamav/:/var/lib/cl
As `antivirus` service is not enabled by default we need to enable the service while running oCIS server. We also need to enable `async upload` and as virus scan is performed in post-processing step, we need to set it as well. Documentation for environment variables related to antivirus is available [here](https://owncloud.dev/services/antivirus/#environment-variables)
```bash
# init oCIS
IDM_ADMIN_PASSWORD=admin \
ocis/bin/ocis init --insecure true
# run oCIS
PROXY_ENABLE_BASIC_AUTH=true \
ANTIVIRUS_SCANNER_TYPE="clamav" \
ANTIVIRUS_CLAMAV_SOCKET="tcp://host.docker.internal:3310" \
POSTPROCESSING_STEPS="virusscan" \
OCIS_ASYNC_UPLOADS=true \
OCIS_ADD_RUN_SERVICES="antivirus" \
OCIS_ADD_RUN_SERVICES="antivirus"
ocis/bin/ocis server
```
{{< hint info >}}
The value for `ANTIVIRUS_CLAMAV_SOCKET` is an example which needs adaption according your OS.
@@ -503,74 +487,13 @@ For antivirus running with docker, use `ANTIVIRUS_CLAMAV_SOCKET= "tcp://host.doc
Run the acceptance test with the following command:
```bash
TEST_WITH_GRAPH_API=true \
TEST_OCIS=true \
TEST_SERVER_URL="https://localhost:9200" \
BEHAT_FEATURE="tests/acceptance/features/apiAntivirus/antivirus.feature" \
make test-acceptance-api
```
## Running Test Suite With Federated Sharing (@ocm)
Test suites that are tagged with `@ocm` require running two different ocis instances. More detailed information and configuration related to it can be found [here](https://doc.owncloud.com/ocis/5.0/deployment/services/s-list/ocm.html).
### Setup First oCIS Instance
```bash
# init oCIS
IDM_ADMIN_PASSWORD=admin \
ocis/bin/ocis init --insecure true
# run oCIS
OCIS_URL="https://localhost:9200" \
PROXY_ENABLE_BASIC_AUTH=true \
OCIS_ENABLE_OCM=true \
OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE="tests/config/local/providers.json" \
OCIS_ADD_RUN_SERVICES="ocm" \
OCM_OCM_INVITE_MANAGER_INSECURE=true \
OCM_OCM_SHARE_PROVIDER_INSECURE=true \
OCM_OCM_STORAGE_PROVIDER_INSECURE=true \
WEB_UI_CONFIG_FILE="tests/config/local/ocis-web.json" \
ocis/bin/ocis server
```
The first oCIS instance should be available at: <https://localhost:9200/>
### Setup Second oCIS Instance
You can run the second oCIS instance in two ways:
#### Using `.vscode/launch.json`
From the `Run and Debug` panel of VSCode, select `Fed oCIS Server` and start the debugger.
#### Using env File
```bash
# init oCIS
source tests/config/local/.env-federation && ocis/bin/ocis init
# run oCIS
ocis/bin/ocis server
```
The second oCIS instance should be available at: <https://localhost:10200/>
{{< hint info >}}
To enable ocm in the web interface, you need to set the following envs:
`OCIS_ENABLE_OCM="true"`
`OCIS_ADD_RUN_SERVICES="ocm"`
{{< /hint>}}
#### Run the Acceptance Test
Run the acceptance test with the following command:
```bash
TEST_SERVER_URL="https://localhost:9200" \
TEST_SERVER_FED_URL="https://localhost:10200" \
BEHAT_FEATURE="tests/acceptance/features/apiOcm/ocm.feature" \
make test-acceptance-api
```
## Running Text Preview Tests Containing Unicode Characters
There are some tests that check the text preview of files containing Unicode characters. The oCIS server by default cannot generate the thumbnail of such files correctly but it provides an environment variable to allow the use of custom fonts that support Unicode characters. So to run such tests successfully, we have to run the oCIS server with this environment variable.
@@ -582,49 +505,8 @@ ocis/bin/ocis server
```
The sample `fontsMap.json` file is located in `tests/config/drone/fontsMap.json`.
```json
{
"defaultFont": "/path/to/ocis/tests/config/drone/NotoSans.ttf"
}
```
## Running Test on Helm Setup
Refer to the [Running API Tests in Kubernetes Cluster](../../../tests/config/k8s/README.md) documentation for running tests against a K8s setup.
## Generating Code Coverage Report by Running Acceptance Tests
To find out what oCIS code is covered by the API tests, first create a debug build of oCIS.
```shell
make -c ocis build-debug
```
oCIS should be served by the debug binary.
```shell
ocis/bin/ocis-debug server
```
Then define a folder to store the coverage report.
```shell
export GOCOVERDIR=coveragedatafiles
```
Running the tests will generate the coverage report inside the `coveragedatafiles` directory.
To view the report in human readable form, enter the following command or refer to the official [documentation](https://go.dev/doc/build-cover#working) for more formats.
```
go tool covdata textfmt -i=coveragedatafiles -o=cov.txt
```
You can also view the report in a web UI using the following command.
```
go tool cover -html=cov.txt
```
This command should open a browser with the code report.
-87
View File
@@ -1,87 +0,0 @@
---
title: "Unit Testing"
date: 2024-04-25T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development/unit-testing
geekdocFilePath: _index.md
---
{{< toc >}}
Go is a statically typed language, which makes it easy to write unit tests. The Go standard library provides a `testing` package that allows you to write tests for your code. The testing package provides a framework for writing tests, and the `go test` command runs the tests. Other than that there are a lot of libraries and tools available to make testing easier.
- [Testify](https://github.com/stretchr/testify) - A toolkit with common assertions and mocks that plays nicely with the standard library.
- [Ginkgo](https://onsi.github.io/ginkgo/) - A BDD-style testing framework for Go.
- [Gomega](https://onsi.github.io/gomega/) - A matcher/assertion library for Ginkgo.
- [GoDog](https://github.com/cucumber/godog) - A Behavior-Driven Development framework for Go which uses Gherkin.
In oCIS we generally use [Ginkgo](https://onsi.github.io/ginkgo/) framework for testing. To keep things consistent, we would encourage you to use the same. In some cases, where you feel the need for a more verbose or more "code oriented" approach, you can also use the testing package from the standard library without ginkgo.
## 1 Ginkgo
Using a framework like [Ginkgo](https://onsi.github.io/ginkgo/) brings many advantages.
### Pros
- Provides a BDD-style syntax which makes it easier to write reusable and understandable tests
- Together with [Gomega](https://onsi.github.io/gomega/) it provides a powerful and expressive framework with assertions in a natural language
- Natural Language Format empowers testing in a way that resembles user interactions with the system
- In the context of microservices it is particularly well suited to test individual services and the interactions between them
- Offers support for asynchronous testing which makes it easier to test code that involves concurrency
- Nested and structured containers and setup capabilities make it easy to organize tests and adhere to the DRY principle
- Provides helpful error messages to identify and fix issues
- Very usable for Test Driven Development following the ["Red, Green, Cleanup, Repeat"](https://en.wikipedia.org/wiki/Test-driven_development) workflow.
### Cons
- Sometimes it can be difficult to get started with
- Asynchronous behaviour brings more complexity to tests.
- Not compatible with broadly known `testify` package
### Example
As you can see, **Ginkgo** and **Gomega** together provide the foundation to write understandable and maintainable tests which can mimic user interaction and the interactions between microservices.
```go
Describe("Public Share Provider", func() {
Context("When the user has no share permission", func() {
BeforeEach(func() {
// downgrade user permissions to have no share permission
resourcePermissions.AddGrant = false
})
It("should return grpc invalid argument", func() {
req := &link.CreatePublicShareRequest{}
res, err := provider.CreatePublicShare(ctx, req)
Expect(err).ToNot(HaveOccurred())
Expect(res.GetStatus().GetCode()).To(Equal(rpc.Code_CODE_INVALID_ARGUMENT))
Expect(res.GetStatus().GetMessage()).To(Equal("no share permission"))
})
})
```
### How to use it in oCIS
{{< button relref="testing-ginkgo" size="large" >}}{{< icon "gdoc_arrow_right_alt" >}} Read more{{< /button >}}
## 2 Testing Package
For smaller straight-forward tests of some packages it might feel more natural to use the testing package that comes with the go standard library.
### Pros
- Straightforward approach
- Naming conventions
- Built-in tooling
### Cons
- Difficult to reuse code in larger and more complex packages
- Difficult to create clean and isolated setups for the test steps
- No natural language resemblance
### How to use it in ocis
{{< button relref="testing-pkg" size="large" >}}{{< icon "gdoc_arrow_right_alt" >}} Read more{{< /button >}}
@@ -1,395 +0,0 @@
---
title: "Testing with Ginkgo"
date: 2024-04-25T00:00:00+00:00
weight: 10
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development/unit-testing
geekdocFilePath: testing-ginkgo.md
---
{{< toc >}}
In this section we try to enable developers to write tests in oCIS using Ginkgo and Gomega and explain how to mock other microservices to also cover some integration tests. The full documentation of the tools can be found on the [Ginkgo](https://onsi.github.io/ginkgo/) and [Gomega](https://onsi.github.io/gomega/) websites.
{{% hint type=tip icon=gdoc_link title="Reading the documentation" %}}
This page provides only a basic introduction to get started with Ginkgo and Gomega. For more detailed information, please refer to the official documentation.
**Useful Links:**
- [Ginkgo](https://onsi.github.io/ginkgo/)
- [Gomega](https://onsi.github.io/gomega/)
- [Mockery](https://vektra.github.io/mockery/latest/)
{{% /hint %}}
## Prerequisites
To use Ginkgo, you need to install the Ginkgo CLI. You can install it using the following command:
```bash
go install github.com/onsi/ginkgo/v2/ginkgo
go get github.com/onsi/gomega/...
```
## Getting Started
Navigate to the directory where you want to write your tests and run the following command:
### Bootstrap
```bash
cd ocis/ocis-pkg/config/parser
ginkgo bootstrap
Generating ginkgo test suite bootstrap for parser in:
parser_suite_test.go
```
This command creates a `parser_suite_test.go` file in the parser directory. This file contains the test suite for the parser package.
```go
package parser_test
import (
"testing"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestParser(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Parser Suite")
}
```
Ginkgo defaults to setting up the suite as a `*_test` package to encourage you to only test the external behavior of your package, not its internal implementation details.
After the package `parser_test` declaration we import the ginkgo and gomega packages into the test's top-level namespace by performing a `.` dot-import. Since Ginkgo and Gomega are DSLs (Domain-specific Languages) this makes the tests more natural to read. If you prefer, you can avoid the dot-import via `ginkgo bootstrap --nodot`. Throughout this documentation we'll assume dot-imports.
With the bootstrap complete, you can now run your tests using the `ginkgo` command:
```bash
ginkgo
Running Suite: Parser Suite - <local-path>/ocis/ocis-pkg/config/parser
===============================================================================================
Random Seed: 1714076559
Will run 0 of 0 specs
Ran 0 of 0 Specs in 0.000 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
Ginkgo ran 1 suite in 7.0058606s
Test Suite Passed
```
Under the hood, ginkgo is simply calling `go test`. While you can run `go test` instead of the ginkgo CLI, Ginkgo has several capabilities that can only be accessed via `ginkgo`. We generally recommend users embrace the ginkgo CLI and treat it as a first-class member of their testing toolchain.
### Adding Specs to the Suite
```bash
ginkgo generate parser
Generating ginkgo test for Parser in:  ✔  7s  22:22:46 
parser_test.go
```
This will generate a `parser_test.go` file in the parser directory. This file contains the test suite for the parser package.
```go
package parser_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
)
var _ = Describe("Parser", func() {
})
```
## Writing Specs
### Describe
The `Describe` block is used to describe the behavior of a particular component of your code. It is a way to group together related specs. The `Describe` block takes a string and a function. The string is a description of the component you are describing, and the function contains the specs that describe the behavior of that component.
```go
var _ = Describe("Parser", func() {
// Specs go here
})
```
### Context
The `Context` block is used to further describe the behavior of a component. It is a way to group together related specs within a `Describe` block. The `Context` block takes a string and a function. The string is a description of the context you are describing, and the function contains the specs that describe the behavior of that context.
```go
var _ = Describe("Parser", func() {
Context("when the input is valid", func() {
// Specs go here
})
})
```
### It
The `It` block is used to describe a single spec. It takes a string and a function. The string is a description of the behavior you are specifying, and the function contains the code that exercises that behavior.
```go
var _ = Describe("Parser", func() {
Context("when the input is valid", func() {
It("parses the input", func() {
// Spec code goes here
})
})
})
```
### Expect
The `Expect` function is used to make assertions in your specs. It takes a value and returns an `*Expectation`. You can then chain methods on the `*Expectation` to make assertions about the value.
```go
var _ = Describe("Parser", func() {
Context("when the input is valid", func() {
It("parses the input", func() {
result := parser.Parse("valid input")
Expect(result).To(Equal("expected output"))
})
})
})
```
### BeforeEach
The `BeforeEach` block is used to run a setup function before each spec in a `Describe` or `Context` block. It takes a function that contains the setup code.
```go
package parser_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
p "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
)
var _ = Describe("Parser", func() {
var c *config.Config
BeforeEach(func() {
c = config.DefaultConfig()
})
Context("when the input is valid", func() {
It("parses the input", func() {
err := p.ParseConfig(c, false)
Expect(err).ToNot(HaveOccurred())
Expect(c.Commons.OcisURL).To(Equal("https://localhost:9200"))
})
})
})
```
Let us take a closer look at the code above:
We are following the recommended practise on variables to **"declare in container nodes"** and **"initialize in setup nodes"**. This is why we are declaring the `c` variable at the top of the `Describe` block and initializing it in the `BeforeEach` block. This is important to get isolated test steps which can be run in any order and even in parallel.
Let us take a look at a bad example where we are polluting the spec by not following this recommended practise:
```go
package parser_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
p "github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
)
var _ = Describe("Parser", func() {
c := config.DefaultConfig()
Context("when the defaults are applied", func() {
It("fails to parse the input", func() {
c.TokenManager.JWTSecret = "" // bam! we have changed the closure variable and it will never be reset
err := p.ParseConfig(c, false)
Expect(err).To(HaveOccurred())
})
It("parses the input", func() {
err := p.ParseConfig(c, false)
Expect(err).ToNot(HaveOccurred())
Expect(c.Commons.OcisURL).To(Equal("https://localhost:9200"))
})
})
})
```
{{% hint type="warning" title="Specs MUST be clean and independent"%}}
Always **declare variables in the container node**(which are basically `Describe()` and `Context()`)
and **initialize your variables in the setup nodes.** (which are basically `BeforeEach()` and `JustBeforeEach()`).
This will ensure that your specs are clean and independent of each other.
{{% /hint %}}
### Focused Specs
You can focus on a single spec by adding an `F` in front of the `It` block. This will run only the focused spec.
```go
var _ = Describe("Parser", func() {
Context("when the input is valid", func() {
FIt("parses the input", func() {
result := parser.Parse("valid input")
Expect(result).To(Equal("expected output"))
})
})
})
```
### Pending Specs
You can mark a spec as pending by adding a `P` in front of the `It` block. This will skip the spec.
```go
var _ = Describe("Parser", func() {
Context("when the input is valid", func() {
PIt("parses the input", func() {
result := parser.Parse("valid input")
Expect(result).To(Equal("expected output"))
})
})
})
```
### Test Driven Development
You can run the tests in watch mode to follow a test-driven development approach. This will run the tests every time you save a file.
```bash
ginkgo watch
```
## Mocking
In oCIS, we use the `mockery` tool to generate mocks for interfaces. [Mockery](https://vektra.github.io/mockery/latest/) is a simple tool that generates mock implementations of Go interfaces. It is useful for writing tests against interfaces instead of concrete types. We can use it to mock requests to other microservices to cover some integration tests. We should already have a number of mocks in the project. The mocks are configured on the packages level in the `.mockery.yaml` files.
**Example file:**
```yaml
with-expecter: true
filename: "{{.InterfaceName | snakecase }}.go"
dir: "{{.PackageName}}/mocks"
mockname: "{{.InterfaceName}}"
outpkg: "mocks"
packages:
github.com/owncloud/ocis/v2/ocis-pkg/oidc:
interfaces:
OIDCClient:
```
We should add missing mocks to this file and define the interfaces we want to mock. After that, we can generate the mocks by running `mockery` in the repo, it will find all the `.mockery.yaml` files and generate the mocks for the interfaces defined in them.
Our mocks are generated with the setting `with-expecter: true`. This allows us to use type-safe methods to generate the call expectations by simply calling `EXPECT()` on the mock object.
{{% hint type="tip" title="Type safe mock identifiers" %}}
By using `EXPECT()` on the mock object, we can work with type-safe methods to generate the call expectations.
{{% /hint %}}
**Example of a mocked gateway client**
In our oCIS services we need to use a gateway pool selector to get the gateway client.
We should always use the constructor on a new mock like `gatewayClient = cs3mocks.NewGatewayAPIClient(GinkgoT())`. This brings us two advantages:
- The `AssertExpectations` method is registered to be called at the end of the tests via `t.Cleanup()` method.
- The `testing.TB` interface is registered on the `mock.Mock` so that tests don't panic when a call on the mock is unexpected.
```go
package publicshareprovider_test
import (
"context"
"time"
"github.com/owncloud/reva/v2/pkg/rgrpc/todo/pool"
cs3mocks "github.com/owncloud/reva/v2/tests/cs3mocks/mocks"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"google.golang.org/grpc"
)
var _ = Describe("PublicShareProvider", func() {
// declare in container nodes
var (
gatewayClient *cs3mocks.GatewayAPIClient
gatewaySelector pool.Selector
)
BeforeEach(func() {
// initialize in setup nodes
pool.RemoveSelector("GatewaySelector" + "any")
// create a new mock client
gatewayClient = cs3mocks.NewGatewayAPIClient(GinkgoT())
gatewaySelector = pool.GetSelector[gateway.GatewayAPIClient](
"GatewaySelector",
"any",
func(cc *grpc.ClientConn) gateway.GatewayAPIClient {
return gatewayClient
},
)
})
Context("The user has the permission to create public shares", func() {
BeforeEeach(func() {
// set up the mock
// this is implicitly creating the expectation that it will be called Once()
// this will throw an error if the method is not called
gatewayClient.
EXPECT().
CheckPermission(
mock.Anything,
mock.Anything,
).
Return(checkPermissionResponse, nil)
})
It("should return a public share", func() {
// call the method
req := &link.CreatePublicShareRequest{
ResourceInfo: &providerpb.ResourceInfo{
Owner: &userpb.UserId{
OpaqueId: "alice",
},
Path: "./NewFolder/file.txt",
},
Grant: &link.Grant{
Permissions: &link.PublicSharePermissions{
Permissions: linkPermissions,
},
Password: "SecretPassw0rd!",
},
Description: "test",
}
res, err := provider.CreatePublicShare(ctx, req)
Expect(err).ToNot(HaveOccurred())
Expect(res.GetStatus().GetCode()).To(Equal(rpc.Code_CODE_OK))
Expect(res.GetShare()).To(Equal(createdLink))
})
})
})
```
{{% hint type="tip" title="Mocking in oCIS" %}}
Use the constructor on new mocks to register the `AssertExpectations` method to be called at the end of the tests via the `t.Cleanup()` method.
{{% /hint %}}
@@ -1,113 +0,0 @@
---
title: "Standard Library Testing"
date: 2024-04-25T00:00:00+00:00
weight: 10
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/development/unit-testing
geekdocFilePath: testing-pkg.md
---
## Using the standard library
To write a unit test for your package, create a file with the `_test.go` suffix. For example, if you have a package `foo` with a file `foo.go`, you can create a file `foo_test.go` in the same directory. The test file should have the same package name as the package being tested. By doing this, you can access all exported and unexported identifiers of the package. It is a good practice to keep the test file in the same package as the code being tested.
### Simple Example
We are using an oversimplified example from [FooBarQuix](https://codingdojo.org/kata/FooBarQix/) to demonstrate how to use the `testing` package.
```go
package divide
import "strconv"
// If the number is divisible by 3, write "Yes" otherwise, the number
func IsDivisible(input int) string {
if (input % 3) == 0 {
return "Yes"
}
return strconv.Itoa(input)
}
```
To test the `IsDivisible` function, create a file `divide_test.go` in the same directory as `divide.go`. The test file should have the same package name as the package being tested.
A test function in Go starts with `Test` and takes `*testing.T` as the only parameter. In most cases, you will name the unit test `Test[NameOfFunction]`. The testing package provides tools to interact with the test workflow, such as `t.Errorf`, which indicates that the test failed by displaying an error message on the console.
The test function for the `IsDivisible` function could look like this
```go
package divide
import "testing"
func TestDivide3(t *testing.T) {
result := IsDivisible(3)
if result != "Yes" {
t.Errorf("Result was incorrect, got: %s, want: %s.", result, "Yes")
}
}
```
To run the test, use the `go test` command in the directory where the test file is located.
### Use a helper package for assertions
You could make the test more readable by using testify. The `assert` package provides a lot of helper functions to make the test more readable.
```go
package divide
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestDivide3(t *testing.T) {
result := IsDivisible(3)
assert.Equal(t, "Yes", result)
}
```
### Table Driven Example
Write Table Driven Tests to test multiple inputs.
```go
package divide
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsDivisibleTableDriven(t *testing.T) {
// Defining the columns of the table
var tests = []struct {
name string
input int
want string
}{
// the table itself
{"9 should be Yes", 9, "Yes"},
{"3 should be Yes", 3, "Yes"},
{"1 is not Yes", 1, "1"},
{"0 should be Yes", 0, "Yes"},
}
// The execution loop
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
answer := IsDivisible(tt.input)
assert.Equal(t, tt.want, answer)
})
}
}
```
A table-driven test starts by defining the input structure. This can be seen like defining the columns of the table. Each row of the table lists a test case to execute. Once the table is defined, the execution loop can be created.
The execution loop calls `t.Run()`, which defines a subtest. In our example each row of the table defines a subtest named `[NameOfTheFuction]/[NameOfTheSubTest]`.
This way of writing tests is very popular, and considered the canonical way to write unit tests in Go.
+53 -28
View File
@@ -22,39 +22,64 @@ sequenceDiagram
participant client as Client
participant proxy as ocis-proxy
participant idp as IdP
participant idm as LibreIDM
participant ldap as External User Directory
participant glauth as ocis-glauth
participant graph as ocis-graph
participant accounts as ocis-accounts
participant ldap as external LDAP server
user->>+client: What is the content of my home?
client->>+proxy: PROPFIND no (or expired) auth
Note over client,proxy: ocis needs to know the IdP that is used to authenticate users. The proxy will redirect unauthenticated requests to that IdP.
proxy-->>-client: 401 Unauthorized
client->>+proxy: 1. The client starts a new openIDConnect Flow
Note over client, proxy: GET /.well-known/openid-configuration
proxy-->>-client: Return openidConnect configuration for the IdP
client-->>client: 2. Client prepares an Authentication Request containing the desired request parameters and generates the code challenge (PKCE).
client->>+idp: 3. Client sends the request and the code challenge to the Authorization Server.
Note over client, idp: GET /authorize? flow=oidc&response_type=code &scope=openid%20profile%20email &code_challenge=Y2SGoq9vtAp7YAavTaO0B550H_Rsj9DypiL7xZuFjOE &code_challenge_method=S25&client_id=s6BhdRkqt3 &state=af0ifjsldkj &redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb HTTP/1.1 Host: server.example.com
client->>+proxy: PROPFIND <br> no (or expired) auth
Note over client,proxy: ocis needs to know the IdP that is<br>used to authenticate users. The<br>proxy will redirect unauthenticated<br>requests to that IdP.
proxy-->>-client: 302 Found
Note over client, idp: HTTP/1.1 302 Found<br>Location: https://server.example.com/authorize?<br>response_type=code&<br>scope=openid%20profile%20email<br>&client_id=s6BhdRkqt3<br>&state=af0ifjsldkj<br>&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb
Note over client, idp: We should follow the OpenID Connect Discovery protocol
Note over client, idp: Clients might fall back to the ocis server if the discovery failed.<br>We can provide a webfinger endpoint there to let guests use an idp<br>that is backed by the accounts service.
Note over client, idp: For now, clients can only handle one IdP, which is configured in ocis.
client-->>client: 1. Client prepares an Authentication Request<br>containing the desired request parameters.
client->>+idp: 2. Client sends the request to the Authorization Server.
Note over client, idp: GET /authorize?<br>response_type=code<br>&scope=openid%20profile%20email<br>&client_id=s6BhdRkqt3<br>&state=af0ifjsldkj<br>&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb HTTP/1.1<br>Host: server.example.com
Note over user, idp: 3. Authorization Server Authenticates the End-User.
alt all users managed by idp/ocis idm
idp->>+idm: LDAP query/bind
idm-->>-idp: LDAP result
Note over idp,ldap: In case users are managed in an external ldap they have to be autoprovisioned in the ocis IdM when they are loggin in.
Note over idp,ldap: Either an IdP already exists or a new one is introduced. Since we are not yet using oidc discovery we can only use one IdP.
alt all users managed by idp/ocis
idp->>+glauth: LDAP query/bind
glauth->>+graph: GET user with Basic Auth<br>GraphAPI
graph->>+accounts: internal GRPC
accounts-->>-graph: response
graph-->>-glauth: OData response
glauth-->>-idp: LDAP result
Note over accounts,ldap: In case internal users are managed<br>in an external ldap they have to be<br>synced to the accounts service to<br>show up as recipients during sharing.
else all users authenticated by an external idp
idp->>+ldap: Lookup of the user in the directory
ldap-->>-idp: Lookup result
idp->>+ldap: LDAP query/bind
ldap-->>-idp: LDAP result
alt guest accounts managed in ocis / lookup using glauth proxy:
Note over idp,glauth: Idp is configured to use glauth as a<br>second ldap server.
idp->>+glauth: LDAP query/bind
glauth->>+graph: GET user with Basic Auth<br>GraphAPI
graph->>+accounts: internal GRPC
accounts-->>-graph: response
graph-->>-glauth: OData response
glauth-->>-idp: LDAP result
else guest account provisioned by other means
Note over accounts, ldap: In case guest accounts are managed<br>in an existing ldap they need to be<br>synced to the accounts service to<br>be able to login and show up as<br>recipients during sharing.
end
end
idp-->>-user: Idp presents the user an authentication prompt.
user->>+idp: 5. User authenticates and gives consent.
idp-->>-client: 6. Authorization Server sends the End-User back to the Client with an Authorization Code.
Note over client, idp: HTTP/1.1 302 Found Location: https://client.example.org/cb? code=SplxlOBeZQQYbYS6WxSbIA&state=af0ifjsldkj
client->>+idp: 7. Client requests a response using the Authorization Code and the code verifier at the Token Endpoint.
Note over client, idp: POST /token HTTP/1.1 Host: server.example.com Content-Type: application/x-www-form-urlencoded grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA &redirect_uri=https%3A%2F%2Fclient.example.org &code_verifier=a98ccbe253754259963e6e2b67b5a044929446d7a15046cc8e3194022ad061d9d667dce91876418d9e6fe9f54819332e
idp->>+idp: 8. IdP checks the code verifier (PKCE)
idp-->>-client: 9. Client receives a response that contains an ID Token and Access Token in the response body. If offline access is requested, the client also receives a refresh token.
Note over client, idp: HTTP/1.1 200 OK Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "access_token": "SlAV32hkKG", "token_type": "Bearer", "refresh_token": "8xLOxBtZp8", "expires_in": 3600, "id_token": "a ... b.c ... d.e ... f" // must be a JWT }
client-->>client: 10. Client validates the ID token and retrieves the End-User's Subject Identifier.
client->>+proxy: PROPFIND With access token
Note over user, idp: 4. Authorization Server obtains End-User Consent/Authorization.
idp-->>-client: 5. Authorization Server sends the End-User back<br>to the Client with an Authorization Code.
Note over client, idp: HTTP/1.1 302 Found<br>Location: https://client.example.org/cb?<br>code=SplxlOBeZQQYbYS6WxSbIA&state=af0ifjsldkj
client->>+idp: 6. Client requests a response using the<br>Authorization Code at the Token Endpoint.
Note over client, idp: POST /token HTTP/1.1<br>Host: server.example.com<br>Content-Type: application/x-www-form-urlencoded<br>grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA<br>&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb
idp-->>-client: 7. Client receives a response that contains an<br>ID Token and Access Token in the response body.
Note over client, idp: HTTP/1.1 200 OK<br>Content-Type: application/json<br>Cache-Control: no-store<br>Pragma: no-cache<br>{<br>"access_token": "SlAV32hkKG",<br>"token_type": "Bearer",<br>"refresh_token": "8xLOxBtZp8",<br>"expires_in": 3600,<br>"id_token": "a ... b.c ... d.e ... f" // must be a JWT<br>}
client-->>client: 8. Client validates the ID token and<br>retrieves the End-User's Subject Identifier.
client->>+proxy: PROPFIND <br> With access token
proxy-->>-client: 207 Multi-Status
client-->>-user: List of Files X, Y, Z ...
{{< /mermaid >}}
+11 -11
View File
@@ -24,9 +24,9 @@ sequenceDiagram
user->>+client: What is the content of my home?
client->>+proxy: PROPFIND Bearer auth using oidc auth token
Note over client,proxy: What is in a bearer token? The spec recommends opaque tokens. Treat it as random byte noise.
Note over client,proxy: the proxy MUST authenticate users using ocis-accounts because it needs to decide where to send the request
client->>+proxy: PROPFIND <br> Bearer auth using oidc auth token
Note over client,proxy: What is in a bearer token? <br> The spec recommends opaque tokens. <br> Treat it as random byte noise.
Note over client,proxy: the proxy MUST authenticate users <br> using ocis-accounts because it needs <br> to decide where to send the request
%% Mention introspection endpoint for opaque tokens
%% idp uses jwt, so we can save a request
%% either way the token can be used to look up the sub and iss of the user
@@ -36,16 +36,16 @@ sequenceDiagram
alt userinfo succeeds
idp-->>proxy: 200 OK
Note over proxy,accounts: Content-Type: application/json{"sub": "248289761001","name": "Jane Doe","given_name": "Jane","family_name": "Doe","preferred_username": "j.doe","email": "janedoe@example.com","picture": "http://example.com/janedoe/me.jpg"}
Note over proxy,accounts: Content-Type: application/json<br>{<br>"sub": "248289761001",<br>"name": "Jane Doe",<br>"given_name": "Jane",<br>"family_name": "Doe",<br>"preferred_username": "j.doe",<br>"email": "janedoe@example.com",<br>"picture": "http://example.com/janedoe/me.jpg"<br>}
%% see: https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse
else userinfo fails
idp-->>-proxy: 401 Unauthorized
Note over proxy,accounts: WWW-Authenticate: error="invalid_token",error_description="The Access Token expired"
Note over proxy,accounts: WWW-Authenticate: error="invalid_token",<br>error_description="The Access Token expired"
proxy-->>client: 401 Unauthorized or 302 Found with redirect to idp
Note over client: start at login flow or refresh the token
proxy-->>client: 401 Unauthorized or <br>302 Found with redirect to idp
Note over client: start at login flow<br> or refresh the token
end
@@ -71,7 +71,7 @@ sequenceDiagram
end
end
Note over proxy,accounts: provision a new account including displayname, email and sub@iss TODO only if the user is allowed to login, based on group membership in the ldap server
Note over proxy,accounts: provision a new account including displayname, email and sub@iss <br> TODO only if the user is allowed to login, based on group <br> membership in the ldap server
proxy->>proxy: generate new uuid
proxy->>+accounts: TODO create account with new generated uuid
accounts-->>-proxy: OK / error
@@ -79,8 +79,8 @@ sequenceDiagram
else account has been disabled
accounts-->>-proxy: account is disabled
proxy-->>client: 401 Unauthorized or 302 Found with redirect to idp
Note over client: start at login flow or refresh the token
proxy-->>client: 401 Unauthorized or <br>302 Found with redirect to idp
Note over client: start at login flow<br> or refresh the token
end
proxy->>proxy: store uuid in context
@@ -88,7 +88,7 @@ sequenceDiagram
%% what if oc10 does not support a certain request / API
proxy->>proxy: mint an internal jwt that includes the UUID and username using revas `x-access-token` header
proxy->>+reva: PROPFIND Token auth using internal JWT
proxy->>+reva: PROPFIND <br>Token auth using internal JWT
reva-->>-proxy: Multistatus response
proxy-->>-client: Multistatus response
Loaded 100 of 379 files, more files were not shown because too many files have changed in this diff. Show more