Skip to content
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

config file relies on tabs and spaces #2910

Closed
mcnesium opened this issue Jul 18, 2024 · 4 comments · Fixed by #2911
Closed

config file relies on tabs and spaces #2910

mcnesium opened this issue Jul 18, 2024 · 4 comments · Fixed by #2911
Assignees

Comments

@mcnesium
Copy link

I built my $XDG_CONFIG_HOME/gopass/config using Nix, but I had to do some ugly fiddling, to make it work:

source = (pkgs.formats.ini { }).generate "gopass.config" {
    …
    "mounts" = {
    "\tpath " = " ${stores}/mcnesium";
    "\tremote " = " ${remote}:passwords/mcnesium.git";
    };

The \t and the spaces around the = were necessary to make the INI format look like this:

[mounts]
    path = /home/mcn/.local/share/gopass/stores/mcnesium
    remote = git@git.qwertz.de:passwords/mcnesium.git

and not like it would generate it without them:

[mounts]
path=/home/mcn/.local/share/gopass/stores/mcnesium
remote=git@git.qwertz.de:passwords/mcnesium.git

With the latter, gopass mounts would simply return that it won't find any configured mounts.

The Nix community argues, gopass would be too picky with the file format, as INI itself would not rely on those tabs and spaces.

@timhae
Copy link

timhae commented Jul 19, 2024

@dominikschulz
Copy link
Member

I would argue that Nix has an ... interesting approach.

But I don't think our parser should require the tabs. That seems unnecessary.

The spaces around the equal signs however make more sense and I think we should keep this as is.

@dominikschulz dominikschulz self-assigned this Jul 20, 2024
@dominikschulz
Copy link
Member

I took a look at the current implementation.

Tabs are not required. We're removing any whitespace early on.

Spaces around the equal sign are currently required but I think we could ease the if that's what the INI spec requires.

dominikschulz added a commit to dominikschulz/gopass that referenced this issue Jul 20, 2024
syntax specification.

The gitconfig format (which is an INI format) does recommend but
not require whitespaces around equal signs that separate keys
and values.

Fixes gopasspw#2910

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
@mcnesium
Copy link
Author

mcnesium commented Aug 6, 2024

LGTM thanks 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants