Giter Site home page Giter Site logo

Get rid of OPLA_BACKEND_DOMAIN about opla-v2 HOT 5 CLOSED

licarth avatar licarth commented on August 23, 2024
Get rid of OPLA_BACKEND_DOMAIN

from opla-v2.

Comments (5)

mikbry avatar mikbry commented on August 23, 2024

But if the backend is on another machine ?

from opla-v2.

licarth avatar licarth commented on August 23, 2024

So, I tend to agree with you, but :
The underlying problem is that we currently use OPLA_BACKEND_DOMAIN for 2 things

  1. to register the app against the backend through opla init on a private network (not open to the public, otherwise anybody can register theirs).
  2. to tell the frontend where the public api sits.

2 things about that :

  1. They are not necessarily the same. A web client will need, let's say api.opla.ai to operate their bots (public but secure). But in order to configure the application (privately, from backend to backend), we will probably use different dns, or IPs).
  2. If we split this into 2 env variables, which I thought about doing (e.g. OPLA_API_DOMAIN and OPLA_BACKEND_HOST), then, we will need to inject different values of OPLA_API_DOMAIN, one per environment for instance, and if we go for prefixes per customer, for instance, then we will have a lot of those. Why should we do that when we can just tell the frontend :"whichever domain there is in the address bar, there will be an API on the api/ relative path."

It doesn't have to be on the same machine, we can do reverse proxying with nginx (that we already do), or use ingress in Kubernetes to point api/* to the right services.

Also, having api.opla.ai and front.opla.ai means 2 certificates, more complexity. I don't see the advantages of having 2 domains.

WDYT

from opla-v2.

mikbry avatar mikbry commented on August 23, 2024

Ok I see your point of view. Let's see how long it could take and work on it later.

from opla-v2.

mikbry avatar mikbry commented on August 23, 2024

done?

from opla-v2.

licarth avatar licarth commented on August 23, 2024

Closing, irrelevant now.

from opla-v2.

Related Issues (20)

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.