Giter VIP home page Giter VIP logo

Comments (5)

cmsax avatar cmsax commented on May 19, 2024 2

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

from linka.

cmsax avatar cmsax commented on May 19, 2024

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.

from linka.

cmsax avatar cmsax commented on May 19, 2024

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

from linka.

fl4shback avatar fl4shback commented on May 19, 2024

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.

from linka.

fl4shback avatar fl4shback commented on May 19, 2024

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

from linka.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.