Use XDG Base Dir Standard
When looking at the README of the project one can easily notice the following:
(…) create a file
$HOME/.MuWire/i2p.properties(…)
Creating a new application that doesn't follow standards for config files intensifies the problem with users' home directory being polluted by wrongly placed directories. It gets to the point where people are desperate enough to write a whole FUSE filesystem just to get dotfiles cleaned up.
It doesn't have to be like this.
Instead of placing config files in ~/.MuWire place them in $XDG_HOME_CONFIG/MuWire (note the absence of the dot), or ~/.config/MuWire if $XDG_HOME_CONFIG is not set.
I'll take a look at the XDG standard. In the meantime I've updated the README to point to the different locations the config files end up being on the different OSes
Support for XDG specs would be very appreciated, it sounds like a minor detail but I often prefer alternative applications according to whether they support xdg or not, since I prefer to keep my configuration and data files in their respective directories in order to backup/clean easily.
Hi, sorry for the delay. I had a look at the XDG standard and it's actually going to be quite tricky to port MuWire to comply with this standard without cutting corners. By cutting corners I mean putting things in XDG_CONFIG_HOME that actually belong in XDG_RUNTIME_DIR etc. Even with cutting corners it's still going to be a non-trivial undertaking, even if it's restricted only for LInux.
What I may do is check if XDG_CONFIG_HOME is set and jam everything that is currently in ~/.MuWire in there as a first step on new installs. Splitting that into the different XDG_* is going to require in-depth changes. If someone wants to tackle this as a project I'll be happy to help them; I can't promise that I'll get around to doing it myself though.
That's understandable, even big projects which do implement XDG such as chromium don't fully support the standard, but personally even just having the main folder with both configuration and some data in XDG_CONFIG_HOME would be enough.
Of course you might want to keep backwards compatibility, meaning that the files go in XDG_CONFIG_HOME if ~/.MuWire does not exists and XDG_CONFIG_HOME is set.
Edit: Although, for new installs you could just fallback to $HOME/.config/ when XDG_CONFIG_HOME is unset as other projects do, I think it's in the specification as well
Ok, I've moved the contents of .MuWire to either XDG_CONFIG_HOME/MuWire or .config/MuWire in the referenced commit. @BachoSeven @zetok it would be great if you can test :)
@zlatinb Thank you, it seems to be working as expected. In my system however muwire ends up creating another unwanted folder, ~/.java/fonts, which shouldn't be created since I have set _JAVA_OPTIONS="-Djava.util.prefs.userRoot="${XDG_CONFIG_HOME:-$HOME/.config}"/java, as well as two more files which should not be directly in ~, respectively a router.config and wrapper.log(note that I'm using i2pd as my i2p router; however it by itself does not create those two files, and I launched it with an alternative --datadir as well).
Thanks for testing. I don't know about ~/.java/fonts, first time I hear about this but will do some research on how to get rid of it or put it in the right place.
router.config and wrapper.log should only appear if you're running with an embedded router, which is not the default when building from source, so that is strange. I'll investigate.
Oh wait the embedded router is my fault; I was trying to figure out how to make everything work because I would keep on getting muwire couldn't connect to the i2p router(and still do, now that I removed the embedded router).
I'm really new to i2p and I haven't understood how I should tell muwire which port my i2pd router is listening on; would really appreciate if you could point me in the right direction.
(so the router and wrapper files are indeed not created unless using the embedded router, however I guess it would make sense to move those as well)
Oh ok that makes more sense. In I2Pd you need to explicitly enable the "I2CP" interface for MuWire to work. Look in the i2pd config file there should be a section for I2CP.