reworkd / AgentGPT

🤖 Assemble, configure, and deploy autonomous AI Agents in your browser.
https://agentgpt.reworkd.ai
GNU General Public License v3.0
31.48k stars 9.22k forks source link

Sign In form does not appear in an Ubuntu 22.04 VPS docker compose setup behind a Traefik V2 proxy. #990

Open SajidK25 opened 1 year ago

SajidK25 commented 1 year ago

Please check that this issue hasn't been reported before.

Expected Behavior

I am trying to deploy docker compose setup into following VPS:-

docker-compose.yml

version: '3.9'

services:
  next:
    container_name: nextv09
    build:
      context: ./next
      dockerfile: Dockerfile
    ports:
      - "3009:3000"
    volumes:
      - ./next/.env:/next/.env
      - ./next/:/next/
      - /next/node_modules
      - /next/.next
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=auto-gpt.tech"
      - "traefik.http.routers.nextv09-insecure.rule=Host(`example.com`)"
      - "traefik.http.routers.nextv09-insecure.entrypoints=web"
      - "traefik.http.middlewares.nextv09-redirect-web-secure.redirectscheme.scheme=https"
      - "traefik.http.routers.nextv09-insecure.middlewares=nextv09-redirect-web-secure"
      - "traefik.http.routers.nextv09.rule=Host(`example.com`)"
      - "traefik.http.routers.nextv09.entrypoints=websecure"
      - "traefik.http.routers.nextv09.tls=true"
      - "traefik.http.routers.nextv09.tls.certresolver=myresolver"
      - "traefik.http.services.nextv09-insecure.loadbalancer.server.port=3000"
      - "traefik.http.routers.nextv09.middlewares=nextv09_auth"
      "traefik.http.middlewares.nextv09_auth.basicauth.users=DEA:$$2y$$05$$u6owE6I3Hlmnjx6L9GiF0.Txrr022V20vsbKsUpAtWiq0VWlxn.t."
    networks:
      - auto-gpt.tech
      - default
  platform:
    container_name: platform-v09
    build:
      context: ./platform
      target: prod
    ports:
      - "8099:8000"
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=auto-gpt.tech"
      - "traefik.http.routers.platform-v09-insecure.rule=Host(`backend.example.com`)"
      - "traefik.http.routers.platform-v09-insecure.entrypoints=web"
      - "traefik.http.middlewares.platform-v09-redirect-web-secure.redirectscheme.scheme=https"
      - "traefik.http.routers.platform-v09-insecure.middlewares=platform-v09-redirect-web-secure"
      - "traefik.http.routers.platform-v09.rule=Host(`backend.example.com`)"
      - "traefik.http.routers.platform-v09.entrypoints=websecure"
      - "traefik.http.routers.platform-v09.tls=true"
      - "traefik.http.routers.platform-v09.tls.certresolver=myresolver"
      - "traefik.http.services.platform-v09-insecure.loadbalancer.server.port=8000"
    volumes:
      - ./platform:/app/src/
    env_file:
      - next/.env
    environment:
      REWORKD_PLATFORM_HOST: 0.0.0.0
      REWORKD_PLATFORM_DB_HOST: db
      REWORKD_PLATFORM_DB_PORT: "3307"
      REWORKD_PLATFORM_DB_USER: "reworkd_platform"
      REWORKD_PLATFORM_DB_PASS: "reworkd_platform"
      REWORKD_PLATFORM_DB_BASE: "reworkd_platform"
    depends_on:
      - db
    networks:
      - auto-gpt.tech
      - default

  db:
    image: mysql:8.0
    container_name: db-nextv09
    restart: always
    build:
      context: ./db
    ports:
      - "3310:3307"
    environment:
      MYSQL_DATABASE: "reworkd_platform"
      MYSQL_USER: "reworkd_platform"
      MYSQL_PASSWORD: "reworkd_platform"
      MYSQL_ROOT_PASSWORD: "reworkd_platform"
      MYSQL_TCP_PORT: 3307
    volumes:
      - db_data:/var/lib/mysql
    command: [ 'mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci' ]
    networks:
      - default

  weaviate:
    image: semitechnologies/weaviate:1.19.6
    restart: on-failure:0
    ports:
      - "8088:8080"
    environment:
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'none'
      CLUSTER_HOSTNAME: 'node1'
    volumes:
      - weaviate:/var/lib/weaviate
    networks:
      - default

  docs:
    build: ./docs
    ports:
      - "3005:3001"
    networks:
      - default

volumes:
  weaviate:
  db_data:

networks:
  auto-gpt.tech:
    external: true

.env

# Platform Config: (max loops determines how many times the agent may execute)
NEXT_PUBLIC_MAX_LOOPS="100"
REWORKD_PLATFORM_MAX_LOOPS=${NEXT_PUBLIC_MAX_LOOPS}

# Deployment Environment:
NODE_ENV="development"
NEXT_PUBLIC_VERCEL_ENV="${NODE_ENV}"

# NextJS:
NEXT_PUBLIC_BACKEND_URL="https://backend.example.com"

# Next Auth config:
NEXTAUTH_SECRET=PZLls3cExFs9znMojQAo9eYd8PyriBeYZ2SN
#NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_URL="https://example.com"
# Auth providers (Use if you want to get out of development mode sign-in):
GOOGLE_CLIENT_ID="***"
GOOGLE_CLIENT_SECRET="***"
GITHUB_CLIENT_ID="***"
GITHUB_CLIENT_SECRET="***"
DISCORD_CLIENT_SECRET="***"
DISCORD_CLIENT_ID="***"

# Backend:
REWORKD_PLATFORM_ENVIRONMENT="${NODE_ENV}"
REWORKD_PLATFORM_FF_MOCK_MODE_ENABLED="false"
REWORKD_PLATFORM_OPENAI_API_KEY="sk-jkdsdadklashdashhkahdashdhkhdakhhdkhsahdkshd"
REWORKD_PLATFORM_FRONTEND_URL="https://example.com"
REWORKD_PLATFORM_RELOAD="true"
REWORKD_PLATFORM_OPENAI_API_BASE="https://api.openai.com/v1"
REWORKD_PLATFORM_SERP_API_KEY="changeme"
REWORKD_PLATFORM_REPLICATE_API_KEY="changeme"

# Database (Backend):
REWORKD_PLATFORM_DATABASE_USER="reworkd_platform"
REWORKD_PLATFORM_DATABASE_PASSWORD="reworkd_platform"
REWORKD_PLATFORM_DATABASE_HOST="db"
REWORKD_PLATFORM_DATABASE_PORT="3307"
REWORKD_PLATFORM_DATABASE_NAME="reworkd_platform"
REWORKD_PLATFORM_DATABASE_URL="mysql://${REWORKD_PLATFORM_DATABASE_USER}:${REWORKD_PLATFORM_DATABASE_PASSWORD}@${REWORKD_PLATFORM_DATABASE_HOST}:${REWORKD_PLATFORM_DATABASE_POR>

# Database (Frontend):
DATABASE_USER="reworkd_platform"
DATABASE_PASSWORD="reworkd_platform"
DATABASE_HOST="db"
DATABASE_PORT="3307"
DATABASE_NAME="reworkd_platform"

Expectation:-

001  Expected Sign in Form

Current behaviour

Sign In form not showing

004  current behavior

Error logs

005  error logs

Steps to reproduce

  1. From project root execute ./setup.sh
  2. Select " Docker-compose (Recommended)" when ask.
  3. Go to the home page using "https://example.com".
  4. Click on "Sign In" (Top-left corner)

Possible solution

No response

Which Operating Systems are you using?

Acknowledgements

jasangill1 commented 1 year ago

Hello @SajidK25 please be advised that you have exposed your open API key please for your own sake take down the .env file screenshot!! Would you be able to send the frontend console logs aswell!!

SajidK25 commented 1 year ago

Hello @SajidK25 please be advised that you have exposed your open API key please for your own sake take down the .env file screenshot!! Would you be able to send the frontend console logs aswell!!

@jasangill1 that is just a random string prefixed with "sk-". So, no worry. FYI, I have already added the front end logs. 005  error logs

jasangill1 commented 1 year ago

@SajidK25 Oh okay sounds good !! could you try changing the frontend URL in the settings.py from "localhost:3000" to "*". Let me know if this helps ?

SajidK25 commented 1 year ago

@SajidK25 Oh okay sounds good !! could you try changing the frontend URL in the settings.py from "localhost:3000" to "*"

@jasangill1 changed from from "localhost:3000" to "*" . However, nothing changed. Still the sign in form not appeared. Screenshot from 2023-07-08 07-20-03

jasangill1 commented 1 year ago

@SajidK25 are you updated to the newest version? Its showing 0.8.0 ? is there even a sign in div there that hidden? Could I also just pick your brain for a bit!! how come you use ubuntu to run it run on it seems like there's a lot of "handshakes" happening in your application, which may be confusing the application. Would you also try running it in production

SajidK25 commented 1 year ago

@SajidK25 are you updated to the newest version? Its showing 0.8.0 ? is there even a sign in div there that hidden? Could I also just pick your brain for a bit!! how come you use ubuntu to run it run on it seems like there's a lot of "handshakes" happening in your application, which may be confusing the application. Would you also try running it in production

@jasangill1 yes nice catch. As far as I remember I updated to 0.9.5 beta. I think I messed up somewhere. Are you suggesting a fresh deployment? I tried "production" as well. There were different issues in production.

I am running Ubuntu in a VPS.

SajidK25 commented 1 year ago

@jasangill1 I have deployed v0.9.5 beta in a fresh VPS. However, no luck! It has raised same error:- Screenshot from 2023-07-08 13-29-04

jasangill1 commented 1 year ago

Hello, @SajidK25 Would you be able to try it natively on Windows or Mac? Maybe Ubuntu is causing errors!! Pleease try and let me know if this changes anything!

SajidK25 commented 1 year ago

Hello, @SajidK25 Would you be able to try it natively on Windows or Mac? Maybe Ubuntu is causing errors!! Pleease try and let me know if this changes anything!

Yes I tried Mac. No errors. Even when I tried natively on Ubuntu it did not raised any error. That issue raised when I tried it on VPS behind a Traefik proxy.

jasangill1 commented 1 year ago

hello @SajidK25, the issue might be with the VPS environment, would you be able to try installing on x86 Ubuntu Server pc box instead? Let me know if this resolves anything!!

SajidK25 commented 1 year ago

hello @SajidK25, the issue might be with the VPS environment, would you be able to try installing on x86 Ubuntu Server pc box instead? Let me know if this resolves anything!!

Thanks for reply. Yes tried in a bare-metal Ubuntu x86 server. But, The result is same . No login form.

jasangill1 commented 1 year ago

Hello @SajidK25 what bout natively on ur windows or mac, if not I think you can just urn off your login page all together!

SajidK25 commented 1 year ago

Hello @SajidK25 what bout natively on ur windows or mac, if not I think you can just urn off your login page all together!

Hi! Thanks for come back. Windows and Mac gave the same result. Would you please tell me how can I off the login page?