Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/matrix-synapse: don't use services.postgresql.initialScript in setup example #302586

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Apr 8, 2024

Description of changes

Closes #285688

This is misleading because initialScript will only be executed at the very first run of postgresql. I.e. when deploying synapse to a server with an existing postgresql, this won't work.

We don't have a good way of automatically provisioning databases declaratively, so for now just explain what needs to be done here and leave it to the user how to include this into their deployment.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@Ma27 Ma27 requested a review from RaitoBezarius April 8, 2024 14:25
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Apr 8, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Apr 8, 2024
@Ma27 Ma27 force-pushed the synapse-initialscript-docs branch from e8f6417 to 62f9486 Compare April 10, 2024 08:36
…n setup example

Closes NixOS#285688

This is misleading because `initialScript` will only be executed at the
*very first* run of postgresql. I.e. when deploying synapse to a server
with an existing postgresql, this won't work.

We don't have a good way of automatically provisioning databases
_declaratively_, so for now just explain what needs to be done here and
leave it to the user how to include this into their deployment.
@Ma27 Ma27 force-pushed the synapse-initialscript-docs branch from 62f9486 to a3d3cdf Compare April 10, 2024 15:43
@Ma27
Copy link
Member Author

Ma27 commented Apr 10, 2024

Pushed a small wording change to make the first sentence of the new paragraph passive.
Unless there are any objections, I'd merge soonish.

@Lassulus
Copy link
Member

Lassulus commented Apr 10, 2024

We use ExecStartPre now to setup the database in our config, is this maybe something we also want to do in the upstream nixos module?
https://git.clan.lol/clan/clan-core/pulls/1108/files line 69

@Ma27
Copy link
Member Author

Ma27 commented Apr 13, 2024

In #80447 I regret it quite much that we had an automatic way of creating databases with no reasonable way to perform upgrades then.

There are discussions about better approaches than ensure*-style options (#206467 and linked issues) and I hope we'll get there eventually. Until then my stance will be to have less of that magic.

Feel free to file a patch or issue anyways if you disagree.

That said, the effectively fixes a documentation bug, so I don't consider this blocking and I'd merge now.

@Ma27 Ma27 merged commit 52432f0 into NixOS:master Apr 13, 2024
21 checks passed
@Ma27 Ma27 deleted the synapse-initialscript-docs branch April 13, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instructions for running a Synapse server are wrong
3 participants