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

Authentication code returned to locahost. #219

Open
rbrus opened this issue Dec 23, 2024 · 5 comments
Open

Authentication code returned to locahost. #219

rbrus opened this issue Dec 23, 2024 · 5 comments

Comments

@rbrus
Copy link

rbrus commented Dec 23, 2024

Hi,

We have deployed open-canvas in the company I work for to start playing with langchain. Yet, after deploying to AppService in a docker, when authentication completes (google accounts) it returns the code to 'localhost:3000?code=' instead of our company app domain.

It sounds simple, but we tried a lot of different solutions e.g.:

  • Starting with yarn (next) start as production.
  • Hardcoding our domain in TS code for redirect to.
  • Added multiple general environmental variable to force it to see the domain.
  • And, some other things found on the internet.

Still, it fails. Does anybody had suchas issue and can support?

@bracesproul
Copy link
Member

I believe this is something you set your domain inside the Google configuration, or supabase. It's not handled inside the Open Canvas app code. Let me know if you still aren't able to find the solution and I can look into it this week @rbrus

@rbrus
Copy link
Author

rbrus commented Dec 30, 2024

Hi @bracesproul , thanks for supporting us here.

Note, we are not perfect in full-stack development, thus it might be simpler, yet let me share our additional work:

We deploy the codebase to Azure AppService in our company subscription, using docker image.

`FROM node:20-alpine
EXPOSE 3000

USER node
WORKDIR /home/node

ENV environmental variables from .env plus additional to try to force next to see our domain as the urls base

COPY --chown=node:node . /home/node/app
WORKDIR /home/node/app

EXPOSE 3000

RUN yarn build
CMD ["yarn", "start"]
`

As there were some issues during build, I have set ignore on the eslint & ts.

When deployed it seems to set correctly redirect on the supabase request, yet when its internally by the codebase routed back it ends up navigating to localhost:3000/?code= .

As well, location in callback request contains:
image

I would appreciate it if you would have any tips what could be the cause of the problem / solution to this problem.

@tisDDM
Copy link

tisDDM commented Jan 2, 2025

Hi @rbrus,

stuck here in a similiar scenario - trying to deploy "open canvas" to have a show case containing LangChain and SelfHosted vs Commercial Models for some companies here in Germany.

OpenCanvas looks very good, but I am still putting a lot of hours into. Reason is, that the code is not "really flexible" when it comes to "real-world-deployments". Some of the configuration is partially hard coded - where "partially" makes it a bit weird.

This applies to the API Clients towards the backend as well as the connection browser next.js server and model configuration. Custom advanced Docker and network scenarios do fail.

Not speaking about the near-deal-breakers in the section of data privacy and licensing (Supabase and Langgraph Server)

keep you posted when I have finalized my solution.

@tisDDM
Copy link

tisDDM commented Jan 6, 2025

I just did the changes, but now I need to chance focus. I need to travel in the next days. Nonetheless I checked everything into my forked repository because I dont dare to do a PR yet. Didnt got time to fully test.

https://github.com/tisDDM/open-canvas

I wrote a few lines for documentation as well. If you are experienced with docker and nginx you will feel comfortable.
Drop me a note for further questions.

On the other hand it is quite likely that I will head for an other framework. This here has eaten far to much of my time and I constantly find hard coded stuff that is making changes difficult. Not talking about the server always using 100% of CPU w/o any chance of doing anything against this behavior.

@sprite33
Copy link

sprite33 commented Jan 7, 2025

You can change your Supabase project >> authentication >> URL configuration >> Site URL to your docker server url.

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

4 participants