askides / aurora

Hate Cookies? Introducing Aurora, 100% Cookie-Free Open Website Analytics. Collect Anonymous Data. Make your Audience Happy Now!
576 stars 20 forks source link

Wrong port is used by UI for API calls #65

Closed mfg92 closed 3 years ago

mfg92 commented 3 years ago

I tried setting up aurora by following the official instructions using docker.

I used the provided docker-compose.yaml and modified it a bit: I needed a port mapping as port 3000 and 5000 were already used on my server. Also I set NEXT_PUBLIC_API_URL to the domain of my server.

Here you can see my docker-compose.yaml file:

version: "3.7"
services:
  ui:
    image: ghcr.io/useaurora/aurora/aurora
    ports:
      - "22081:3000"
    environment:
      NEXT_PUBLIC_API_URL: "http://MY_DOMAIN_HERE.org:22080/"
    depends_on:
      - postgres

  api:
    image: ghcr.io/useaurora/api/api
    ports:
      - "22080:5000"
    environment:
      DB_CONNECTION: pg
      DB_HOST: postgres
      DB_PORT: 5432
      DB_DATABASE: aurora
      DB_USERNAME: aurora
      DB_PASSWORD: aurora
      DB_SSL: "false"
      JWT_SECRET: MY_JWT_SECRET
    depends_on:
      - postgres

  postgres:
    image: postgres:12-alpine
    environment:
      POSTGRES_DB: aurora
      POSTGRES_USER: aurora
      POSTGRES_PASSWORD: aurora
    volumes:
      - aurora_postgres:/var/lib/postgresql/data

volumes:
  aurora_postgres:

Now when i go to the /setup page and press "Initialize Database!" nothing happens. In the consol of the browser i can see that a POST to _http://MY_DOMAIN_HERE.org:22081/v2/initialize/database_ fails with 404. So the problem is that the UI uses the wrong port 22081, the correct one would be 22080. So it feels like NEXT_PUBLIC_API_URL is ignored.

askides commented 3 years ago

Hi! Thank you for the issue.

I will check this problem asap.

askides commented 3 years ago

Hello!

Please could you try again with the new release?

I have fixed the problem, now the variable will be set up when container starts!

Let me know if the problem is solved.

Have a nice day!

mfg92 commented 3 years ago

Now it works as expected. Thank you very mutch! Have a nice weekend!