replydev / cotp

Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality.
GNU General Public License v3.0
255 stars 24 forks source link

[Feature request]: Better method of portability #483

Closed MagicalDrizzle closed 2 months ago

MagicalDrizzle commented 2 months ago

So I have read https://github.com/replydev/cotp/issues/297, and I'd love to know if you are still interested in implementing the --dbpath idea. Context: I'm using Scoop to install cotp, and they prevent PATH pollution by having a dedicated directory containing shims which when launched will look for the executable path and execute it. (So you only need to add one dir to PATH and not 500) Unfortunately this means cotp is "executed" at the shims directory and not the actual binary location, which seems to prevent it from recognizing there's a db.cotp in the binary folder. Having a --dbpath options would solve this since I can specify the argument in the shim config. The current solution doesn't work because Scoop shims doesn't support adding environment vairables. Another plus would be you don't need to set an env var every time you wish to use custom database(s) location.

replydev commented 2 months ago

Hello @MagicalDrizzle,

I get your point and it would be good to improve portability as you proposed. I will implement that and release a new version.

replydev commented 2 months ago

@MagicalDrizzle

I have added the new -d or --database-path argument. Are you able to try the debug build? https://github.com/replydev/cotp/actions/runs/10637976851

MagicalDrizzle commented 2 months ago

@MagicalDrizzle

I have added the new -d or --database-path argument. Are you able to try the debug build? https://github.com/replydev/cotp/actions/runs/10637976851

Seems to work just fine for me. (also I'm curious whether it is possible to statically link vcruntime140.dll...)

replydev commented 2 months ago

@MagicalDrizzle

Yeah it is possible to static link the MSVC runtime but I prefer to avoid it to reduce the binary size.

I am merging the PR and closing the issue.