Skip to content

Proposal: move configuration to config directory #100

@aykevl

Description

@aykevl

Right now, go-librespot reads configuration and credentials from the current working directory (unless specified otherwise). I propose we use the following scheme instead:

  • Configuration is read from ~/.config/go-librespot/config.yml. The file is the same as it currently is.
  • Credentials are stored in a new state file, in ~/.config/go-librespot/state.json. The file looks like this:
    {
      "credentials": {
        "username": "...",
        "data": "..."
      },
      "device_id": "..."
    }
  • The config directory is configurable with a flag, defaulting to UserConfigDir() + "/go-librespot" so it also uses the appropriate directory on other OSes.

There are a few reasons why I think this is a good idea:

  • I think the current directory is a bad place to store configuration. Maybe it's fine on a headless system, but at least the way I use go-librespot is on a regular user account (with config directory available).
  • More state needs to be saved, such as ZeroConfig credentials. I also have an issue that Spotify keeps defaulting to "Let others Jam on this speaker" which I suspect is because the device ID is regenerated each time.

@devgianlu if you agree with this scheme I'd like to implement this (but asking here first before I put a lot of work into it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions