5 ms·
> Inside of the home directory a file ~/.identity contains the JSON formatted user record of the user. It follows the format defined in JSON User Records. Why
by Tecuane 7y ago
> Inside of the home directory a file ~/.identity contains the JSON formatted user record of the user. It follows the format defined in JSON User Records.
Why couldn't this have gone into ~/.config/? There's enough garbage cluttering my home directory.
- farisjarrah 7y agoI'm with you on this. They should use the XDG base directory standard
- jml7c5 7y agoI would suspect (though I'll admit without looking into it) that in order to know where $XDG_CONFIG_HOME is, one first has to load the user info. Bit of a chicken and the egg scenario.
- mixedCase 7y agoI'm the kind of guy who goes through $HOME every once in a while and start looking for workarounds or filing bugs requesting XDG Base Directory spec support. But in this case I can't complain. It's literally about the behavior of the home folder. This one makes complete sense to me.
- oefrha 7y ago> I'm the kind of guy who goes through $HOME every once in a while and start looking for workarounds or filing bugs requesting XDG Base Directory spec support. I used to be that guy. Now I’m not. Re workarounds: usually that means env vars, but all that crap in env is copied to the execution environment of every single process, which is pretty awful. Re bug reports: usually only a few “that guy”s care at all, sometimes there’s endless debate about whether things go into XDG_DATA_HOME or XDG_CACHE_HOME, the occasional accepted PR requires so much effort I might as well just try to forget about all the garbage sitting in the $HOME.
- anarazel 7y agoIt's needed before the actual contents of the home directory are available (i.e. mounted), if I understand correctly. Nor is it actually user-modifiable: > Since the user record is cryptographically signed the user cannot make modifications to the file on their own (at least not without corrupting it, or knowing the private key used for signing the record). > This file system should contain a single directory named after the user. This directory will become the home directory of the user when activated. It contains a second copy of the user record in the ~/.identity file, like in the other storage mechanisms. Not quite sure what the purpose of this copy is, given users can delete / replace it?
- userbinator 7y agoAlso this: Since the user record is cryptographically signed the user cannot make modifications to the file on their own (at least not without corrupting it, or knowing the private key used for signing the record). That sounds like something that shouldn't even be in the user's own home directory. ...and JSON, of all things. Every aspect of systemd which I've worked with seems to be full of sprawling complexity and overengineering, and this is no exception. I know "it's not the UNIX philosophy" is a common dismissive complait about it, but looking at the design gives a very different feeling than the "original UNIX" designs, which felt humble and simple.
- mixedCase 7y ago>...and JSON, of all things. Every aspect of systemd which I've worked with seems to be full of sprawling complexity and overengineering boolean, number, string, array, object, null Sounds simple to me.
- lokedhs 7y agoPlease tell me what you'll end up with if you encode and then decode the number 1E12 using two different JSON implementations. Check the spec, and then tell me if it's simple.
- zeveb 7y agoDoes the JSON number type permit me to store the number 123,456,789,098,765,432,123,456,789,098,765,432,123? When I read it in with a parser, what integer value will my code see? This is not an academic question: large integers are common, for example, as cryptographic keys.
- clktmr 7y ago>...and JSON, of all things. Right? Reasoning was "the web people are using it too". Why not just use key value based config files like every other system tool?
- stubish 7y ago
- stubish 7y agoThinking out loud, there is no reason .identity needs to be in the root of your home directory. The .identity file contains arbitrary metadata, which could just as easily specify which subdirectory should be mounted as $HOME. You could also move your other $XDG_ directories like .config out of $HOME.
- upofadown 7y ago.config is a XDG thing. The location of it is configurable. Which is the opposite of a standard and is a bad idea in general.
- farisjarrah 7y agoJust out of curiosity, why is it the opposite of a standard if its configurable? XDG home seems to have a sane default of .config, but also provides configuration with the $XDG_CONFIG_HOME environment variable. To me it looks like thats part of the specified XDG base directory standard. https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://specifications.freedesktop.org/basedir-spec/basedir-...
- upofadown 7y agoIt can hardly be considered a standard location if you literally make it so people will consider putting it wherever they like.