ente icon indicating copy to clipboard operation
ente copied to clipboard

[auth] [linux] ente data in user home - infinite loading if ~/ente file exists

Open nktnet1 opened this issue 1 year ago • 1 comments

Description

When using ente, a directory and sqlite3 database is created in the user's home folder:

$ file ~/ente/.ente.authenticator.db
/home/nktnet/ente/.ente.authenticator.db: SQLite 3.x database, user version 1, last written using SQLite version 3046000, file counter 2, database pages 4, cookie 0x1, schema 4, UTF-8, version-valid-for 2

Deleting/renaming the directory means that user details are lost.

Worse, having a file with path ~/ente instead of a directory means that ente-auth will load infinitely (as it cannot read from the sqlite database).

A better way to store user configurations would be to follow the standards set by XDG Base Directory, whereby this sqlite database file is stored in $XDG_DATA_HOME, e.g.

${XDG_DATA_HOME}/ente/.ente.authenticator.db         # which defaults to:
${HOME}/.local/share/.ente/.ente.authenticator.db

This is similar to #2563, where ente is using ~/temp instead of ${XDG_CACHE_HOME}/ente, leading to user files being unintentionally deleted.

The code in question is below: https://github.com/ente-io/ente/blob/8d91b857fb0662df29d042c6f21b611272d979b4/auth/lib/store/authenticator_db.dart#L13-L39

Thanks ~

Version

v3.0.17

What product are you using?

Ente Auth (installed ente-auth-bin from AUR)

What platform are you using?

Desktop - Linux

nktnet1 avatar Jul 28 '24 12:07 nktnet1

Will be fixed in the next version, thanks!

prateekmedia avatar Sep 18 '24 14:09 prateekmedia

It works for me, can we close this issue now?

Tommimon avatar Apr 12 '25 00:04 Tommimon