Repository navigation
Conversation
…ings Signed-off-by: Nathan van Dael <n.vandael@cloudwise.nl>
| cfg.clearOverrideServerUrl(); | ||
| cfg.clearOverrideLocalDir(); |
There was a problem hiding this comment.
This only clears the user value. A device default or policy overrideLocalDir stays e.g. Nextcloud, so it applies to every account added later. For a second account, initialiseLocalSyncFolder() gets the first account folder, findGoodPathForNewSyncFolder() rejects it and falls back to e.g Nextcloud2.
However, with a policy enforced URL, the auto finish skips the sync options step, so the user never sees this. Should a overrideLocalDir only apply to the first account, or should this be handled explicitly?
Assisted-by: Claude:claude-opus-5-5
- Return whether setOverrideServerUrl() and setOverrideLocalDir() wrote the value, and show a hint when a policy blocks --overrideserverurl or --overridelocaldir. - Reject a --overridelocaldir path that is not absolute while parsing the command line, using the schema validator. - Add ConfigFile::isOverrideServerUrlLocked(), shared by the wizard and the nc:// URI scheme handler, so only a policy or command line value locks the server URL and restricts login links. Builds enable APPLICATION_SERVER_URL_ENFORCE by default, so the wizard now clears the lock for a device default. - Apply an overrideLocalDir from device default or policy only to the first account, in the wizard and for account setup from the command line. A command line value still applies to the next account. Skip the sync options step only for a locked folder. - Update the docs and add tests. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Nathan van Dael <n.vandael@cloudwise.nl>
| Theme::instance()->setForceOverrideServerUrl(true); | ||
| Theme::instance()->setStartLoginFlowAutomatically(true); | ||
| } else { | ||
| Theme::instance()->setForceOverrideServerUrl(false); |
There was a problem hiding this comment.
the false in this line should depend on the boolean set in APPLICATION_SERVER_URL_ENFORCE.
the way this is now, a branded client with APPLICATION_SERVER_URL_ENFORCE set to true will not enforce the server url as expected.
| _overrideLocalDir = overrideLocalDir; | ||
| } | ||
| } else { | ||
| showHint("Invalid URL passed to --overridelocaldir"); |
There was a problem hiding this comment.
| showHint("Invalid URL passed to --overridelocaldir"); | |
| showHint("Invalid path passed to --overridelocaldir"); |
camilasan
left a comment
There was a problem hiding this comment.
After this round, I think it will be good enough to merge it.
thanks for the contribution!
- A device default no longer unlocks the server URL in a build that sets APPLICATION_SERVER_URL together with APPLICATION_SERVER_URL_ENFORCE. Standard builds enable APPLICATION_SERVER_URL_ENFORCE without a URL, so a device default stays editable there. - Say "Invalid path" when --overridelocaldir is given without a path. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Nathan van Dael <n.vandael@cloudwise.nl>
|
Hi @camilasan . I've implemented your feedback, thanks for giving this to me. |
|
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.) |
Resolves
Part of #5497.
overrideServerUrlandoverrideLocalDirnow resolve through the managed settings framework (ConfigFile::getConfig). They can be set by device policy (registry / managed plist) or as a device default, in addition to the existing--overrideserverurl/--overridelocaldircommand-line options.Summary
Wizard behaviour per source
Details
http(s)URL or JSON list of{name, url}foroverrideServerUrl, absolute path foroverrideLocalDir. Empty or invalid values are skipped, including empty user values that older clients wrote after account setup.initialiseOverrideServerChoices).ConfigFile::clearConfig()removes a user value so the next source applies again.restoreLegacyAccount,nextcloudcmd) is skipped only for an override from the user config.doc/settings/managed-settings.md.Deliberate choices
forceOverrideServerUrltofalse. Otherwise branded builds withAPPLICATION_SERVER_URL_ENFORCEwould lose their lock.testUnit_state_expectedpattern from the Coding Style wiki.Testing
Linux CI container (
client-qt6:client-sid-6.10.2-4,-Werror):The new tests fail without the fix: the wizard default test fails without the lock change, and 10 value-check cases fail without the validator.
Manual test on Windows (Craft build), six scenarios: device default, policy, policy with server list, invalid policy value, empty legacy user value, command line.
macOS and Linux were not tested manually.
TODO
Checklist
AI (if applicable)