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

/admin 404, page not found #30

Closed
q20 opened this issue Mar 13, 2023 · 19 comments
Closed

/admin 404, page not found #30

q20 opened this issue Mar 13, 2023 · 19 comments

Comments

@q20
Copy link

q20 commented Mar 13, 2023

Hello again!

Using the following YML for docker compose, all looks well, yet I am unable to open the admin page, instead I get an error 404. Is there anything wrong with the changes I have made to the default configuration?

version: '3'
services:
  client:
    image: wongsaang/chatgpt-ui-client:latest
    environment:
      - SERVER_DOMAIN=https://chatgpt.MYDOMAIN.COM
      - NUXT_PUBLIC_APP_NAME='ChatGPT UI'
      - NUXT_PUBLIC_TYPEWRITER=true
      - NUXT_PUBLIC_TYPEWRITER_DELAY=100
    depends_on:
      - backend-web-server
    ports:
      - '2480:80'
    networks:
      - chatgpt_ui_network
  backend-wsgi-server:
    image: wongsaang/chatgpt-ui-wsgi-server:latest
    environment:
      - APP_DOMAIN=127.0.0.1:2428
      #      - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # If this parameter is not set, the built-in Sqlite will be used by default. It should be noted that if you do not connect to an external database, the data will be lost after the container is destroyed.
      - DJANGO_SUPERUSER_USERNAME=admin # default superuser name
      - DJANGO_SUPERUSER_PASSWORD=password # default superuser password
      - DJANGO_SUPERUSER_EMAIL=admin@example.com # default superuser email
      # If you want to use the email verification function, you need to configure the following parameters
#      - EMAIL_HOST=SMTP server address
#      - EMAIL_PORT=SMTP server port
#      - EMAIL_HOST_USER=
#      - EMAIL_HOST_PASSWORD=
#      - EMAIL_USE_TLS=True
    volumes:
      - /volume1/docker/chatpgpt-ui/db.sqlite3:/app/db.sqlite3
    ports:
      - '8000:8000'
    networks:
      - chatgpt_ui_network
  backend-web-server:
    image: wongsaang/chatgpt-ui-web-server:latest
    environment:
      - BACKEND_URL=http://127.0.0.1:8000
    ports:
      - '2428:80'
    depends_on:
      - backend-wsgi-server
    networks:
      - chatgpt_ui_network

networks:
  chatgpt_ui_network:
    driver: bridge

I made a couple of changes as ports 80 and 9000 are unavailable/already in use. Changed ports to 2480 and 2428.

Thanks! : )

@WongSaang
Copy link
Owner

Please note that 127.0.0.1 points to the container's internal address. I suggest using the following address.

backend-web-server:
    image: wongsaang/chatgpt-ui-web-server:latest
    environment:
      - BACKEND_URL=http://backend-wsgi-server:8000

@WongSaang
Copy link
Owner

Another solution could be referenced at:

#27 (comment)

@q20
Copy link
Author

q20 commented Mar 13, 2023

Thanks for the suggestion. I have now specified the IP on the host running docker, recreated the containers, and still 404 trying to access /admin.
Any other ideas?

@spencerwongfeilong
Copy link

try this

@WongSaang
Copy link
Owner

Can you please send the complete content of your compose.yml file again?

@q20
Copy link
Author

q20 commented Mar 14, 2023

No problem. Here it is:

version: '3'
services:
  client:
    image: wongsaang/chatgpt-ui-client:latest
    restart: always
    environment:
      - SERVER_DOMAIN=https://MYDOMAIN.COM
      - NUXT_PUBLIC_APP_NAME='ChatGPT UI'
      - NUXT_PUBLIC_TYPEWRITER=true
      - NUXT_PUBLIC_TYPEWRITER_DELAY=100
    depends_on:
      - backend-web-server
    ports:
      - '2480:80'
    networks:
      - chatgpt_ui_network
  backend-wsgi-server:
    image: wongsaang/chatgpt-ui-wsgi-server:latest
    restart: always
    environment:
      - APP_DOMAIN=HOSTIP:2428
      #      - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # If this parameter is not set, the built-in Sqlite will be used by default. It should be noted that if you do not connect to an external database, the data will be lost after the container is destroyed.
      - DJANGO_SUPERUSER_USERNAME=admin # default superuser name
      - DJANGO_SUPERUSER_PASSWORD=password # default superuser password
      - DJANGO_SUPERUSER_EMAIL=admin@example.com # default superuser email
      # If you want to use the email verification function, you need to configure the following parameters
#      - EMAIL_HOST=SMTP server address
#      - EMAIL_PORT=SMTP server port
#      - EMAIL_HOST_USER=
#      - EMAIL_HOST_PASSWORD=
#      - EMAIL_USE_TLS=True
    volumes:
      - /volume1/docker/chatpgpt-ui/db.sqlite3:/app/db.sqlite3
    ports:
      - '8000:8000'
    networks:
      - chatgpt_ui_network
  backend-web-server:
    image: wongsaang/chatgpt-ui-web-server:latest
    restart: always
    environment:
      - BACKEND_URL=http://HOSTIP:8000
    ports:
      - '2428:80'
    depends_on:
      - backend-wsgi-server
    networks:
      - chatgpt_ui_network

networks:
  chatgpt_ui_network:
    driver: bridge

I'm no Docker expert, but could my issue lie with all the port changes? Perhaps you could use "expose" to allow the containers to communicate with each other on the default without interfering with the Docker host's ports? We could then specify a single port forward for the web client (in my case, 2480:80).

@WongSaang
Copy link
Owner

Hello,
I have reviewed your configuration file and couldn't find any issues.
May I ask if you are able to access the front-end page through http://HOSTIP ? Also, are you accessing the management panel through http://HOSTIP:2428/admin ?

@q20
Copy link
Author

q20 commented Mar 14, 2023

I can access via port 2480:

image

But not /admin:

image

@WongSaang
Copy link
Owner

Haha,
The management panel should be accessed through the backend service. According to your configuration, you should access it through http://hostip:2428/admin.

image

@q20
Copy link
Author

q20 commented Mar 14, 2023

Progress!

image

Cannot log in with default credentials, though:

image

@WongSaang
Copy link
Owner

The environment variable APP_DOMAIN of the backend-wsgi-server is equal to the IP address and port of the management panel you are actually requesting.
image
👇
image

@q20
Copy link
Author

q20 commented Mar 14, 2023

What a champ! I had corrupted that line. 😉
I'm in!

image

@q20
Copy link
Author

q20 commented Mar 14, 2023

Created test user:

image

Doesn't successfully log in, though:

image

URL is https://MYDOMAIN.COM

@WongSaang
Copy link
Owner

👍 Before figuring out the reason, you can directly use the default super user login.

@q20
Copy link
Author

q20 commented Mar 14, 2023

Same issue though, I'm afraid. Superuser cannot log in to the non-admin site. No error, just does nothing. :/

@WongSaang
Copy link
Owner

sorry, I cannot reproduce your issue.

@q20
Copy link
Author

q20 commented Mar 14, 2023

No problem. I'll simply start again and see what happens. 👍

@WongSaang
Copy link
Owner

Hello, if there is nothing else to add, I will close this issue.

@q20
Copy link
Author

q20 commented Mar 20, 2023

No problem. 👍

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

3 participants