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
Prosody 0.10.0 #32960
Conversation
e829d0c
to
232287f
Compare
There was a problem hiding this 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"; | ||
}; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No checksum update?
There was a problem hiding this comment.
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…
f8d4652
to
a102d18
Compare
notes from 34C3 NixOS meetup:
|
a102d18
to
16a9e0e
Compare
729916d
to
ec691ad
Compare
updating config options, removing luazlib as mod_compression was removed for security reasons.
ec691ad
to
2c0b230
Compare
@fpletz is it still be possible to get this into 18.03? |
@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. |
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! |
nixos/tests/prosody.nix
Outdated
services.prosody.enable = true; | ||
environment.systemPackages = let | ||
sendMessage = pkgs.writeScriptBin "send-message" '' | ||
#!{pkgs.python3.interpreter} |
There was a problem hiding this comment.
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}
?
There was a problem hiding this comment.
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. 😉
There was a problem hiding this comment.
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.
a83162d
to
88f06c5
Compare
I added a basic test after @fpletz' proposal which starts a server, plays around with the user database via 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 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. |
@GrahamcOfBorg test prosody |
Success on aarch64-linux (full log) Attempted: tests.prosody Partial log (click to expand)
|
Failure on x86_64-linux (full log) Attempted: tests.prosody Partial log (click to expand)
|
@@ -255,37 +417,47 @@ in | |||
|
|||
config = mkIf cfg.enable { | |||
|
|||
environment.systemPackages = [ pkgs.prosody ]; | |||
environment.systemPackages = [ cfg.package ]; | |||
|
|||
environment.etc."prosody/prosody.cfg.lua".text = '' |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 👎
There was a problem hiding this comment.
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.
Test only timed out, built it locally. |
@globin thank you! |
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>. |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. 😉
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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. 🙂
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
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)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.