Skip to content

feat: first prototype of circles federation over OCM - #3070

Draft
cristianscheid wants to merge 1 commit into
masterfrom
feat/noid/ocm-implementation
Draft

cristianscheid wants to merge 1 commit into
masterfrom
feat/noid/ocm-implementation

Conversation

@cristianscheid

@cristianscheid cristianscheid commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

This is a prototype for replacing circles custom federation protocol with OCM. It focuses on how circles events propagate between servers. The idea is to send events via OCM notifications (ocm/notifications) instead of using the two existing custom routes (/apps/circles/incoming/ and /apps/circles/event/).

As a first step, this is what was done:

  • circles is advertised on /.well-known/ocm as a new resource type/protocol:
$ curl -s https://nextcloud.local/.well-known/ocm | jq
{
  "enabled": true,
  "apiVersion": "1.0-proposal1",
  "version": "1.1.2",
  "endPoint": "https://nextcloud.local/index.php/ocm",
  "publicKey": { ... },
  "provider": "Nextcloud 36.0.0.1",
  "resourceTypes": [
    {
      "name": "file",
      "shareTypes": [
        "user",
        "group"
      ],
      "protocols": {
        "webdav": "/public.php/webdav/"
      }
    },
    {
      "name": "circle",
      "shareTypes": [],
      "protocols": {
        "circles": "/index.php/apps/circles/"
      }
    }
  ],
  [ ... ]
}
  • added new config value: federated_teams_ocm
  • when federated_teams_ocm is enabled and remote server advertises via OCM discovery both the circles protocol and the notification-sender-domain capability (see feat(ocm): support new format of notfication payload server#66049), circles events are sent as OCM notifications instead of the custom routes:
POST /apps/circles/incoming/ -> POST /ocm/notifications with CIRCLES_BROADCAST_EVENT
POST /apps/circles/event/ -> POST /ocm/notifications with CIRCLES_REQUEST_EVENT
  • these routes/events handle circle management (e.g., adding a member, renaming circle)
  • CIRCLES_BROADCAST_EVENT is sent by the server hosting the team to all remote servers that have members
    • each remote server applies the event's changes on receipt
  • CIRCLES_REQUEST_EVENT is sent by a server with team members to the server hosting the team
    • the host server applies the change locally, then sends a CIRCLES_BROADCAST_EVENT to all remote servers that have members
    • each remote server applies the event's changes on receipt

  • existing routes (/apps/circles/incoming/ and /apps/circles/event/ ) are still there, so servers without this change keep working
  • remote servers are still registered with occ circles:remote using WebFinger discovery
  • federated items (inside lib/FederatedItems) logic was not changed, meaning server still validates/applies change, and broadcasts it through the async loopback
  • what changes is how circle events requests travel between servers, using OCM protocol instead of custom protocol (when enabled and remote supports it)

TODO

  • add tests
  • maybe as a follow up PR, we could do the remote server registration (occ circles:remote <host>) using OCM discovery instead of WebFinger, by checking if remote has it enabled and lists the circle resource type with the circles protocol

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Comment thread lib/ConfigLexicon.php Resolved
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid
cristianscheid force-pushed the feat/noid/ocm-implementation branch from f2a037b to c6edcf9 Compare November 11, 2026 16:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants