Follow XDG Base Directory Specification

Description

The "mender-cli" utility stores the token under ~/.mender/ , ref: https://sources.debian.org/src/mender-cli/1.1.0-1/cmd/util.go/#L36

Please consider following the XDG Base Directory Specification, see:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Golang seems to have a helper funciton for this specific case, see:
https://godoc.org/github.com/golang/build/maintner/godata#XdgCacheDir

That would mean that cache files (like tokens) normally end up under: ~/.cache/mender/
(but you can override the directory using the standardized environment variables as specified in the xdg base dir spec.)

This is a specific example I've spotted, but it would be nice if the XDG Base directories where adhered to everywhere instead of using "old-school" ~/.mender/ for everything....

PS. Unused/dead code: https://sources.debian.org/src/mender-cli/1.1.0-1/cmd/root.go/#L29

Affects versions

None

Environment

None

Attachments

2

Checklist

Activity

Show:

eystein.maloy.stenbergMay 1, 2019 at 3:48 PM

Nice, thanks for the contribution !
I see it is merged, is there anything left to do here (e.g. docs, help text, CLI options)?

Andreas HenrikssonMarch 13, 2019 at 8:49 PM

Andreas HenrikssonFebruary 28, 2019 at 1:03 PM
Edited

Patches for mender-cli:

Possible TODOs:

  • If default token doesn't exist in new path, but in old you might want to move it

  • Clean up leftovers in the old path (rmdir ~/.mender/)

  • Consider if you need to update anything in vendor/

Mirza KrakFebruary 28, 2019 at 12:24 PM
Edited

is also related to this.

Thanks

Fixed

Details

Assignee

Reporter

Priority

Fix versions

Zendesk Support

Checklist

Created February 28, 2019 at 12:18 PM
Updated June 5, 2019 at 11:45 AM
Resolved June 5, 2019 at 11:45 AM