Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Look for config files in /etc/ruma #198

Closed
wants to merge 4 commits into from
Closed

Conversation

agraven
Copy link

@agraven agraven commented Jan 14, 2020

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
Copy link
Author

agraven commented Jan 15, 2020

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

@jimmycuadra
Copy link
Member

It might make sense to use app_dirs for this.

@agraven
Copy link
Author

agraven commented Jan 15, 2020

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.

Use a clone-on-write to avoid unnecessary creation of path buffers, and
use if let instead of methods on Option to increase readability and
decrease levels of nesting
@agraven
Copy link
Author

agraven commented Mar 14, 2020

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

@jplatte
Copy link
Member

jplatte commented Mar 14, 2020

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
Copy link
Member

jplatte commented Apr 9, 2020

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
Copy link
Author

agraven commented Apr 9, 2020

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

@jplatte
Copy link
Member

jplatte commented Apr 9, 2020

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.

@agraven agraven closed this Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Look for config file in /etc
3 participants