-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
matrix-dendrite: init at 0.3.11 #109561
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
matrix-dendrite: init at 0.3.11 #109561
Conversation
This comment has been minimized.
This comment has been minimized.
4ec025a
to
70d2375
Compare
70d2375
to
9fbe3ac
Compare
This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch) Result of 1 package failed to build and are new build failure:
|
Hmm, I can't reproduce the failing test on my machine. Looking into it. |
Keep in mind that I have sandbox enabled. Probably related to that. |
Is darwin even supported by upstream?
There are two things I'm missing though (though feel free to correct me if I'm wrong :)):
|
Yes! It's mentioned the installation instructions at least. FWIW it seems to work fine locally (for me).
I'm using Naffka. It's just configured under the kafka section. Do you mean the ports I set up?
If I delete the non-pertinent sections of the config from settings, can people still configure these options? (This is my first nixos module). Which upstream defaults should we keep then? And which one's should we make options? Right now I'm assuming port, and servers should be options, are there any others?
I can try! Do you have a reference I can base this off of? One issue is I'm storing the keyfiles in the user home directory, which needs to persist (and I believe a dynamic user's home directory will be wiped). We probably don't want to store these in the nix store. |
On the contrary, I find modules where all the configuration is dumped into a |
Sorry to make you sad 😆 I will do the work to fix this, this was just my first pass! |
Of course, sorry: I didn't mean to offend your work. |
No offense taken! I was just prefacing this with some context that I might need more feedback this first time. I read through the source where they read settings, and tested it. This seems to be close to the minimal configuration necessary: version: 1
global:
server_name: localhost
trusted_third_party_id_servers:
- matrix.org
- vector.im
kafka:
use_naffka: true
client_api:
external_api:
listen: http://[::]:8071
federation_api:
external_api:
listen: http://[::]:8072
media_api:
external_api:
listen: http://[::]:8074
sync_api:
external_api:
listen: http://[::]:8073
logging:
- type: file
level: info
params:
path: /home/michael/.cache/log/dendrite Should I replace the settings with this minimal yamltand make options for server_name and trusted_third_party_id_servers? P I can add additional args for the ports in the systemd service, and also add these as options (so we'd have a total of 5, including dataDir). These aren't read from the config but from the config file. httpBindAddr = flag.String("http-bind-address", ":8008", "The HTTP listening port for the server")
httpsBindAddr = flag.String("https-bind-address", ":8448", "The HTTPS listening port for the server") The other options I would probably want to include are 3 for paths to keys (for a total of 8), right now you can just copy the keys over to the directory made for the matrix-dendrite user. |
6c7af78
to
18956d8
Compare
18956d8
to
82e5bf6
Compare
I think I have addressed everyone's concerns, users are now required to generate and specify their own matrix keys and TLS keys (no magic service anymore). I didn't add additional sandboxing but will file an issue after this is merged. |
About to test your latest changes. One question: why does The suggested default seems to be |
Ah, I'm not sure that particularly necessary to have as a default option, so I just went ahead and removed the whole thing (it can still be set by the user ofc) |
82e5bf6
to
5783102
Compare
5783102
to
4725138
Compare
4725138
to
c3b30b5
Compare
@infinisil I think I addressed your review. |
c3b30b5
to
ff43bbe
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.
Looking good!
Nice! Feel free to merge whenever :) (I can't) |
vendorSha256 = "1l1wydvi0yalas79cvhrqg563cvs57hg9rv6qnkw879r6smb2x1n"; | ||
|
||
meta = with lib; { | ||
homepage = "https://matrix.org"; |
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.
This doesn't seem appropriate.
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.
If so, then synapse should also be changed
nixpkgs/pkgs/servers/matrix-synapse/default.nix
Lines 76 to 78 in 1d64c0d
meta = with lib; { | |
homepage = "https://matrix.org"; | |
description = "Matrix reference homeserver"; |
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.
Yes, I think so
-i ${configurationYaml} \ | ||
-o /run/matrix-dendrite/dendrite.yaml | ||
'' else '' | ||
${pkgs.coreutils}/bin/cp ${configurationYaml} /run/matrix-dendrite/dendrite.yaml |
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.
Can we use ln -s
?
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 copied the behavior of the branch with ${pkgs.envsubst}/bin/envsubst
which introduces a "secret" into the file. I think it's better the behavior of both branches match
${pkgs.envsubst}/bin/envsubst \ | ||
-i ${configurationYaml} \ | ||
-o /run/matrix-dendrite/dendrite.yaml |
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.
Can we use chmod to make it non-writable?
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 think so, this can be done in the sandboxing PR
Why was this even merged without tests? |
Yeah tests would be ideal, but not required imo. Also this PR is already pretty old and has seen a lot of review, the fact that @mjlbach has been updating it throughout all this time is commendable. But I think at some point the potential risk of losing a valuable contributor just because of PR's being reviewed for too long over-weighs the benefits. |
I have a WIP branch with tests, but as this is my first time writing tests for a nixos module, I am having a bit of difficulty debugging. I'm happy to open the draft PR today for feedback, and will address additional feedback to continue to improve the module. FWIW I think this is a valuable module as-is as it makes matrix homeserver hosting much more accessible (synapse is a resource hog, and is infeasible to run on a raspberry pi as many do with znc bouncers. @infinisil I was happy to stick through the review process, and thank you for continuing to provide feedback throughout it as well :) I learned a lot too! |
As an update, the tests are blocked by the fact that matrix python sdk which we use for tests hasn't been updated in 2 years and isn't compatible with dendrite. Matrix-nio isn't either, but I submitted an upstream patch which will fix it. matrix-nio/matrix-nio#254 I'm going to go ahead and open the draft PR, pending that fix being merged and the version bumped in nixpkgs. Edit: nvm, it's merged. Now just to wait for a release. |
They are not required but it seems like in this case it would have been rather easy to copy them from Synapse's.
100% agreed
For sure! If only dendrite supported push notifications (not for me, but for those who use crippled phones). |
Yes, sadly this was not the case as the python SDK used by those tests is fairly abandoned. Matrix-nio, which I used for the new test, supports dendrite (as of tonight) and probably should be preferred for testing all matrix-servers going forward. |
Motivation for this change
Dendrite is coming closer to a stable release. The package seems to build fine, and I was able to setup a home server.
I also made a basic monolithic configuration with the default settings autogenerated from the dendrite yaml in accordance with the latest settings RFC. (Thanks @infinisil for your help!)
Some thoughts/goals
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)