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

Prosody 0.10.0 #32960

Merged
merged 6 commits into from Mar 22, 2018
Merged

Prosody 0.10.0 #32960

merged 6 commits into from Mar 22, 2018

Conversation

florianjacob
Copy link
Contributor

Motivation for this change

Prosody 0.10 most notably introduces long-awaited support for the XEPs Message Carbons and Message Archive Management.
See the release notes for more detail.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Note: Some module names now gained an underscore in their name, and therefore, with the current system, need a snake case option name instead of a camel case one – ideas for improvements welcome. 😉 I searched for a nix function to convert camelCase attribute names to snake_case for the config, but could not find something like this.

Copy link
Contributor

@orivej orivej left a comment

Choose a reason for hiding this comment

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

I have not tested this, but the change looks good.

type = types.bool;
default = true;
description = "Allow users to register on this server using a client and change passwords";
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this previously built in, or were the users unable to register over XMPP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, actually, this has not much to do with the 0.10 update in itself, I just stumbled over it during cleaning and creating the new module section. 😅

Previously, enabling this module was not exposed, but tied to the state of services.prosody.allowRegistration. The author probably thought that the module has no benefit when registration is disabled (it has, users can change their passwords themselves) or that enabling it would allow users to register even if services.prosody.allowRegistration = false; (it doesn't, this module is actually what gets configured through services.prosody.allowRegistration).

services.prosody.allowRegistration = false; and services.prosody.modules.register = true; is also upstream's default.

For server admins upgrading, the only effect should be that users can change their passwords via their XMPP clients now, even when public registration via XMPP is disabled, i.e. users are managed manually with the prosodyctl command line tool.

};

communityModules = fetchhg {
url = "https://hg.prosody.im/prosody-modules";
rev = "9a3e51f348fe";
rev = "a844d1535c4d";
sha256 = "09g4vi52rv0r3jzcm0bsgp4ngqq6iapfbxfh0l7qj36qnajp4vm6";
Copy link
Member

Choose a reason for hiding this comment

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

No checksum update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Strangely not, at the time I updated, nix-prefetch-hg https://hg.prosody.im/prosody-modules returned the checksum that was already there. No idea how that could happen, but the build worked. 🤔

Just updated the communityModules again when resolving the merge conflicts, now the checksum changed. Maybe the prosody module hosting was broken or something…

@florianjacob florianjacob force-pushed the prosody-0.10 branch 2 times, most recently from f8d4652 to a102d18 Compare January 1, 2018 16:53
@florianjacob
Copy link
Contributor Author

notes from 34C3 NixOS meetup:

  • @fpletz mentioned he's using prosody, and will test the update when he finds the time. 👍
  • Someone else was preparing the update as well and might have something to add, but I did not notice when they left and forgot to ask for their name in advance. 😕

updating config options, removing luazlib as mod_compression was removed
for security reasons.
@florianjacob
Copy link
Contributor Author

@fpletz is it still be possible to get this into 18.03?
Would be quite nice to be able to run my server on stable after the next release. 🙂

@fpletz
Copy link
Member

fpletz commented Mar 12, 2018

@florianjacob 18.03 still on the table. Unfortunately I wasn't able to upgrade my jabber instance to master or 18.03 yet due to #34253. We should probably add a prosody test.

@globin globin self-assigned this Mar 20, 2018
@globin
Copy link
Member

globin commented Mar 20, 2018

I'll finish this tomorrow, I've just deployed this on our infrastructure, with some minor changes that I'll clean up then. Thanks for your work!

services.prosody.enable = true;
environment.systemPackages = let
sendMessage = pkgs.writeScriptBin "send-message" ''
#!{pkgs.python3.interpreter}
Copy link
Member

Choose a reason for hiding this comment

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

#!{pkgs.python3.interpreter} -> #!${pkgs.python3.interpreter}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Damn, you caught me! I'm working on adding that simple test at this very moment and pushed that commit to test it on another machine / trying it with the borg build bot. I hoped to be finished before you'd take a look. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test is now finished! This was harder than expected, sorry for the inconvenience.

@florianjacob
Copy link
Contributor Author

florianjacob commented Mar 21, 2018

I added a basic test after @fpletz' proposal which starts a server, plays around with the user database via prosodyctl and connects locally to send a message using a python xmpp library.

This is the first NixOS test I wrote, I did not find a place where I need to register that test so it gets executed along the other ones, is that right? EDIT: I stumbled over a list of many tests inside of nixpkgs/nixos/release.nix, but I'm not sure whether I should / need to add it there…

The test could be expanded in some places to cover more which I noted as TODOs, but I'd say the basics sanity checks are covered and this is now good to go, if @globin is fine with how it was written.

@globin
Copy link
Member

globin commented Mar 22, 2018

@GrahamcOfBorg test prosody

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.prosody

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 96.40s
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/mawk11zaj2bvcyf53kpq5cbqchy0vw2l-vm-test-run-prosody

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: tests.prosody

Partial log (click to expand)

cannot build derivation '/nix/store/vi474bxlvn3gbx31qk3gr00mz9v59pr8-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ppgznrpbc3i4xn5awrkwlccwkhpph4c7-stage-1-init.sh.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/8f0isrfpn8czy3s1235imfv0vskp7nrk-initrd.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/xc3wfiqx6bzy3kbs9k6mfg28f2x09szp-nixos-system-machine-18.09.git.7c6a649.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/fyb1d19dzwr5bbch54g7xl0hk1m53xsn-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/b60sijvfh9im3w1qni4vx2jgnqghmg92-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/rzclp0kfdiw0v3bgn8b9rjk0yrvj3wvm-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/m4vp0cwqp7sx33ikrk2xpngskfn24799-nixos-test-driver-prosody.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/nmpry9wcb8c5l3y0ij0g9zsc3p7bkaa8-vm-test-run-prosody.drv': 1 dependencies couldn't be built
error: build of '/nix/store/nmpry9wcb8c5l3y0ij0g9zsc3p7bkaa8-vm-test-run-prosody.drv' failed

@@ -255,37 +417,47 @@ in

config = mkIf cfg.enable {

environment.systemPackages = [ pkgs.prosody ];
environment.systemPackages = [ cfg.package ];

environment.etc."prosody/prosody.cfg.lua".text = ''
Copy link
Member

Choose a reason for hiding this comment

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

I suggest using the --config option instead of polluting /etc.

Copy link
Member

Choose a reason for hiding this comment

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

We would have to create a specially wrapped prosodyctl then, so 👎

Copy link
Member

Choose a reason for hiding this comment

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

True. Didn't think about that because I don't use prosodyctl for managing users.

@globin
Copy link
Member

globin commented Mar 22, 2018

Test only timed out, built it locally.

@globin globin merged commit 76ea0e1 into NixOS:master Mar 22, 2018
@florianjacob florianjacob deleted the prosody-0.10 branch March 22, 2018 13:19
@florianjacob
Copy link
Contributor Author

@globin thank you!

@fpletz
Copy link
Member

fpletz commented Mar 22, 2018

Also big 👍 from me. Thanks!

@@ -347,6 +347,11 @@ following incompatible changes:</para>
<para>
The better-performing <literal>libevent</literal> backend is now enabled by default.
</para>

<para>
<literal>withCommunityModules</literal> now passes through the modules to <option>services.prosody.extraModules</option>.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just simplified my config with this. ❤️

};

vcard = mkOption {
Copy link

Choose a reason for hiding this comment

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

There is a lot of new options, but they are not referenced anywhere in module, so they will not work. What's the purpose of that change then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Every option in moduleOpts is automatically converted to lua and added to the config file at https://github.com/NixOS/nixpkgs/pull/32960/files#diff-d51fea555a73d3c752f162a7a433c498R442 so they don't need to be explicitly mentioned anywhere else in the module, avoiding loads of boilerplate code. Note that this mechanism was already in place before this PR, in case that caused the confusion. 😉

Copy link

Choose a reason for hiding this comment

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

@florianjacob Very interesting, thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gnidorah you're welcome, thanks for reviewing. 🙂

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.

None yet

7 participants