ruma / homeserver

A Matrix homeserver written in Rust.
https://www.ruma.io/
1.08k stars 41 forks source link

Look for config files in /etc/ruma #198

Closed agraven closed 4 years ago

agraven commented 4 years ago

This is a relatively naive implementation that does the same iteration over files but with /etc/ruma prepended to the path if none were found in the local directory.

Note that the type of config_path has been changed from Path to PathBuf to allow for joining the directory with the file name. This could be avoided by simply adding the absolute path of each potential file in etc to DEFAULT_CONFIG_FILES, but I considered that a bit too hardcoded.

Additionally, I changed DEFAULT_CONFIG_FILES from a static to a const as it's my understanding that it's best practice to use const when possible.

Should close #196.

agraven commented 4 years ago

The test failure seems to be related to out of date dependencies. See line 2292 and onwards.

jimmycuadra commented 4 years ago

It might make sense to use app_dirs for this.

agraven commented 4 years ago

I think that crate is better suited for user-level applications, because it relies on the xdg crate, which, as mentioned in the issue (#196), looks for system level config files in /etc/xdg, which is highly unusual behaviour for a daemon.

agraven commented 4 years ago

I added some minor improvements to this PR. Is it ready to be merged?

jplatte commented 4 years ago

Jimmy currently isn't around. I could merge this, but I'm not sure I should given that I don't really want to maintain the homeserver parts of ruma.

jplatte commented 4 years ago

This repository will soon be archived (I'll write a blog post about it and update README.md in the coming days). There is another homeserver project based on our lower-level crates in the works, discussion on that happens in #rustmatrix:koesters.xyz.

agraven commented 4 years ago

I assume you don't mind me closing the PR then?

jplatte commented 4 years ago

No, go ahead if you want. I haven't closed any of the other PRs yet because I don't think it really makes a difference after the project is archived and I didn't want to pointlessly generate notifications.