Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

immich-go appears to retain/cache an API key #211

Closed
drsib opened this issue Mar 31, 2024 · 4 comments · Fixed by #214
Closed

immich-go appears to retain/cache an API key #211

drsib opened this issue Mar 31, 2024 · 4 comments · Fixed by #214
Assignees

Comments

@drsib
Copy link

drsib commented Mar 31, 2024

I have 2 users in my installation. After uploading files to my admin user, i re-ran immich-go for a second user with that user's API key. All of the photos were uploaded to the admin user rather than the user owing the new API key

@drsib
Copy link
Author

drsib commented Mar 31, 2024

The code appears to reference a config file? Looks like its storing the API key there? Im not an expert by any means. I have tried rebooting the computer running immich-go and the server to see if there was a variable caching issue. It still appears to use the original API key

@drsib
Copy link
Author

drsib commented Mar 31, 2024

Found the config file in

C:\Users\XXX\.immich-go\immich-go.json

There is an API key stored there. The tool appears to read this API key even if a new one is provided in the arguments when the program is run. Not sure if that is expected behavior?

@simulot
Copy link
Owner

simulot commented Mar 31, 2024

it is... The naive idea was to save the credential in that file. Doing so, the file could be used for getting the credentials.
What behavior is expect for such file?

@drsib
Copy link
Author

drsib commented Mar 31, 2024

I like the idea of saving it. That way someone doesn't need to continue to provide it for future runs.

Maybe update the value in the config file if something new is provided when it is run again? That way it will remember what was last used but someone could easily change it.

A more complicated solution would be to build profile support where someone could switch, but that seems overkill.

Alternatively, you could just document that's how it works and how to change it if you want to use a different API key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants