Conversation
| use Symfony\Component\Console\Input\InputOption; | ||
| use Symfony\Component\Console\Output\OutputInterface; | ||
|
|
||
| class ManageTrustedServers extends Command { |
There was a problem hiding this comment.
It would be great if this was using the new AsCommand attribute, see for example the files app how this is done
| ->addOption('add', null, InputOption::VALUE_NONE, 'add the given servers to the trusted servers list') | ||
| ->addOption('remove', null, InputOption::VALUE_NONE, 'remove the given servers from the trusted servers list') | ||
| ->addOption('list', null, InputOption::VALUE_NONE, 'list all trusted servers'); |
There was a problem hiding this comment.
I would prefer 3 sub commands federation:trusted-servers:add, federation:trusted-servers:remove and federation:trusted-servers:list.
You can have multiple command in a single class, see https://docs.nextcloud.com/server/latest/developer_manual/app_development/commands.html#multiple-commands-in-one-class
|
Hello there, 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.) |
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
Notes
--listignores the servers argument;--add/--removerequire at least one URL — enforced viaINVALID(exit 2) return codes.--removetakes a URL rather than an id (matching your ask), so findServerId() re-applies the samehttps://prefix + trailing-slash trim thatTrustedServers::addServer()used when the row was stored, then matches againstgetServers()to find the idremoveServer(int $id)needs.STATUS_OKetc.) are mapped to readable labels in the--listtable.