Skip to content

feat: Manage Trusted Servers via OCC command - #63440

Merged
come-nc merged 1 commit into
nextcloud:masterfrom
T0mWz:63439
Nov 12, 2026
Merged

come-nc merged 1 commit into
nextcloud:masterfrom
T0mWz:63439

Conversation

@T0mWz

@T0mWz T0mWz commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Issue

As an administrator, I currently have to manually add each URL one by one as a trusted server via the Web Interface. From an administrative standpoint, the ability to add a single URL or a list of URLs via the shell would be highly desirable.

See submitted issue; #63439

Wish

Add an OCC option to list and manage federated trusted servers. This would eliminate the need for multiple clicks and copy-and-paste actions. But it also makes automated management easier.

Usage

occ federation:trusted-servers --list
occ federation:trusted-servers --add https://a.example.com https://b.example.com
occ federation:trusted-servers --remove https://a.example.com

Notes

  • --list ignores the servers argument; --add/--remove require at least one URL — enforced via INVALID (exit 2) return codes.
  • --remove takes a URL rather than an id (matching your ask), so findServerId() re-applies the same https:// prefix + trailing-slash trim that TrustedServers::addServer() used when the row was stored, then matches against getServers() to find the id removeServer(int $id) needs.
  • Status codes (STATUS_OK etc.) are mapped to readable labels in the --list table.

@T0mWz
T0mWz requested review from a team and sorbaugh as code owners August 20, 2026 13:58
@T0mWz
T0mWz requested review from Altahrim, come-nc and icewind1991 and removed request for a team August 20, 2026 13:58
@CarlSchwan CarlSchwan added stale Ticket or PR with no recent activity and removed stale Ticket or PR with no recent activity labels Aug 31, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@T0mWz

T0mWz commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@cristianscheid I hope all is fine now. 3 failing pipelines, but I think that's not related to this change. Can you verify those for me ? 😃

@cristianscheid

Copy link
Copy Markdown
Member

@cristianscheid I hope all is fine now. 3 failing pipelines, but I think that's not related to this change. Can you verify those for me ? 😃

Yes it was fine, was just a matter of re-running the jobs and they passed. Tyvm!

@T0mWz

T0mWz commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi @CarlSchwan and @cristianscheid , please can you review that it can be merged?
Thanks!

@SebastianKrupinski

Copy link
Copy Markdown
Contributor

@CarlSchwan @cristianscheid

Do we want all 3 commands in one file? We usually do one file per command.

@cristianscheid

Copy link
Copy Markdown
Member

@CarlSchwan @cristianscheid

Do we want all 3 commands in one file? We usually do one file per command.

@SebastianKrupinski this was a suggestion by Carl on previous comment:
#63440 (comment)

Docs reference:
https://docs.nextcloud.com/server/latest/developer_manual/app_development/commands.html#multiple-commands-in-one-class

@cristianscheid cristianscheid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@T0mWz

T0mWz commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@SebastianKrupinski @CarlSchwan can this be merge ?

@come-nc come-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good apart from license question

@T0mWz

T0mWz commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @come-nc ! Applied your suggestion.

@SebastianKrupinski

Copy link
Copy Markdown
Contributor

Hi @T0mWz

Can you also please squash the commits

Signed-off-by: Tom Wezepoel <tom.wezepoel@surf.nl>
@T0mWz

T0mWz commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Done @SebastianKrupinski 😀

@come-nc
come-nc merged commit 710c55f into nextcloud:master Nov 12, 2026
165 of 168 checks passed
@welcome

welcome Bot commented Nov 12, 2026

Copy link
Copy Markdown

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants