Compare commits

...
52 Commits
Author SHA1 Message Date
sylph 456dc232cb fix(postprocessing,storage-users): NATS再送による重複処理を解消する
ワーカーが埋まっている間に順番待ちしている後続イベントがAckWait超過で再送され、多重処理されていた問題に対処する。

- ocis-pkg/natsconsumer: durableコンシューマーのAckWait/MaxDeliverをサーバー側の更新APIで反映するヘルパーを追加。購読オプションで渡すと再起動時にconfig不一致で起動できなくなるため。

- ocis-pkg/eventdedup: 同一イベントIDの再送を破棄するフィルターを追加。

- postprocessing/storage-users: AckWait(既定30分)/MaxDelivery(既定3)/並行数/重複排除ウィンドウの設定と環境変数を追加し、起動時にコンシューマー設定を反映。
2026-11-03 18:35:48 +09:00
sylph b690f4eb8f fix(graph): 個人スペース名の禁止文字を置換して同期する
表示名にスラッシュなどが含まれていてもスペース名だけを安全な文字へ置換し、作成・更新・未作成時の生成でバリデーションに失敗しないようにする。
2026-11-02 17:50:26 +09:00
sylph 455d76cab4 docs(idp): 登録関連のエラーコードとファイル構成を追記する
- 直前のコミットに入らなかった表の更新を追加する
- registration_* のエラーコード、新規ファイル、RegistrationSection.spec.ts のテスト案内
2026-11-01 22:59:57 +09:00
sylph 10247ace43 docs(idp): 新規登録の設定と承認待ちワークフローを説明する
- 4 つの登録設定、ログイン画面の表示、Web 登録、承認待ちの扱いを追記
- 管理 API・エラーコード・ファイル構成の表を更新
- 承認待ちユーザー名の判別、Users 画面で有効化したときの Discord ログイン遮断などの制限を明記
2026-11-01 22:58:35 +09:00
sylph ce462dbe20 feat(admin-settings): 登録設定のトグルと承認待ち一覧を追加
- 一般設定に「登録」セクションを追加 (Settings.ReadWrite 権限が必要)
- 登録受付 / Web 登録 / Discord 登録 / 管理者承認を切り替えた時点で保存し、失敗したら元に戻す
- 承認待ちアカウントをユーザー名・メール・登録元・申請日時で一覧表示する
- 承認ボタンで有効化し、拒否は確認ダイアログの後にアカウントを削除する
2026-11-01 22:57:06 +09:00
sylph cf505b3065 feat(idp): ログイン画面で登録設定に応じて登録リンクと Discord ボタンを切り替える
- Web 登録が有効なときだけ「アカウント作成」リンクを表示する
- Discord 登録が有効なら Discord ボタンを「Discord でログイン / 登録」と表示する
- 判定は公開 API と同じ PublicRegistration を使い、サーバー側で描画する
2026-11-01 22:51:22 +09:00
sylph f8d3daf7ff feat(idp): 経路チェック付きの Web セルフ登録を追加
- GET/POST /oauth2/discord/register で登録フォームを表示・受け付ける
- Web 登録が無効、または登録受付が OFF のときは registration_closed で拒否
- Origin/Referer が公開 URL と違う POST を拒否する
- ユーザー名・メール・パスワードを検証し、重複やパスワードポリシー違反はフォームに表示
- 承認制が有効なら accountEnabled=false で作成し、登録元 web として承認待ちに記録
- 段階③で抜けていた Accounts の組み立てを追加 (本番で NewHandler が失敗していた)
2026-11-01 22:48:41 +09:00
sylph 0b0d460eac feat(idp): 承認待ちユーザーのパスワードログインで承認待ちと通知する
- /signin/v1/identifier/_/logon を idp で先に受け、lico のログインが失敗し
  かつユーザー名が承認待ちなら 403 registration_pending を返す
- それ以外のリクエストは lico の応答をそのまま返す
- ログイン画面で「現在、管理者の承認待ちです」を表示する
2026-11-01 22:41:59 +09:00
sylph 3ac62eb510 feat(idp): 承認待ちアカウントの管理者向け承認/拒否 API を追加
- GET /oauth2/discord/admin/pending で承認待ち一覧を返す
- POST /oauth2/discord/admin/pending/{id}/approve で accountEnabled=true にする
- POST /oauth2/discord/admin/pending/{id}/reject でアカウントを削除する
- Graph の更新に失敗した場合は承認待ちの記録を残し、再試行できるようにする
2026-11-01 22:37:51 +09:00
sylph fbe1b9560b feat(idp): Discord 登録の経路チェックと承認待ちワークフローを追加
- 承認待ちアカウントを pending.json に保存 (ユーザー ID、登録元、申請日時)
- Discord 登録が無効なら新規 Discord ユーザーを registration_closed で拒否
- 承認制が有効なら accountEnabled=false で作成し、申請受付画面を表示 (セッションは発行しない)
- 承認待ちユーザーの Discord ログインを registration_pending で遮断
- 新しいエラーコードの文言 (英語/日本語) を追加
2026-11-01 22:31:26 +09:00
sylph 019e65a951 feat(idp): 新規登録の設定と公開 API を追加
- 登録受付 / Web 登録 / Discord 登録 / 管理者承認の 4 設定を registration.json に保存
- ファイルがない環境では従来どおり (受付 ON、Discord ON、Web OFF、承認 OFF)
- GET /oauth2/discord/registration でログイン画面向けの公開設定を返す (認証なし)
- GET/PUT /oauth2/discord/admin/registration で管理者が設定を変更する
2026-11-01 22:25:37 +09:00
sylph 8b132a520e fix(idp): サービスアカウントが未設定なら graph の設定を使う
- ocis init が idp.service_account を書く前に作られた ocis.yaml でも
  Discord ログインが有効になるように、ランタイムで idp を起動する前に
  graph.service_account を写す
2026-11-01 22:13:01 +09:00
sylph de0eace537 fix(idp): identity manager が ldap 以外で Discord ログインを無効にしたときもログを出力する 2026-11-01 22:02:57 +09:00
sylph a5f57a6e2a fix(idp): Discord ログイン無効化の理由を error レベルで出力する 2026-11-01 21:25:41 +09:00
sylph 35b11ed975 feat(idp): 既存アカウントに Discord を連携できるようにする
- My Account の Preferences に Discord 連携の行を追加 (Discord ログイン有効時のみ表示)
- GET/POST /oauth2/discord/account/link で連携状態の取得と連携開始を行う (認証必須)
- state Cookie に link モードとユーザー ID を署名付きで入れ、callback で紐付ける
- Discord ID が別アカウントに、またはアカウントが別の Discord に紐付いている場合は拒否する
- 結果は /account?discord_link= で返し、Web がメッセージを表示する
- proxy に /oauth2/discord/account/ を認証必須ルートとして追加
- ドキュメントに連携の節を追記
2026-11-01 20:58:27 +09:00
sylph a3c56a9272 docs(idp): Discord ログインの実装ドキュメントを追加 2026-11-01 20:44:05 +09:00
sylph d372a0f4c0 feat(idp): Discord ログインを追加
- 指定の Discord サーバーのメンバーだけがログインできる OAuth2 ログインを追加
- Client ID / Secret / サーバー ID は管理設定画面から設定する
- 紐付け済みアカウントは oCExternalIdentity の Discord ID で検索する
- 確認済みメールが一致する既存アカウントには Discord を紐付ける
- アカウントがない場合はユーザー名を入力してもらってから作成する
- Discord と紐付いたアカウントは email_verified を true にする
  (lico ldap バックエンドをラップした identity manager を登録)
2026-11-01 20:40:12 +09:00
sylph d466cb205c ci: Gitea Actions を手動ビルド専用ワークフローに整理
- build-release.yml(タグ時の Releases 公開)を削除
- build-package.yml を追加: workflow_dispatch のみで ocis linux/amd64 をビルドし、
  バイナリと sha256 を Actions の Artifact(7 日間)に保存
- runs-on を ubuntu-latest に変更
2026-11-01 16:02:12 +09:00
sylph d76d421fc6 chore: Reverse Cloud 向けに CI 整理・日本語化・UI 改善
- 本家 GitHub Actions / bot 設定、Transifex (.tx)、Sonar/Codacy 設定を削除
- Web UI の ja 翻訳を全 msgid (1,397 件) まで補完し表記を統一
- アプリ名を Reverse Cloud に変更 (theme.json / index.html / manifest)
- ファイルサイズに正確なバイト数のツールチップを追加
- コンテキストメニューに最小幅とスクロールを追加
- 音声プレビューにタイトル・アーティスト・メタデータ表示を追加
- 手動実行と v* タグ時のみ動く Gitea Actions (build-release.yml) を追加
2026-11-01 15:22:17 +09:00
kobergj fbd21b636c chore: release 8.2.2 (#13210)
Web Tests / web-build-test (push) Canceled after 0s
Web Tests / detect-web-changes (push) Canceled after 1m2s
Check licenses / license-check (push) Canceled after 1m8s
Web Tests / web-tests-passed (push) Failing after 7s
* chore: release 8.2.2

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

* fix(web): bump vulnerable web dependencies

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>

---------

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-10-21 11:49:16 +02:00
LarsJurgensen cb93f12eb2 fix(graph): [stable-8.2][OCISDEV-1561] tolerate preferred language lookup failures (#13190)
Backport of owncloud/ocis#13188.
2026-10-20 11:57:09 +02:00
LarsJurgensen cd040d0c6d chore: [stable-8.2] bump golang.org/x/net to v0.60.0 (CVE-2026-78669) 2026-10-20 11:18:41 +02:00
Martin c15333d2a2 docs(stable-8.2-PR13165): final removal of any docs related content (#13187)
Backport of PR #13165
2026-10-19 17:11:42 +02:00
Roman PerekhodandClaude Sonnet 5 84908d0810 fix: [OCISDEV-1476] fix AuthApp requests failing with a custom PROXY_… (#13078)
* fix: [OCISDEV-1476] fix AuthApp requests failing with a custom PROXY_USER_OIDC_CLAIM

* fix: [OCISDEV-1476] map ErrAccountNotFound to 401 in verifyUser

AccountResolver.verifyUser only mapped ErrAccountDisabled to 401 before
falling through to a generic 500. The identity backend excludes disabled
accounts from by-username lookups and returns ErrAccountNotFound instead,
so a disabled user authenticating via AppAuth or basic auth got a 500
instead of a 401, caught by the acceptance test suite.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-09 09:37:00 +02:00
Roman PerekhodandClaude Sonnet 5 8948de6633 fix: [OCISDEV-1523] fix the LDAP master-ID filter for an empty base filter (#13096)
* fix: [OCISDEV-1523] fix the LDAP master-ID filter for an empty base filter

EnhanceFilterWithMasterID replaced an empty LDAP filter with a master-ID-only
filter. This action restricted an unrestricted search to master-ID users
only. The bug broke the cross-instance user search in multi-instance
deployments. The function now keeps an empty filter unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: [OCISDEV-1523] require an explicit LDAP user filter with a master ID

EnhanceFilterWithMasterID in ocis-pkg/ldap/filter.go now keeps an empty
LDAP filter unchanged instead of restricting it to master-ID users only.
The auth-basic, users, groups, and graph services reuse this function to
compute their default LDAP user filter at startup.

An unset filter now means these services resolve or authenticate every
user in the shared LDAP directory, not only master-ID users. This action
is a behavior change for a deployment that sets
OCIS_MULTI_INSTANCE_MASTER_ID without an explicit OCIS_LDAP_USER_FILTER.

Each service now rejects startup when OCIS_MULTI_INSTANCE_MASTER_ID is
set and its own user filter is empty. This action keeps a multi-instance
deployment scoped to its own users by default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* refactor: [OCISDEV-1523] simplify EnhanceFilterWithMasterID guard clauses

The function collapses three early-return guards into one condition.
This action removes a duplicated rationale comment between filter.go
and filter_test.go.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-08 17:50:06 +02:00
Roman PerekhodandJuan Pablo Villafañez 8d8a015d1a backport: ocis_multi ldap group fix and marketplace CSP (#13090)
* fix: [OCISDEV-969] ocis_multi deployment with proper ldap groups (#12466)

fix: ocis_multi deployment with proper ldap groups
(cherry picked from commit 8dc7afc07c)

* feat(app-store): allow ownCloud Marketplace in ocis_multi CSP
Backport the ocis_multi portion of the marketplace CSP allowlisting
introduced in master so csp.yaml and csp-ocm.yaml also permit
connections to the new ownCloud Marketplace domain.

Backports #12793

---------

Co-authored-by: Juan Pablo Villafañez <jpvillafanez@izertis.com>
2026-10-07 18:32:07 +02:00
Michal Klos adeecc8cf7 chore: backport consolidate dependency and security bumps (#13081) (#13087)
* chore: backport consolidate dependency and security bumps (#13081)

* fix: pin reva to stable-8.2 tip, not main-branch commit
2026-10-07 16:59:59 +02:00
Roman PerekhodandMatteo 853d7d19d2 bump vue to 3.5.43 (#13073) (#13080)
chore(web): bump vue to 3.5.43 and source-map-js

Co-authored-by: Matteo <193476828+mzner@users.noreply.github.com>
2026-10-06 20:53:16 +02:00
kobergjandClaude Opus 5 2b4204ddb8 chore: release 8.2.1 (#12980)
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-10-02 23:11:22 +02:00
Roman PerekhodandClaude Sonnet 5 12d4423284 fix: [ocisdev-1433] fix public share, add The grpc clients keepalive … (#13048)
* fix: [ocisdev-1433] fix public share, add The grpc clients keepalive and more (#13020)

* fix: the public share configuration and fixed graceful shutdown

* fix: [OCISDEV-1433] remove GRPC_MAX_CONNECTION_AGE

The setting closed healthy grpc connections on a timer so that clients would redo
their DNS lookup. It never helped against the failure it was reached for - a
connection whose peer stopped answering - because the age limit is enforced by
the server, the grace period was left at infinity so a request already in flight
was never ended, and any value without a unit suffix silently disabled it again.

Detecting a peer that stops answering is now the job of the grpc clients, which
ping the peer while a request is in flight. The servers here got the matching
enforcement policy so they accept those pings; the client side arrives with the
next reva bump.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: Added the new variable OCDAV_DISABLE_PROPFIND_PUBLIC_LINK_RESOLUTION that disable the resolution of public link shares when answering PROPFIND requests.

* chore: bump reva

* fix: The keepalive added to grpc clinet

* chore: bump reva

* build(deps): bump go 1.26.8, grpc-go dependency

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

* chore: bump pnpm dependencies

* fix: avoid go vet false positive in userlog conversion.go

The go.mod bump to go 1.26.8 made go vet flag loadTemplates' calls to
t.Get(nt.Subject/nt.Message) as non-constant format strings, breaking
the build for services/userlog/pkg/service. These are translation
lookup keys, not printf format strings, so route the call through a
local func value to defeat vet's static trace.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-10-02 19:46:33 +00:00
Michal Klos 5988f8b8e6 feat: [backport][OCISDEV-1411] don't logout users on a transient IdP userinfo failure (#13049)
axios >=1.20.0 strips any outgoing header literally named "purge" (case-insensitive) as a reserved per-HTTP-method bucket name, silently dropping the Purge header the web client sent to permanently delete a space. The graph service now also accepts an X-Purge alias (Purge still works for other API clients), the web client sends that instead, and axios stays bumped to 1.20.0 for the CVE fix. .trivyignore reverted to its original state since no exemption is needed.

Signed-off-by: Michal Klos <michal.klos@kiteworks.com>
2026-10-02 21:13:28 +02:00
Prajwol Amatya b623e7dbe7 [tests-only][full-ci] test: backport fix flakiness in apiVault (#12864)
test: fix user mfa setup for vauld

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-09-24 16:23:20 +05:45
Roman PerekhodandClaude Opus 4.8 2eff54dcb2 fix: [stable-8.2] harden public link brute force protection (#12945)
fix: [OCISDEV-1404] harden public link brute force protection

The proxy public share authenticator set the brute force protection skip
marker on every authentication, including requests where the proxy is the
only authenticator. Failed password attempts on those requests were never
counted, so the rate limit for password protected public links was not
enforced.

The skip marker is now only set for requests that are re-authenticated
downstream, so failed attempts are reliably counted and the throttle is
applied consistently.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-15 12:24:04 +02:00
Roman PerekhodandClaude Opus 4.8 cb9ced39f0 fix: [backport] correct introductionVersion for OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL (#12951)
Change the documented introductionVersion of the
OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL environment variable from 8.0.0 to 8.3.0.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-14 17:23:56 +00:00
Roman Perekhod ef46003751 fix: [stable-8.2] harden nats communication (#12932)
* fix: [OCISDEV-1115] harden nats communication

(cherry picked from commit 3deec26d89)

* chore: update changelog PR number to #12932
2026-09-14 09:24:34 +02:00
Roman Perekhod 791a895b2f fix: [OCISDEV-1360] Cache LDAP instance mapper lookups (#12898) 2026-09-11 11:41:37 +02:00
Roman Perekhod 22ce901173 fix: [stable-8.2] Remove the unmarshalable request body field from graph log messages (#12916)
fix: Remove the unmarshalable request body field from graph log messages
2026-09-10 16:25:57 +00:00
Michal Klos 5e132219c0 chore: [stable-8.2] bumps (#12912)
chore: bumps
2026-09-09 19:20:40 +02:00
Roman Perekhod 09e7446f84 build(deps): bump dependencies (#12902)
build(deps): bump dependencies
2026-09-09 13:10:09 +00:00
Pradip Subedi a7f7d564a1 [tests-only] test: Backport of add vault public link scenarios (#12799)
test: add vault public link rejection scenarios
2026-08-27 14:08:33 +05:45
Prajwol Amatya 474ecbe36d [tests-only][full-ci] test: backport PR wait until qr is loaded (#12836)
test: wait until QR is loaded

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-27 11:25:02 +05:45
Prajwol Amatya ca261fdff2 [tests-only][full-ci]test: backport test to share resources from vault (#12839)
test: add test to share resources from vault

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-27 11:24:45 +05:45
Pradip Subedi 14e0773642 [tests-only][full-ci] test: Backport fix for coreApiShareManagementToShares (#12798)
test: enable secure viewer role before upload in moveReceivedShare scenarios
2026-08-27 10:09:53 +05:45
Lukas Hirt abe3461807 chore(deps): bump golang.org/x/mod to v0.40.0 (#12848)
Addresses CVE-2026-56864 and CVE-2026-56865 (GOSUMDB transparency-log
tile verification bypass), which Trivy flags as HIGH severity. The
vulnerable sumdb/tlog package is not reachable from any shipped oCIS
binary: golang.org/x/mod is only pulled in transitively by the
docs/helpers doc-generation tool and by golang.org/x/tools, which is
pinned as a build-time-only tool dependency (`//go:build tools`).

golang.org/x/crypto, golang.org/x/net, and golang.org/x/tools were
bumped along with it to satisfy their updated minimum-version
requirements; go build/vet and the affected test suites pass
unchanged.

Signed-off-by: Lukas Hirt <info@hirt.cz>
2026-08-26 12:34:40 +05:45
Prajwol Amatya 2a267a62c5 [tests-only][full-ci] test: backport search tests in vault (#12744)
* test: search resources in vault

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: add test to search using content and tags

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: add tika service for vault tests

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: move deleteUserTotpCredentials to before scenario

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: refactor the step to check acr vaule

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

---------

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-20 11:14:32 +05:45
Prajwol AmatyaandNalem7 541e5824d2 [tests-only][full-ci] add retry logic for space creation and copy request (#12815)
* test: add retry once for space creation wherever required (#12785)

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

* test: add retry logic for file copy requests (#12781)

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

---------

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Co-authored-by: Nalem7 <61624650+nabim777@users.noreply.github.com>
2026-08-20 11:14:14 +05:45
LarsJurgensen 2faf44b0db security: bump golang.org/x/image to v0.45.0 (#12806)
chore: bump golang.org/x/image to v0.45.0
2026-08-18 09:37:58 +02:00
Martin cbcc3216e3 docs: [8.2] fix the introduction version of some envvars (#12803) 2026-08-14 12:52:18 +00:00
Michal Klos a137821862 feat: [stable-8.2][OCISDEV-1115] harden nats communication (#12792)
feat: [OCISDEV-1115] harden nats communication (#12777)

* feat: [OCISDEV-1115] harden nats communication

* feat: bump reva for tls-enabled stores
2026-08-14 13:09:46 +02:00
Michal Klos 895d09db3f feat: [stable-8.2][OCISDEV-855] receivedsharecache: retry on transient storage errors in CAS loop (#12789)
feat: [OCISDEV-855] receivedsharecache: retry on transient storage errors in CAS loop (#12621)
2026-08-14 09:41:31 +02:00
Prajwol Amatya 544ebe5cad [tests-only][full-ci] test: backport fix for flaky e2e test (#12779)
* test: slow down test run

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: scope temp upload path per Playwright worker

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

* test: login user after creating resources via API

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>

---------

Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
2026-08-13 12:47:22 +05:45
Michal Klos b7d887527b chore: [stable-8.2] bump go and web packages (#12775)
chore: bump go and web packages (#12765)

* chore: bump go packages

* chore: bump web packages
2026-08-12 13:29:50 +02:00
2277 changed files with 190163 additions and 122019 deletions

No files matched your search

-6
View File
@@ -77,12 +77,6 @@ $(PIGEON): $(BINGO_DIR)/pigeon.mod
@echo "(re)installing $(GOBIN)/pigeon-v1.2.1"
@cd $(BINGO_DIR) && GOWORK=off GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) GOARM=$(GOHOSTARM) $(GO) build -mod=mod -modfile=pigeon.mod -o=$(GOBIN)/pigeon-v1.2.1 "github.com/mna/pigeon"
PROTOC_GEN_DOC := $(GOBIN)/protoc-gen-doc-v1.5.1
$(PROTOC_GEN_DOC): $(BINGO_DIR)/protoc-gen-doc.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-doc-v1.5.1"
@cd $(BINGO_DIR) && GOWORK=off GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) GOARM=$(GOHOSTARM) $(GO) build -mod=mod -modfile=protoc-gen-doc.mod -o=$(GOBIN)/protoc-gen-doc-v1.5.1 "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go-v1.28.1
$(PROTOC_GEN_GO): $(BINGO_DIR)/protoc-gen-go.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
-5
View File
@@ -1,5 +0,0 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.17
require github.com/pseudomuto/protoc-gen-doc v1.5.1 // cmd/protoc-gen-doc
-169
View File
@@ -1,169 +0,0 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.15.0+incompatible h1:0gSxPGWS9PAr7U2NsQ2YQg6juRDINkUyuvbb4b2Xm8w=
github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg=
github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.3.0-java h1:bV5JGEB1ouEzZa0hgVDFFiClrUEuGWRaAc/3mxR2QK0=
github.com/envoyproxy/protoc-gen-validate v0.3.0-java/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c h1:jWtZjFEUE/Bz0IeIhqCnyZ3HG6KRXSntXe4SjtuTH7c=
github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/huandu/xstrings v1.0.0 h1:pO2K/gKgKaat5LdpAhxhluX2GPQMaI3W5FUz/I/UnWk=
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
github.com/imdario/mergo v0.3.4 h1:mKkfHkZWD8dC7WxKx3N9WCF0Y+dLau45704YQmY6H94=
github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007 h1:28i1IjGcx8AofiB4N3q5Yls55VEaitzuEPkFJEVgGkA=
github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/pseudomuto/protoc-gen-doc v1.5.0 h1:pHZp0MEiT68jrZV8js8BS7E9ZEnlSLegoQbbtXj5lfo=
github.com/pseudomuto/protoc-gen-doc v1.5.0/go.mod h1:exDTOVwqpp30eV/EDPFLZy3Pwr2sn6hBC1WIYH/UbIg=
github.com/pseudomuto/protoc-gen-doc v1.5.1 h1:Ah259kcrio7Ix1Rhb6u8FCaOkzf9qRBqXnvAufg061w=
github.com/pseudomuto/protoc-gen-doc v1.5.1/go.mod h1:XpMKYg6zkcpgfpCfQ8GcWBDRtRxOmMR5w7pz4Xo+dYM=
github.com/pseudomuto/protokit v0.2.0 h1:hlnBDcy3YEDXH7kc9gV+NLaN0cDzhDvD1s7Y6FZ8RpM=
github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307 h1:O5C+XK++apFo5B+Vq4ujc/LkLwHxg9fDdgjgoIikBdA=
golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181107211654-5fc9ac540362 h1:b69RmkJsx8NyRJsKF2mQ/AF8s4BNxwNsT4rQ3wON1U0=
google.golang.org/genproto v0.0.0-20181107211654-5fc9ac540362/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4 h1:ysnBoUyeL/H6RCvNRhWHjKoDEmguI+mPU+qHgK8qv/w=
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-2
View File
@@ -26,8 +26,6 @@ MOCKERY="${GOBIN}/mockery-v2.53.5"
PIGEON="${GOBIN}/pigeon-v1.2.1"
PROTOC_GEN_DOC="${GOBIN}/protoc-gen-doc-v1.5.1"
PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.28.1"
PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v1.0.0"
-22
View File
@@ -1,22 +0,0 @@
---
exclude_paths:
- '.github/**'
- 'CHANGELOG.md'
- '**/CHANGELOG.md'
- 'changelog/**'
- '**/changelog/**'
- 'docs/**'
- '**/docs/**'
- '**/pkg/proto/**'
- 'idp/ui_config/**'
- 'idp/scripts/**'
- 'settings/rollup.config.js'
- 'accounts/rollup.config.js'
- 'deployments/**'
- 'tests/acceptance/expected-failures-*.md'
- 'tests/acceptance/bootstrap/**'
- 'tests/acceptance/TestHelpers/**'
- 'tests/acceptance/run.sh'
- 'vendor/**/*'
- 'tests/ociswrapper/vendor/**'
...
+99
View File
@@ -0,0 +1,99 @@
name: Build Package (Reverse Cloud)
# 手動実行専用。ビルドして Actions の Artifact(7 日間)に保存する。
# push / PR / タグでは実行しない。
on:
workflow_dispatch:
inputs:
version:
description: 'パッケージのバージョン(空欄なら 0.0.0-dev.<短縮SHA>)'
required: false
default: ''
concurrency:
group: build-package-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: '24'
CHROMEDRIVER_SKIP_DOWNLOAD: 'true'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine version
id: ver
shell: bash
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
if [[ -n "${INPUT_VERSION}" ]]; then
VERSION="${INPUT_VERSION#v}"
else
VERSION="0.0.0-dev.$(git rev-parse --short HEAD)"
fi
if ! [[ "${VERSION}" =~ ^[0-9A-Za-z.+-]+$ ]]; then
echo "::error::invalid version: ${VERSION}"; exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Enable pnpm (packageManager in web/package.json)
id: pnpm
shell: bash
run: |
corepack enable
cd web && corepack prepare --activate && pnpm --version
echo "store=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm.outputs.store }}
key: pnpm-${{ runner.os }}-${{ hashFiles('web/pnpm-lock.yaml', 'services/idp/pnpm-lock.yaml') }}
restore-keys: pnpm-${{ runner.os }}-
- name: Build frontend assets (web / idp)
run: make ci-node-generate
- name: Go generate
env:
BUF_TOKEN: ${{ secrets.BUF_API_TOKEN }}
run: make ci-go-generate
- name: Build ocis (linux/amd64, static PIE)
shell: bash
env:
CGO_ENABLED: '0'
VERSION: ${{ steps.ver.outputs.version }}
run: |
set -euo pipefail
sed -i "s/LatestTag = \".*\"/LatestTag = \"${VERSION}\"/" ocis-pkg/version/version.go
make -C ocis release-linux-docker-amd64
OUT="dist/ocis-${VERSION}-linux-amd64"
mkdir -p dist
cp ocis/dist/binaries/ocis-linux-amd64 "${OUT}"
(cd dist && sha256sum "$(basename "${OUT}")" > "$(basename "${OUT}").sha256")
ls -lh dist
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ocis-${{ steps.ver.outputs.version }}-linux-amd64
path: dist/
retention-days: 7
-3
View File
@@ -1,3 +0,0 @@
# Managed by owncloud/admin — edit codeowners/ownership.yml, not this file.
# Generated by scripts/sync-codeowners.py. Last matching pattern wins.
* @owncloud/ocis-maintainers
-15
View File
@@ -1,15 +0,0 @@
# Configuration for update-docs - https://github.com/behaviorbot/update-docs
# Comment to be posted to on PRs that don't update documentation
updateDocsComment: >
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/owncloud/ocis/blob/master/changelog/README.md) item based on your changes.
updateDocsWhiteList:
- Tests-only
- tests-only
- Tests-Only
- docs-only
- docs-Only
- Docs-Only
updateDocsTargetFiles:
- changelog/unreleased/
-73
View File
@@ -1,73 +0,0 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
day: sunday
time: '22:00'
timezone: Etc/UTC
open-pull-requests-limit: 5
groups:
minor-and-patch:
update-types:
- minor
- patch
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
day: sunday
time: '22:00'
timezone: Etc/UTC
open-pull-requests-limit: 5
groups:
minor-and-patch:
update-types:
- minor
- patch
- package-ecosystem: npm
directory: "/services/idp"
schedule:
interval: weekly
day: sunday
time: '22:00'
timezone: Etc/UTC
open-pull-requests-limit: 5
groups:
minor-and-patch:
update-types:
- minor
- patch
- package-ecosystem: docker
directories:
- "/"
- "/ocis/docker"
schedule:
interval: weekly
day: sunday
time: '22:00'
timezone: Etc/UTC
open-pull-requests-limit: 5
groups:
minor-and-patch:
update-types:
- minor
- patch
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
day: sunday
time: '22:00'
timezone: Etc/UTC
open-pull-requests-limit: 5
groups:
minor-and-patch:
update-types:
- minor
- patch
-82
View File
@@ -1,82 +0,0 @@
### Template
[Release Template](https://github.com/owncloud/ocis/blob/master/.github/release_template.md)
### Prerequisites
* [ ] DEV/QA: Kickoff meeting [Kickoff meeting] (https://confluence.owncloud.com/display/QA/Technical+release+3.0.0+Overview)
* [ ] DEV/QA: Define client versions and provide list of breaking changes for desktop/mobile team
* [ ] DEV/QA: Check new strings and align with clients
* [ ] DEV/DOCS: Create list of pending docs tasks
* [ ] DEV: Create branch `release-x.x.x-rc.x` -> CODEFREEZE
* [ ] DEV: bump ocis version in necessary files
* [ ] DEV: `changelog/CHANGELOG.tmpl`
* [ ] DEV: `ocis-pkg/version/version.go`
* [ ] DEV: `sonar-project.properties`
* [ ] DEV: prepare changelog folder in `changelog/x.x.x_????_??_??`
* [ ] DEV: Check successful CI run on release branch
* [ ] DEV: Create signed tag `vx.y.z-rc.x`
* [ ] DEV: Check successful CI run on `vx.y.z-rc.x` tag / BLOCKING for all further activity
* [ ] DEV: Merge back release branch
* [ ] DEV: bump released deployments to `vx.y.z-rc.x`
* [ ] DEV: update `ocis.released.owncloud.works`
* [ ] DEV: https://ocis.team.owncloud.works/
* [ ] DEV: needs snapshot and migration
### QA Phase
* [ ] QA: Confirmatory testing (if needed)
* [ ] QA: [Compatibility test](https://github.com/owncloud/QA/blob/master/Server/Test_Plan_OCIS_Compatibility_Test.md)
* [ ] QA: [Performance test](https://github.com/owncloud/cdperf/tree/main/packages/k6-tests/src)
* [ ] QA: Documentation test:
* [ ] QA: Single binary - setup
* [ ] QA: Docker - setup
* [ ] QA: Docker-compose - setup
* [ ] QA: helm/k8s - setup
* [ ] QA: e2e with different deployment:
* [ ] QA: [wopi](ocis.ocis-wopi.released.owncloud.works)
* [ ] QA: [traefik](ocis.ocis-traefik.released.owncloud.works)
* [ ] QA: [ldap](ocis.ocis-ldap.released.owncloud.works)
* [ ] QA: e2e with different storage:
* [ ] QA: local
* [ ] QA: nfs
* [ ] QA: s3
* [ ] QA: Different clients:
* [ ] QA: desktop (define version) https://github.com/owncloud/client/releases
* [ ] QA: against mac - smoke test
* [ ] QA: against windows - smoke test
* [ ] QA: against linux (use auto tests)
* [ ] QA: android (define version) https://github.com/owncloud/android/releases
* [ ] QA: ios (define version)
* [ ] QA: [Web Office Smoke test](https://github.com/owncloud/QA/blob/master/Server/Test_Plan_OCIS_Smoke_Web_Office_Test.md) on Web Office (Collabora, Onlyoffice, Microsoft office)
* [ ] QA: [Smoke test](https://github.com/owncloud/QA/blob/master/Server/Test_Plan_OCIS_Smoke_Test.md) on pre-production server
* [ ] QA: [Smoke test](https://github.com/owncloud/QA/blob/master/Server/Test_Plan_OCIS_Smoke_Ldap_Test.md) ldap
* [ ] QA: Collecting errors found
### After QA Phase
* [ ] Brief company-wide heads up via mail @tbsbdr
* [ ] Create list of changed ENV vars and send to release-coordination@owncloud.com
* [ ] Variable Name
* [ ] Introduced in version
* [ ] Default Value
* [ ] Description
* [ ] dependencies with user other components
* [ ] DEV: Create branch `release-x.x.x`
* [ ] DEV: bump ocis version in necessary files
* [ ] DEV: `ocis-pkg/version/version.go`
* [ ] DEV: `sonar-project.properties`
* [ ] DEV: released deployment versions
* [ ] DEV: prepare changelog folder in `changelog/x.x.x_???`
* [ ] Release Notes + Breaking Changes @tbsbdr
* [ ] Migration + Breaking Changes Admin Doc @mmattel
* [ ] DEV: Create final signed tag
* [ ] DEV: Check successful CI run on `vx.y.z` tag / BLOCKING for all further activity
* [ ] Merge release notes
### Post-release communication
* [ ] DEV: Create a `docs-stable-x.y` branch based on the docs folder in the ocis repo @micbar
* [ ] DEV/QA: Ping documentation in RC about the new release tag (for ocis/helm chart version bump in docs)
* [ ] DEV/QA: Ping marketing to update all download links (download mirrors are updated at the full hour, wait with ping until download is actually available)
* [ ] DEV/QA: Ping @hodyroff once the demo instances are running this release
* [ ] DEV: Merge back release branch
* [ ] DEV: Create stable-x.y branch in the ocis repo from final tag
-88
View File
@@ -1,88 +0,0 @@
---
_extends: gh-labels
repository:
name: ocis
description: ':atom_symbol: ownCloud Infinite Scale Stack'
homepage: 'https://doc.owncloud.com/ocis/next/'
topics: reva, ocis
private: false
has_issues: true
has_projects: true
has_wiki: false
has_downloads: false
default_branch: master
allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: true
labels:
- name: OCIS-Fastlane
color: "#deadbf"
description: Planned outside of the sprint
- name: Storage:EOS
color: "#3F7A62"
- name: Storage:S3NG
color: "#3F7A62"
- name: Storage:CephFS
color: "#3F7A62"
- name: Storage:OCIS
color: "#3F7A62"
- name: Storage:POSIX
color: "#3F7A62"
- name: Storage:ownCloudSQL
color: "#3F7A62"
teams:
- name: ci
permission: admin
- name: employees
permission: push
- name: cern
permission: triage
- name: ocis-contractors
permission: push
branches:
- name: master
protection:
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: false
require_code_owner_reviews: false
required_status_checks:
strict: false
contexts: []
enforce_admins: null
restrictions:
apps: []
users:
- dependabot
teams:
- ci
- employees
- ocis-contractors
- name: stable-*
protection:
required_pull_request_reviews:
required_approving_review_count: 2
dismiss_stale_reviews: false
require_code_owner_reviews: false
required_status_checks:
strict: false
contexts: []
enforce_admins: null
restrictions:
apps: []
users:
- dependabot
teams:
- ci
- employees
- ocis-contractors
...
-21
View File
@@ -1,21 +0,0 @@
only: issues
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 10
# Issues with these labels will never be considered stale
exemptLabels:
- "Type:Bug"
- "Type:Technical-Debt"
- "Category:Enhancement"
- "Category:Research"
- "QA:team"
# Label to use when marking an issue as stale
staleLabel: "Status:Stale"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in 10 days if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
-809
View File
@@ -1,809 +0,0 @@
name: Acceptance Tests
on:
pull_request:
workflow_dispatch:
jobs:
detect-changes:
name: detect-changes
runs-on: ubuntu-latest
outputs:
docs-only: ${{ steps.check.outputs.docs-only }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Check if changes are docs-only
id: check
run: |
# Always run full CI on workflow_dispatch, tags, or when PR title contains [full-ci]
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "docs-only=false" >> "$GITHUB_OUTPUT"
exit 0
fi
PR_TITLE="${{ github.event.pull_request.title }}"
if echo "$PR_TITLE" | grep -qi "\[full-ci\]"; then
echo "docs-only=false" >> "$GITHUB_OUTPUT"
exit 0
fi
# Get changed files between the PR base and head
CHANGED_FILES=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" 2>/dev/null || git diff --name-only HEAD~1)
# Patterns that are considered documentation/non-code changes
DOCS_ONLY=true
while IFS= read -r file; do
case "$file" in
.github/workflows/*) DOCS_ONLY=false; break ;;
.github/*|.vscode/*|changelog/*|docs/*|deployments/*) ;;
*/CHANGELOG.md|*/CONTRIBUTING.md|*/README.md|CHANGELOG.md|CONTRIBUTING.md|LICENSE|README.md) ;;
*) DOCS_ONLY=false; break ;;
esac
done <<< "$CHANGED_FILES"
echo "docs-only=$DOCS_ONLY" >> "$GITHUB_OUTPUT"
echo "Changed files docs-only: $DOCS_ONLY"
build-and-test:
name: build-and-test
needs: [detect-changes]
if: needs.detect-changes.outputs.docs-only != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
- name: Enable pnpm
run: corepack enable && corepack prepare pnpm@10.33.3 --activate
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.4"
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Install libvips-dev for ENABLE_VIPS build
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips-dev
- name: Pre-checks and generate
run: |
# Phase 1 — I/O + light CPU, no contention between tasks.
# wa (I/O wait) will spike during npm/pnpm downloads.
# Expected avg load: ~50-60 % CPU on 2 vCPU.
vmstat 2 > /tmp/vmstat-phase1.log & MONITOR_PID=$!
(make vendor-bin-codestyle && make vendor-bin-codesniffer && make test-php-style && make check-env-var-annotations) > /tmp/php-style.log 2>&1 & PIDS=($!)
(npm install -g @gherlint/gherlint@1.1.0 && make test-gherkin-lint) > /tmp/gherkin.log 2>&1 & PIDS+=($!)
bash tests/acceptance/check-deleted-suites-in-expected-failure.sh > /tmp/suites.log 2>&1 & PIDS+=($!)
make govulncheck > /tmp/govulncheck.log 2>&1 & PIDS+=($!)
make ci-node-generate > /tmp/node-gen.log 2>&1 & PIDS+=($!)
make ci-go-generate > /tmp/go-gen.log 2>&1 & PIDS+=($!)
make changelog-lint > /tmp/changelog-lint.log 2>&1 & PIDS+=($!)
FAILED=0
for PID in "${PIDS[@]}"; do wait "$PID" || FAILED=1; done
kill $MONITOR_PID 2>/dev/null; wait $MONITOR_PID 2>/dev/null || true
# How to read the load line:
# busy — % of time CPUs were doing work (100% = fully saturated)
# runq — processes waiting for a CPU turn; runq >> nCPU means tasks
# compete and each runs slower (runq 10 on 2 vCPU = ~5× slower)
# wa — % waiting on disk/network; wa > 20% = I/O bound, not CPU bound
# → high wa: add more parallel tasks; high runq: reduce them
awk '/^[ ]*[0-9]/ { busy=100-$15; sum_b+=busy; if(busy>pk_b)pk_b=busy;
sum_r+=$1; if($1>pk_r) pk_r=$1; sum_wa+=$16; n++ }
END { printf "=== phase 1 load (2 vCPU): avg busy %d%% peak %d%% | avg runq %.0f peak %d | avg wa %d%%\n",
sum_b/n, pk_b, sum_r/n, pk_r, sum_wa/n }' /tmp/vmstat-phase1.log
echo "=== php-style ===" && cat /tmp/php-style.log
echo "=== gherkin ===" && cat /tmp/gherkin.log
echo "=== suites ===" && cat /tmp/suites.log
echo "=== govulncheck ===" && cat /tmp/govulncheck.log
echo "=== ci-node-generate ===" && cat /tmp/node-gen.log
echo "=== ci-go-generate ===" && cat /tmp/go-gen.log
echo "=== changelog-lint ===" && cat /tmp/changelog-lint.log
exit $FAILED
- name: Trivy scan
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
with:
scan-type: fs
format: table
exit-code: 1
severity: CRITICAL,HIGH
trivy-config: .trivy.yaml
- name: Build, lint and test
run: |
# Phase 2 — all three are CPU-bound Go compilation on 2 vCPU.
# They compete for CPU (expect id < 10, load ~95 %) but share the
# Go build cache within this runner, so make test reuses artifacts
# from the ocis build. Critical path = ocis build (~300 s).
vmstat 2 > /tmp/vmstat-phase2.log & MONITOR_PID=$!
make ci-golangci-lint > /tmp/golangci-lint.log 2>&1 & PIDS=($!)
ENABLE_VIPS=true make -C ocis build > /tmp/ocis-build.log 2>&1 & PIDS+=($!)
make test > /tmp/unit-tests.log 2>&1 & PIDS+=($!)
GOWORK=off make -C tests/ociswrapper build > /tmp/ociswrapper-build.log 2>&1 & PIDS+=($!)
FAILED=0
for PID in "${PIDS[@]}"; do wait "$PID" || FAILED=1; done
kill $MONITOR_PID 2>/dev/null; wait $MONITOR_PID 2>/dev/null || true
# Signal: busy=saturated runq>>2=tasks competing(slows each) wa>20%=I/O bound
awk '/^[ ]*[0-9]/ { busy=100-$15; sum_b+=busy; if(busy>pk_b)pk_b=busy;
sum_r+=$1; if($1>pk_r) pk_r=$1; sum_wa+=$16; n++ }
END { printf "=== phase 2 load (2 vCPU): avg busy %d%% peak %d%% | avg runq %.0f peak %d | avg wa %d%%\n",
sum_b/n, pk_b, sum_r/n, pk_r, sum_wa/n }' /tmp/vmstat-phase2.log
echo "=== golangci-lint ===" && cat /tmp/golangci-lint.log
echo "=== ocis build ===" && cat /tmp/ocis-build.log
echo "=== ociswrapper build ===" && cat /tmp/ociswrapper-build.log
echo "=== unit tests ===" && cat /tmp/unit-tests.log
exit $FAILED
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ocis-build-artifacts
path: |
ocis/bin/ocis
tests/ociswrapper/bin/ociswrapper
retention-days: 1
if-no-files-found: error
local-api-tests:
name: ${{ matrix.suite }}
needs: [build-and-test]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
# contract & locks
- apiContract
- apiLocks
# settings & notifications (needs email)
- apiSettings
- apiNotification
- apiCors
# graph
- apiGraphUser
- apiGraph
- apiGraphGroup
# spaces & dav
- apiSpaces
- apiSpacesShares
- apiSpacesDavOperation
- apiDownloads
- apiAsyncUpload
- apiDepthInfinity
- apiArchiver
- apiActivities
# search
- apiSearch1
- apiSearch2
- apiSearchContent # needs Tika
# sharing
- apiSharingNgShares
- apiReshare
- apiSharingNgPermissions
- apiSharingNgAdditionalShareRole
- apiSharingNgDriveInvitation
- apiSharingNgItemInvitation
- apiSharingNgDriveLinkShare
- apiSharingNgItemLinkShare
- apiSharingNgLinkShareManagement
# auth
- apiAuthApp
# antivirus (needs ClamAV)
- apiAntivirus
# federation (needs email + federation ocis)
- apiOcm
# collaboration (needs WOPI)
- apiCollaboration
- apiVault
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.4"
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Cache libcurl 8.12.0
id: cache-libcurl
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /opt/libcurl
key: libcurl-8.12.0-${{ runner.os }}
- name: Install libcurl 8.12.0 build dependencies
# Always run: libvips-dev is needed at runtime (govips thumbnails in the pre-built binary)
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libssl-dev libnghttp2-dev libpsl-dev libldap-dev libssh-dev zlib1g-dev libvips-dev
- name: Compile libcurl 8.12.0 from source
if: steps.cache-libcurl.outputs.cache-hit != 'true'
run: |
cd /tmp
curl -sLO https://curl.se/download/curl-8.12.0.tar.gz
tar xzf curl-8.12.0.tar.gz
cd curl-8.12.0
./configure --with-ssl --with-zlib --with-nghttp2 --prefix=/opt/libcurl --enable-versioned-symbols --silent
make -j$(nproc) --silent
sudo make install --silent
- name: Restore libcurl ldconfig
# Always run: on cache hit the .so files are restored to /opt/libcurl/lib but
# /etc/ld.so.cache on the fresh runner doesn't know about them yet.
# Without ldconfig, PHP's curl extension can't find libcurl even though it's present.
run: |
echo "/opt/libcurl/lib" | sudo tee /etc/ld.so.conf.d/libcurl-8.conf
sudo ldconfig
/opt/libcurl/bin/curl --version | head -1
php -r '
$v = curl_version()["version"];
echo "PHP curl: $v\n";
if (version_compare($v, "8.12.0", "<")) {
fwrite(STDERR, "FATAL: PHP sees libcurl $v, need >= 8.12.0\n");
exit(1);
}
'
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper
- name: Run ${{ matrix.suite }}
run: BEHAT_SUITES=${{ matrix.suite }} python3 tests/acceptance/run-github.py
cli-tests:
needs: [build-and-test]
name: ${{ matrix.suite }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- cliCommands,apiServiceAvailability # grouped: both need ClamAV + email services
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.4"
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper
- name: Run ${{ matrix.suite }}
run: BEHAT_SUITES="${{ matrix.suite }}" python3 tests/acceptance/run-github.py
ldap-pool-tests:
needs: [build-and-test]
name: ldapPool-${{ matrix.suite }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- apiGraphUser,apiGraph,apiGraphGroup
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.4"
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper
- name: Run ${{ matrix.suite }} with OCIS_LDAP_POOL_ENABLED=true
run: BEHAT_SUITES="${{ matrix.suite }}" OCIS_LDAP_POOL_ENABLED=true python3 tests/acceptance/run-github.py
core-api-tests:
name: ${{ matrix.suite }}
needs: [build-and-test]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- "coreApiAuth,coreApiCapabilities,coreApiFavorites,coreApiMain,coreApiVersions"
- "coreApiShareManagementBasicToShares,coreApiShareManagementToShares"
- "coreApiSharees"
- "coreApiSharePublicLink2"
- "coreApiShareOperationsToShares1,coreApiShareOperationsToShares2,coreApiSharePublicLink1,coreApiShareCreateSpecialToShares1,coreApiShareCreateSpecialToShares2,coreApiShareUpdateToShares"
- "coreApiTrashbin,coreApiTrashbinRestore,coreApiWebdavEtagPropagation1,coreApiWebdavEtagPropagation2"
- "coreApiWebdavDelete,coreApiWebdavOperations,coreApiWebdavMove2"
- "coreApiWebdavProperties"
- "coreApiWebdavMove1,coreApiWebdavPreviews,coreApiWebdavUpload,coreApiWebdavUploadTUS"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.4"
extensions: curl, xml, mbstring, zip, ldap, gd
tools: composer
- name: Cache libcurl 8.12.0
id: cache-libcurl
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /opt/libcurl
key: libcurl-8.12.0-${{ runner.os }}
- name: Install libcurl 8.12.0 build dependencies
# Always run: libvips-dev is needed at runtime (govips thumbnails in the pre-built binary)
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libssl-dev libnghttp2-dev libpsl-dev libldap-dev libssh-dev zlib1g-dev libvips-dev
- name: Compile libcurl 8.12.0 from source
if: steps.cache-libcurl.outputs.cache-hit != 'true'
run: |
cd /tmp
curl -sLO https://curl.se/download/curl-8.12.0.tar.gz
tar xzf curl-8.12.0.tar.gz
cd curl-8.12.0
./configure --with-ssl --with-zlib --with-nghttp2 --prefix=/opt/libcurl --enable-versioned-symbols --silent
make -j$(nproc) --silent
sudo make install --silent
- name: Restore libcurl ldconfig
# Always run: on cache hit the .so files are restored to /opt/libcurl/lib but
# /etc/ld.so.cache on the fresh runner doesn't know about them yet.
# Without ldconfig, PHP's curl extension can't find libcurl even though it's present.
run: |
echo "/opt/libcurl/lib" | sudo tee /etc/ld.so.conf.d/libcurl-8.conf
sudo ldconfig
/opt/libcurl/bin/curl --version | head -1
php -r '
$v = curl_version()["version"];
echo "PHP curl: $v\n";
if (version_compare($v, "8.12.0", "<")) {
fwrite(STDERR, "FATAL: PHP sees libcurl $v, need >= 8.12.0\n");
exit(1);
}
'
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper
- name: Run ${{ matrix.suite }}
run: >
BEHAT_SUITES="${{ matrix.suite }}"
ACCEPTANCE_TEST_TYPE=core-api
WITH_REMOTE_PHP=true
python3 tests/acceptance/run-github.py
e2e-tests:
name: e2e-${{ matrix.suite }}
needs: [build-and-test]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- suite: part-1
args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc --run-part 1"
- suite: part-2
args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc --run-part 2"
- suite: part-3
args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc --run-part 3"
- suite: part-4
args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc --run-part 4"
- suite: search
args: "--type playwright --suites search"
tika: true
- suite: keycloak
args: "--type playwright --suites journeys,keycloak"
keycloak: true
- suite: mfa
args: "--type playwright --suites mfa"
mfa: true
- suite: oidc
args: "--type playwright specs/oidc/refreshToken.spec.ts"
oidc: true
- suite: oidc-iframe
args: "--type playwright specs/oidc/iframeTokenRenewal.spec.ts"
oidc_iframe: true
- suite: app-provider
args: "--type playwright --suites app-provider"
collaboration: true
- suite: ocm
args: "--type playwright --suites ocm"
federated: true
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
# 24.16.0 breaks playwright install (yauzl zip extraction hangs); pin to last known good.
# https://github.com/microsoft/playwright/issues/40724
node-version: "24.15.0"
- name: Enable pnpm
run: |
corepack enable && corepack prepare pnpm@10.33.3 --activate
pnpm config set store-dir ./.pnpm-store
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper
- name: Cache Playwright Chromium
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-${{ hashFiles('web/pnpm-lock.yaml') }}
# --- Tika (search suite only) ---
- name: Start Tika
if: matrix.tika == true
run: |
docker run -d --name tika --network host apache/tika:3.2.2.0-full
timeout 120 bash -c 'until curl -sf http://localhost:9998; do sleep 2; done'
echo "tika ready."
# --- Keycloak (keycloak and mfa suites) ---
- name: Generate Keycloak certs
if: matrix.keycloak == true || matrix.mfa == true
run: |
mkdir -p keycloak-certs
openssl req -x509 -newkey rsa:2048 \
-keyout keycloak-certs/keycloakkey.pem \
-out keycloak-certs/keycloakcrt.pem \
-nodes -days 365 -subj '/CN=keycloak' \
-addext 'subjectAltName=DNS:localhost,IP:127.0.0.1'
chmod -R 777 keycloak-certs
- name: Start Postgres
if: matrix.keycloak == true || matrix.mfa == true
run: |
docker run -d --name postgres --network host \
-e POSTGRES_DB=keycloak \
-e POSTGRES_USER=keycloak \
-e POSTGRES_PASSWORD=keycloak \
postgres:alpine3.18
timeout 30 bash -c 'until docker exec postgres pg_isready -U keycloak; do sleep 1; done'
- name: Start Keycloak
if: matrix.keycloak == true || matrix.mfa == true
run: |
# The mfa suite needs a different realm with TOTP MFA configured.
# ocis-ci-realm uses ocis-server:9200, ocis-mfa-ci-realm uses localhost:9200;
# ocis runs on 127.0.0.1:9200 so we rewrite both forms.
if [[ "${{ matrix.mfa }}" == "true" ]]; then
REALM_FILE=tests/config/ci/ocis-mfa-ci-realm.dist.json
else
REALM_FILE=tests/config/ci/ocis-ci-realm.dist.json
fi
sed -e 's|https://ocis-server:9200|https://127.0.0.1:9200|g' \
-e 's|https://localhost:9200|https://127.0.0.1:9200|g' \
"$REALM_FILE" > /tmp/ocis-realm.json
docker run -d --name keycloak --network host \
-e OCIS_DOMAIN=https://127.0.0.1:9200 \
-e KC_HOSTNAME=localhost \
-e KC_PORT=8443 \
-e KC_DB=postgres \
-e "KC_DB_URL=jdbc:postgresql://localhost:5432/keycloak" \
-e KC_DB_USERNAME=keycloak \
-e KC_DB_PASSWORD=keycloak \
-e KC_FEATURES=impersonation \
-e KC_BOOTSTRAP_ADMIN_USERNAME=admin \
-e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
-e KC_HTTPS_CERTIFICATE_FILE=/keycloak-certs/keycloakcrt.pem \
-e KC_HTTPS_CERTIFICATE_KEY_FILE=/keycloak-certs/keycloakkey.pem \
-v "$(pwd)/keycloak-certs:/keycloak-certs:ro" \
-v "/tmp/ocis-realm.json:/opt/keycloak/data/import/oCIS-realm.json:ro" \
quay.io/keycloak/keycloak:26.2.5 \
start-dev --proxy-headers xforwarded \
--spi-connections-http-client-default-disable-trust-manager=true \
--import-realm --health-enabled=true
timeout 300 bash -c 'until curl -skf https://localhost:9000/health/ready; do sleep 3; done' \
|| (echo "=== keycloak logs ===" && docker logs keycloak --tail 80 && exit 1)
echo "keycloak ready."
# --- Collabora + OnlyOffice (app-provider suite only) ---
- name: Start Collabora
if: matrix.collaboration == true
run: |
docker run -d \
--name collabora \
--network host \
--entrypoint bash \
-e DONT_GEN_SSL_CERT=set \
-e "extra_params=--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=https://127.0.0.1:9200" \
collabora/code:25.04.7.3.1 \
-c "coolconfig generate-proof-key && bash /start-collabora-online.sh"
timeout 150 bash -c 'until curl -kfsSL https://localhost:9980/hosting/discovery > /dev/null; do sleep 5; done'
echo "collabora ready."
- name: Start OnlyOffice
if: matrix.collaboration == true
run: |
sudo systemctl stop postgresql || true
docker run -d \
--name onlyoffice \
--network host \
-e WOPI_ENABLED=true \
-e USE_UNAUTHORIZED_STORAGE=true \
-v "${{ github.workspace }}/tests/config/ci/only-office.json:/tmp/local.json:ro" \
--entrypoint /bin/sh \
onlyoffice/documentserver:9.2.1 \
-c "set -e
cp /tmp/local.json /etc/onlyoffice/documentserver/local.json
openssl req -x509 -newkey rsa:4096 -keyout onlyoffice.key -out onlyoffice.crt -sha256 -days 365 -batch -nodes
mkdir -p /var/www/onlyoffice/Data/certs
cp onlyoffice.key /var/www/onlyoffice/Data/certs/
cp onlyoffice.crt /var/www/onlyoffice/Data/certs/
chmod 400 /var/www/onlyoffice/Data/certs/onlyoffice.key
/app/ds/run-document-server.sh"
timeout 150 bash -c 'until curl -kfsSL https://localhost:443/hosting/discovery > /dev/null; do sleep 5; done'
echo "onlyoffice ready."
- name: Run e2e-${{ matrix.suite }}
run: E2E_ARGS="${{ matrix.args }}" python3 tests/acceptance/run-e2e.py
env:
TIKA_NEEDED: ${{ matrix.tika == true && 'true' || 'false' }}
KEYCLOAK_NEEDED: ${{ matrix.keycloak == true && 'true' || 'false' }}
MFA_NEEDED: ${{ matrix.mfa == true && 'true' || 'false' }}
OIDC_NEEDED: ${{ matrix.oidc == true && 'true' || 'false' }}
OIDC_IFRAME_NEEDED: ${{ matrix.oidc_iframe == true && 'true' || 'false' }}
COLLABORATION_NEEDED: ${{ matrix.collaboration == true && 'true' || 'false' }}
FEDERATED_NEEDED: ${{ matrix.federated == true && 'true' || 'false' }}
- name: Upload tracing result
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: playwright-traces-${{ matrix.suite }}-${{ github.run_attempt }}
path: web/reports/e2e
retention-days: 7
- name: Upload a11y result
if: ${{ !cancelled() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: playwright-a11y-result-${{ matrix.suite }}-${{ github.run_attempt }}
path: web/reports/e2e/a11y-report.json
retention-days: 7
litmus:
name: litmus
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis
- name: Run litmus
run: python3 tests/acceptance/run-litmus.py
cs3api:
name: cs3api
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis
- name: Run cs3api validator
run: python3 tests/acceptance/run-cs3api.py
wopi-builtin:
name: wopi-builtin
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis
- name: Run WOPI validator (builtin)
run: python3 tests/acceptance/run-wopi.py --type builtin
wopi-cs3:
name: wopi-cs3
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install libvips runtime
run: |
sudo apt-get update -qq
# NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ocis-build-artifacts
- name: Restore binary permissions
run: chmod +x ocis/bin/ocis
- name: Run WOPI validator (cs3)
run: python3 tests/acceptance/run-wopi.py --type cs3
external-ldap-tests:
name: external-ldap-smoke
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
- name: Enable pnpm
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
# web/idp assets must be embedded for `ocis server` to come up (same as run-github.py)
- name: Generate assets
run: make ci-node-generate
- name: Build oCIS
run: make -C ocis build
# Boots an external osixia LDAP + oCIS (embedded idm excluded) and runs the
# smoke scope against the graph API — exercises the external-directory
# read-after-write / retry path (OCISDEV-1030/1032/1033) that the embedded-idm
# acceptance jobs never hit.
- name: Run external-LDAP smoke
run: tests/ldap-smoke/run.sh
external-ldap-distributed-tests:
name: external-ldap-distributed-smoke
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
- name: Enable pnpm
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
# web/idp assets must be embedded for `ocis server` to come up (same as run-github.py)
- name: Generate assets
run: make ci-node-generate
- name: Build oCIS
run: make -C ocis build
# Distributed LDAP topology (proxy over an async syncrepl replica + write master);
# the replication lag exercises the retry / read-after-write path (OCISDEV-1030/1032/1033).
- name: Run external-LDAP distributed smoke
run: tests/ldap-smoke-distributed/run.sh
all-acceptance-tests:
needs: [detect-changes, local-api-tests, cli-tests, ldap-pool-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests, external-ldap-tests, external-ldap-distributed-tests]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check all jobs passed
run: |
# If docs-only, all test jobs are expected to be skipped — that's a pass
if [[ "${{ needs.detect-changes.outputs.docs-only }}" == "true" ]]; then
echo "Docs-only change — skipping tests is expected."
exit 0
fi
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
exit 1
fi
-18
View File
@@ -1,18 +0,0 @@
name: Check licenses
on:
pull_request:
push:
branches: [master, stable-*]
jobs:
license-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install REUSE tool
run: pip install reuse
- name: Run REUSE lint
run: reuse lint
-12
View File
@@ -1,12 +0,0 @@
name: Validate commit message
on:
pull_request:
branches: [master, stable-*]
permissions:
contents: read
jobs:
validate:
uses: owncloud/reusable-workflows/.github/workflows/semantic-git-message.yml@main
-79
View File
@@ -1,79 +0,0 @@
name: test deployment example
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # every day at 00:00 UTC
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- example: ocis_full
urls: "https://ocis.owncloud.test"
- example: ocis_ldap
urls: "https://ocis.owncloud.test https://ldap.owncloud.test"
- example: ocis_multi
urls: "https://ocis.owncloud.test https://ocis.ocm.owncloud.test"
- example: ocis_ocm
urls: "https://ocis.owncloud.test https://ocis.ocm.owncloud.test https://ocis.ocm.next.owncloud.test"
- example: ocis_keycloak
urls: "https://ocis.owncloud.test https://keycloak.owncloud.test"
steps:
- name: Checkout ocis repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: owncloud/ocis
- name: Set up Docker Compose
uses: docker/setup-compose-action@16feee727cbdc83b6a014e6cc26fec4a79bcf30c # v2.2.0
- name: Prepare hosts entry
run: |
echo "127.0.0.1 ocis.owncloud.test collabora.owncloud.test keycloak.owncloud.test mail.owncloud.test minio.owncloud.test onlyoffice.owncloud.test tika ldap.owncloud.test ocis.ocm.owncloud.test ocis.ocm.next.owncloud.test onlyoffice.owncloud.test" | sudo tee -a /etc/hosts
- name: Run compose stack
working-directory: deployments/examples/${{ matrix.example }}
run: |
set -e
echo "=== Running ${{ matrix.example }} ==="
docker compose up -d
- name: Wait for services
run: |
set -e
URLS="${{ matrix.urls }}"
for url in $URLS; do
echo "=== Waiting for $url ==="
end=$((SECONDS+150))
ready=false
while [ $SECONDS -lt $end ]; do
echo "Trying $url"
if curl -kfsS --max-time 5 "$url" > /dev/null; then
echo "✅ $url is ready"
ready=true
break
fi
echo "⏳ Not ready yet, retrying in 5s..."
sleep 5
done
if [ "$ready" = false ]; then
echo "❌ $url never became ready"
exit 1
fi
done
- name: Tear down
if: always()
working-directory: deployments/examples/${{ matrix.example }}
run: docker compose down -v
-54
View File
@@ -1,54 +0,0 @@
name: k6 Load Test
on:
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: k6-load-test-server
cancel-in-progress: false
jobs:
k6-load-test:
name: k6-load-test
runs-on: ubuntu-latest
container:
image: owncloudci/alpine:latest
if: >-
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.title || '', 'k6-test'))
env:
SSH_OCIS_REMOTE: ${{ secrets.SSH_OCIS_REMOTE }}
SSH_OCIS_USERNAME: ${{ secrets.SSH_OCIS_USERNAME }}
SSH_OCIS_PASSWORD: ${{ secrets.SSH_OCIS_PASSWORD }}
TEST_SERVER_URL: ${{ secrets.TEST_SERVER_URL }}
SSH_K6_REMOTE: ${{ secrets.SSH_K6_REMOTE }}
SSH_K6_USERNAME: ${{ secrets.SSH_K6_USERNAME }}
SSH_K6_PASSWORD: ${{ secrets.SSH_K6_PASSWORD }}
OCIS_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install SSH dependencies
run: apk add --no-cache openssh-client sshpass
- name: Run k6 load tests
if: ${{ !cancelled() }}
run: sh tests/config/drone/run_k6_tests.sh
- name: Retrieve OCIS logs
if: ${{ !cancelled() }}
run: sh tests/config/drone/run_k6_tests.sh --ocis-log
- name: Show Grafana dashboard link
if: ${{ !cancelled() }}
run: |
echo "Grafana Dashboard: https://grafana.k6.infra.owncloud.works"
@@ -1,84 +0,0 @@
name: Release NPM packages
on:
push:
tags:
- "babel-preset-v*"
- "design-system-v*"
- "eslint-config-v*"
- "extension-sdk-v*"
- "prettier-config-v*"
- "tsconfig-v*"
- "web-client-v*"
- "web-pkg-v*"
- "web-test-helpers-v*"
jobs:
release-npm:
name: Publish NPM package
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: web
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.15.0
registry-url: "https://registry.npmjs.org"
- name: Setup pnpm
run: corepack enable && corepack prepare pnpm@10.33.3 --activate
- name: Install dependencies
run: pnpm install
- name: Determine package
id: package
run: |
TAG="${{ github.ref_name }}"
PACKAGES="babel-preset design-system eslint-config extension-sdk prettier-config tsconfig web-client web-pkg web-test-helpers"
for pkg in $PACKAGES; do
if [[ "$TAG" == "${pkg}-v"* ]]; then
echo "name=$pkg" >> "$GITHUB_OUTPUT"
echo "version=${TAG#${pkg}-v}" >> "$GITHUB_OUTPUT"
exit 0
fi
done
echo "tag '$TAG' does not match any known package prefix: $PACKAGES"
exit 1
- name: Verify package version
run: |
PKG="${{ steps.package.outputs.name }}"
VERSION="${{ steps.package.outputs.version }}"
ACTUAL_VERSION=$(jq -r '.version' < "packages/${PKG}/package.json")
echo "Build ${PKG} ${VERSION} package.json: ${ACTUAL_VERSION}"
if [ "${ACTUAL_VERSION}" != "${VERSION}" ]; then
echo "git tag does not match version in web/packages/${PKG}/package.json"
exit 1
fi
- name: Build tokens
run: pnpm build:tokens
- name: Build package
run: |
PKG="${{ steps.package.outputs.name }}"
case "$PKG" in
design-system|web-client|web-pkg|web-test-helpers)
pnpm --filter "@ownclouders/${PKG}" vite build
;;
esac
- name: Publish to NPM
run: |
pnpm publish \
--no-git-checks --filter "@ownclouders/${{ steps.package.outputs.name }}" \
--access public --tag latest
-415
View File
@@ -1,415 +0,0 @@
name: Release
on:
push:
tags:
- 'v*'
branches:
- 'feat/release-pipeline**'
workflow_dispatch:
inputs:
version_override:
description: 'Version override (leave empty to auto-detect from latest tag)'
type: string
default: ''
env:
PRODUCTION_RELEASE_TAGS: '5.0,7,8'
DOCKER_REPO_ROLLING: owncloud/ocis-rolling
DOCKER_REPO_PRODUCTION: owncloud/ocis
NODE_VERSION: '24'
PNPM_VERSION: '10.28.1'
jobs:
determine-release-type:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.info.outputs.version }}
is_production: ${{ steps.info.outputs.is_production }}
is_prerelease: ${{ steps.info.outputs.is_prerelease }}
docker_repos: ${{ steps.info.outputs.docker_repos }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
if: ${{ github.ref_type == 'branch' || (github.event_name == 'workflow_dispatch' && inputs.version_override == '') }}
with:
fetch-depth: 0
fetch-tags: true
- id: info
run: |
next_dev() {
# If latest tag is already a pre-release (e.g. v8.0.2-dev.1), reuse its base
# version (8.0.2-dev.1) so repeated branch runs don't bump the patch counter.
# If latest tag is a production release (e.g. v8.0.1), increment patch (8.0.2-dev.1).
local tag=$(git tag --sort=-version:refname | grep -m1 '^v' || echo "v0.0.0")
local ver="${tag#v}"
if [[ "$ver" == *"-"* ]]; then
echo "${ver%%-*}-dev.1"
else
IFS='.' read -r M m p <<< "$ver"
echo "${M}.${m}.$((p + 1))-dev.1"
fi
}
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
VERSION="${{ inputs.version_override }}"
[[ -z "$VERSION" ]] && VERSION=$(next_dev)
elif [[ "${{ github.ref_type }}" == "branch" ]]; then
VERSION=$(next_dev)
else
VERSION="${GITHUB_REF#refs/tags/v}"
fi
IS_PRODUCTION=false
for TAG in ${PRODUCTION_RELEASE_TAGS//,/ }; do
[[ "$VERSION" == "$TAG"* ]] && IS_PRODUCTION=true && break
done
[[ "$VERSION" == *"-"* ]] && IS_PRERELEASE=true || IS_PRERELEASE=false
if [[ "$IS_PRODUCTION" == "true" && "$IS_PRERELEASE" == "false" ]]; then
REPOS=[\"$DOCKER_REPO_ROLLING\",\"$DOCKER_REPO_PRODUCTION\"]
else
REPOS=[\"$DOCKER_REPO_ROLLING\"]
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "is_production=$IS_PRODUCTION" >> $GITHUB_OUTPUT
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
echo "docker_repos=$REPOS" >> $GITHUB_OUTPUT
generate-code:
runs-on: ubuntu-latest
needs: [determine-release-type]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install --silent -g yarn npx --force
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v4
with:
version: ${{ env.PNPM_VERSION }}
- run: pnpm config set store-dir ./.pnpm-store && make ci-node-generate
env:
CHROMEDRIVER_SKIP_DOWNLOAD: 'true'
- run: make ci-go-generate
env:
BUF_TOKEN: ${{ secrets.BUF_API_TOKEN }}
- name: bump LatestTag
run: |
VERSION="${{ needs.determine-release-type.outputs.version }}"
sed -i "s/LatestTag = \".*\"/LatestTag = \"$VERSION\"/" ocis-pkg/version/version.go
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: generated-code
path: |
.
!.git
!web
retention-days: 1
docker-build:
if: false
name: docker-build (${{ matrix.arch }}, ${{ matrix.repo }})
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
needs: [determine-release-type, generate-code, security-scan-trivy]
strategy:
matrix:
arch: [amd64, arm64]
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: generated-code
path: .
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: goversion
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- run: |
ALPINE_VERSION=$(grep '^FROM.*alpine:' ocis/docker/Dockerfile.linux.${{ matrix.arch }} | grep -o 'alpine:[0-9.]*' | cut -d: -f2 | cut -d. -f1,2)
docker run --rm \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
"golang:${{ steps.goversion.outputs.go-version }}-alpine${ALPINE_VERSION}" \
sh -c "apk add --no-cache bash gcc musl-dev vips-dev make git && \
git config --global --add safe.directory /workspace && \
CGO_ENABLED=1 ENABLE_VIPS=true VERSION=${{ needs.determine-release-type.outputs.version }} \
make -C ocis release-linux-docker-${{ matrix.arch }}"
- id: tags
run: |
VERSION="${{ needs.determine-release-type.outputs.version }}"
REPO="${{ matrix.repo }}"
ARCH="${{ matrix.arch }}"
printf "tags<<EOF\n%s\nEOF\n" \
"${REPO}:${VERSION}-linux-${ARCH}" >> $GITHUB_OUTPUT
- id: build
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: ocis
file: ocis/docker/Dockerfile.linux.${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
load: true
push: false
provenance: false
build-args: |
REVISION=${{ github.sha }}
VERSION=${{ needs.determine-release-type.outputs.version }}
tags: ${{ steps.tags.outputs.tags }}
- id: trivy
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
continue-on-error: true
with:
image-ref: ${{ steps.tags.outputs.tags }}
format: table
exit-code: 1
severity: HIGH,CRITICAL
ignore-unfixed: true
skip-files: /usr/bin/gomplate,/usr/bin/wait-for
hide-progress: true
env:
TRIVY_IGNOREFILE: .trivyignore
- name: Block on vulnerabilities
if: steps.trivy.outcome == 'failure'
run: |
echo "::error title=Security scan blocked release::Image ${{ steps.tags.outputs.tags }} has HIGH or CRITICAL vulnerabilities (see Trivy report above). Fix all findings before releasing."
exit 1
- name: push
if: steps.trivy.outcome == 'success'
run: docker push ${{ steps.tags.outputs.tags }}
docker-scan:
name: docker-scan (${{ matrix.arch }}, ${{ matrix.repo }})
runs-on: ubuntu-latest
needs: [determine-release-type, docker-build]
strategy:
matrix:
arch: [amd64]
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
id: trivy
continue-on-error: true
with:
image-ref: ${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-${{ matrix.arch }}
format: table
exit-code: 1
severity: HIGH,CRITICAL
ignore-unfixed: true
skip-files: /usr/bin/gomplate,/usr/bin/wait-for
hide-progress: true
env:
TRIVY_IGNOREFILE: .trivyignore
- name: Block on vulnerabilities
if: steps.trivy.outcome == 'failure'
run: |
echo "::error title=Security scan blocked release::Image ${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-${{ matrix.arch }} has HIGH or CRITICAL vulnerabilities (see Trivy report above). Fix all findings before releasing."
exit 1
docker-manifest:
if: false
name: docker-manifest (${{ matrix.repo }})
runs-on: ubuntu-latest
needs: [determine-release-type, docker-build, docker-scan]
strategy:
matrix:
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- if: ${{ contains(matrix.repo, 'rolling') }}
run: |
docker buildx imagetools create \
-t "${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}" \
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-amd64" \
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-arm64"
- if: ${{ !contains(matrix.repo, 'rolling') }}
run: |
docker buildx imagetools create \
-t "${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}" \
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-amd64" \
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-arm64"
docker-readme:
if: false
name: docker-readme (${{ matrix.repo }})
runs-on: ubuntu-latest
needs: [determine-release-type, docker-manifest]
strategy:
matrix:
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ matrix.repo }}
readme-filepath: ocis/README.md
build-binaries:
name: build-binaries (${{ matrix.os }})
runs-on: ubuntu-latest
needs: [determine-release-type, generate-code]
strategy:
matrix:
os: [linux, darwin]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: generated-code
path: .
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- run: |
make -C ocis release-${{ matrix.os }} OUTPUT=${{ needs.determine-release-type.outputs.version }}
make -C ocis release-finish
if [[ "${{ matrix.os }}" == "linux" ]]; then
cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/
fi
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: binaries-${{ matrix.os }}
path: ocis/dist/release/*
retention-days: 1
security-scan-trivy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
with:
scan-type: fs
format: table
exit-code: 1
severity: CRITICAL,HIGH
trivy-config: .trivy.yaml
license-check:
runs-on: ubuntu-latest
needs: [determine-release-type, generate-code]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: generated-code
path: .
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- run: npm install --silent -g yarn npx "pnpm@$PNPM_VERSION" --force
# web is excluded from the generated-code artifact (see generate-code) to
# avoid OOM on upload, so its node_modules — which provides the
# license-checker-rseidelsohn binary — must be reinstalled here.
- run: cd web && pnpm install
- run: make ci-node-check-licenses && make ci-node-save-licenses
- run: make ci-go-check-licenses && make ci-go-save-licenses
- run: tar -czf third-party-licenses.tar.gz -C third-party-licenses .
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: third-party-licenses
path: third-party-licenses.tar.gz
retention-days: 1
generate-changelog:
runs-on: ubuntu-latest
needs: [determine-release-type]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- run: |
make changelog CHANGELOG_VERSION=$(echo "${{ needs.determine-release-type.outputs.version }}" | cut -d'-' -f1)
# calens produces empty output when no versioned changelog directory exists (e.g. dev builds).
# Fall back to a pointer to the unreleased entries.
if [[ $(wc -l < ocis/dist/CHANGELOG.md) -lt 5 ]]; then
echo "Development release — no release notes yet. See [unreleased changes](https://github.com/owncloud/ocis/tree/master/changelog/unreleased/)." > ocis/dist/CHANGELOG.md
fi
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: changelog
path: ocis/dist/CHANGELOG.md
retention-days: 1
create-github-release:
runs-on: ubuntu-latest
needs: [determine-release-type, build-binaries, license-check, generate-changelog, security-scan-trivy]
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: binaries-linux
path: release-assets
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: binaries-darwin
path: release-assets
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: third-party-licenses
path: release-assets
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: changelog
path: .
- uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
with:
tag_name: v${{ needs.determine-release-type.outputs.version }}
name: v${{ needs.determine-release-type.outputs.version }}
body_path: CHANGELOG.md
prerelease: ${{ needs.determine-release-type.outputs.is_prerelease == 'true' }}
files: release-assets/*
audit-release:
runs-on: ubuntu-latest
needs:
- determine-release-type
- generate-code
- build-binaries
- security-scan-trivy
- license-check
- generate-changelog
- create-github-release
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: binaries-linux
path: release-assets
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: binaries-darwin
path: release-assets
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: third-party-licenses
path: release-assets
- run: |
python3 scripts/audit-release.py \
--version "${{ needs.determine-release-type.outputs.version }}" \
--dir release-assets/ \
--github-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,28 +0,0 @@
name: Remove stale branches
on:
workflow_dispatch:
inputs:
dry-run:
description: 'Run in dry-run mode (no actual branch deletion)'
required: true
default: 'false'
type: boolean
schedule:
- cron: "0 0 * * *" # Everday at midnight
permissions:
contents: write
jobs:
remove-stale-branches:
name: Remove Stale Branches
runs-on: ubuntu-latest
steps:
- uses: fpicalausa/remove-stale-branches@9b829bc2975ade0c61e64e9613def53ec0732440 # v2.6.1
with:
ignore-unknown-authors: true
default-recipient: "kobergj"
dry-run: ${{ inputs.dry-run || 'false' }} # fallback to dry-run
exempt-branches-regex: "^(main$|master$|stable-|release-|docs$|docs-stable-)"
exempt-protected-branches: true
operations-per-run: 30
-41
View File
@@ -1,41 +0,0 @@
name: Translation Sync
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
sync:
uses: owncloud/reusable-workflows/.github/workflows/translation-sync.yml@main
with:
mode: make
reviewers: kobergj,mmattel # individual users
# team_reviewers: owncloud/ocis-team # and/or a GitHub team slug if exists
sub_path: .
secrets:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
TRANSLATION_APP_ID: ${{ secrets.TRANSLATION_APP_ID }}
TRANSLATION_APP_PRIVATE_KEY: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }}
# web/ is a pnpm workspace nested inside the repo, not covered by the
# root-level L10N_MODULES/sub_path: . sync above (that job has no
# package.json at the repo root, so a pnpm install there would be a
# no-op/fail). Run it as its own invocation scoped to sub_path: web,
# sequenced after `sync` since the reusable workflow always pushes to
# the same hardcoded chore/translations-update branch.
sync-web:
needs: sync
uses: owncloud/reusable-workflows/.github/workflows/translation-sync.yml@main
with:
mode: make
package_manager: pnpm
reviewers: kobergj,mmattel
sub_path: web
secrets:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
TRANSLATION_APP_ID: ${{ secrets.TRANSLATION_APP_ID }}
TRANSLATION_APP_PRIVATE_KEY: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }}
-105
View File
@@ -1,105 +0,0 @@
name: Web Tests
on:
pull_request:
push:
branches: [master, stable-*]
jobs:
detect-web-changes:
name: detect-web-changes
runs-on: ubuntu-latest
outputs:
web-changed: ${{ steps.check.outputs.web-changed }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Check if web/ changed
id: check
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "web-changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
PR_TITLE="${{ github.event.pull_request.title }}"
if echo "$PR_TITLE" | grep -qi "\[full-ci\]"; then
echo "web-changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
CHANGED_FILES=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" 2>/dev/null || git diff --name-only HEAD~1)
WEB_CHANGED=false
while IFS= read -r file; do
case "$file" in
web/*) WEB_CHANGED=true; break ;;
.github/workflows/web-tests.yml) WEB_CHANGED=true; break ;;
esac
done <<< "$CHANGED_FILES"
echo "web-changed=$WEB_CHANGED" >> "$GITHUB_OUTPUT"
echo "web/ changed: $WEB_CHANGED"
web-build-test:
name: web-build-test
needs: [detect-web-changes]
if: needs.detect-web-changes.outputs.web-changed == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 10.33.3
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.15.0
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- name: Check licenses
run: pnpm licenses:check
- name: Save licenses
run: pnpm licenses:csv && pnpm licenses:save
- name: Check types
run: pnpm check:types
- name: Check format
run: pnpm check:format
- name: Lint
run: pnpm lint
- name: Run unit tests
run: pnpm test:unit --coverage
- name: Build
run: pnpm build
web-tests-passed:
name: web-tests-passed
needs: [detect-web-changes, web-build-test]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check web-build-test passed or was skipped
run: |
if [[ "${{ needs.web-build-test.result }}" == "failure" || "${{ needs.web-build-test.result }}" == "cancelled" ]]; then
exit 1
fi
@@ -1,31 +0,0 @@
name: Weekly Pipeline Report
on:
workflow_dispatch:
pull_request:
branches:
- feat/ci-report-tool
schedule:
- cron: "0 8 * * 1" # Every Monday at 8:00 AM UTC
permissions:
contents: read
jobs:
generate-report:
name: Generate Pipeline Report
runs-on: ubuntu-latest
container: golang:1.25-alpine
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
- name: Run CI Reporter
working-directory: tools/ci-reporter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GOWORK=off go run ./cmd/list-flaky-tests \
--github-token "$GITHUB_TOKEN" \
--workflow acceptance-tests.yml \
--since 4w
-14
View File
@@ -1,14 +0,0 @@
SKIP_CONFIG_DOCS_GENERATE ?= 0
CONFIG_DOCS_BASE_PATH ?= ../../docs/services
.PHONY: config-docs-generate
config-docs-generate: #$(FLAEX)
# since https://github.com/owncloud/ocis/pull/2708 flaex can no longer be used
# TODO: how to document configuration
# @if [ $(SKIP_CONFIG_DOCS_GENERATE) -ne 1 ]; then \
# $(FLAEX) >| $(CONFIG_DOCS_BASE_PATH)/$(NAME)/configuration.md \
# ; fi;
.PHONY: grpc-docs-generate
grpc-docs-generate: buf-generate
-1
View File
@@ -10,7 +10,6 @@ protoc-deps: $(BINGO)
@cd ../.. && GOPATH="" GOBIN=".bingo" $(BINGO) get -l github.com/go-micro/generator/cmd/protoc-gen-micro
@cd ../.. && GOPATH="" GOBIN=".bingo" $(BINGO) get -l github.com/owncloud/protoc-gen-microweb
@cd ../.. && GOPATH="" GOBIN=".bingo" $(BINGO) get -l github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
@cd ../.. && GOPATH="" GOBIN=".bingo" $(BINGO) get -l github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
@cd ../.. && GOPATH="" GOBIN=".bingo" $(BINGO) get -l github.com/favadi/protoc-go-inject-tag
.PHONY: buf-generate
+1 -1
View File
@@ -28,7 +28,7 @@ COPY --from=generate /ocis /ocis
WORKDIR /ocis/ocis
RUN make ci-go-generate build ENABLE_VIPS=true
FROM alpine:3.24.1
FROM alpine:3.24.2
RUN apk add --no-cache attr ca-certificates curl mailcap tree \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.2-r0" \
@@ -0,0 +1,13 @@
Bugfix: Remove the unmarshalable request body field from graph log messages
We've removed the `body` field from the log messages of the graph service's HTTP
handlers. The field was set from `http.Request.Body`, an `io.ReadCloser`, which
can never be serialized into a useful log value.
The tracing middleware replaces the request body with a wrapper that carries an
exported function field, so serializing it failed outright and the log line was
emitted with `"body": "marshaling error: json: unsupported type: func(int64)"`
instead of the payload. Without the tracing middleware the field serialized to an
empty object. In both cases the intended payload was never logged.
https://github.com/owncloud/ocis/pull/12916
@@ -0,0 +1,12 @@
Bugfix: Cache LDAP instance mapper lookups
In multi-instance deployments, resolving a user's instance name/ID during
`GET /graph/v1.0/users` (and group member expansion) issued a fresh, uncached
LDAP search per instance/guest attribute value on every request. Under load
this multiplied into large numbers of redundant LDAP round-trips per page of
users, saturating the LDAP connection pool and causing request timeouts. The
LDAP identity backend now caches instance mapper lookups, including negative
(not-found) results, for a configurable TTL
(`OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL`, default 60s).
https://github.com/owncloud/ocis/pull/12898
@@ -0,0 +1,9 @@
Bugfix: Fix share metadata corruption during concurrent share operations
When multiple sharing service replicas processed share operations concurrently
for the same user, the share metadata could become corrupted with references to
missing data, making all shares inaccessible to that user. The received share
cache now uses compare-and-swap (etag) validation to detect concurrent writes
and retries gracefully, preventing metadata corruption.
https://github.com/owncloud/ocis/pull/12621
@@ -0,0 +1,13 @@
Bugfix: Accept an X-Purge alias for the space-delete Purge header
axios >=1.20.0 reserves "purge" as an internal per-HTTP-method header-bucket
name and strips any outgoing request header matching it case-insensitively.
The web client's permanent space-delete request set a header literally named
Purge, so it was silently dropped, and the server treated the request as a
disable instead of a permanent delete.
The graph service now also accepts an X-Purge header, and the web client
sends that instead. The original Purge header is still accepted for other
API clients.
https://github.com/owncloud/ocis/pull/13049
@@ -0,0 +1,12 @@
Bugfix: Return a retryable 503 when the OIDC userinfo call fails transiently
A transient failure of the OIDC userinfo call (a timeout, a network error or a
5xx/429 from the IdP) was mapped to HTTP 401. Clients read the 401 as an invalid
session and logged the user out on a brief IdP slowdown.
The proxy now distinguishes a transient IdP failure from an authentication
failure and returns a retryable 503 (with Retry-After) for the former, so clients
retry and keep their session. A genuinely invalid or expired token still returns
401.
https://github.com/owncloud/ocis/pull/12999
@@ -0,0 +1,15 @@
Change: Replace GRPC_MAX_CONNECTION_AGE with client keepalive
The grpc clients now send a keepalive ping while a request is in flight and fail
the requests on a connection whose peer stops answering, instead of waiting for
as long as the caller allows. This covers both the reva CS3 clients (gateway,
storage-users, storage-shares, ...) and the go-micro based clients used for
inter-service calls between the other oCIS services. Set GRPC_CLIENT_KEEPALIVE_TIME
and GRPC_CLIENT_KEEPALIVE_TIMEOUT to enable and tune this; leave them unset to keep
grpc's own default (no pings).
GRPC_MAX_CONNECTION_AGE has been removed. It only closed healthy connections on
a timer, never ended a request that was already in flight, and silently did
nothing when its value had no unit suffix.
https://github.com/owncloud/ocis/pull/13020
@@ -0,0 +1,14 @@
Enhancement: Make the public share expiry janitor configurable
The sharing service runs a background janitor that permanently deletes
expired public shares. Whether that cleanup runs at all could previously only
be set in the sharing service's yaml config, and how often it ran was fixed
internally with no way to tune it.
Both settings are now exposed as environment variables:
OCIS_SHARING_ENABLE_EXPIRED_SHARES_CLEANUP toggles the cleanup (default:
enabled, expired shares stay hidden from listings even when disabled), and
the new OCIS_SHARING_JANITOR_RUN_INTERVAL sets the interval in seconds
between janitor runs (default: 3600).
https://github.com/owncloud/ocis/pull/13020
@@ -0,0 +1,10 @@
Enhancement: Add TLS support for the frontend stat cache store connection
The frontend service was the only remaining place where a `nats-js-kv` store
connection could not be secured. Its OCS stat cache forwarded the store type,
nodes, database, table, TTL and credentials to reva, but not the TLS settings,
so the connection stayed plaintext with no operator toggle to change it. The
stat cache now honours `OCIS_CACHE_ENABLE_TLS`, `OCIS_CACHE_TLS_INSECURE` and
`OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE` like every other cache and store.
https://github.com/owncloud/ocis/pull/12932
@@ -0,0 +1,8 @@
Enhancement: Add TLS support for NATS store and registry connections
All `nats-js-kv` store, cache, and service registry connections now support
TLS. Configure via `OCIS_CACHE_ENABLE_TLS`, `OCIS_PERSISTENT_STORE_ENABLE_TLS`,
and `MICRO_REGISTRY_ENABLE_TLS`, with corresponding `*_TLS_INSECURE` and
`*_TLS_ROOT_CA_CERTIFICATE` variants per connection type.
https://github.com/owncloud/ocis/pull/12765
@@ -0,0 +1,6 @@
Bugfix: Correct introduction version for OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL
We changed the documented introduction version of the
OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL from 8.0.0 to 8.2.1.
https://github.com/owncloud/ocis/pull/12951
@@ -0,0 +1,12 @@
Enhancement: The public link resolution flag added to PROPFIND
The public link resolution flag and the context timeout added to PROPFIND request
The ocdav PROPFIND handler resolves public link shares to populate the oc:share-type property.
A new toggle for skipping that lookup. The toggle is now exposed as
OCDAV_DISABLE_PROPFIND_PUBLIC_LINK_RESOLUTION, which can be set to reduce load
on services for large collections.
Also, the bounded context was added for least public share request. Since this property is needed only
to display an icon next to files in the list, indicating that a public link exists,
it can be omitted if the ListPublicShares request is slow.
https://github.com/owncloud/ocis/pull/13020
@@ -0,0 +1,5 @@
Security: Bump Go and deps
Fix the CVE vulnerabilities flagged by the release image scan.
https://github.com/owncloud/ocis/pull/12902
@@ -0,0 +1,9 @@
Security: Bump vulnerable dependencies
Bumped google.golang.org/grpc to v1.83.2 and several web frontend dependencies
to their patched releases via pnpm overrides: @xmldom/xmldom to 0.8.15, js-yaml
to 4.3.2, vitest to 4.1.11, postcss to 8.5.23, qs to 6.16.0, dompurify to
3.4.13, esbuild to 0.28.1, colord to 2.9.4, browserslist to 4.28.7, fast-uri to
3.1.6 and baseline-browser-mapping to 2.11.0.
https://github.com/owncloud/ocis/pull/12912
@@ -0,0 +1,9 @@
Security: Bump grpc-go dependency
We've updated the google.golang.org/grpc dependency to fix a reported
denial-of-service vulnerability related to gRPC server handling of requests
missing authority or Host headers. As no tagged release containing the fix was
available yet, we pulled in a pre-release snapshot of grpc-go that includes it,
which also required bumping the minimum Go version to 1.26.8.
https://github.com/owncloud/ocis/pull/13020
@@ -0,0 +1,6 @@
Security: Bump golang.org/x/image to v0.45.0
Upgraded golang.org/x/image from v0.44.0 to v0.45.0 to address
GO-2026-6222: excessive memory allocation during VP8L decoding.
https://github.com/owncloud/ocis/pull/12806
@@ -0,0 +1,7 @@
Security: Harden public link brute force protection
We've hardened the brute force protection for password protected public links so
that failed password attempts are reliably counted and the rate limit is
consistently enforced.
https://github.com/owncloud/ocis/pull/12945
@@ -0,0 +1,13 @@
Bugfix: Fix AuthApp and basic auth requests with custom PROXY_USER_OIDC_CLAIM
We fixed AuthApp (app password) and HTTP basic auth requests returning an
internal server error whenever PROXY_USER_OIDC_CLAIM was set to anything
other than its default value. Both authenticators put the already
authenticated user directly into the request context instead of faking
incomplete claims for the account resolver to re-resolve. We also made sure
a user who only ever authenticates this way still gets a default role
assigned, and that these requests keep getting rejected on deployments with
multiple instances enabled, since neither carries tenant-membership
information.
https://github.com/owncloud/ocis/pull/13078
@@ -0,0 +1,10 @@
Bugfix: Keep /me working when the preferred language lookup fails
The graph service returned HTTP 500 for the whole `GET /graph/v1.0/me` response
whenever the settings lookup for the user's preferred language failed, including
on a transient timeout. Since `/me` is the first request the Web UI makes after
login, that locked affected users out of oCIS entirely. The lookup failure is
now logged at warn level and `preferredLanguage` falls back to
`OCIS_DEFAULT_LANGUAGE`.
https://github.com/owncloud/ocis/pull/13188
@@ -0,0 +1,25 @@
Bugfix: Fix the LDAP master-ID filter when the base filter is empty
The function `EnhanceFilterWithMasterID` in `ocis-pkg/ldap/filter.go` adds a
master-ID clause to an LDAP filter with OR. An empty filter means "no
restriction". Before this fix, the function replaced an empty filter with a
master-ID-only filter. This action restricted an unrestricted search to
master-ID users only.
The bug broke the search for a user on another instance in multi-instance
deployments. This search uses the Graph API endpoint `/graph/v1.0/users`.
Multi-instance deployments use this search to find a user to share a resource
with.
Now the function keeps an empty filter unchanged. The function still adds a
master-ID clause to a filter that is not empty.
The `graph`, `auth-basic`, `users`, and `groups` services also use this
function to compute their default LDAP user filter when
`OCIS_MULTI_INSTANCE_MASTER_ID` is set. An empty user filter now means these
services resolve or authenticate every user in the shared LDAP directory,
not only master-ID users. Each of these services now rejects startup when
`OCIS_MULTI_INSTANCE_MASTER_ID` is set and its own user filter is empty.
Set an explicit `OCIS_LDAP_USER_FILTER` for every multi-instance deployment.
https://github.com/owncloud/ocis/pull/13096
@@ -0,0 +1,7 @@
Enhancement: Allow ownCloud Marketplace in ocis_multi CSP
The `ocis_multi` deployment example's default Content-Security-Policy configuration
was updated to allow connections to the new ownCloud Marketplace domain, matching
the change already applied to the other deployment examples.
https://github.com/owncloud/ocis/pull/13090
@@ -0,0 +1,5 @@
Security: Bump vulnerable dependencies
Bumped bump vue to 3.5.43
https://github.com/owncloud/ocis/pull/13080
@@ -0,0 +1,7 @@
Security: Bump vulnerable web dependencies
Bumped vite to 7.3.7, markdown-it to 14.3.3 and follow-redirects to 1.16.1 to
address CVE-2026-112942, CVE-2026-111758, CVE-2026-111759, CVE-2026-111755 and
CVE-2026-111756.
https://github.com/owncloud/ocis/pull/13210
+1 -3
View File
@@ -11,8 +11,7 @@
},
"require-dev": {
"ext-simplexml": "*",
"bamarni/composer-bin-plugin": "^1.8",
"playwright-php/playwright": "^1.2"
"bamarni/composer-bin-plugin": "^1.8"
},
"extra": {
"bamarni-bin": {
@@ -20,7 +19,6 @@
}
},
"require": {
"khanamiryan/qrcode-detector-decoder": "^2.0",
"spomky-labs/otphp": "^11.5"
}
}
@@ -2,7 +2,7 @@
printenv
# replace oCIS domain in keycloak realm import
mkdir /opt/keycloak/data/import
sed -e "s/ocis.owncloud.test/${OCIS_DOMAIN}/g" /opt/keycloak/data/import-dist/ocis-realm.json > /opt/keycloak/data/import/oCIS-realm.json
sed -e "s/ocis.owncloud.test/${OCIS_DOMAIN}/g" -e "s/ocis.ocm.owncloud.test/${OCIS_OCM_DOMAIN}/g" /opt/keycloak/data/import-dist/ocis-realm.json > /opt/keycloak/data/import/oCIS-realm.json
# sed -e "s/ocis.ocm.owncloud.test/${OCIS_OCM_DOMAIN}/g" /opt/keycloak/data/import-dist/ocis-realm.json > /opt/keycloak/data/import/oCIS-realm.json
# run original docker-entrypoint
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
- 'https://${KEYCLOAK_DOMAIN|keycloak.owncloud.test}/'
default-src:
- '''none'''
@@ -24,6 +25,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
manifest-src:
- '''self'''
media-src:
@@ -5,6 +5,7 @@ directives:
- '''self'''
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
# In contrary to bash and docker the default is given after the | character
- 'https://${KEYCLOAK_DOMAIN|keycloak.owncloud.test}/'
default-src:
@@ -23,6 +24,7 @@ directives:
- 'data:'
- 'blob:'
- 'https://raw.githubusercontent.com/owncloud/awesome-ocis/'
- 'https://marketplace.owncloud.com/'
manifest-src:
- '''self'''
media-src:
@@ -192,7 +192,8 @@ services:
OCIS_LDAP_BIND_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin}
OCIS_LDAP_GROUP_BASE_DN: "ou=groups,dc=owncloud,dc=com"
GRAPH_LDAP_GROUP_CREATE_BASE_DN: "ou=groups-8d24cb5f-6ee6-4b98-86df-c4c268dddb46,ou=groups,dc=owncloud,dc=com"
OCIS_LDAP_GROUP_OBJECTCLASS: "owncloudGroup"
OCIS_LDAP_GROUP_OBJECTCLASS: "groupOfNames"
OCIS_LDAP_GROUP_ADDITIONAL_OBJECTCLASSES: "ownCloudGroup"
OCIS_LDAP_USER_BASE_DN: "ou=users,dc=owncloud,dc=com"
OCIS_LDAP_USER_OBJECTCLASS: "inetOrgPerson"
LDAP_LOGIN_ATTRIBUTES: "uid"
@@ -272,6 +273,7 @@ services:
- "./config/keycloak/ocis-realm.dist.json:/opt/keycloak/data/import-dist/ocis-realm.json"
environment:
OCIS_DOMAIN: ${OCIS_DOMAIN:-ocis.owncloud.test}
OCIS_OCM_DOMAIN: ${OCIS_OCM_DOMAIN:-ocis.ocm.owncloud.test}
KC_HOSTNAME: ${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}
KC_DB: postgres
KC_DB_URL: "jdbc:postgresql://postgres:5432/keycloak"
-4
View File
@@ -1,4 +0,0 @@
hugo/
grpc_apis/
helpers/output/*
services/**/_index.md
View File
Whitespace-only changes.
-97
View File
@@ -1,97 +0,0 @@
SHELL := bash
# we need an override so that this variable is cleanly set in this makefile
# else it might come from somewhere else
override HUGO := $(CURDIR)/hugo
override HDIR := $(HUGO)/.git
# if the directory exists, print that we do not need to prepare
hugo-exists:
@if [ -d $(HDIR) ]; then \
echo; \
echo 'Build environment for hugo exists, nothing to setup, continuing.'; \
fi
# if the directory does not extist, initialize the framework and create the theme
$(HDIR):
@echo 'Initialize the hugo framework and build the theme, no docs get built.'
@mkdir -p $(HUGO)/content/
@mkdir -p $(HUGO)/extensions/
@mkdir -p $(HUGO)/public/
@cd $(HUGO) && git init
@cd $(HUGO) && git config advice.detachedHead false
@cd $(HUGO) && git remote rm origin || true
@cd $(HUGO) && git remote add origin https://github.com/owncloud/owncloud.github.io
@cd $(HUGO) && git fetch --depth=1
@cd $(HUGO) && git checkout origin/main -f
@$(MAKE) -C $(HUGO) --no-print-directory theme
# print available make targets
.PHONY: help
.DEFAULT_GOAL := help
help:
@echo -e 'Available .PHONY targets: \n'
@grep -P -o '(?<=^\.PHONY: )(.*)' Makefile | sort -u
@echo
# alternative target because we also use it in the root's makefile
.PHONY:list
list: help
# Creates a symlink ../hugo → hugo/ required by the Hugo Docker image
# (hugomods/hugo:base-0.129.0), which expects the hugo folder at the repo root.
# CURDIR will work for make only but not when running manually in the shell
.PHONY: docs-hugo-drone-prep
docs-hugo-drone-prep:
@echo
@echo 'Linking directory hugo for drone.'
@rm -f ../hugo
@ln -s $(HUGO) ../hugo
# generate data from sources such as services
.PHONY: docs-run-helpers
docs-run-helpers:
@echo
@echo 'Generate envvar adoc and md tables for all oCIS services used for dev and admin docs'
@pushd helpers && go run .; popd
# create the docs build environment
.PHONY: docs-init
docs-init: hugo-exists $(HDIR)
# if there is nothing to do, stop printing that
# another way would be https://stackoverflow.com/questions/58039810/makefiles-what-is-an-order-only-prerequisite
@:
# the docs-build|serve commands require that docs-init was run first for the required data to exists
# create a docs build
.PHONY: docs-build
docs-build:
@echo
@echo 'Building ocis for owncloud.dev'
@$(MAKE) -C $(HUGO) --no-print-directory hugo-build
@echo 'To view the rendered docs in the browser, run: make docs-serve'
# serve built docs with hugo
.PHONY: docs-serve
docs-serve:
@$(MAKE) -C $(HUGO) --no-print-directory hugo-server
# copy required resources into hugo
.PHONY: docs-copy
docs-copy:
@echo
@echo 'Syncing required doc files and directories for the build process.'
# brace expansion not with sh
@rsync --delete -ax --exclude={hugo,templates,Makefile,.gitignore,README.md} ./ $(HUGO)/content/
# clean up docs build artifacts (removing the hugo folder)
.PHONY: docs-clean
docs-clean:
# NOTE: the whitespace at the beginning of the ifeq/else/endif statements is intentional.
@echo
ifneq ($(shell id -u), 0)
@echo "You must run the clean command using sudo or as root because some doc files are created by root"
else
@echo 'Clean up docs build artifacts'
@rm -rf $(HUGO)
@echo "Removed folder: $(HUGO)"
endif
+9 -3
View File
@@ -1,5 +1,11 @@
# Documentation
# Internal Documentation Space
To contribute to documentation please see also: [Documentation](http://owncloud.dev/ocis/development/build-docs/)
**IMPORTANT**\
All the docs including the helpers and their output has been migrated to the [docs.owncloud.com](https://github.com/owncloud/docs.owncloud.com/tree/main/content/ocis) repo and is now part of the [oCIS documentation](https://doc.owncloud.com/) that can be viewed on the web.
Note that when running a helper like `make -C docs docs-generate` locally, you will see the generated output in e.g. docs/services/<service-name>. When merging a PR, the pipeline will generate the output in the master branch but finally moves it into the `docs` branch. You will therefore _not_ see changes in the docs folder of the master branch!
This folder is intended for any information that is not part of the official developer documentation. Nothing in here will be transferred, either manually or automatically, to the docs repo. It is therefore a place for developers to put things that are not necessarily part of the official developer documentation.
Note that the [acceptance test](.github/workflows/acceptance-tests.yml) workflow omits any CI run on changed files in this folder. This is also true for [code analysis](.codacy.yml).
**IMPORTANT**\
Although it may exist, you do not need to maintain any `env-vars.yaml` file in any branch. This file is obsolete in ocis, as the process has been moved to the documentation.
-46
View File
@@ -1,46 +0,0 @@
---
title: ownCloud
---
{{< toc >}}
## Admin Documentation
Before you start reading, if you are interested in:
- learning ocis from an admin perspective,
- different deployment scenarios,
- 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/).
## Developer Documentation
Welcome to our developer documentation. Here you find documentation with focus for *developers*:
- [oCIS]({{< ref "./ocis" >}}) server
- oCIS Services
- Clients like:
- [ownCloud Web](https://github.com/owncloud/ocis/tree/master/web) - the new web frontend for oCIS and ownCloud, shipped in-tree as part of oCIS
- [ownCloud Android app](https://github.com/owncloud/android)
- [ownCloud iOS app](https://github.com/owncloud/ios-app)
- [ownCloud Desktop Syncing Client](https://github.com/owncloud/client)
- Integrations
## We love open source
The oCIS server is Apache v2 licensed.
The lower storage layer of oCIS is defined by the CS3 APIs and implemented in the REVA project. Our goal is to develop the CS3 APIs to an open standard and collaborate on the open source REVA reference implementation for CS3 APIs.
You can also find all client sources on [GitHub](https://github.com/owncloud/).
## Join the oCIS Community
The [server repository](https://github.com/owncloud/ocis) on [GitHub](https://www.github.com) is a good entry point to the oCIS project -- it also contains the [ownCloud Web](https://github.com/owncloud/ocis/tree/master/web) frontend source in-tree. 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) and the major [Desktop](https://github.com/owncloud/desktop) platforms.
To chat about development, join our public chat on [matrix: ownCloud Infinite Scale](https://matrix.to/#/#ocis:matrix.org).
If you want to help and improve ownCloud or oCIS, start coding or open issues on GitHub in the related repository.
We are very happy to hear your feedback and ideas!
-53
View File
@@ -1,53 +0,0 @@
---
title: APIs
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
{{< toc-tree >}}
Infinite Scale provides a large set of different **application programming interfaces (APIs)**. Infinite Scale is built by microservices. That means many calls to "functions" in the code are remote calls.
Basically we have two different API "universes": [HTTP](http) and [gRPC](grpc_apis).
{{< columns >}} <!-- begin columns block -->
{{< figure src="/ocis/static/http-logo.png" width="70%" alt="Image sourced from https://commons.wikimedia.org/ free of licenses" >}}
<--->
{{< figure src="/ocis/static/grpc-logo.png" width="70%" alt="Image sourced from https://grpc.io/ under CC 4.0 BY license" >}}
{{< /columns >}}
For inter-service-communication we are using mostly gRPC calls because it has some advantages. In the future, clients may decide to use gRPC directly to make use of these advantages.
{{< figure src="/ocis/static/ocis-apis.drawio.svg" class="page-image">}}
## [HTTP](http)
HTTP APIs are mostly used for client <-> server communication. Modern applications are embracing a [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) software architecture style. REST APIs are using the HTTP protocol to transfer data between clients and servers. All our clients talk to the Server using HTTP APIs. This has legacy reasons and is well-supported across many platforms and technologies. Infinite Scale uses an [HTTP API gateway](../services/proxy) to route client requests to the correct service.
### OpenAPI
It is best practise to define APIs and their behavior by a spec. We are using the OpenAPI standard for all new APIs. The [OpenAPI Specification](https://swagger.io/specification/), previously known as the Swagger Specification, is a specification for a machine-readable interface definition language for describing, producing, consuming and visualizing RESTful web services. Previously part of the Swagger framework, it became a separate project in 2016, overseen by the OpenAPI Initiative, an open-source collaboration project of the Linux Foundation. Swagger and some other tools can generate code, documentation and test cases from interface files.
### RFC
Some APIs have become a de facto standard and are additionally covered by an [RFC](https://en.wikipedia.org/wiki/Request_for_Comments).
## [gRPC](grpc_apis)
In gRPC, a client application can directly call methods on a server application on a different machine as if it was a local object. This makes it easier to create distributed applications based on microservices. In gRPC we can define a service and specify the methods that can be called remotely. A gRPC client has a stub that provides the same methods and types as the server.
Infinite Scale uses a [gRPC API Gateway](../services/gateway) to route the requests to the correct service.
### Protobuf
gRPC APIs are typically defined by [Protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). The different client and server stubs are created from ``*.proto`` files by code generation tools.
## Versioning
There are different standards for API versioning: Through URL, through request parameter, through custom header and through content negotiation. Ocis uses the versioning by URL concept although this creates a big code footprint. The versioning follows [SemVer](https://semver.org). We update the major version number when breaking changes are needed. Clients can decide which major version they use through the request URL. The specific implementation is documented on each API.
-63
View File
@@ -1,63 +0,0 @@
---
title: gRPC
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/grpc_apis/
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
{{< toc-tree >}}
## **R**emote &nbsp; **P**rocedure &nbsp; **C**alls
[gRPC](https://grpc.io) is a modern open source high performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication. It is also applicable in last mile of distributed computing to connect devices, mobile applications and browsers to backend services.
## Advantages of gRPC
{{< columns >}}
### {{< icon "gauge-high" >}} &nbsp; Performance
gRPC uses http/2 by default and is faster than REST. When using protocol buffers for encoding, the information comes on and off the wire much faster than JSON. Latency is an important factor in distributed systems. JSON encoding creates a noticeable factor of latency. For distributed systems and high data loads, gRPC can actually make an important difference. Other than that, gRPC supports multiple calls via the same channel and the connections are bidirectional. A single connection can transmit requests and responses at the same time. gRPC keeps connections open to reuse the same connection again which prevents latency and saves bandwidth.
<--->
### {{< icon "helmet-safety" >}} &nbsp; Robustness
gRPC empowers better relationships between clients and servers. The rules of communication are strictly enforced. That is not the case in REST calls, where the client and the server can send and receive anything they like and hopefully the other end understands what to do with it. In gRPC, to make changes to the communication, both client and server need to change accordingly. This prevents mistakes specially in microservice architectures.
{{< /columns >}}
{{< columns >}}
### {{< icon "magnifying-glass-plus" >}} &nbsp; Debuggability
gRPC requests are re-using the same context and can be tracked or traced across multiple service boundaries.
This helps to identify slow calls and see what is causing delays. It is possible to cancel requests which cancels
them on all involved services.
<--->
### {{< icon "boxes-stacked" >}} &nbsp; Microservices
gRPC has been evolving and has become the best option for communication between microservices because of its unmatched
performance and its polyglot nature. One of the biggest strengths of microservices is the freedom of programming
languages and technologies. By using gRPC we can leverage all the advantages of strictly enforced communication
standards combined with freedom of choice between different programming languages - whichever would fit best.
{{< /columns >}}
{{< hint type=info title="gRPC Advantages" >}}
- http/2
- protocol buffers
- reusable connections
- multi language support
{{< /hint >}}
## CS3 APIs
{{< figure src="/ocis/static/cs3org.png" >}}
The [CS3 APIs](https://github.com/cs3org/cs3apis) connect storages and application providers.
The CS3 APIs follow Google and Uber API design guidelines, specially on error handling and naming convention. You can read more about these
guidelines at https://cloud.google.com/apis/design/ and https://github.com/uber/prototool/blob/dev/style/README.md.
The CS3 APIs use [Protocol Buffers version 3 (proto3)](https://github.com/protocolbuffers/protobuf) as their
Interface Definition Language (IDL) to define the API interface and the structure of the payload messages.
-11
View File
@@ -1,11 +0,0 @@
---
title: Http
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
The [Hypertext Transfer Protocol (HTTP)](https://www.rfc-editor.org/rfc/rfc2616) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser.
Development of HTTP was initiated by Tim Berners-Lee at CERN in 1989 and summarized in a simple document describing the behavior of a client and a server using the first HTTP protocol version that was named 0.9. That first version of HTTP protocol soon evolved into a more elaborated version that was the first draft toward a far future version 1.0
-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
-72
View File
@@ -1,72 +0,0 @@
---
title: "LibreGraph"
date: 2018-05-02T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/graph
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
The LibreGraph API is a REST Api which is inspired by the [Microsoft Graph API](https://developer.microsoft.com/en-us/graph). It tries to stay compliant with the Microsoft Graph API and aims to be the Next Generation Api in Infinite Scale where we want to support most of the features of the platform.
The [API specification](https://github.com/owncloud/libre-graph-api) is available in the OpenApi 3 standard and there are generated client and server [SDKs](https://github.com/owncloud/libre-graph-api#clients) available. You can browse the API with the [Swagger UI](https://owncloud.dev/libre-graph-api/).
## Calling the LibreGraph API
```sh
{HTTP method} https://ocis.url/graph/{version}/{resource}?{query-parameters}
```
The request component consists of:
| Component | Description |
|--------------------|-------------------------------------------------------------------------|
| {HTTP method} | The HTTP method which is used in the request. |
| {version} | The version of the LibreGraph API used by the client. |
| {resource} | The LibreGraph Resource which the client is referencing in the request. |
| {query-parameters} | Optional parameters for the request to customize the response. |
### HTTP methods
| Method | Description |
|--------|-------------------------------|
| GET | Read data from a resource. |
| POST | Create a new resource. |
| PATCH | Update an existing resource. |
| PUT | Replace an existing resource. |
| DELETE | Delete an existing resource. |
The methods `GET` and `DELETE` need no request body. The methods `POST`, `PATCH` and `PUT` require a request body, normally in JSON format to provide the needed values.
### Version
Infinite Scale currently provides the version `v1.0`.
### Resource
A resource could be an entity or a complex type and is usually defined by properties. Entities are always recognizable by an `Id` property. The URL contains the resource which you are interacting with e.g. `/me/drives` or `/groups/{group-id}`.
Each resource could possibly require different permissions. Usually you need permissions on a higher level for creating or updating an existing resource than for reading.
### Query parameters
Query parameters can be OData system query options, or other strings that a method accepts to customize its response.
You can use optional OData system query options to include more or fewer properties than the default response, filter the response for items that match a custom query, or provide additional parameters for a method.
For example, adding the following filter parameter restricts the drives returned to only those with the driveType property of `project`.
```shell
GET https://ocis.url/graph/v1.0/drives?$filter=driveType eq 'project'
```
For more information about OData query options please check the [API specification](https://github.com/owncloud/libre-graph-api) and the provided examples.
### Authorization
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. The graph endpoints that support a preconfigured token can be found in the [API specification](https://github.com/owncloud/libre-graph-api)
## Resources
{{< toc-tree >}}
-275
View File
@@ -1,275 +0,0 @@
---
title: Groups
weight: 40
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/graph
geekdocFilePath: groups.md
---
{{< toc >}}
## Groups API
The Groups API is implementing a subset of the functionality of the
[MS Graph Group resource](https://docs.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0)
The JSON representation of a Group as handled by the Groups API looks like this:
```
{
"displayName": "group",
"id": "f0d97060-da16-4b0d-9fa4-d1ec43afc5f1"
}
```
Our implementation currently supports two Attributes for a Group:
| Attribute | Description |
|---------------|-----------------------------------------------------------------------------------------------------------------------------|
| displayName | The groups name |
| id | An unique, stable readonly identifier for the group that stays the same for the whole lifetime of the Group, usually a UUID |
### Reading groups
#### `GET /groups`
Returns a list of all groups
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/groups' -u user:password
```
Response:
```
{
"value": [
{
"displayName": "group",
"id": "38580a2e-7018-42ed-aff6-b2af0b4e9790"
},
{
"displayName": "Example Users",
"id": "7a20f238-8a22-4458-902d-47674c317e5f"
}
]
}
```
#### `GET /groups?$expand=members`
Returns a list of all groups including its members
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/groups?$expand=members' -u user:password
```
Response:
```
{
"value": [
{
"displayName": "group",
"id": "38580a2e-7018-42ed-aff6-b2af0b4e9790",
"members": [
{
"displayName": "user1",
"id": "2e7b7e23-6c42-4d34-81b0-2bed34e51983",
"mail": "user1@example.org",
"onPremisesSamAccountName": "user1"
},
{
"displayName": "user2",
"id": "b45c9e35-0d95-4165-96bc-68bff4a316ed",
"mail": "user2@example.org",
"onPremisesSamAccountName": "user2"
}
]
},
{
"displayName": "Example Users",
"id": "7a20f238-8a22-4458-902d-47674c317e5f",
"members": [
{
"displayName": "user3",
"id": "026fbfef-79ef-4f5d-887b-9eaf42777239",
"mail": "user3@example.org",
"onPremisesSamAccountName": "user3"
}
]
}
]
}
```
#### `GET /groups/{groupid}`
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/groups/7a20f238-8a22-4458-902d-47674c317e5f' -u user:password
```
Response:
```
{
"displayName": "Example Users",
"id": "7a20f238-8a22-4458-902d-47674c317e5f"
}
```
#### `GET /groups/{groupid}?$expand=members`
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/groups/7a20f238-8a22-4458-902d-47674c317e5f?$expand=members' -u user:password
```
Response:
```
{
"displayName": "Example Users",
"id": "7a20f238-8a22-4458-902d-47674c317e5f",
"members": [
{
"displayName": "user3",
"id": "026fbfef-79ef-4f5d-887b-9eaf42777239",
"mail": "user3@example.org",
"onPremisesSamAccountName": "user3"
}
]
}
```
### Getting Group Members
#### `GET /groups/{groupid}/members`
Returns a list of User objects that are members of a group.
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/groups/7a20f238-8a22-4458-902d-47674c317e5f/members' -u user:password
```
Response:
```
[
{
"displayName": "Test User",
"id": "c54b0588-7157-4521-bb52-c1c8ca84ea71",
"mail": "example@example.org",
"onPremisesSamAccountName": "example"
},
{
"displayName": "Albert Einstein",
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"mail": "einstein@example.org",
"onPremisesSamAccountName": "einstein"
}
]
```
### Creating / Updating Groups
#### `POST /groups`
Use this to create a new group.
h
##### Request Body
Note the missing `"id"` Attribute. It will be generated by the server:
```
{
"displayName": "Example Users"
}
```
##### Response
When successful, the response will return the new group including the newly allocated `"id"`:
```
{
"displayName": "Example Users",
"id": "7a20f238-8a22-4458-902d-47674c317e5f"
}
```
#### `DELETE /groups/{id}`
Example:
```
curl -k --request DELETE 'https://localhost:9200/graph/v1.0/groups/7a20f238-8a22-4458-902d-47674c317e5f' -u user:password
```
When successful the API returns no response body and the HTTP status code 204 (No Content)
#### `PATCH /groups/{id}`
Updating attributes of a single group is supposed to be done with a patch request. This is however currently not fully
implemented for our write-enabled backends. The PATCH request can however be used to add multiple members to a group at once.
See below.
### Adding a single member to a group
#### `POST /groups/{id}/members/$ref`
The request body contains a single attribute "`@odata.id`" referencing the new member of the group by URI. Example:
```
curl -k --header "Content-Type: application/json" \
--request POST --data \
'{ "@odata.id": "https://localhost:9200/graph/v1.0/users/4c510ada-c86b-4815-8820-42cdf82c3d51" }' \
'https://localhost:9200/graph/v1.0/groups/7a20f238-8a22-4458-902d-47674c317e5f/members/$ref' -u user:password
```
When successful the API returns no response body and the HTTP status code 204 (No Content)
### Adding multiple members in a single request
#### `PATCH /groups/{id}`
The request body contains the attribute `members@odata.bind` holding a list of URI references for the new members.
Example:
```
{
"members@odata.bind": [
"https://localhost:9200/graph/v1.0/users/4c510ada-c86b-4815-8820-42cdf82c3d51",
"https://localhost:9200/graph/v1.0/users/c54b0588-7157-4521-bb52-c1c8ca84ea71"
]
}
```
When successful the API returns no response body and the HTTP status code 204 (No Content)
### Removing a member
#### `DELETE /groups/{groupid}/members/{id}/$ref`
Example
```
curl -k --request DELETE \
'https://localhost:9200/graph/v1.0/groups/7a20f238-8a22-4458-902d-47674c317e5f/members/4c510ada-c86b-4815-8820-42cdf82c3d51/$ref' \
-u user:password
```
When successful the API returns no response body and the HTTP status code 204 (No Content)
-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
-494
View File
@@ -1,494 +0,0 @@
---
title: Spaces
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/graph
geekdocFilePath: spaces.md
---
{{< toc >}}
## Spaces API
The Spaces API is implementing a subset of the functionality of the
[MS Graph Drives resource](https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0).
### Example Space
The JSON representation of a Drive, as handled by the Spaces API, looks like this:
````json
{
"driveAlias": "project/mars",
"driveType": "project",
"id": "storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925",
"lastModifiedDateTime": "2023-01-24T21:19:26.417055+01:00",
"name": "Mars",
"owner": {
"user": {
"displayName": "",
"id": "89ad5ad2-5fdb-4877-b8c9-601a9670b925"
}
},
"quota": {
"remaining": 999853685,
"state": "normal",
"total": 1000000000,
"used": 146315
},
"root": {
"eTag": "\"910af0061161c42d8d1224df6c4a2527\"",
"id": "storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925",
"permissions": [
{
"grantedToIdentities": [
{
"user": {
"displayName": "Admin",
"id": "some-admin-user-id-0000-000000000000"
}
}
],
"roles": [
"manager"
]
}
],
"webDavUrl": "https://localhost:9200/dav/spaces/storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925"
},
"special": [
{
"eTag": "\"f97829324f63ce778095334cfeb0097b\"",
"file": {
"mimeType": "image/jpeg"
},
"id": "storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925!40171bea-3263-47a8-80ef-0ca20c37f45a",
"lastModifiedDateTime": "2022-02-15T17:11:50.000000496+01:00",
"name": "Mars_iStock-MR1805_20161221.jpeg",
"size": 146250,
"specialFolder": {
"name": "image"
},
"webDavUrl": "https://localhost:9200/dav/spaces/storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925%2189ad5ad2-5fdb-4877-b8c9-601a9670b925/.space/Mars_iStock-MR1805_20161221.jpeg"
},
{
"eTag": "\"ff38b31d8f109a4fbb98ab34499a3379\"",
"file": {
"mimeType": "text/markdown"
},
"id": "storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925!e2167612-7578-46e2-8ed7-971481037bc1",
"lastModifiedDateTime": "2023-01-24T21:10:23.661841+01:00",
"name": "readme.md",
"size": 65,
"specialFolder": {
"name": "readme"
},
"webDavUrl": "https://localhost:9200/dav/spaces/storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925%2189ad5ad2-5fdb-4877-b8c9-601a9670b925/.space/readme.md"
}
],
"webUrl": "https://localhost:9200/f/storage-users-1$89ad5ad2-5fdb-4877-b8c9-601a9670b925"
}
````
## Creating Spaces
### Create a single space `POST /drives`
https://owncloud.dev/libre-graph-api/#/drives/CreateDrive
### Create a space item (Enable sync) `POST /drives/{drive-id}/root/children`
https://owncloud.dev/libre-graph-api/#/drives.root/CreateDriveItem
## Reading Spaces
```shell
GET https://ocis.url/graph/{version}/{me/}drives/?{query-parameters}
```
| Component | Description |
|--------------------|------------------------------------------------------------------------------------------------------------------------|
| {version} | The version of the LibreGraph API used by the client. |
| {/me} | The `me` component of the part is optional. If used, you only see spaces where the acting user is a regular member of. |
| {query-parameters} | Optional parameters for the request to customize the response. |
### List all spaces `GET /drives`
Returns a list of all available spaces, even ones where the acting user is not a regular member of. You need elevated permissions to do list all spaces. If you don't have the elevated permissions, the result is the same like `GET /me/drives`.
{{< hint type=info title="Multiple Administration Personas" >}}
The ownCloud spaces concept draws a strict line between users which can work with the content of a space and others who have the permission to manage the space. A user which is able to manage quota and space metadata does not necessarily need to be able to access the content of a space.
**Space Admin**\
There is a global user role "Space Admin" which grants users some global permissions to manage space quota and some space metadata. This Role enables the user also to disable, restore and delete spaces. He cannot manage space members.
**Space Manager**\
The "Space Manager" is a user which is a regular member of a space because he has been invited. In addition to being part of a space the user can also manage the memberships of the space.
{{< /hint >}}
### List My Spaces `GET /me/drives`
https://owncloud.dev/libre-graph-api/#/me.drives/ListMyDrives
## Modifying Spaces
Modify the properties of a space. You need elevated permissions to execute this request.
### Set the space quota to 5GB `PATCH /drives/{drive-id}`
To limit the quota of a space you need to set the `quota.total` value. The API response will give back all actual quota properties.
````json
{
"quota": {
"remaining": 5368709120,
"state": "normal",
"total": 5368709120,
"used": 0
}
}
````
| Attribute | Description |
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| remaining | The remaining disk space in `bytes`. If the quota is not limited, this will show the total available disk space. |
| state | The state of the space in regards to quota usage. This can be used for visual indicators. It can be `normal`(<75%), `nearing`(between 75% and 89%), `critical`(between 90% and 99%) and `exceeded`(100%). |
| total | The space id. The value needs to be a space ID. |
| used | The used disk space in bytes. |
{{< tabs "set-space-quota" >}}
{{< tab "Request" >}}
```shell
curl -L -k -X PATCH 'https://localhost:9200/graph/v1.0/drives/storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff' \
-H 'Content-Type: application/json' \
--data-raw '{
"quota": {
"total": 5368709120
}
}'
```
{{< /tab >}}
{{< tab "Response - 200 OK" >}}
````json {hl_lines=[17]}
{
"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": {
"remaining": 5368709120,
"state": "normal",
"total": 5368709120,
"used": 0
},
"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 >}}
### Change the space name, subtitle and alias `PATCH /drives/{drive-id}`
You can change multiple space properties in one request as long as you submit a valid JSON body. Please be aware that some properties need different permissions.
{{< tabs "change-space-props" >}}
{{< tab "Request" >}}
```shell
curl -L -k -X PATCH 'https://localhost:9200/graph/v1.0/drives/storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "Mars",
"description": "Mission to mars",
"driveAlias": "project/mission-to-mars"
}'
```
{{< /tab >}}
{{< tab "Response - 200 OK" >}}
````json {hl_lines=[2,3,7]}
{
"description": "Mission to mars",
"driveAlias": "project/mission-to-mars",
"driveType": "project",
"id": "storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff",
"lastModifiedDateTime": "2023-01-19T14:17:36.094283+01:00",
"name": "Mars",
"owner": {
"user": {
"displayName": "",
"id": "535aa42d-a3c7-4329-9eba-5ef48fcaa3ff"
}
},
"quota": {
"remaining": 15,
"state": "normal",
"total": 15,
"used": 0
},
"root": {
"eTag": "\"f5fee4fdfeedd6f98956500779eee15e\"",
"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 >}}
## Disabling / Deleting Spaces
### Disable a space `DELETE /drives/{drive-id}`
This operation will make the space content unavailable for all space members. No data will be deleted.
{{< tabs "disable-space" >}}
{{< tab "Request" >}}
```shell
curl -L -k -X DELETE 'https://localhost:9200/graph/v1.0/drives/storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff/'
```
{{< /tab >}}
{{< tab "Response - 204 No Content" >}}
This response has no body value.
A disabled space will appear in listings with a `root.deleted.state=trashed` property. The space description and the space image will not be readable anymore.
```json {hl_lines=[18,19,20]}
{
"description": "Marketing team resources",
"driveAlias": "project/marketing",
"driveType": "project",
"id": "storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff",
"lastModifiedDateTime": "2023-01-19T14:17:36.094283+01:00",
"name": "Marketing",
"owner": {
"user": {
"displayName": "",
"id": "535aa42d-a3c7-4329-9eba-5ef48fcaa3ff"
}
},
"quota": {
"total": 15
},
"root": {
"deleted": {
"state": "trashed"
},
"eTag": "\"f5fee4fdfeedd6f98956500779eee15e\"",
"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 >}}
### Restore a space `PATCH /drives/{drive-id}`
This operation will make the space content available again to all members. No content will be changed.
To restore a space, the Header `Restore: T` needs to be set.
{{< tabs "restore-space" >}}
{{< tab "Request" >}}
```shell
curl -L -X PATCH 'https://localhost:9200/graph/v1.0/drives/storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff/' \
-H 'Restore: T' \
-H 'Content-Type: text/plain' \
--data-raw '{}'
```
{{< hint type=info title="Body value" >}}
This request needs an empty body (--data-raw '{}') to fulfil the standard libregraph specification even when the body is not needed.
{{< /hint >}}
{{< /tab >}}
{{< tab "Response - 200 OK" >}}
```json
{
"description": "Marketing team resources",
"driveAlias": "project/marketing",
"driveType": "project",
"id": "storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff",
"lastModifiedDateTime": "2023-01-19T14:17:36.094283+01:00",
"name": "Marketing",
"owner": {
"user": {
"displayName": "",
"id": "535aa42d-a3c7-4329-9eba-5ef48fcaa3ff"
}
},
"quota": {
"remaining": 15,
"state": "normal",
"total": 15,
"used": 0
},
"root": {
"eTag": "\"f5fee4fdfeedd6f98956500779eee15e\"",
"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 >}}
### Permanently delete a space `DELETE /drives/{drive-id}`
This operation will delete a space and all its data permanently. This is restricted to spaces which are already disabled.
To delete a space, the Header `Purge: T` needs to be set.
{{< tabs "delete-space" >}}
{{< tab "Request" >}}
```shell {hl_lines=[2]}
curl -L -X DELETE 'https://localhost:9200/graph/v1.0/drives/storage-users-1$535aa42d-a3c7-4329-9eba-5ef48fcaa3ff' \
-H 'Purge: T'
```
{{< hint type=warning title="Data will be deleted" >}}
This request will delete a space and all its content permanently. This operation cannot be reverted.
{{< /hint >}}
{{< /tab >}}
{{< tab "Response - 204 No Content" >}}
This response has no body value.
{{< /tab >}}
{{< tab "Response - 400 Bad Request" >}}
The space to be deleted was not disabled before.
```json
{
"error": {
"code": "invalidRequest",
"innererror": {
"date": "2023-01-24T19:57:19Z",
"request-id": "f62af40f-bc18-475e-acd7-e9008d6bd326"
},
"message": "error: bad request: can't purge enabled space"
}
}
```
{{< /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
-270
View File
@@ -1,270 +0,0 @@
---
title: Users
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/graph
geekdocFilePath: users.md
---
{{< toc >}}
## Users API
The Users API is implementing a subset of the functionality of the
[MS Graph User resource](https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0)
The JSON representation of a User handled by the Users API looks like this:
```
{
"displayName": "Albert Einstein",
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"mail": "einstein@example.org",
"onPremisesSamAccountName": "einstein"
}
```
Our implementation currently supports only a limited set of Attributes of Users:
| Attribute | Description |
|---------------|---------------------------------------------------------------------------------------------------------------------------|
| displayName | The full name of the user, usually a combination of given name and last name |
| mail | The user's email address |
| onPremisesSamAccountName | The loginname/account name of the user |
| id | An unique, stable readonly identifier for the user that stays the same for the whole lifetime of the User, usually a UUID |
| passwordProfile | Contains the password of the users. This is only present when updating or creating users. It is never returned by the API |
### Reading users
#### `GET /me`
Returns the user object of the currently signed-in user
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/me' -u user:password
```
Response:
```
{
"displayName": "Albert Einstein",
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"mail": "einstein@example.org",
"onPremisesSamAccountName": "einstein"
}
```
#### `GET /users`
Returns a list of all users
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/users' -u user:password
```
Response:
```
{
"value": [
{
"displayName": "Albert Einstein",
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"mail": "einstein@example.org",
"onPremisesSamAccountName": "einstein"
},
{
"displayName": "Maurice Moss",
"id": "058bff95-6708-4fe5-91e4-9ea3d377588b",
"mail": "moss@example.org",
"onPremisesSamAccountName": "moss"
}
]
}
```
#### `GET /users?$expand=memberOf`
Returns a list of all users
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/users?$expand=memberOf' -u user:password
```
Response:
```
{
"value": [
{
"displayName": "Albert Einstein",
"id": "4c510ada-c86b-4815-8820-42cdf82c3d51",
"mail": "einstein@example.org",
"onPremisesSamAccountName": "einstein",
"memberOf": [
{
"displayName": "users",
"id": "509a9dcd-bb37-4f4f-a01a-19dca27d9cfa"
},
{
"displayName": "sailing-lovers",
"id": "6040aa17-9c64-4fef-9bd0-77234d71bad0"
},
{
"displayName": "violin-haters",
"id": "dd58e5ec-842e-498b-8800-61f2ec6f911f"
},
{
"displayName": "physics-lovers",
"id": "262982c1-2362-4afa-bfdf-8cbfef64a06e"
}
],
},
{
"displayName": "Maurice Moss",
"id": "058bff95-6708-4fe5-91e4-9ea3d377588b",
"mail": "moss@example.org",
"onPremisesSamAccountName": "moss",
"memberOf": [
{
"displayName": "users",
"id": "509a9dcd-bb37-4f4f-a01a-19dca27d9cfa"
}
],
}
]
}
```
#### `GET /users/{userid or accountname}`
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/users/058bff95-6708-4fe5-91e4-9ea3d377588b' -u user:password
```
Response:
```
{
"displayName": "Maurice Moss",
"id": "058bff95-6708-4fe5-91e4-9ea3d377588b",
"mail": "moss@example.org",
"onPremisesSamAccountName": "moss"
}
```
#### `GET /users/{userid or accountname}?$expand=memberOf`
Example:
```
curl -k 'https://localhost:9200/graph/v1.0/users/058bff95-6708-4fe5-91e4-9ea3d377588b?$expand=memberOf' -u user:password
```
Response:
```
{
"displayName": "Maurice Moss",
"id": "058bff95-6708-4fe5-91e4-9ea3d377588b",
"mail": "moss@example.org",
"onPremisesSamAccountName": "moss",
"memberOf": [
{
"displayName": "users",
"id": "509a9dcd-bb37-4f4f-a01a-19dca27d9cfa"
}
],
}
```
### Creating / Updating Users
#### `POST /users`
Use this to create a new user.
##### Request Body
Note the missing `"id"` Attribute. It will be generated by the server:
```
{
"displayName": "Example User",
"mail": "example@example.org",
"onPremisesSamAccountName": "example",
"passwordProfile": {
"password": "ThePassword"
}
}
```
##### Response
When successful, the response will return the new user, without the password, but including the newly allocated `"id"`:
```
{
"displayName":"Example User",
"id":"c067b139-c91c-4e47-8be6-669156a0587b",
"mail":"example@example.org",
"onPremisesSamAccountName":"example"
}
```
#### `DELETE /users/{id}`
Example:
```
curl -k --request DELETE 'https://localhost:9200/graph/v1.0/users/c067b139-c91c-4e47-8be6-669156a0587b' -u user:password
```
When successful the API returns no response body and the HTTP status code 204 (No Content)
#### `PATCH /users/{id}`
Updating attributes of a single user can be done with a patch request. The Request Body contains the new values of the attributes
to be updated. E.g. to update the `displayName` Attribute:
```
curl -k --header "Content-Type: application/json" \
--request PATCH --data '{"displayName": "Test User" }' \
'https://localhost:9200/graph/v1.0/users/c54b0588-7157-4521-bb52-c1c8ca84ea71' -u user:password
```
Similar to creating a user via `POST`, the `PATCH` request will return the user object containing the new attribute values.
### Change password
#### `POST /me/changePassword`
Users can change their own password by sending a POST request to `/me/changePassword`
##### Request Body
```
{
"currentPassword": "current",
"newPassword": "new"
}
```
When successful the API returns no response body and the HTTP status code 204 (No Content)
```
curl -i -k --header "Content-Type: application/json" \
--request POST --data '{"currentPassword": "current", "newPassword": "new" }' \
'https://localhost:9200/graph/v1.0/me/changePassword' -u user:current
```
-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 >}}
-13
View File
@@ -1,13 +0,0 @@
---
title: Architecture
date: 2023-12-06T13:00:00+01:00
weight: 10
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.
*Pictures tell more than a thousand words.*
-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.
-202
View File
@@ -1,202 +0,0 @@
---
title: "Efficient Stat Polling"
date: 2020-03-03T10:31:00+01:00
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/architecture
geekdocFilePath: efficient-stat-polling.md
---
The fallback sync mechanism uses the ETag to determine which part of a sync tree needs to be checked by recursively descending into folders whose ETag has changed. The ETag can be calculated using a `stat()` call in the filesystem and we are going to explore how many `stat()` calls are necessary and how the number might be reduced.
## ETag propagation
What does ETag propagation mean? Whenever a file changes its content or metadata the ETag or "entity tag" changes. In the early days of ownCloud it was decided to extend this behavior to folders as well, which is outside of any WebDAV RFC specification. Nevertheless, here we are, using the ETag to reflect changes, not only on WebDAV resources but also WebDAV collections. The server will propagate the ETag change up to the root of the tree.
{{<mermaid class="text-center">}}
graph TD
linkStyle default interpolate basis
subgraph final ETag propagation
ert3(( etag:N )) --- el3(( etag:O )) & er3(( etag:N ))
er3 --- erl3(( etag:O )) & err3(( etag:N ))
end
subgraph first ETag propagation
ert2(( etag:O )) --- el2(( etag:O )) & er2(( etag:N ))
er2 --- erl2(( etag:O )) & err2(( etag:N ))
end
subgraph initial file change
ert(( etag:O )) --- el(( etag:O )) & er(( etag:O ))
er --- erl(( etag:O )) & err(( etag:N ))
end
{{</mermaid>}}
The old `etag:O` is replaced by propagating the new `etag:N` up to the root, where the client will pick it up and explore the tree by comparing the old ETags known to him with the state of the current ETags on the server. This form of sync is called *state based sync*.
## Single user sync
To let the client detect changes in the drive (a tree of files and folders) of a user, we rely on the ETag of every node in the tree. The discovery phase starts at the root of the tree and checks if the ETag has changed since the last discovery:
- if it is still the same nothing has changed inside the tree
- if it changed the client will compare the ETag of all immediate children and recursively descend into every node that changed
This works, because the server side will propagate ETag changes in the tree up to the root.
{{<mermaid class="text-center">}}
graph TD
linkStyle default interpolate basis
ec( client ) -->|"stat()"|ert
subgraph
ert(( )) --- el(( )) & er(( ))
er --- erl(( )) & err(( ))
end
{{</mermaid>}}
## Multiple users
On an ocis server there is not one user but many. Each of them may have one or more clients running. In the worst case all of them polling the ETag of his home root node every 30 seconds.
Keep in mind that etags are only propagated inside each distinct tree. No sharing is considered yet.
{{<mermaid class="text-center">}}
graph TD
linkStyle default interpolate basis
ec( client ) -->|"stat()"|ert
subgraph
ert(( )) --- el(( )) & er(( ))
er --- erl(( )) & err(( ))
end
mc( client ) -->|"stat()"|mrt
subgraph
mrt(( )) --- ml(( )) & mr(( ))
mr --- mrl(( )) & mrr(( ))
end
fc( client ) -->|"stat()"|frt
subgraph
frt(( )) --- fl(( )) & fr(( ))
fr --- frl(( )) & frr(( ))
end
{{</mermaid>}}
## Sharing
*Storage providers* are responsible for persisting shares as close to the storage as possible.
One implementation may persist shares using ACLs, another might use custom extended attributes. The chosen implementation is storage specific and always a tradeoff between various requirements. Yet, the goal is to treat the storage provider as the single source of truth for all metadata.
If users can bypass the storage provider using e.g. `ssh` additional mechanisms needs to make sure no inconsistencies arise:
- the ETag must still be propagated in a tree, eg using inotify, a policy engine or workflows triggered by other means
- deleted files should land in the trash (e.g. `rm` could be wrapped to move files to trash)
- overwriting files should create a new version ... other than a fuse fs I see no way of providing this for normal posix filesystems. Other storage backends that use the s3 protocol might provide versions natively.
The storage provider is also responsible for keeps track of references e.g. using a shadow tree that users normally cannot see or representing them as symbolic links in the filesystem (Beware of symbolic link cycles. The clients are currently unaware of them and would flood the filesystem).
To prevent write amplification ETags must not propagate across references. When a file that was shared by einstein changes the ETag must not be propagated into any share recipients tree.
{{<mermaid class="text-center">}}
graph TD
linkStyle default interpolate basis
ec( einsteins client ) -->|"stat()"|ert
subgraph
ml --- mlr(( ))
mrt(( )) --- ml(( )) & mr(( ))
mr --- mrl(( )) & mrr(( ))
end
mlr -. reference .-> er
subgraph
ert(( )) --- el(( )) & er(( ))
er --- erl(( )) & err(( ))
end
mc( maries client ) -->|"stat()"|mrt
{{</mermaid>}}
But how can Marie's client detect the change?
We are trading writes for reads: the client needs to stat the own tree & all shares or entry points into other storage trees.
It would require client changes that depend on the server side actually having an endpoint that can efficiently list all entry points into storages a user has access to including their current etag.
But having to list n storages might become a bottleneck anyway, so we are going to have the gateway calculate a virtual root ETag for all entry points a user has access to and cache that.
## Server Side Stat Polling
Every client polls the virtual root ETag (every 30 sec). The gateway will cache the virtual root ETag of every storage for 30 sec as well. That way every storage provider is only stated once every 30 sec (can be throttled dynamically to adapt to storage io load).
{{<mermaid class="text-center">}}
graph TD
linkStyle default interpolate basis
ec( client ) -->|"stat()"|evr
subgraph gateway caching virtual etags
evr(( ))
mvr(( ))
fvr(( ))
end
evr --- ert
mvr --- mrt
fvr --- frt
subgraph
ert(( )) --- el(( )) & er(( ))
er --- erl(( )) & err(( ))
end
mc( client ) -->|"stat()"|mvr
subgraph
mrt(( )) --- ml(( )) & mr(( ))
ml --- mlm(( ))
mr --- mrl(( )) & mrr(( ))
end
mlm -.- er
mvr -.- er
fc( client ) -->|"stat()"|fvr
subgraph
frt(( )) --- fl(( )) & fr(( ))
fr --- frl(( )) & frr(( ))
end
{{</mermaid>}}
Since the active clients will poll the etag for all active users the gateway will have their ETag cached. This is where sharing comes into play: The gateway also needs to stat the ETag of all other entry points ... or mount points. That may increase the number of stat like requests to storage providers by an order of magnitude.
### Ram considerations
For a single machine using a local posix storage the linux kernel already caches the inodes that contain the metadata that is necessary to calculate the ETag (even extended attributes are supported). With 4k inodes 256 nodes take 1Mb of RAM, 1k inodes take 4Mb and 1M inodes take 4Gb to completely cache the file metadata. For distributed filesystems a dedicated cache might make sense to prevent hammering it with stat like requests to calculate ETags.
### Bandwidth considerations
The bandwidth for a single machine might be another bottleneck. Consider a propfind request with roughly 500 bytes and a response with roughly 800 bytes in size:
- At 100Mbit (~10Mb/s) you can receive 20 000 PROPFIND requests
- At 1000Mbit (~100Mb/s) you can receive 200 000 PROPFIND requests
- At 10Gbit (~1Gb/s) you can receive 2 000 000 PROPFIND requests
This can be scaled by adding more gateways and sharding users because these components are stateless.
## Share mount point polling cache
What can we do to reduce the number of stat calls to storage providers. Well, the gateway queries the share manager for all mounted shares of a user (or all entry points, not only the users own root/home). The share references contain the storage provider that contains the share. If every user has its own storage provider id the gateway could check in its own cache if the storage root etag has changed. It will be up-to-date because another client likely already polled for its etag.
This would reduce the number of necessary stat requests to active storages.
### Active share node cache invalidation
We can extend the lifetime of share ETag cache entries and only invalidate them when the root of the storage that contains them changes its ETag. That would reduce the number of stat requests to the number of active users.
### Push notifications
We can further enhance this by sending push notifications when the root of a storage changes. Which is becoming increasingly necessary for mobile devices anyway.
-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"
```
-200
View File
@@ -1,200 +0,0 @@
---
title: "Protocol changes"
date: 2022-05-17T08:46:00+01:00
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/architecture
geekdocFilePath: protocol-changes.md
---
The spaces concept allows clients to look up the space endpoints a user has access to and then do individual sync discoveries. Technically, we introduce an indirection that allows clients to rely on server provided URLs instead of hardcoded `/webdav` or `/dav/files/{username}` paths, that may change over time.
## Space discovery
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant Graph
participant SpaceA
participant SpaceB
links Client: {"web": "https://owncloud.dev/clients/web/", "RClone": "https://owncloud.dev/clients/rclone/"}
link Graph: Documentation @ https://owncloud.dev/extensions/graph/
Note left of Client: First, a clients looks<br/>up the spaces a user has access to
opt space lookup
Client->>+Graph: GET /me/drives
Graph-->>-Client: 200 OK JSON list of spaces, say A, B and C,<br/> each with a dedicated webDavURL, etag and quota
end
Note left of Client: Then it can do a parallel<br/>sync discovery on spaces<br/>whose etag changed
par Client to Space A
Client->>+SpaceA: PROPFIND {webDavURL for Space A}
SpaceA-->>-Client: 207 Multistatus PROPFIND response
and Client to Space B
Client->>+SpaceB: PROPFIND {webDavURL for space B}
SpaceB-->>-Client: 207 Multistatus PROPFIND response
end
{{</mermaid>}}
### New /dav/spaces/{spaceid} endpoint with spaceid and a relative path
The ocDAV service is responsible for translating ownCloud flavoured WebDAV into CS3 API calls.
**General view**
A PROPFIND finds its way to a storage provider like this:
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant ocDAV
participant StorageProvider
Note right of Client: {spaceid} identifies the space<br>{relative/path} is relative to the space root
Client->>+ocDAV: PROPFIND /dav/space/{spaceid}/{relative/path}
Note right of ocDAV: translate ownCloud flavoured webdav<br>into CS3 API requests
ocDAV->>+StorageProvider: ListContainer({spaceid}, path: {relative/path})
StorageProvider-->>-ocDAV: []ResourceInfo
ocDAV-->>-Client: 207 Multistatus
{{</mermaid>}}
While the above is a simplification to get an understanding of what needs to go where, there are several places where sharding can happen.
**Proxy can do user based routing**
The ocis proxy authenticates requests and can forward requests to different backends, depending on the logged-in user or cookies. For example multiple ocdav services can be configured to shard users based on username or affiliation.
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant proxy
participant ocDAV1 as ocDAV [a-k]
participant ocDAV2 as ocDAV [l-z]
Note right of Client: {spaceid} identifies the space<br>{relative/path} is relative to the space root
Client->>+proxy: PROPFIND /dav/space/{spaceid}/{relative/path}
alt username starting with a-k
proxy->>+ocDAV1: PROPFIND /dav/space/{spaceid}/{relative/path}
Note right of ocDAV1: translate ownCloud flavoured webdav<br>into CS3 API requests
ocDAV1-->>-Client: 207 Multistatus
else username starting with l-z
proxy->>+ocDAV2: PROPFIND /dav/space/{spaceid}/{relative/path}
ocDAV2-->>-Client: 207 Multistatus
end
{{</mermaid>}}
**Gateway can do path or storage provider id based routing**
The reva gateway acts as a facade to multiple storage providers that can be configured with the storage registry:
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant ocDAV
participant Gateway
participant StorageRegistry
participant StorageProvider1 as StorageProvider [a-k]
participant StorageProvider2 as StorageProvider [l-z]
Note right of ocDAV: translate ownCloud flavoured webdav<br>into CS3 API requests
ocDAV->>+Gateway: ListContainer({spaceid}, path: {relative/path})
Note right of Gateway: find address of the storage provider<br>that is responsible for the space
Gateway->>+StorageRegistry: ListStorageProviders({spaceid})
StorageRegistry-->>-Gateway: []ProviderInfo
Note right of Gateway: forward request to<br>correct storage provider
alt username starting with a-k
Gateway->>+StorageProvider1: ListContainer({spaceid}, path: {relative/path})
StorageProvider1-->>-Gateway: []ResourceInfo
else username starting with l-z
Gateway->>+StorageProvider2: ListContainer({spaceid}, path: {relative/path})
StorageProvider2-->>-Gateway: []ResourceInfo
end
Gateway-->>-ocDAV: []ResourceInfo
{{</mermaid>}}
### Old /dav/files/{username} endpoint with username and a path relative to the users home
**PROPFIND request against old webdav endpoints**
To route a PROPFIND request against the old webdav endpoints like `/dav/files/username`, ocdav first has to build a CS3 namespace prefix, e.g. `/users/{{.Id.OpaqueId}}` to the users home.
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant ocDAV
participant Gateway
opt old /dav/files/{username} endpoint with username and a path relative to the users home
Note right of Client: translate ownCloud flavoured webdav<br>into CS3 API requests
Client->>+ocDAV: PROPFIND /dav/files/{username}/{relative/path}
Note right of ocDAV: translate ownCloud flavoured webdav<br>into CS3 API requests
ocDAV->>+Gateway: GetUser({username})
Gateway-->>-ocDAV: User
Note right of ocDAV: build path prefix to user home
ocDAV->>+ocDAV: {namespace/prefix} = ApplyLayout({path layout}, User), eg. /users/e/einstein
Note right of ocDAV: look up the space responsible for a path
ocDAV->>+Gateway: ListStorageSpaces(path: {namespace/prefix}/{relative/path})
Gateway-->>-ocDAV: []StorageSpace
Note right of ocDAV: make actual request with space and relative path
ocDAV->>+Gateway: ListContainer({spaceid}, path: {relative/path})
Gateway-->>-ocDAV: []ResourceInfo
ocDAV-->>-Client: 207 Multistatus
end
{{</mermaid>}}
**Handling legacy global namespace webdav endpoints**
The reason ocis uses a path based lookup instead of looking up the current users home using the user id and a space type filter is, because there are deployments that use a global namespace at the legacy `/webdav` endpoint. To support these use cases, the gateway allows looking up spaces using their mount path.
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant ocDAV
participant Gateway
Note right of Client: translate ownCloud flavoured webdav<br>into CS3 API requests
alt old /dav/files/{username} endpoint with username and a path relative to the users home
Client->>+ocDAV: PROPFIND /dav/files/{username}/{relative/path}
Note right of ocDAV: look up {username} in URL path
ocDAV->>+Gateway: GetUser({username})
Gateway-->>-ocDAV: User
Note right of ocDAV:build namespace prefix to user home
ocDAV->>+ocDAV: {namespace/prefix} = ApplyLayout({namespace layout}, User), eg. /users/e/einstein
else legacy /webdav/ endpoint with a path relative to the users home
Client->>+ocDAV: PROPFIND /webdav/{relative/path}
Note right of ocDAV: use currently logged in user
ocDAV->>+ocDAV: ContextGetUser()
Note right of ocDAV: build namespace prefix to user home
ocDAV->>+ocDAV: {namespace/prefix} = ApplyLayout({namespace layout}, User), eg. /users/e/einstein
else legacy /webdav/ endpoint with a path relative to a global namespace
Client->>+ocDAV: PROPFIND /webdav/{relative/path}
Note right of ocDAV: omit namespace prefix by using empty layout template
ocDAV->>+ocDAV: {namespace/prefix} = ApplyLayout("/", u), always returns "/"
end
Note right of ocDAV: look up the space responsible for a path
ocDAV->>+Gateway: ListStorageSpaces(path: {namespace/prefix}/{relative/path})
Gateway-->>-ocDAV: []StorageSpace
Note right of ocDAV: make actual request with space and relative path
ocDAV->>+Gateway: ListContainer({spaceid}, path: {relative/path})
Gateway-->>-ocDAV: []ResourceInfo
ocDAV-->>-Client: 207 Multistatus
{{</mermaid>}}
@@ -1,10 +0,0 @@
---
title: "Services Communication"
date: 2022-02-15T11:26:00+01:00
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/architecture
geekdocFilePath: services-communication.md
---
{{< figure src="/ocis/static/ocis-services-communication.drawio.svg" >}}
-133
View File
@@ -1,133 +0,0 @@
---
title: "Upload processing"
date: 2022-07-06T12:47:00+01:00
weight: 30
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/architecture
geekdocFilePath: upload-processing.md
---
Uploads are handled by a dedicated service that uses TUS.io for resumable uploads. When all bytes have been transferred the upload is finalized by making the file available in file listings and for download.
The finalization may be asynchronous when mandatory workflow steps are involved.
## Legacy PUT upload
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant ocdav
participant storageprovider
participant dataprovider
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}
dataprovider-->>-ocdav: 201 Created
ocdav-->>-Client: 201 Created
{{</mermaid>}}
## TUS upload
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant ocdav
participant storageprovider
participant datagateway
participant dataprovider
Client->>+ocdav: POST /dav/spaces/{spaceid}\nUpload-Metadata: {base64 encoded filename etc}\nTUS-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
Client->>+datagateway: PATCH /data/{jwt}\nTUS-Resumable: 1.0.0\nUpload-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
{{</mermaid>}}
## TUS upload with async postprocessing
{{<mermaid class="text-center">}}
%%{init: {"sequence": { "showSequenceNumbers":true, "messageFontFamily":"courier", "messageFontWeight":"normal", "messageFontSize":"11"}}}%%
%% font weight is a css bug: https://github.com/mermaid-js/mermaid/issues/1976
%% edit this diagram by pasting it into eg. https://mermaid.live
sequenceDiagram
participant Client
participant ocdav
participant storageprovider
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
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
Client->>+datagateway: PATCH /data/{jwt}
Note right of datagateway: TUS-Resumable: 1.0.0\nUpload-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
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
alt success
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
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
end
{{</mermaid>}}
## Async TUS upload with postprocessing
This might be a TUS extension or a misunderstanding on our side of what tus can do for us. Clients should send a `Prefer: respond-async` header to allow the server to return early when postprocessing might take longer. The PATCH requests can then return status `202 Accepted` and a `Location` header to a websocket that clients can use to track the processing / upload progress.
TODO there is a conflict with the TUS.io POST request with the creation extension, as that also returns a `Location` header which carries the upload URL. We would need another header to transport the websocket location. Maybe `Websocket-Location` or `Progress-Location`?
-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.
@@ -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.
@@ -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.
@@ -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/" >}})
@@ -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
---
-25
View File
@@ -1,25 +0,0 @@
---
title: Rclone
date: 2021-11-17T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/clients/rclone
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
## About Rclone
{{< hint ok >}}
Rclone is a command line program to manage files on cloud storage. It is a feature rich alternative to cloud vendors' web storage interfaces. Over 40 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.
Rclone has powerful cloud equivalents to the unix commands rsync, cp, mv, mount, ls, ncdu, tree, rm, and cat. Rclone's familiar syntax includes shell pipeline support, and --dry-run protection. It is used at the command line, in scripts or via its API.
Users call rclone "The Swiss army knife of cloud storage", and "Technology indistinguishable from magic".
{{< /hint >}}
Source: [Rclone project website](https://rclone.org/)
## Table of Contents
{{< toc-tree >}}
@@ -1,46 +0,0 @@
---
title: WebDAV with Basic Authentication
date: 2021-11-17T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/clients/rclone
geekdocFilePath: webdav-sync-basic-auth.md
geekdocCollapseSection: true
---
## WebDAV with Basic Authentication
{{< hint danger >}}
Basic Authentication is disabled by default in oCIS because of security considerations. In order to make the following Rclone commands work the oCIS administrator needs to enable Basic Authentication e.g. by setting the environment variable `PROXY_ENABLE_BASIC_AUTH` to `true`.
Please consider to use [Rclone with OpenID Connect]({{< ref "webdav-sync-oidc.md" >}}) instead.
{{< /hint >}}
For the usage of a WebDAV remote with Rclone see also the [Rclone documentation](https://rclone.org/webdav/)
## Configure the WebDAV remote
First of all we need to set up our credentials and the WebDAV remote for Rclone. In this example we do this by setting environment variables. You might also set up a named remote or use command line options to achieve the same.
``` bash
export RCLONE_WEBDAV_VENDOR=owncloud
export RCLONE_WEBDAV_URL=https://ocis.owncloud.test/remote.php/webdav/
export RCLONE_WEBDAV_USER=einstein
export RCLONE_WEBDAV_PASS=$(rclone obscure relativity)
```
{{< hint info >}}
Please note that `RCLONE_WEBDAV_PASS` is not set to the actual password, but to the value returned by `rclone obscure <password>`.
{{< /hint >}}
We now can use Rclone to sync the local folder `/tmp/test` to `/test` in your oCIS home folder.
### Sync to the WebDAV remote
``` bash
rclone sync :local:/tmp :webdav:/test
```
If your oCIS doesn't use valid SSL certificates, you may need to use `rclone --no-check-certificate sync ...`.
-77
View File
@@ -1,77 +0,0 @@
---
title: WebDAV with OpenID Connect
date: 2021-11-17T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/clients/rclone
geekdocFilePath: webdav-sync-oidc.md
geekdocCollapseSection: true
---
## WebDAV with OpenID Connect
Rclone itself is not able to open and maintain an OpenID Connect session. But it is able to still use OpenID Connect for authentication by leveraging a so called OIDC-agent.
### Setting up the OIDC-agent
You need to install the [OIDC-agent](https://github.com/indigo-dc/oidc-agent) from your OS' package repository (e.g. [Debian](https://github.com/indigo-dc/oidc-agent#debian-packages) or [MacOS](https://github.com/indigo-dc/oidc-agent#debian-packages)).
### Configuring the OIDC-agent
Run the following command to add a OpenID Connect profile to your OIDC-agent. It will open the login page of OpenID Connect identity provider where you need to log in if you don't have an active session.
``` bash
oidc-gen \
--client-id=oidc-agent \
--client-secret="" \
--pub \
--issuer https://ocis.owncloud.test \
--redirect-uri=http://localhost:12345 \
--scope max \
einstein-ocis-owncloud-test
```
If you have dynamic client registration enabled on your OpenID Connect identity provider, you can skip the `--client-id`, `--client-secret` and `--pub` options.
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 \
--client-id=xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69 \
--client-secret=UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh \
--issuer https://cloud.ocis.test \
--redirect-uri=http://localhost:12345 \
--scope="openid offline_access profile email" \
my-client
```
When using a self signed certificate you have to provide the certificate chain using `--cp /etc/ssl/certs/test.cert.pem`. In case oidc-gen cannot determine the flow try with `--flow=code`.
Please also note that the OIDC-agent will listen on your localhost interface on port 12345 for the time of the initial authentication. If that port is already occupied on your machine, you can easily change that by setting the `--redirect-uri` parameter to a different value.
After a successful login or an already existing session you will be redirected to success page of the OIDC-agent.
You will now be asked for a password for your account configuration, so that your OIDC session is secured and cannot be used by other people with access to your computer.
## Configure the WebDAV remote
First of all we need to set up our credentials and the WebDAV remote for Rclone. In this example we do this by setting environment variables. You might also set up a named remote or use command line options to achieve the same.
``` bash
export RCLONE_WEBDAV_VENDOR=owncloud
export RCLONE_WEBDAV_URL=https://ocis.owncloud.test/remote.php/webdav/
export RCLONE_WEBDAV_BEARER_TOKEN_COMMAND="oidc-token einstein-ocis-owncloud-test"
```
### Sync to the WebDAV remote
We now can use Rclone to sync the local folder `/tmp/test` to `/test` in your oCIS home folder.
``` bash
rclone sync :local:/tmp :webdav:/test
```
If your oCIS doesn't use valid SSL certificates, you may need to use `rclone --no-check-certificate sync ...`.
-10
View File
@@ -47,16 +47,6 @@ variables:
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
-1
View File
@@ -1 +0,0 @@
configuration.md
-67
View File
@@ -1,67 +0,0 @@
---
title: "oCIS - ownCloud Infinite Scale"
date: 2020-02-27T20:35:00+01:00
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" >}}
## ownCloud Infinite Scale
Welcome to oCIS, the modern file-sync and share platform, which is based on our knowledge and experience with the PHP based [ownCloud server](https://owncloud.com/#server).
### The idea of federated storage
To create a truly federated storage architecture oCIS breaks down the old ownCloud Classic user specific namespace, which is assembled on the server side, and makes the individual parts accessible to clients as storage spaces and storage space registries.
The diagram below shows the core concepts that are the foundation for the new architecture:
- End user devices can fetch the list of *storage spaces* a user has access to, by querying one or multiple *storage space registries*. The list contains a unique endpoint for every *storage space*.
- [*Storage space registries*]({{< ref "./storage/terminology#storage-space-registries" >}}) manage the list of storage spaces a user has access to. They may subscribe to *storage spaces* in order to receive notifications about changes on behalf of an end users mobile or desktop client.
- [*Storage spaces*]({{< ref "./storage/terminology#storage-spaces" >}}) represent a collection of files and folders. A users personal files are contained in a *storage space*, a group or project drive is a *storage space*, and even incoming shares are treated and implemented as *storage spaces*. Each with properties like owners, permissions, quota and type.
- [*Storage providers*]({{< ref "./storage/terminology#storage-providers" >}}) can hold multiple *storage spaces*. At an oCIS instance, there might be a dedicated *storage provider* responsible for users personal storage spaces. There might be multiple, either to shard the load, provide different levels of redundancy or support custom workflows. Or there might be just one, hosting all types of *storage spaces*.
{{< figure src="/ocis/static/idea.drawio.svg" >}}
As an example, Einstein might want to share something with Marie, who has an account at a different identity provider and uses a different storage space registry. The process makes use of [OpenID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html) for authentication and would look something like this:
To share something with Marie, Einstein would open `https://cloud.zurich.test`. His browser loads oCIS web and presents a login form that uses the [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#EmailSyntax) to look up the OIDC issuer. For `einstein@zurich.test` he will end up at `https://idp.zurich.test`, authenticate and get redirected back to `https://cloud.zurich.test`. Now, oCIS web will use a similar discovery to look up the *storage space registry* for the account, based on the email (or username). He will discover that `https://cloud.zurich.test` is also his *storage registry* that the web UI will use to load the list of *storage spaces* that are available to him.
After locating a folder that he wants to share with Marie he enters her email `marie@paris.test` in the sharing dialog to grant her the editor role. This, in effect, creates a new *storage space* that is registered with the *storage space registry* at `https://cloud.zurich.test`.
Einstein copies the URL in the browser (or an email with the same URL is sent automatically, or the storage registries use a back-channel mechanism). It contains the most specific `storage space id` and a path relative to it: `https://cloud.zurich.test/#/spaces/716199a6-00c0-4fec-93d2-7e00150b1c84/a/rel/path`.
When Marie enters that URL she will be presented with a login form on the `https://cloud.zurich.test` instance, because the share was created on that domain. If `https://cloud.zurich.test` trusts her OpenID Connect identity provider `https://idp.paris.test` she can log in. This time, the *storage space registry* discovery will come up with `https://cloud.paris.test` though. Since that registry is different than the registry tied to `https://cloud.zurich.test` oCIS web can look up the *storage space* `716199a6-00c0-4fec-93d2-7e00150b1c84` and register the WebDAV URL `https://cloud.zurich.test/dav/spaces/716199a6-00c0-4fec-93d2-7e00150b1c84/a/rel/path` in Marie's *storage space registry* at `https://cloud.paris.test`. When she accepts that share her clients will be able to sync the new *storage space* at `https://cloud.zurich.test`.
### oCIS microservice runtime
The oCIS runtime allows us to dynamically manage services running in a single process. We use [suture](https://github.com/thejerf/suture) to create a supervisor tree that starts each service in a dedicated goroutine. By default oCIS will start all built-in oCIS services in a single process. Individual services can be moved to other nodes to scale-out and meet specific performance requirements. A [go-micro](https://github.com/asim/go-micro/blob/master/registry/registry.go) based registry allows services in multiple nodes to form a distributed microservice architecture.
### oCIS Services
Every oCIS service uses [ocis-pkg](https://github.com/owncloud/ocis/tree/master/ocis-pkg), which implements the [go-micro](https://go-micro.dev/) interfaces for [servers](https://github.com/asim/go-micro/blob/v3.5.0/server/server.go#L17-L37) to register and [clients](https://github.com/asim/go-micro/blob/v3.5.0/client/client.go#L11-L23) to lookup nodes with a service [registry](https://github.com/asim/go-micro/blob/v3.5.0/registry/registry.go).
We are following the [12 Factor](https://12factor.net/) methodology with oCIS. The uniformity of services also allows us to use the same command, logging and configuration mechanism. Configurations are forwarded from the
oCIS runtime to the individual extensions.
### go-micro
While the [go-micro](https://go-micro.dev/) framework provides abstractions as well as implementations for the different components in a microservice architecture, it uses a more developer focused runtime philosophy: It is used to download services from a repo, compile them on the fly and start them as individual processes. For oCIS we decided to use a more admin friendly runtime: You can download a single binary and start the contained oCIS services with a single `bin/ocis server`. This also makes packaging easier.
We use [ocis-pkg](https://github.com/owncloud/ocis/tree/master/ocis-pkg) to configure the default implementations for the go-micro [grpc server](https://github.com/asim/go-micro/tree/v3.5.0/plugins/server/grpc), [client](https://github.com/asim/go-micro/tree/v3.5.0/plugins/client/grpc) and [mdns registry](https://github.com/asim/go-micro/blob/v3.5.0/registry/mdns_registry.go), swapping them out as needed, e.g. to use the [kubernetes registry plugin](https://github.com/asim/go-micro/tree/v3.5.0/plugins/registry/kubernetes).
### REVA
A lot of embedded services in oCIS are built upon the [REVA](https://reva.link/) runtime. We decided to bundle some of the [CS3 services](https://github.com/cs3org/cs3apis) to logically group them. A [home storage provider](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/storagehome.go#L93-L108), which is dealing with [metadata](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ProviderAPI), and the corresponding [data provider](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/storagehome.go#L109-L123), which is dealing with [up and download](https://cs3org.github.io/cs3apis/#cs3.gateway.v1beta1.FileUploadProtocol), are one example. The [frontend](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go) with the [oc flavoured webdav](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go#L132-L138), [ocs handlers](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go#L139-L148) and a [data-gateway](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go#L126-L131) are another.
### Protocol driven development
Interacting with oCIS involves a multitude af APIs. The server and all clients rely on [OpenID Connect](https://openid.net/connect/) for authentication. The [embedded LibreGraph Connect](https://owncloud.dev/services/idp/) can be replaced with any other OpenID Connect Identity Provider. Clients use the [WebDAV](http://webdav.org/) based [oc sync protocol](https://github.com/cernbox/smashbox/blob/master/protocol/protocol.md) to manage files and folders, [ocs to manage shares](https://doc.owncloud.com/server/developer_manual/core/apis/ocs-share-api.html) and [TUS](https://tus.io/protocols/resumable-upload.html) to upload files in a resumable way. On the server side [REVA](https://reva.link/) is the reference implementation of the [CS3 apis](https://github.com/cs3org/cs3apis) which is defined using [protobuf](https://developers.google.com/protocol-buffers/). By embedding [libregraph/idm](https://github.com/libregraph/idm), oCIS provides a [LDAP](https://tools.ietf.org/html/rfc2849) interface to make accounts, including guests available to firewalls and other systems. In the future, we are looking into [the Microsoft Graph API](https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0), which is based on [odata](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html), as a well-defined REST/JSON dialect for the existing endpoints.
### Acceptance test suite
We run a huge [test suite](https://github.com/owncloud/core/tree/master/tests), which originated in ownCloud Classic and continues to grow. A detailed description can be found in the developer docs for [testing]({{< ref "development/testing" >}}).
### Architecture Overview
Running `bin/ocis server` will start the following services, all of which can be scaled and deployed on a single node or in a cloud native environment, as needed.
{{< figure src="/ocis/static/architecture-overview.drawio.svg" >}}
@@ -1,50 +0,0 @@
---
title: "1. Introduce an accounts service"
weight: 1
date: 2020-06-15T20:21:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* 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)
## Context and Problem Statement
To attach metadata like shares to users ownCloud relies on persistent, non-reassignable, unique identifiers for users (and files). Email und username can change when a user changes his name. But even the OIDC sub+iss combination may change when the IdP changes. While there is [an account porting protocol](https://openid.net/specs/openid-connect-account-porting-1_0.html) that describes how a relying party (RP) such as ownCloud should behave, it still requires the RP to maintain its own user identifiers.
## Decision Drivers
* oCIS should be a single binary that can run out of the box without external dependencies like an LDAP server.
* Time: we want to build a release candidate asap.
* Firewalls need access to guests, typically via LDAP.
* Not all external LDAPs are writeable for us to provision Guest accounts.
* We see multiple LDAP servers in deployments. Being able to handle them is important and should be covered by using OIDC + being able to query multiple LDAP servers.
## Considered Options
* Accounts service wraps LDAP
* [GLAuth](https://github.com/glauth/glauth) wraps accounts service
## Decision Outcome
Chosen option: "GLAuth wraps accounts service", because we need write access to provision guest accounts and GLAuth currently has no write support.
### Positive Consequences
* We can build a self-contained user management in the accounts service and can adjust it to our requirements.
* We do not rely on an LDAP server which would only be possible by implementing write support in the LDAP libraries used by GLAuth (hard to estimate effort, when will that be merged upstream).
### Negative Consequences
* We need to spend time on implementing user management
## Pros and Cons of the Options
### Accounts service wraps LDAP
* Bad, because not all external LDAPs are writeable for us to provision Guest accounts.
@@ -1,36 +0,0 @@
---
title: "2. Persist accounts in a CS3 storage"
weight: 2
date: 2020-08-21T20:21:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0002-persist-accounts-using-cs3-storage.md
---
* Status: accepted
* Deciders: [@butonic](https://github.com/butonic), [@felixboehm](https://github.com/felixboehm)
* Date: 2020-08-21
Technical Story: [File system based indexing](https://github.com/owncloud/ocis-accounts/pull/92)
## Context and Problem Statement
To set up High Availability (HA) or a geo-replicated setup we need to persist accounts in a distributed way. To efficiently query the accounts by email or username, and not only by id, they need to be indexed. Unfortunately, the [bleve](https://github.com/blevesearch/bleve) index we currently store locally on disk cannot be shared by multiple instances, preventing a scale out deployment.
## Considered Options
* Look into distributed bleve
* Persist users in a CS3 storage
## Decision Outcome
Chosen option: "Persist users in a CS3 storage", because we have one service less running and can rely on the filesystem for geo-replication and HA.
### Positive Consequences
* We can store accounts on the storage using the CS3 API, pushing geo-distribution to the storage layer.
* Backups of users and storage can be implemented without inconsistencies between using snapshots.
### Negative Consequences
* We need to spend time on implementing a reverse index based on files, and symlinks.
@@ -1,115 +0,0 @@
---
title: "3. Use external User Management"
weight: 3
date: 2020-12-09T20:21:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2022-02-08
Technical Story: [Skip account-service by talking to CS3 user-api](https://github.com/owncloud/ocis/pull/1020)
## Context and Problem Statement
To attach metadata like shares to users ownCloud relies on persistent, non-reassignable, unique identifiers for users (and files). Email and username can change when a user changes his name. But even the OIDC sub+iss combination may change when the IdP changes. While there is [an account porting protocol](https://openid.net/specs/openid-connect-account-porting-1_0.html) that describes how a relying party (RP) such as ownCloud should behave, it still requires the RP to maintain its own user identifiers.
## Decision Drivers
* oCIS should be a single binary that can run out of the box without external dependencies like an LDAP server.
* Time: we want to build a release candidate asap.
* oCIS should be able to be easily integrated with standard user management components
## Considered Options
* Accounts service wraps LDAP
* [GLAuth](https://github.com/glauth/glauth) wraps accounts service
## Decision Outcome
Chosen option: "Move accounts functionality to GLAuth and name it accounts", by moving the existing accounts service file based persistence to GLAuth and use it as a drop in replacement for an LDAP server. The reverse index and web UI existing in the accounts service will move as well in order to make GLAuth a standalone, small scale user management with write capabilities.
### Product summary
- GLAuth is a drop in user management for small scale deployments that do not rely on an actual LDAP server.
- oCIS admins can either use the web UI to manage users in GLAuth or use existing tools in their IDM.
- We hide the complexity by embedding an OpenID Provider, an LDAP server and a user management web UI.
### Resulting deployment options
- Use internal user management
- Recommended for small scale use cases and simple deployments
- Users, groups and roles are stored and managed within GLAuth
- Use external user management
- Recommended for mid and large scale use cases
- Users, groups and roles are stored and managed within an external LDAP / AD / IDM
- Separate oCIS and LDAP admin: oCIS admin relies on the LDAP admin to manage users
- User permissions for roles are always managed in oCIS (settings service) because they are specific to oCIS
### Resulting technical implications
- Make the file based reverse index a standalone library
- Contribute to GLAuth
- Add ms graph based rest API to manage users, groups and roles (the LDAP lib is currently readonly)
- Add web UI to glauth that uses the ms graph based rest API to manage users
- Add a backend that uses the file based reverse index, currently living in the oCIS accounts service
- Move fallback mechanism from ocis/glauth service to upstream GLAuth to support multiple LDAP servers
- Make it a chain to support more than two LDAP servers
- Document the implications for merging result sets when searching for recipients
- At least one writeable backend is needed to support creating guest accounts
- Make all services currently using the accounts service talk to the CS3 userprovider
- To support multiple LDAP servers we need to move the fallback mechanism in ocis/glauth service to upstream GLAuth
- The current CS3 API for user management should be enriched with pagination, field mask and a query language as needed
- properly register an [auxiliary LDAP schema that adds an ownCloudUUID attribute to users and groups](https://github.com/owncloud/ocis/blob/c8668e8cb171860c70fec29e5ae945bca44f1fb7/deployments/examples/cs3_users_ocis/config/ldap/ldif/10_owncloud_schema.ldif)
### Positive Consequences
* The accounts service (which is our drop in LDAP solution) can be dropped. The CS3 userprovider service becomes the only service dealing with users.
* No sync
### Negative Consequences
* If users want to store users in their IDM and at the same time guests in a separate user management we need to implement GLAuth backends that support more than one LDAP server.
## Pros and Cons of the Options
### GLAuth wraps accounts service
Currently, the accounts service is the source of truth and we use it to implement user management.
* Good, because it solves the problem of storing and looking up an owncloud UUID for a user (and group)
* Good, because we can manage users out of the box
* Good, because we can persist accounts in a CS3 storage provider
* Bad, because it maintains a separate user repository: it needs to either learn or sync users.
### Move accounts functionality to GLAuth and name it accounts
We should use an existing LDAP server and make GLAuth a drop in replacement for it.
* Good, because we can use an existing user repository (an LDAP server), no need to sync or learn users.
* Good, because admins can rely on existing user management tools.
* Good, because we would have a clear separation of concerns:
- users reside in whatever repository, typically an LDAP server
- could be an existing LDAP server or AD
- could be our embeddable drop in glauth server
- we use a service to wrap the LDAP server with other APIs:
- ms graph API - ODATA based restful API,
- [SCIM](http://www.simplecloud.info/) - designed to manage user identities, supported by some IDPs,
- the current accounts API (which is a protobuf spec following the ms graph API)
- our account management UI can use the ms graph based API service which can have different backends
- an existing LDAP server
- our drop in glauth server (which might serve the ms graph based API itself)
- the CS3 API + a future guest provisioning API + a future CS3 user provisioning API (or [generic space provisioning](https://github.com/cs3org/cs3apis/pull/95))
- all oCIS services can use the service registry to look up the accounts service that provides an internal API
- could be the CS3 user provider (and API)
- could be the internal protobuf accounts API
- introduce a new guest provisioning API to CS3 which properly captures our requirement to have them in the user repository
- guests need to be made available to the firewall
- storages like EOS that integrate with the os for acl based file permissions need a numeric user and group id
* Good, because we can use the CS3 user provider with the existing LDAP / rest driver.
* Bad, because oCIS admins may not have the rights to manage role assignments. (But this is handled at a different department.)
* Bad, because oCIS admins may not have the rights to disable users if an external LDAP is used instead of the drop in GLAuth.
## Links
* supersedes [ADR-0001]({{< ref "0001-introduce-accounts-service.md" >}})
* superseded by [17. Allow read only external User Management]({{< ref "0017-allow-read-only-external-user-management.md" >}})
@@ -1,80 +0,0 @@
---
title: "4. Support Hot Migration"
weight: 4
date: 2020-12-09T20:21:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2021-03-16
Technical Story: \[description | ticket/issue URL\]
## Context and Problem Statement
Migration is one of the most important topics of the oCIS story. We need to provide a concept how to migrate from oC10 to oCIS.
## Decision Drivers
- Do not lose file blob or metadata.
- To prevent a sync surge from clients the etag for files should be migrated.
- To prevent internal links from breaking or pointing to wrong files the file id of existing files needs to be migrated.
- To prevent data loss trash and version blobs should be migrated.
- Existing shares like public links and federated shares must remain functional after the migration.
- To prevent internal shares the share type, permissions and expiry needs to be migrated.
- To prevent public links from breaking the url token, permissions, expiry and password needs to be migrated.
- *What about federated shares?*
- *What about additional share permissions, e.g. comment on office files?*
- Legacy clients need to keep working
- To keep existing clients working the `remote.php/webdav` and `dav/files/<username>` webdav endpoints as well as the ocs API need to be available.
- *What about [app passwords/tokens](https://doc.owncloud.com/server/user_manual/personal_settings/security.html#app-passwords-tokens)?*
## Considered Options
1. Cold Migration: migrate data while systems are not online, so no user interaction happens in between.
2. Hot Migration: one or both systems are online during migration.
## Decision Outcome
Chosen option: "\[option 1\]", because \[justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)\].
### Positive Consequences
- \[e.g., improvement of quality attribute satisfaction, follow-up decisions required, …\]
- …
### Negative Consequences
- \[e.g., compromising quality attribute, follow-up decisions required, …\]
- …
## Pros and Cons of the Options
### Cold Migration
The migration happens while the service is offline. File metadata, blobs and share data is exported from ownCloud Classic and imported in oCIS. This can happen user by user, where every user export would contain the file blobs, their metadata, trash, versions, shares and all metadata that belongs to the user's storage. To prevent group shares from breaking, users in the same groups must be migrated in batch. Depending on the actual group shares in an instance this may effectively require a complete migration in a single batch.
- Good, because oCIS can be tested in a staging system without writing to the production system.
- Good, because file layout on disk can be changed to support new storage driver capabilities.
- Bad, because the export and import might require significant amounts of storage.
- Bad, because a rollback to the state before the migration might cause data loss of the changes that happened in between.
- Bad, because the cold migration can mean significant downtime.
### Hot Migration
The migration happens in subsequent stages while the service is online.
- Good, because the admin can migrate users from old to new backend in a controlled way.
- Good, because users and admins can learn to trust the new system.
- Good, because there can be preparations even long before the migrations happens in parallel on the oC10 codebase, i.e. addition of metadata that is needed while the system operates.
- Good, because the downtime of the system can be fairly small.
- Bad, because it is more complex and might drag on for a long time.
## Links
- [Clarify responsibilities of share providers and storage providers · Issue #1377 · cs3org/reva (github.com)](https://github.com/cs3org/reva/issues/1377) because the share manager for oCIS should store share information on the storage system. And [storage provider should persist share creator · Issue #93 · cs3org/cs3apis (github.com)](https://github.com/cs3org/cs3apis/issues/93) finally: [eos: store share id in inherited xattr · Issue #543 · cs3org/reva (github.com)](https://github.com/cs3org/reva/issues/543)
@@ -1,210 +0,0 @@
---
title: "5. Account Management through CS3 API"
weight: 5
date: 2021-04-12T15:00:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2021-04-12
Technical Story: [Write only management API for User and Group resources](https://github.com/cs3org/cs3apis/pull/119)
## Context and Problem Statement
What would be a more effective way of using network resources and handle account management within the oCIS-Reva ecosystem? Separating account management at the service level is pragmatic and allows for fast iterations, but also steadily accumulates inconsistencies and bloats technical debt.
## Decision Drivers
* Reduce number of network calls.
* Reduce number of services (merge Account + GLAuth from ADR-0003).
* Formalize account management at the API level.
## Considered Options
* Account management delegated to vendors.
* Add account management to the CS3 API.
## Decision Outcome
Chosen option: "Add account management to the CS3 API". Making the API declare an API for account management will not only allow a deployment to fail fast (as in: the management node is not running) but would also centralize all management operations that should happen to be constrained within the Reva context. Constrained operations *SHOULD* be by definition more secure, or at least as secure as the rest of the system.
### Positive Consequences
* More resilient API.
* Because account management is considered a "first class citizen" changes are forced to go through a more exhaustive revision process.
* Removing Accounts from search users<sup>1</sup>.
* Replace the provisioning API in favor of the new Reva Admin node.
(1) the current vendor implementation of searching a user (i.e: when sharing a resource) relies directly on the accounts service, since this is the only source of truth. Searching a user looks like:
```
┌────────────────────────────────────────┐
│user search (no LDAP) │
│ │
│ ┌──────────┐ │
│ │ │ │
│ │ proxy │ │
│ │ │ ┌ ─ ─ ─ ─ ─ ┐ │
│ └──────────┘ go-micro │
│ ▲ │ │ │
│ │ Λ │
│ ▼ │ ╱ ╲ │ │
│ ┌──────────┐ ╱ ╲ │
│ │ │ │ ╱ ╲ │ │
│ │ ocs │◀──(1)───▶registry▏ │
│ │ │ │ ╲ ╱ │ │
│ └──────────┘ ╲ ╱ │
│ ▲ │ ╲ ╱ │ │
│ │ V │
│ │ │ │ │
│ │ │
│ │ └ ─ ─ ─ ─ ─ ┘ │
│ │ │
│ │ │
│ │ ┌──────────┐ │
│ │ │ │ │
│ └─────────────▶│ accounts │ │
│ │ │ │
│ └──────────┘ │
│ │
│ │
│(1) ocs requests a connection to the │
│accounts service to the registry │
│ │
└────────────────────────────────────────┘
```
Whereas, as a result of ADR-0003 and this ADR, we can simplify and improve this design:
```
┌─────────────────────────────────────────────┐
│user search │
│ │
│ │
│ ┌──────────┐ │
│ │ │ │
│ │ proxy │ │
│ │ │ │
│ └──────────┘ │
│ │ │
│ ▼ │
│ ┌──────────┐ │
│ │ │ │
│ │ ocs │ │
│ │ │ │
│ └──────────┘ │
│ │ │
│ │ │
│ ┌ ─ ─ ─ ─ ─│─ ─ ─ ─ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ┐ │
│ reva ▼ │ IDM │
│ │ ┌──────────┐ │ ┌──────────┐ │ │
│ │ │ │ │ │ │
│ │ │ users │◀─────┼──▶│ GLAuth │ │ │
│ │ │ │ │ │ │
│ │ └──────────┘ │ └──────────┘ │ │
│ │ │
│ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ └ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │
│ │
└─────────────────────────────────────────────┘
```
And instead rely on the already existing Reva users provider.
## Pros and Cons of the Options
### Account management delegated to vendors
* Good, because it allows for fast iterations.
* Bad, because account management happens outside of the Reva process. This can potentially end up in invalid account creation / deletion / updates.
* An example with the existing Accounts service is that any client can fire CRUD accounts requests to the Accounts service as long as the client knows where the server is running and provides with an Authorization header (only required by the proxy). This request totally bypasses Reva middlewares and therefore any security measures that should be enforced by the entire system.
* Bad, because leaves teams the task of designing and implementing a way of dealing with account management. Ideally one schema should be provided / suggested.
Creating an account using the first option looks currently is implemented in vendors as:
```
┌──────────────────────────────────────────────────┐
│ creating a user (webui) │
│ │
│ ┌──────────┐ │
│ │ │ │
│ │ proxy │ │
│ │ │ │
│ └──────────┘ │
│ │ │
│ │ │
│ /api/v0/accounts/accounts-create │
│ │ │
│ │ │
│ │ │
│ ▼ │
│ ┌──────────┐ │
│ │ │ │
│ │ accounts │ │
│ │ │ │
│ └──────────┘ │
│ │
│ note that while doing CRUD operations changes │
│ are instantly reflected for the IDP since out of │
│ the box oCIS uses an accounts backend for │
│ GLAuth. │
└──────────────────────────────────────────────────┘
```
As explained before, during this flow no Reva middlewares are run. Creating an account will only use the embedded accounts js file alongside a minted jwt token (by the oCIS proxy) to communicate with the accounts service.
### Add account management to the CS3 API
* Good, because it solidifies what the CS3 API can or cannot do, and account management should be handled at the API level since ultimately accounts would contain a mix of required CS3 and vendor-specific attributes.
* Good, because it centralizes account management and constrains it within the Reva boundaries.
* Good, because there is a clear separation of concerns on what is accounts management logic.
* Good, because we already designed [a similar API for the accounts service](https://github.com/owncloud/ocis/blob/master/accounts/pkg/proto/v0/accounts.proto#L42-L85) the only difference being we (vendors) [define their own messages](https://github.com/owncloud/ocis/blob/master/accounts/pkg/proto/v0/accounts.proto#L252-L408).
* The API would fully include CRUD methods
* Bad, because development cycles are larger.
* an example flow will be: `update api > run prototool > publish language specific packages > update dependencies to fetch latest version of the package > utilize the new changes`.
The new account management workflow will result in:
```
┌───────────────────────────────────────────────────┐
│creating a user (webui) │
│ - maintain the same route for compatibility │
│ │
│ ┌──────────┐ │
│ │ │ │
│ │ proxy │ │
│ │ │ │
│ └──────────┘ │
│ │ │
│ │ │
│ /api/v0/accounts/accounts-create │
│ │ │
│ │ │
│ ┌ ─ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ┐ ┌ ─ ─ ─ ─ ─ ─ ─ ─ │
│ Reva │ IDM │ │
│ │ │ │ │ │
│ ▼ │ │
│ │ ┌──────────┐ │ │ ┌──────────┐ │
│ │ │ │ │ │ │
│ │ │ admin │───────────┼──┼──▶│ GLAuth │ │
│ │ │ │ │ │ │
│ │ └──────────┘ │ │ └──────────┘ │
│ │ │
│ │ │ │ │
│ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │
│ │
│ │
│ │
│ │
│ │
│ │
│ an example of a driver could be GLAuth │
│ implementing the user management portion of the │
│ GraphAPI │
└───────────────────────────────────────────────────┘
```
This flow allows Reva and oCIS Proxy to run any middleware logic in order to validate a request. The communication between the proposed Admin api (CS3 API messages) and the IDM (GLAuth) are specific to the _drivers_.
-58
View File
@@ -1,58 +0,0 @@
---
title: "6. Service Discovery within oCIS and Reva"
weight: 6
date: 2021-04-19T13:00:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2021-04-19
Technical Story: [Introduce Named Services.](https://github.com/cs3org/reva/pull/1509)
## Context and Problem Statement
Reva relies heavily on config files. A known implication of this approach are having to know a-priori where a service is running (host + port). We want to move away from hardcoded values and rely instead on named services for service discovery. Furthermore, we would like both platforms (Reva + oCIS) to have the same source of truth at any given time, not having one to notify the other whenever a service status changes.
## Decision Drivers
* Avoid a-priori knowledge of services.
* Ease of scalability.
* Always up-to-date knowledge of the running services on a given deployment (a service registry doesn't have to necessarily be running on the same machine / network)
## Considered Options
* Hardcoded tuples of hostname + port
* Dynamic service registration
## Decision Outcome
Chosen option: "Dynamic service registration". There were some drawbacks regarding this due to introducing go-micro to Reva was from start an issue. Given the little usage of go-micro we need, we decided instead to define our very own [Registry interface](https://github.com/refs/reva/blob/58d013a7509d1941834e1bc814e9a9fa8bff00b1/pkg/registry/registry.go#L22-L35) on Reva and extended the runtime arguments to [allow for injecting a registry](https://github.com/refs/reva/blob/58d013a7509d1941834e1bc814e9a9fa8bff00b1/cmd/revad/runtime/option.go#L53-L58).
### Positive Consequences
* Having dynamic service registration delegates the entire lifecycle of finding a process to the service registry.
* Removing a-priori knowledge of hostname + port for services.
* Marrying go-micro's registry and a newly defined registry abstraction on Reva.
* We will embrace go-micro interfaces by defining a third merger interface in order to marry go-micro registry and reva registry.
* The ability to fetch a service node relying only on its name (i.e: com.owncloud.proxy) and not on a tuple hostname + port that we rely on being preconfigured during runtime.
* Conceptually speaking, a better framework to tie all the services together. Referring to services by names is less overall confusing than having to add a service name + where it is running. A registry is agnostic to "where is it running" because it, by definition, keeps track of this specific question, so when speaking about design or functionality, it will ease communication.
## Pros and Cons of the Options
### Hardcoded tuples of hostname + port
* Good, because firewalls are easier to configure since IP are static.
* Good, because the mental model required is easier to grasp as IP addresses can be easily bundled.
* Bad, because it requires thorough planning of ports.
### Dynamic service registration
* Good, because it abstracts the use of service lookup away to registry logic from the admin or developer.
* Good, because it allows for, through interfaces, registry injection
* This means we can have a service registry that we extensively use in oCIS and inject its functionality onto Reva.
* Bad, because it's yet another abstraction.
* Bad, because firewalls are harder to configure with dynamic IPs.f
-156
View File
@@ -1,156 +0,0 @@
---
title: "7. Open Graph API for oCIS File Spaces"
weight: 7
date: 2021-05-03T09:00:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2021-03-19
Technical Story: API to enable the concept of [Spaces](https://github.com/owncloud/enterprise/issues/3863)
## Context and Problem Statement
As one of the building blocks for Spaces in oCIS we plan to add an API that returns information about available spaces. This ADR discusses the API design oriented on the Microsoft Graph API.
> Note: The term "spaces" is used here in the context of "a space where files can be saved", similar to a directory. It is not to be confused with space in the sense of free file space for example.
The purpose of this new API is to give clients a very simple way to query the dynamic list of spaces, that the user has access to. Clients can provide a better user experience with that.
This API is supposed to be queried often, to give clients a condensed view of the available spaces for a user, but also their eTags and cTags. Hence the clients do not have to perform a PROPFIND for every space separately.
This API would even allow providing (WebDAV-) endpoints depending on the kind and version of the client asking for it.
## Decision Drivers
- Make it easy to work with a dynamic list of spaces of a user for the clients.
- No longer the need to make assumptions about WebDAV- and other routes in clients.
- More meta data available about spaces for a better user experience.
- Part of the bigger spaces plan.
- Important to consider in client migration scenarios, i.e. in CERN.
## Considered Options
1. [Microsoft Graph API](https://developer.microsoft.com/en-us/graph) inspired API that provides the requested information.
## Decision Outcome
This the DRAFT for the API.
### API to Get Info about Spaces
ownCloud servers provide an API to query for available spaces of an user.
See the openAPI Specification for the [Libre Graph API](https://owncloud.dev/libre-graph-api/).
Most important, the API returns the WebDAV endpoint for each space. With that, clients do not have to make assumptions about WebDAV routes any more.
See [Drive item in Microsoft Graph API](https://docs.microsoft.com/en-us/graph/api/resources/onedrive?view=graph-rest-1.0) for an overview of `drive` and `driveItem` resources. The concrete list of drives / spaces a user has access to can be obtained on multiple endpoints.
### Get "Home folder"
Retrieve information about the home space of a user. Note: The user has access to more spaces. This call only returns the home space to provide API parity with the Graph API.
API Call: `/me/drive`: Returns the information about the users home folder.
### Get All Spaces of a User
Retrieve a list of available spaces of a user. This includes all spaces the user has access to at that moment, also the home space.
API Call: `/me/drives`: Returns a list of spaces.
There is also `/drives`, returning the list of spaces the user has access to. This endpoint is used to access any space by id using `/drives/{drive-id}`.
### Common Reply
The reply to both calls is either one or a list of [Drive representation objects](https://docs.microsoft.com/de-de/graph/api/resources/drive?view=graph-rest-1.0):
```
{
"id": "string",
"createdDateTime": "string (timestamp)",
"description": "string",
"driveType": "personal | projectSpaces | shares",
"lastModifiedDateTime": "string (timestamp)",
"name": "string",
"owner": { "@odata.type": "microsoft.graph.identitySet" },
"quota": { "@odata.type": "microsoft.graph.quota" },
"root": { "@odata.type": "microsoft.graph.driveItem" },
"webUrl": "url"
}
```
The meaning of the objects in Open Graph API context are:
1. **id** - a persistent and unique ID identifying the space, called Storage Space ID.
2. **driveType** - describing the type of the space.
3. **owner** - an owner object to whom the space belongs
4. **quota** - quota information about this space
5. **root** - the root driveItem object.
6. **webUrl** - The URL to make this space visible in the browser.
The following *driveType* values are available in the first step, but might be enhanced later:
* **personal**: The users home space
* **projectSpaces**: The project spaces available for the user (*)
* **shares**: The share jail, contains all shares for the user (*)
Other space types such as backup, hidden etc. can be added later as requested.
> Note: The *projectSpaces* and *shares* space are virtual spaces. They only contain other spaces, and no regular resources.
The (*) marked types are not defined in the official MS API. They are prefixed with `oc` to avoid namespace clashes.
The `root` object equals a [driveItem](https://docs.microsoft.com/de-de/graph/api/resources/driveitem?view=graph-rest-1.0) and contains information about the root resource (directory) of the space.
This is an example object as it can be expected as `root` element. It is not complete, as not all elements will be implemented so far.
```
{
"cTag": "string (etag)",
"webDavUrl": "string",
/* inherited from baseItem */
"id": "string (identifier)",
"createdBy": {"@odata.type": "microsoft.graph.identitySet"},
"createdDateTime": "String (timestamp)",
"eTag": "string",
"lastModifiedBy": {"@odata.type": "microsoft.graph.identitySet"},
"lastModifiedDateTime": "String (timestamp)",
"name": "string",
"webUrl": "string",
}
```
Meaningful fields of the root element in the context of the Open Graph API:
1. **id** - a persistent and unique ID identifying the root directory node.
2. **webDavUrl** - The webdav path of the top item of the space.
3. **eTag** - an identifier that changes automatically if the content *or* metadata of the node or the underlying resources changes.
4. **cTag** - an identifier that changes automatically if the content of the root node or of one of the underlying resources changes.
5. **webUrl** - The URL to make this space visible in the browser.
> Note: To indicate that only the metadata of a resource has changed, the eTag has changed, but the cTag not.
### Positive Consequences
- A well understood and mature API from Microsoft adopted to our needs.
- Prerequisite for Spaces in oCIS.
- Enables further steps in client development.
### Negative Consequences
- Migration impact on existing installations. Still to be investigated.
- Requires additional webdav endpoint that allows accessing an arbitrary storage space, either
- with an id: `/dav/spaces/<spaceid>/relative/path/to/file.ext`, or
- with a global path: `/dav/global/<accessible>/<mount>/<point>/relative/path/to/file.ext`, e.g. `/dav/global/projects/Golive 2021/Resources/slides.odt`
### Open Topics
- What are the WebDAV paths for Trashbin, Versions
+ option: additional entries in the reply struct
- The identitySet object used for "owner" and "coowner" require to implement the [https://docs.microsoft.com/de-de/graph/api/resources/identityset?view=graph-rest-1.0](IdentitySet) JSON object, which contains information that seems to be of limited benefit for oCIS. An alternative would be to implement a simpler identity object for oCIS and use that.
-194
View File
@@ -1,194 +0,0 @@
---
title: "8. Configuration"
weight: 8
date: 2021-05-03T15:00:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2021-05-03
## Context and Problem Statement
As per urfave/cli's doc:
>The precedence for flag value sources is as follows (highest to lowest):
>
>0. Command line flag value from user
>1. Environment variable (if specified)
>2. Configuration file (if specified)
>3. Default defined on the flag
An issue arises in point 2, in the sense that configuration file refers to a single file containing the value for the env variable. The CLI framework we use for flag parsing does not support merging config structs with CLI flags. This introduces an inconsistency with the framework: config structs are not supported, and we cannot hook to the lifecycle of the flags parsing to use a file as source and conform to these rules.
Because we solely rely on [structured configuration](https://github.com/owncloud/ocis/blob/master/ocis-pkg/config/config.go) we need a way to modify values in this struct using the provided means urfave/cli gives us (flags, env variables, config files and default value), but since we have different modes of operation (supervised Vs. unsupervised) we have to define a clear line.
### Decision Drivers
- Improve experience for the end user.
- Improve experience for developers.
- Sane defaults.
- Sane overrides.
### Considered Options
- Extend [FlagInputSourceExtension interface](https://github.com/urfave/cli/blob/master/altsrc/flag.go#L12-L17)
- Feature request: support for structured configuration (urfave/cli).
- Clearly defined boundaries of what can and cannot be done.
- Expose structured field values as CLI flags
- Drop support for structure configuration
- Adapt the "structured config files have the highest priority" within oCIS
### Decision Outcome
[STILL UNDECIDED]
#### Positive Consequences
[TBD, depends on Decision Outcome]
### Pros and Cons of the Options
#### Extend FlagInputSourceExtension interface
- Good, because we could still use Viper to load from config files here and apply values to the flags in the context.
- Bad, because urfave/cli team are [actively working on v3 of altsrc](https://github.com/urfave/cli/issues/1051#issuecomment-606311923) and we don't want to maintain yet another slice of the codebase.
notes: source is [FlagInputSourceExtension interface](https://github.com/urfave/cli/blob/master/altsrc/flag.go#L12-L17)
#### Feature request: support for structured configuration (urfave/cli).
- Good, because we could remove Viper off the codebase and solely rely on urfave/cli's native code.
- Bad, because there are no plans to support this upstream.
#### Clearly defined boundaries of what can and cannot be done.
- Good, because no changes to the codebase required (not drastic changes.)
- Bad, because we're limited by the framework
#### Expose structured field values as CLI flags
- Good, because it has been already taken into account on large projects (kubernetes) [here.](https://docs.google.com/document/d/1Dvct469xfjkgy3tjWMAKvRAJo4CmGH4cgSVGTDpay6A) in point 5.
- Bad, because it requires quite a bit<sup>1</sup> of custom logic.
- Bad, because how should these flags be present in the `-h` menu of a subcommand? Probably some code generation needed.
*[1] this is a big uncertainty.
#### Drop support for structure configuration
- Good, because it makes the integration with the cli framework easier to grasp.
- Good, because it is not encouraged by the 12factor app spec.
- Bad, because we already support if and users make active use of it. At least for development.
#### Adapt the "structured config files have the highest priority" within oCIS
- Good, because that would mean little structural changes to the codebase since the Viper config parsing logic already uses the `Before` hook to parse prior to the command's action executes.
### Notes
#### Use Cases and Expected Behaviors
##### Supervised (`ocis server` or `ocis run extension`)
![grafik](https://user-images.githubusercontent.com/6905948/116872568-62b1a780-ac16-11eb-9f29-030a651ee39b.png)
- Use a global config file (ocis.yaml) to configure an entire set of services: `> ocis --config-file /etc/ocis.yaml service`
- Use a global config file (ocis.yaml) to configure a single extension: `> ocis --config-file /etc/ocis/yaml proxy`
- When running in supervised mode, config files from extensions are NOT evaluated (only when running `ocis server`, runs with `ocis run extension` do parse individual config files)
- i.e: present config files: `ocis.yaml` and `proxy.yaml`; only the contents of `ocis.yaml` are loaded<sup>1</sup>.
- Flag parsing for subcommands are not allowed in this mode, since the runtime is in control. Configuration has to be done solely using config files.
*[1] see the development section for more on this topic.
###### Known Gotchas
- `> ocis --config-file /etc/ocis/ocis.yaml server` does not work. It currently only supports reading global config values from the predefined locations.
##### Unsupervised (`ocis proxy`)
![grafik](https://user-images.githubusercontent.com/6905948/116872534-54fc2200-ac16-11eb-8267-ffe7b03177b3.png)
- `ocis.yaml` is parsed first (since `proxy` is a subcommand of `ocis`)
- `proxy.yaml` is parsed if present, overriding values from `ocis.yaml` and any cli flag or env variable present.
#### Other known use cases
- Configure via env + some configuration files like WEB_UI_CONFIG or proxy routes
- Configure via flags + some configuration files like WEB_UI_CONFIG or proxy routes
- Configure via global (single file for all extensions) config file + some configuration files like WEB_UI_CONFIG or proxy routes
- configure via per extension config file + some configuration files like WEB_UI_CONFIG or proxy routes
Each individual use case DOES NOT mix sources (i.e: when using cli flags, do not use environment variables nor cli flags).
_Limitations on urfave/cli prevent us from providing structured configuration and framework support for cli flags + env variables._
#### Use Cases for Development
#### Config Loading
Sometimes is desired to decouple the main series of services from an individual instance. We want to use the runtime to startup all services, then do work only on a single service. To achieve that one could use `ocis server && ocis kill proxy && ocis run proxy`. This series of commands will 1. load all config from `ocis.yaml`, 2. kill the supervised proxy service and 3. start the same service with the contents from `proxy.yaml`.
#### Start an extension multiple times with different configs (in Supervised mode)
Flag parsing on subcommands in supervised mode is not yet allowed. The runtime will first parse the global `ocis.yaml` (if any) and run with the loaded configuration. This use case should provide support for having 2 different proxy config files and making use of the runtime start 2 proxy services, with different values.
For this to work, services started via `Service.Start` need to forward any args as flags:
```go
if err := client.Call("Service.Start", os.Args[2], &reply); err != nil {
log.Fatal(err)
}
```
This should provide with enough flexibility for interpreting different config sources as: `> bin/ocis run proxy --config-file /etc/ocis/unexpected/proxy.yaml`
#### Developing Considered Alternatives Further
Let's develop further the following concept: Adapt the "structured config files have the highest priority" within oCIS.
Of course it directly contradicts urfave/cli priorities. When a command finished parsing its cli args and env variables, only after that `Before` is called. This mean by the time we reach a command `Before` hook, flags have already been parsed and its values loaded to their respective destinations within the `Config` struct.
This should still not prevent a developer from using different config files for a single service. Let's analyze the following use case:
1. global config file present (ocis.yaml)
2. single proxy.yaml config file
3. another proxy.yaml config file
4. running under supervision mode
The outcome of the following set of commands should be having all bootstrapped services running + 2 proxies on different addresses:
```console
> ocis server
> ocis kill proxy
> ocis run proxy --config-file proxy.yaml
> ocis run proxy --config-file proxy2.yaml
```
This is a desired use case that is yet not supported due to lacking of flags forwarding.
#### Follow-up PR's
- Variadic runtime extensions to run (development mostly)
- Arg forwarding to command (when running in supervised mode, forward any --config-file flag to supervised subcommands)
- Ability to set `OCIS_URL` from a config file (this would require to extend the ocis-pkg/config/config.go file).
#### The case for `OCIS_URL`
`OCIS_URL` is a jack-of-all trades configuration. It is meant to ease up providing defaults and ensuring dependant services are well configured. It is an override to the following env vars:
```
OCIS_IDM_ADDRESS
PROXY_OIDC_ISSUER
STORAGE_OIDC_ISSUER
STORAGE_FRONTEND_PUBLIC_URL
STORAGE_LDAP_IDP
WEB_UI_CONFIG_SERVER
WEB_OIDC_AUTHORITY
OCIS_PUBLIC_URL
```
Because this functionality is only available as an env var, there is no current way to "normalize" its usage with a config file. That is, there is no way to individually set `OCIS_URL` via config file. This is clear technical debt, and should be added functionality.
#### State of the Art
- [Kubernetes proposal on this very same topic](https://docs.google.com/document/d/1Dvct469xfjkgy3tjWMAKvRAJo4CmGH4cgSVGTDpay6A)
- [Configuration \| Pulumi](https://www.pulumi.com/docs/intro/concepts/config/)
- Configuration can be altered via setters through the CLI.
-71
View File
@@ -1,71 +0,0 @@
---
title: "9. Extension Template"
weight: 9
date: 2021-06-10T15:00:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
geekdocFilePath: 0009-extension-template.md
---
* Status: proposed
* Deciders: [@c0rby](https://github.com/c0rby) <!-- optional -->
* Date: 2021-06-10
Technical Story: [description | ticket/issue URL] <!-- optional -->
## Context and Problem Statement
We want to accelerate and simplify extension development by removing the necessity to type or copy the boilerplate code. Can we provide a template or a similar mechanism to aid when developing new extensions?
## Decision Drivers <!-- optional -->
* The solution should be easily maintainable.
* It should always be up-to-date.
* The solution should be easy to use.
## Considered Options
* Use [boilr](https://github.com/tmrts/boilr)
* Create a template git repository.
* Use [ocis-hello](https://github.com/owncloud/ocis-hello/) as a "template"
## Decision Outcome
Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)].
### Positive Consequences: <!-- optional -->
* [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]
* …
### Negative consequences: <!-- optional -->
* [e.g., compromising quality attribute, follow-up decisions required, …]
* …
## Pros and Cons of the Options <!-- optional -->
### [boilr](https://github.com/tmrts/boilr)
We have a boilr template already. [boilr-ocis-extension](https://github.com/owncloud/boilr-ocis-extension/)
This approach is nice because it provides placeholders which can be filled during the generation of a new extension from the template. It also provides prompts for the placeholder values during generation.
* Good, because with the placeholders it is hard to miss values which should be changed
* Bad, because maintaining is more complex
### Template git repository
Create a git repository with an extension containing the boilerplate code.
* Good, because we can use the usual tools for QA and dependency scanning/updating.
* Good, because it doesn't require any additional tool.
### [ocis-hello](https://github.com/owncloud/ocis-hello/) as a "template"
We have the ocis-hello repository which acts as an example extension containing a grpc and http service and a web UI. It also demonstrates the usage of the settings service.
* Good, because it contains a bit more code than just the plain boilerplate
* Good, because the integration into oCIS is already tested for the Hello extension (e.g. with Proxy and Settings). This will ensure, that the example extension is up-to-date.
* Bad, because if you don't require all features you have to delete stuff
-85
View File
@@ -1,85 +0,0 @@
---
title: "10. Extension Policies"
weight: 10
date: 2021-06-30T14:00:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2021-06-30
## Context and Problem Statement
There should be a way to impose certain limitations in areas of the code that require licensing. This document researches an approach to achieve this goal, while limiting the scope to the enforcement side of it. The architecture for a policy system must be composed of 2 parts:
1. License creation and validation
2. Enforcement
It is desirable to keep both systems isolated, since the implementation of the latter has to be done within the constraints of the codebase. The alternative is running an enforcement service and have each and every single request evaluating whether the request is valid or not.
## Decision Drivers
- As a team, we want to have the licensing code concentrated in a central module
- We don't want to stop/start the extension whenever a policy is updated (hot reload). It must happen during runtime.
## Considered Options
1. Build the evaluation engine in-house.
2. Use third party libraries such as Open Policy Agent (a CNCF approved project written in Go)
## Decision Outcome
Chosen option: option 2; Use third party libraries such as Open Policy Agent (a CNCF approved project written in Go)
### Positive Consequences
- OPA is production battle tested.
- Built around performance - policies evaluations are no longer than 1ms per request.
- Middleware friendly: we use gRPC clients all over our ecosystem; wrappers (or middlewares) is a viable way to solve this problem instead of a dedicated service or its own package.
- Community support.
- Kubernetes friendly.
- Supports envoy, kong, terraform, traefik, php, node and many more.
### Negative Consequences
- More vendor code inside the binary (larger attack surface, larger footprint [to be quantified] )
## Chosen option approach
Make use of [overloading Open Policy Agent's input](https://www.openpolicyagent.org/docs/latest/external-data/#option-2-overload-input) along with an external storage source (instead of an OPA service) in conjunction with go-micro's gRPC client wrappers (a.k.a. middlewares) to leverage policy rules evaluation.
### Terminology
New terms are defined to refer to new mental models:
- Policy: self-imposed limitation of a piece of software. i.e: "after 20 users limit the use of thumbnails".
- Checkers: in the context of a middleware, a checker is in charge of defining logical conditions that prevent requests (users) from doing an action.
- Policy file: a [rego file](https://www.openpolicyagent.org/docs/latest/policy-language/).
- Policy evaluation: the act of piecing together input (from a request), data (from an external storage) and policies in order to make a decision.
#### Temporary new Interfaces part of the PoC
- IStorage: provides means of extracting data from an external source (in case of the POC an etcd storage cluster).
### External data storages
However, for this to be usable it needs state. The Rego engine works with input and data, where data is essentially a database the input is tried against, in order to expand this poc to include functionality such as counters (i.e: give access to the thumbnails only to 50 users) we need an external storage, and consequentially, Rego needs to have an option to load data from an external storage. There is an entire chapter in the documentation regarding external data: https://www.openpolicyagent.org/docs/latest/external-data/. The most "natural" option (option 5) states:
> OPA includes functionality for reaching out to external servers during evaluation. This functionality handles those cases where there is too much data to synchronize into OPA, JWTs are ineffective, or policy requires information that must be as up-to-date as possible.
This is a natural option because it requires service-to-service communication, and by definition using microservices it should come "natural to us". Another approach is using JWT (which we already use) to encode the necessary data into the JWT and handing it over to rego as "data". The issue with this approach is that depending on the features of the licenses the JWT might grow and be filled with noise and redundancy (this is, unless a new token is issued for licensing purposes).
### Future ideas
[This proof of concept](https://github.com/owncloud/ocis/pull/2236) is very rigid in the sense that the `IStorage` interface only has one implementation that ties it to etcd, meaning running an oCIS cluster without an etcd service will result in a crash. This is by far ideal and less coupled implementations should be done. There is the case of using the storage metadata as a source to store data necessary to the policies, or even using the go-micro store as a kv store to achieve the exact same, since it already runs as its own service. The implementation of this is trivial and left out of the POC since it requires more time than the allotted for this task.
#### Message Broker
This problem perfectly encompasses the use of a message broker, where services such as OCS will emit messages to a bus and only listeners react to them. In this case the following applies:
![message broker](https://i.imgur.com/sa1pANQ.jpg)
The necessary interfaces are provided to us by go-micro, only implementations are to be done.
-320
View File
@@ -1,320 +0,0 @@
---
title: "11. WebUI URL format"
weight: 11
date: 2021-07-07T14:55:00+01:00
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/ocis/adr
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)
* Date: 2021-07-07
## Context and Problem Statement
When speaking about URLs we have to make a difference between browser URLs and API URLs. Only browser URLs are visible to end users and will be bookmarked. The currently existing and bookmarked ownCloud Classic URLs look something like this:
```
GET https://demo.owncloud.com/apps/files/?dir=/path/to/resource&fileid=5472225
303 Location: https://demo.owncloud.com/apps/files/?dir=/path/to/resource
```
When the URL contains a `fileid` parameter the server will look up the corresponding `dir`, overwriting whatever was set before the redirect. The `fileid` always takes precedence and the server is responsible for the lookup.
```
GET https://demo.owncloud.com/apps/files/?dir=/path/to/resource
```
The `dir` parameter is then used to make a WebDAV request against the `/dav/files` endpoint of the currently logged-in user:
```
PROPFIND https://demo.owncloud.com/remote.php/dav/files/demo/path/to/resource
```
The resulting PROPFIND response is used to render the file listing. All good so far.
For the new ocis web UI we want to clean up the user visible Browser URLs. They currently look like this:
```
https://demo.owncloud.com/#/files/list/all/path/to/resource
```
Currently, there is no `fileid` like parameter in the browser URL, making bookmarks of it fragile (they break when a bookmarked folder is renamed).
The oCIS web UI just takes the path and uses the `/webdav` endpoint of the currently logged-in user:
```
PROPFIND https://demo.owncloud.com/remote.php/webdav/path/to/resource
```
With the new ownCloud web client (owncloud/web)
needs to interpret them to make API calls. With this in mind, this is the current mapping on ownCloud Web with OC10 and OCIS backend:
| | Browser URL | API URL |
|------|----------------------------------------------------------------|----------------------------------------------------|
| OC10 + classic WebUI | `https://demo.owncloud.com/apps/files/?dir=/path/to/resource&fileid=5472225` | `https://demo.owncloud.com/remote.php/dav/files/demo/path/to/resource` |
| OC10 + OCIS WebUI| `https://web.owncloud.com/index.html#/files/list/all/path%2Fto%2Fresource` | `https://demo.owncloud.com/remote.php/webdav/path/to/resource` |
| OCIS | `https://demo.owncloud.com/#/files/list/all/path/to/resource` | `https://demo.owncloud.com/remote.php/webdav/path/to/resource` |
On an OC10 backend the `fileid` query parameter takes precedence over the `dir`. In fact if `dir` is invalid but `fileid` isn't, the resolution will succeed, as opposed to if the `fileid` is wrong (doesn't exist) and `dir` correct, resolution will fail altogether with a 404.
This ADR is limited to the scope of "how will a web client deal with the browser URL?". The API URLs will change with the spaces concept to `https://demo.owncloud.com/dav/spaces/<space_id>/relative/path/to/resource`. The Web UI can look up a space id and the mount path using the `/graph/v1.0/drives` API:
1. TODO for a given resource id as part of the URL the `https://demo.owncloud.com/v1.0/drive/items/123456A14B0A7750!359?$select=parentReference` can be used to retrieve the drive/space:
```
{
"parentReference": {
"driveId": "123456a14b0a7750",
"driveType": "personal",
"id": "123456A14B0A7750!357",
"path": "/drive/root:"
}
}
```
2. TODO to fetch the list of all spaces with their mount points we need an API endpoint that allows clients (not only the web ui) to 'sync' the list of storages a user has access to from the storage registry on the server side. This allows clients to directly talk to a storage provider on another instance, allowing true storage federation. The MS graph api has no notion of mount points, so we will need to add a `mountpath` *(or `mountpoint`? or `alias`?)* to our [`drive` resource properties in the libreGraph spec](https://github.com/owncloud/open-graph-api/blob/dc6da5359eee0345429080b5b59762fd8c57b121/api/openapi-spec/v0.0.yaml#L351-L384). Tracked in https://github.com/owncloud/open-graph-api/issues/6
{{< hint >}}
@jfd: The graph api returns a `path` in the `parentReference`, which is part of the `root` in a `drive` resource. But it contains a value in the namespace of the `graph` endpoint, e.g.: `/drive/root:/Bilder` for the `/Bilder` folder in the root of the currently logged-in users personal drive/space. Which is again relative to the drive. To give the clients a way to determine the mount point we need to add a new `mountpath/point/alias` property.
{{< /hint >}}
## Decision Drivers
* To reveal relevant context to the user URLs should either carry a path component or a meaningful alias
* To prevent bookmarks from breaking URLs should have an id component that can be used by the system to lookup the resource
## Considered Options
* Existing ownCloud Classic URLs
* ID based URLs
* Path based URLs
* Space based URLs
* Mixed Global URLs
* Configurable path component in URLs
## Decision Outcome
Chosen option: "Mixed global URLs", because it meets the requirement to contain a path and a stable identifier.
### Positive Consequences <!-- optional -->
* The path makes it "human readable"
* The URL can be bookmarked
* The bookmarked URLs remain stable even if the path changes
* All URLs can be shortened to hide any metadata like path, resource name and query parameters
### Negative Consequences <!-- optional -->
* the web UI needs to look up the space alias in a registry to build an API request for the `/dav/space` endpoint
## Pros and Cons of the Options
### Existing ownCloud Classic URLs
The existing ownCloud Classic URLs look like this
| URL | comment |
|-----|---------|
| `https://<host>/apps/files/?dir=<path>&fileid=<fileid>` | pattern |
| `https://demo.owncloud.com/apps/files/?dir=/&fileid=18` | root of the currently logged in user |
| `https://demo.owncloud.com/index.php/apps/files/?dir=/path/to/resource&fileid=192` | sub folder `/path/to/resource` |
It contains a path and a `fileid` (which takes precedence).
* Good, because the `fileid` prevents bookmarks from breaking
* Good, because the `dir` reveals context in the form of a path
* Bad, because the web UI needs to look up the space alias in a registry to build an API request for the `/dav/space` endpoint
* Bad, because URLs still contain a long prefix `(/index.php)/apps/files`
* Bad, because the `fileid` needs to be accompanied by a `storageid` to allow efficient routing in ocis
* Bad, because if not configured properly an additional `/index.php` prefixes the route
* Bad, because power users cannot navigate by updating only the path in the URL, as the `fileid` takes precedence. They have to delete the `fileid` to navigate
### ID based URLs
MS OneDrive has URLs like this:
| URL | comment |
|-----|---------|
| `https://<host>/?id=<fileid>(&cid=<cid>)` | pattern, the `cid` is optional but added automatically |
| `https://onedrive.live.com/?id=root&cid=A12345A14B0A7750` | root of a personal drive |
| `https://onedrive.live.com/?id=A12345A14B0A7750%21359&cid=A12345A14B0A7750` | sub folder in a personal drive |
It contains only IDs but no folder names. The `fileid` is a URL encoded `<cid>!<numericid>`. Very similar to the CS3 `resourceid` which consists of `storageid` and `nodeid`.
* Good, because bookmarks cannot break
* Good, because URLs do not disclose unshared path segments
* Bad, because the web UI needs to look up the space id in a registry to build an API request for the `/dav/space` endpoint
* Bad, because URLs reveal no context to users
### Path based URLs
There is a customized ownCloud instance that uses path only based URLs:
| URL | comment |
|-----|---------|
| `https://<host>/apps/files/?dir=/&` | root of the currently logged in user |
| `https://demo.owncloud.com/apps/files/?dir=/&` | root of the currently logged in user |
| `https://demo.owncloud.com/apps/files/?dir=/path/to/resource&` | sub folder `/path/to/resource` |
* Good, because the URLs reveal the full path context to users
* Good, because power users can navigate by updating the path in the url
* Bad, because the web UI needs to look up the space id in a registry to build an API request for the `/dav/space` endpoint
* Bad, because the bookmarks break when someone renames a folder in the path
* Bad, because there is no id that can be used as a fallback lookup mechanism
* Bad, because URLs might leak too much context (parent folders of shared files)
### Space based URLs
| URL | comment |
|-----|---------|
| `https://<host>/#/s/<space_id>(/<relative/path>)(?id=<resource_id>)` | the pattern, relative `path` and `resource_id` are optional |
| `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607` | root of a storage space, might be the currently logged in users home |
| `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607/relative/path/to/resource` | sub folder `/relative/path/to/resource` in the storage with id `b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607`, works ***only*** if path still exists |
| `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607/relative/path/to/resource?id=ba4c1820-df12-11eb-8dcd-ff21f12c1264:beb78dd6-df12-11eb-a05c-a395505126f6` | sub folder `/relative/path/to/resource` in the storage with id `b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607`, lookup can fall back to the `id` |
{{< hint >}}
* `/#` is used by the current vue router.
* `/s` denotes that this is a space url.
* `<space_id>` and `<resource_id>` both consist of `<storage_id>:<node_id>`, but the `space_id` can be replaced with a shorter id or an alias. See further down below.
* `<relative/path>` takes precedence over the `<resource_id>`, both are optional
{{< /hint >}}
* Good, because the web UI does not need to look up the space id in a registry to build an API request for the `/dav/space` endpoint
* Good, because the URLs reveal a relevant path context to users
* Good, because everything after the `#` is not sent to the server, building the webdav request to list the folder is offloaded to the clients
* Good, because power users can navigate by updating the path in the url
* Bad, because the current ids are uuid based, leading to very long URLs where the path component nearly vanishes between two very long strings
* Bad, because the `#` in the URL is just a technical requirement
* Bad, because ocis web requires a `/#/files/s` at the root of the route to distinguish the files app from other apps
* Bad, while navigating using the WebUI, the URL has to be updated whenever we change spaces.
* Bad, because the technical `<space_id>` is meaningless to end users
With the above explained, let's see some use cases:
#### Example 1: UserA shares something from her Home folder with UserB
- open the browser and go to `demo.owncloud.com`
- the browser's url changes to: `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607`. You're now in YOUR home folder / personal space.
- you create a new folder `/relative/path/to/resource` and navigate into `/relative/path/to`
- the URL now changes to: `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607/relative/path/to`
- You share `resource` with some else
- You navigate into `/relative/path/to/resource`
- now the URL would look like: `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:3a9305da-df17-11eb-ab99-abe09d93e08a`
As you can see, even if you're the owner of `/relative/path/to/resource` and navigate into it, the URL changes due to a new space being entered. This ensures that while working in your home folder, copying URLs and giving them to the person you share the resource with, the receiver can still navigate within the new space.
In short terms, while navigating using the WebUI, the URL has to constantly change whenever we change spaces to reflect the most explicit one.
#### Example 2: UserA shares something from a Workspace
Assuming we only have one storage provider; a consequence of this, all storage spaces will start with the same storage_id.
- open the browser and go to `demo.owncloud.com`
- the browser's url changes to: `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607`. You're now in YOUR home folder / personal space.
- you have access to a workspace called `foo` (created by an admin)
- navigate into workspace `foo`
- the URL now changes to: `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:d342f9ce-df18-11eb-b319-1b6d9df4bc74`. You are now at the root of the workspace `foo`.
- because we only have one storage provider, the `space_id` section of the URL only updates the `node_id` part of it.
- had we had more than one storage provider, the `space_id` would depend on which storage provider contains the storage space.
- you create a folder `/relative/path/to/resource`
- you navigate into `/relative/path/to/resource`
- now the URL would look like: `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:d342f9ce-df18-11eb-b319-1b6d9df4bc74/relative/path/to/resource`
- or a more robust url: `https://demo.owncloud.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:d342f9ce-df18-11eb-b319-1b6d9df4bc74/relative/path/to/resource?id=b78c2044-5b51-446f-82f6-907a664d089c:04f1991c-df19-11eb-9cc7-3b09f04f9ca3`
#### Spaces Registry
A big drawback against this idea is that the length of the URL is increased by a lot, rendering them almost unreadable. Introducing a Spaces Registry (SR) would shorten them. Let's see how.
A URL without a SR would look like: `https://ocis.com/#/s/b78c2044-5b51-446f-82f6-907a664d089c:d342f9ce-df18-11eb-b319-1b6d9df4bc74/TEST?id=b78c2044-5b51-446f-82f6-907a664d089c:04f1991c-df19-11eb-9cc7-3b09f04f9ca3`
The same URL with a SR `https://ocis.com/#/s/workspaceFoo/TEST?id=b78c2044-5b51-446f-82f6-907a664d089c:04f1991c-df19-11eb-9cc7-3b09f04f9ca3`
Space Registry resolution can happen at the client side (i.e: the client keeps a list of space name -> space id [where space id = storageid + nodeid]; the client queries a SR) or server side. Server side is more resilient due to clients can have limited networking; for instance if they are running on a tight intranet.
### Mixed Global URLs
While ID based space URLs can be made more readable by shortening the IDs they only start to reveal context when an alias is used instead of the space id. These aliases however have to be unique identifiers. These aliases should live in namespaces like `/workspaces/marketing` and `/personal/marketing` to make phishing attacks harder (in this case a user that registered with the username `marketing`). But namespaced aliases is semantically equivalent to ... a path hierarchy.
When every space has a namespaced alias and a relative path we can build a global namespace:
| URL | comment |
|-----|---------|
| `https://<host>/files</namespaced/alias></relative/path/to/resource>?id=<resource_id>` | the pattern, `/files` might become optional |
| `https://demo.owncloud.com/files/personal/einstein/?id=b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21607` | root of user `einstein` |
| `https://demo.owncloud.com/files/personal/einstein/relative/path/to/resource?id=b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21608` | sub folder `/relative/path/to/resource` |
| `https://demo.owncloud.com/files/shares/einstein/somesharename?id=b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21608` | shared URL for `/relative/path/to/resource` |
| `https://demo.owncloud.com/files/personal/einstein/marie is stupid/and richard as well/resource?id=b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21608` | sub folder `marie is stupid/and richard as well/resource` ... something einstein might not want to reveal |
| `https://demo.owncloud.com/files/shares/einstein/resource (2)?id=b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21608` | named link URL for `/marie is stupid/and richard as well/resource`, does not disclose the actual hierarchy, has an appended counter to avoid a collision |
| `https://demo.owncloud.com/files/shares/einstein/mybestfriends?id=b78c2044-5b51-446f-82f6-907a664d089c:194b4a97-597c-4461-ab56-afd4f5a21608` | named link URL for `/marie is stupid/and richard as well/resource`, does not disclose the actual hierarchy, has a custom alias for the share |
| `https://demo.owncloud.com/files/public/kcZVYaXr7oZ66bg/relative/path/to/resource` | sub folder `/relative/path/to/resource` in public link with token `kcZVYaXr7oZ66bg` |
| `https://demo.owncloud.com/files/public/kcZVYaXr7oZ66bg/relative/path/to/resource` | sub folder `/relative/path/to/resource` in public link with token `kcZVYaXr7oZ66bg` |
| `https://demo.owncloud.com/s/kcZVYaXr7oZ66bg/` | shortened link to a resource. This is needed to be able to copy a link to a resource without leaking any metadata. |
`</namespaced/alias></relative/path/to/resource>` is the global path in the CS3 api. The CS3 Storage Registry is responsible by managing the mount points.
In order to be able to copy and paste URLs all resources must be uniquely identifiable:
* Instead of `/home` the URL always has to reflect the user: `/personal/einstein`
* Workspaces can use `/workspaces/<alias>` or `/workspaces/<additional>/<classification>/<alias>` where the hierarchy is given by the organization
* Experiments can use `/experiments/<alias>`
* Research institutes could set up `/papers/<researchgroup>/<alias>`
* Trash could be accessed by prefixing the namespace alias with `/trash`? or using `/trash/<space_id>`
* Instead of a namespaced alias a storage space id could be used with a generic `/space/<space_id>` namespace
* An url shortener can create urls like `/s/<token>` which could be used as a stable link to a resource.
* Links for anonymous users will resolve to `/public/<token>`
The alias namespace hierarchy and depth can be pre-determined by the admin. Even if aliases change the `id` parameter prevents bookmarks from breaking. A user can decide to build a different hierarchy by using his own registry.
What about shares? Similar to `/home` it must reflect the user: `/shares/einstein` would list all shares *by* einstein for the currently logged-in user. The ui needs to apply the same URL rewriting as for space based URLs: when navigating into a share the URL has to switch from `/personal/einstein/relative/path/to/shared/resource` to `/shares/einstein/<unique and potentially namespaced alias for shared resource>`. When more than one `resource` was shared a name collision would occur. To prevent this we can use ids `/shares/einstein/id/<resource_id` or namespaced aliases `/shares/einstein/files/alias`. Similar to the `/trash` prefix we could treat `/shares` as a filter for the shared resources a user has access to, but that would disclose unshared path segments in personal spaces. We could make that a feature and let users create an alias for a shared resource, similar as for public links. Then they can decide if they want to disclose the full path in their personal space (or another workspace) or if they want to use an alias which is then accessed at `/shares/einstein/<alias>`. As a default we could take the alias at creation time from the filename. That way two shares to a resource with the same name, e.g.: `/personal/einstein/project AAA/foo` and `/personal/einstein/project BBB/foo` would lead to `/shares/einstein/foo` (a CS3 internal reference to `/personal/einstein/project AAA/foo`) and `/shares/einstein/foo (2)` (a CS3 internal reference to `/personal/einstein/project BBB/foo`). `foo (2)` would keep its name even when `foo` is deleted or renamed. Well an id as the alias might be better then, because users might rename these aliases, which would break URLs if they have been bookmarked. In any case this would make end user more aware of what they share AND it would allow them to choose an arbitrary context for the links they want to send out: personal internal share URLs.
With these different namespaces the `/files` part in the URL becomes obsolete, because the files application can be registered for multiple namespaces: `/personal`, `/workspaces`, `/shares`, `/trash` ...
* Good, because it contains a global path
* Good, because spaces with namespaced aliases can be bookmarked and copied into mails or chat without disclosing unshared path segments, as the space is supposed to be shared
* Good, because the UI can detect broken paths and notify the user to update his bookmark if the resource could be found by `id`
* Good, because the `/files` part might only be required for `id` only based lookup to let the web ui know which app is responsible for the route
* Good, because it turns shares into deliberately named spaces in `/shares/<owner>/<alias>`
* Good, because all urls can be shortened to hide any metadata like path, resource name and query parameters
* Bad, because the web UI needs to look up the space alias in a registry to build an API request for the `/dav/space` endpoint
### Configurable path component in URLs
Not every deployment may have the requirement to have the path in the URL. We could use id only based URLs, similar to onedrive and make showing paths configurable.
| URL | comment |
|-----|---------|
| `https://<host>/files?id=<resource_id>` | default id based navigation |
| `https://<host>/files</namespaced/alias></relative/path/to/resource>?id=<resource_id>` | optional path based navigation with fallback to id |
In contrast to ownCloud Classic path takes precedence and the user is warned when the fileid in his bookmark no longer matches the id on the server: sth. like "The path of the resource has changed, please verify and update your bookmark!"
When a file is selected the filename also becomes part of the URL so individual files can be bookmarked.
If navigation is id based we need to look up the path for the id so we can make a webdav request, or we need to implement the graph drives and driveItem resources.
The URL `https://<host>/files?id=<resource_id>̀` is sent to the server. It has to look up the correct path and redirect the request, including the path. But that would make all bookmarks contain tha path again, even if paths were configured to not be part of the URL.
The `/meta/<fileid>` webdav endpoint can be used to look up the path with property `meta-path-for-user`.
For now, we would use path based navigation with URLs like this:
```
https://<host>/files</namespaced/alias></relative/path/to/resource>?id=<resource_id>
```
This means that only the _resource path_ is part of the URL path. Any other parameter, e.g. file `id`, `page` or sort order must be given as URL parameters.
- [ ] To make lookup by id possible we need to implement the `/meta/<fileid>` endpoint so the sdk can use it to look up the path. We should not implement a redirect on the ocis server side because the same redirect logic would need to be added to oc10. Having it in ocis web is the right place.
- [ ] The old sharing links and oc10 urls still need to be redirected by ocis/reva as in oc10.
Public links would have the same format: `https://<host>/files?id=<resource_id>` The web UI has to detect if the user is logged in or not and adjust the ui accordingly.
{{< hint warning >}}
Since there is no difference between public and private files a logged-in user cannot see the public version of a link unless he logs out.
{{< /hint >}}
Loaded 100 of 2277 files, more files were not shown because too many files have changed in this diff. Show more