question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: ENDPOINT cannot be configurable

See original GitHub issue

Describe the bug

ENDPOINT cannot be configurable

Expected behavior

ENDPOINT can be set via environment variable

How to reproduce?

here is my docker-compose file as follow

# This compose file is for demonstration only, do not use in prod.
version: "3.9"
services:
  app:
    depends_on:
      postgres:
        condition: service_healthy
    image: ghcr.io/logto-io/logto:${TAG-latest}
    ports:
      - 3001:3001
    environment:
      - ALL_YES=1
      - NO_INQUIRY=0
      - TRUST_PROXY_HEADER=1
      - DB_URL_DEFAULT=postgres://postgres:p0stgr3s@postgres:5432
      - ENDPOINT=https://logto.example.com
  postgres:
    image: postgres:14-alpine
    user: postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: p0stgr3s
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5

when I open Admin Console via https://logto.example.com , click create account button, it just redirect to https://127.0.0.1:3001/oidc/auth?client_id=admin-console&redirect_uri=https%3A%2F%2Flogto.example.com%2Fconsole%2Fcallback&code_challenge=sa1zL03R9gYGibaj7Bf2Euwq_3s8T92-MPNyUyyNCvY&code_challenge_method=S256&state=_udq2h4pOI31mkJMpacDXjgZ-YFLiZR-PivdHRCD6ckZ3Cq4XxKnXhiYLvbhMT1lJgqki7WPo5UrloWh_MIDCg&response_type=code&prompt=consent&scope=openid+offline_access+profile&resource=https%3A%2F%2Fapi.logto.io

LOGTO_URL is hard code to https://127.0.0.1:3001, this is not configurable from environment variable

Context

OS:

Environment:

Logto version:

Node version:

Postgres version:

Command of starting Logto:

Screenshots

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
waltcowcommented, Aug 8, 2022

The miss of proxy_set_header Host $host lead to ENDPOINT set to https://127.0.0.1:3001 as default , make it looks like ENDPOINT is hard-coded 😭

0reactions
JZLeungcommented, Aug 19, 2022

My Nginx has this configuration item proxy_set_header Host $host , but the message redirect_uri did not match any of the client's registered redirect_uris is still displayed.

I modified docker-compose.yml and ran docker-compose restart

my docker-compose.yml:

version: "2.1"
services:
  app:
    depends_on:
      postgres:
        condition: service_healthy
    image: ghcr.io/logto-io/logto:prerelease
    ports:
      - 3001:3001
    environment:
      - ALL_YES=1
      - NO_INQUIRY=0
      - TRUST_PROXY_HEADER=1
      - DB_URL_DEFAULT=postgres://postgres:p0stgr3s@postgres:5432
      - ENDPOIN=https://logto.mysite.com
  postgres:
    image: postgres:14-alpine
    user: postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: p0stgr3s
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5

and my nginx’s proxy config:

# Proxy headers
proxy_set_header Upgrade           $http_upgrade;
proxy_set_header Connection        $connection_upgrade;
proxy_set_header Host              $host;
proxy_set_header X-Real-IP         $remote_addr;
proxy_set_header Forwarded         $proxy_add_forwarded;
proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host  $host;
proxy_set_header X-Forwarded-Port  $server_port;

# Proxy timeouts
proxy_connect_timeout              60s;
proxy_send_timeout                 60s;
proxy_read_timeout                 60s;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Windows Defender or Endpoint Protection client
Go to the Start menu, and open inetcpl.cpl . Switch to the Advanced tab. In the section to Reset Internet Explorer settings, select...
Read more >
Cannot configure endpoint for AWS Secrets Manager or ...
Describe the bug Cannot configure endpoint for AWS Secrets Manager or Parameter Store integration. The application fails to start with the ...
Read more >
causedCUCC Bug Tracking - Cisco Community
Rename "Video Endpoint deployment" to "Endpoint Deployment" and move to Step 2. The screen must provide option upload through CSV for all endpoints...
Read more >
Troubleshooting Cloud Endpoints configuration deployment
After each step, run the gcloud endpoints services deploy command again to see if the error is resolved. Cannot convert to service config....
Read more >
c# - WCF - Client Endpoint Configuration Error - Stack Overflow
Seems like the ConfigurationName in the Generated proxy is just IMyService rather than MyServices.Contracts.IMyService. So in your clients web.config can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found