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

FR: Set linkding instance and token as an ENV VAR / Docker Secret #20

Open
fl4shback opened this issue Jul 12, 2023 · 5 comments
Open

Comments

@fl4shback
Copy link

fl4shback commented Jul 12, 2023

Hello!
I have a Linka instance that's protected behind Authelia. So it's not publicly accessible.
For convenience, I would like to be able to persist my token and linkding instance in the app even when my browser local storage is reset.

Do you think it would be possible to set the token and instance URL as ENV vars ?

Thanks!

@cmsax
Copy link
Collaborator

cmsax commented Jul 13, 2023

It's possible to pass environment variables to react building stage, then the vars would be statically embedded to the HTML/JS files and visible to all front-end users. If this is ok, maybe we can try it.

Maybe it's better to set the secrets in a proxy which is invisible to users, e.g. Nginx server, like following:

location = /oneapi {
  set $args $args&apiKey=tiger;
  proxy_pass https://api.somewhere.com;
}

Both solutions need modification to Dockerfile.

@cmsax
Copy link
Collaborator

cmsax commented Jul 13, 2023

For more information about react envs, please read this page: https://vitejs.dev/guide/env-and-mode.html

@fl4shback
Copy link
Author

For my use case both of the 2 solutions would work as my instance is private, but I agree that for other users the first one would be less than ideal from a security standpoint.

Wouldn't the proxy solution require more than just editing the Dockerfile ?
Sorry, I'm not versed at all in JS and React.

@cmsax
Copy link
Collaborator

cmsax commented Jul 13, 2023

👌 I got it, maybe this weekend I'll implement this feature.

@fl4shback
Copy link
Author

Hi!
Did you have time to look into this ?
Thanks 😊

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

No branches or pull requests

2 participants