opencve icon indicating copy to clipboard operation
opencve copied to clipboard

Existing docker-compose.yml returning 404 while hitting /admin page

Open Userbmer opened this issue 2 years ago • 3 comments

Expected Behavior

The exact steps for composing docker and volume should give access to http://WEBSERVER_IP:8000/admin/ or http://WEBSERVER_IP:8000/admin

Actual Behavior

While hitting http://WEBSERVER_IP:8000/admin/ or http://WEBSERVER_IP:8000/admin, it is returning 404.

Steps to Reproduce the Problem

  • follow the instructions as per https://docs.opencve.io/installation/docker/
  • Do appropriate modification
  • Hit http://WEBSERVER_IP:8000/admin/

Specifications

  • OpenCVE version: 1.4.1
  • Python version: 3.8
  • Platform: Ubuntu [Debian]

Screenshots (optional)

image

Userbmer avatar Aug 22 '23 15:08 Userbmer

It will do that if you haven't created the admin user yet, and if you are not the admin https://docs.opencve.io/installation/docker/#create-an-admin

MarkDeckert avatar Aug 23 '23 21:08 MarkDeckert

I confirm what @MarkDeckert said, did you create and admin user?

ncrocfer avatar Sep 01 '23 07:09 ncrocfer

I have the same problem reported by Userbmer. These are the details:

  1. I am using a Debian 12 VM under VirtualBox. I allocated 6 GB RAM for this VM.
  2. The Docker version in this VM is 20.10.24; the Docker-Compose version is 1.29.2.
  3. I followed the steps in https://docs.opencve.io/installation/docker EXACTLY as specified, in the order specified, with one proviso: I had to do everything as root, for, otherwise, the installation steps would fail due to insufficient permissions.
  4. ALL of the steps completed successfully.
  5. I tried to access the web interface only after I had completed all the steps in the page above.
  6. I tried with "server_name = <my_ip_address>:8000" and just "server_name =" in opencve.cfg, but it made no difference. Any suggestions on what else to try?
  7. There certainly is something listening on port 8000 - when I do "telnet localhost 8000" (or even "telnet <my_ip_address> 8000" from a different system) I get the following:
telnet <my_ip_address> 8000
Trying <my_ip_address>...
Connected to <my_ip_address>.
Escape character is '^]'.
1111
HTTP/1.1 400 Bad Request
Connection: close
Content-Type: text/html
Content-Length: 197

<html>
  <head>
    <title>Bad Request</title>
  </head>
  <body>
    <h1><p>Bad Request</p></h1>
    Invalid Request Line &#x27;Invalid HTTP request line: &#x27;1111&#x27;&#x27;
  </body>
</html>
Connection closed by foreign host.

What is the exact meaning of "creating an admin user and being the admin" in this context? I created the admin user with "docker exec -it webserver opencve create-user xyz <my_email_address> --admin". How is this related to the errors that I am getting when trying to access https://localhost:8000, or https://<my_ip_address>:8000 from a remote host? I am not even given the chance to supply any credentials.

Finally, it is not clear to me whether anything is to be done to launch the docker app when rebooting the system. It would seem that nothing is required for, on rebooting, the container is clearly running and, like I said, something is listening on port 8000. Still, some clarification on this would be welcome.

lsdijk avatar Sep 20 '23 17:09 lsdijk

Closing this issue as it has been inactive for a long time.

ncrocfer avatar Jan 18 '25 12:01 ncrocfer