Skip to content

Conversation

@karaolidis
Copy link
Contributor

@karaolidis karaolidis commented Feb 1, 2026

Summary

Adds --password-salt and --secret options to maintenance:install for fully declarative deployments (e.g., sops-nix, Ansible Vault). Values are validated for minimum length and fall back to random generation if not provided.

Running this in my homelab for months without issues.

TODO

I have not added unit tests to this commit as the main change is in the install function that has a lot of side effects. Looking for comments in regards to how to implement this, if at all.

Checklist

@karaolidis karaolidis requested a review from a team as a code owner February 1, 2026 14:11
@karaolidis karaolidis requested review from come-nc, leftybournes, provokateurin and salmart-dev and removed request for a team February 1, 2026 14:11
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

I also use Nextcloud in a declarative environment using NixOS and I'm not 100% sure if this is needed or not. If you restore a backup, you'd have those values in your config.php. The backup would always contain the config.php and your database, so they would be in sync anyway.

Maybe you can explain a bit what this fixes? I'm not against merging it, just wondering what pain point this removes.

@karaolidis karaolidis force-pushed the declarative-salt-secret branch from 0050707 to 1972cc0 Compare February 2, 2026 10:55
@karaolidis
Copy link
Contributor Author

I also use Nextcloud in a declarative environment using NixOS and I'm not 100% sure if this is needed or not. If you restore a backup, you'd have those values in your config.php. The backup would always contain the config.php and your database, so they would be in sync anyway.

Maybe you can explain a bit what this fixes? I'm not against merging it, just wondering what pain point this removes.

This is not necessarily a "fix", I'd just like to be able to fully control the values of all parameters instead of having Nextcloud generate them randomly, to make it easier to pre-generate a reproducible config.php/deployment.

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

LGTM, just one minor change.

@karaolidis karaolidis force-pushed the declarative-salt-secret branch from 1972cc0 to 8393caa Compare February 2, 2026 11:04
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

@provokateurin provokateurin self-assigned this Feb 2, 2026
@nickvergessen
Copy link
Member

Would be good to run the PR from within our repo to see CI
So the cypress setup and others still pass.

@provokateurin
Copy link
Member

I'll do a local copy 👍

@provokateurin
Copy link
Member

#57994

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
@provokateurin provokateurin force-pushed the declarative-salt-secret branch from 8393caa to d73d5a2 Compare February 3, 2026 12:21
@provokateurin
Copy link
Member

Rebased to fix CI

@AndyScherzinger AndyScherzinger merged commit f46eea1 into nextcloud:master Feb 3, 2026
341 of 354 checks passed
@welcome
Copy link

welcome bot commented Feb 3, 2026

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 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.

6 participants