[GH-ISSUE #201] Feature Request :Seperate state files from config #131

Open
opened 2026-02-28 14:25:39 +03:00 by kerem · 4 comments
Owner

Originally created by @guidcruncher on GitHub (Aug 31, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/201

At the moment, state (persistence and lock file) are stored in the same folder which sometime can cause issues separating concerns in docker for example.

Maybe using the XDG Base directory speciation if these variables are set in the users environment?

https://specifications.freedesktop.org/basedir-spec/latest/

Originally created by @guidcruncher on GitHub (Aug 31, 2025). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/201 At the moment, state (persistence and lock file) are stored in the same folder which sometime can cause issues separating concerns in docker for example. Maybe using the XDG Base directory speciation if these variables are set in the users environment? [https://specifications.freedesktop.org/basedir-spec/latest/ ](https://specifications.freedesktop.org/basedir-spec/latest/)
Author
Owner

@markferry commented on GitHub (Sep 9, 2025):

Yup. Makes integration in to snapcast more awkward than it should be.

<!-- gh-comment-id:3271118250 --> @markferry commented on GitHub (Sep 9, 2025): Yup. Makes [integration in to snapcast](https://github.com/badaix/snapcast/pull/1425) more awkward than it should be.
Author
Owner

@devgianlu commented on GitHub (Sep 10, 2025):

I could see switching to XDG, but could you elaborate on what exactly are the difficulties introduced by having them in the same folder?

<!-- gh-comment-id:3275939661 --> @devgianlu commented on GitHub (Sep 10, 2025): I could see switching to XDG, but could you elaborate on what exactly are the difficulties introduced by having them in the same folder?
Author
Owner

@guidcruncher commented on GitHub (Sep 10, 2025):

It’s more of a security thing, you may not want state (user tokens etc) to be exposed in the same location as your config, and certainly docker containers can offer you secure locations for these things

It doesn’t have to be XDG But the options to use Seperate locations maybe good.

<!-- gh-comment-id:3276729007 --> @guidcruncher commented on GitHub (Sep 10, 2025): It’s more of a security thing, you may not want state (user tokens etc) to be exposed in the same location as your config, and certainly docker containers can offer you secure locations for these things It doesn’t have to be XDG But the options to use Seperate locations maybe good.
Author
Owner

@markferry commented on GitHub (Sep 11, 2025):

From a conventional unixy perspective I do expect to able to specify the path of the config file itself. (But maybe this in unconventional for golang?)

My config really wants to live under /etc with all the other daemon configs.
/etc is version controlled (e.g. etckeeper), and readonly for the go-librespot user. So can't really keep state there.

FWIW, I'd also expect the state dir to be configurable (typically under /var).

<!-- gh-comment-id:3277057645 --> @markferry commented on GitHub (Sep 11, 2025): From a conventional unixy perspective I do expect to able to specify the path of the config file itself. (But maybe this in unconventional for golang?) My config really wants to live under `/etc` with all the other daemon configs. `/etc` is version controlled (e.g. etckeeper), and _readonly_ for the go-librespot user. So can't really keep state there. FWIW, I'd also expect the state dir to be configurable (typically under `/var`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#131
No description provided.