getmeli / meli

Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Other
2.4k stars 97 forks source link

Unable to logon after fresh install using a static username-password #170

Closed alikat500 closed 3 years ago

alikat500 commented 3 years ago

Hello,

Problem Description

I deployed meli on a VPS using the installation instruction via https://docs.meli.sh/get-started/installation

Upon the attempt to log in I'm unable to authenticate and receive error message with status code 401

I changed the "following" in my docker-compose.yml file:

  MELI_JWT_SECRET: "A random 37-charter using upper case, lower case, numbers and symbols"
  # https://docs.meli.sh/authentication
  MELI_USER: "changed the user name"
  MELI_PASSWORD: "A random 37-charter using upper case, lower case, numbers and symbols"

// There is a space between : and the first character of user and password values

Steps to Reproduce

docker-compose up

I get prompted with a logon page

I enter the user name and password as configured in MELI_USER and MELI_PASSWORD respectively.

I receive the following error message:

Could not sign in: Error: Request failed with status code 401

Thanks in advance!

gempain commented 3 years ago

@alikat500 thanks for opening an issue here, and apologies for the inconvenience. I just tested with a fresh install using the latest beta release, and I cannot reproduce. Here is my docker-compose.yml:

version: "3"

services:

  meli:
    image: getmeli/meli:beta
    restart: unless-stopped
    environment:
      MELI_URL: http://localhost:8080
      MELI_MONGO_URI: mongodb://mongo:27017/meli
      # openssl rand -hex 32
      MELI_JWT_SECRET: "99249808b824565446dbdd92c33d4b5bec05e68d9f6aca5232dda8ec92ca6a5ea5b82357e2"
      MELI_USER: "geoffroy"
      # openssl rand -hex 32
      MELI_PASSWORD: "e0306346d9c8cc2525bcc29d9622d26c487aa55612d8d64dda6b07d7909e9181ced0052f1e"
      DEBUG: meli.server:handlerError,meli*
    depends_on:
      - mongo
    volumes:
      - ./tmp/sites:/sites
      - ./tmp/caddy/data:/data
      - ./tmp/caddy/config:/config
    ports:
      - 127.0.0.1:8080:80
      - 127.0.0.1:8081:2019

  mongo:
    image: mongo:4.2-bionic
    restart: unless-stopped
    volumes:
      - ./tmp/mongo:/data/db
    ports:
      - 127.0.0.1:27017:27017

And here is a quick video of it going live:

Install Meli with Docker Compose

alikat500 commented 3 years ago

I used your docker-compose.yml and wasn't able to browse to the URL. It must be something on myside. Thanks for looking into this @gempain !

alikat500 commented 3 years ago

OK, I tried a few things and it fixed my issue.

  1. Restored my vps to fresh install's snapshot
  2. Used the same docker-compose file from: https://docs.meli.sh/get-started/installation with following changes:

Instead of using a random 37 character (including special characters) values for MELI_JWT_SECRET and MELI_PASSWORD, ran openssl rand -hex 32 to generate the passwords

put the values for the following parameters in "" MELI_JWT_SECRET: MELI_USER: MELI_PASSWORD: // Note: The docker-compose file on docs.meli.sh does not have these values in quotes.

  1. Ran docker-compose pull
  2. Ran docker-compose up

BTW, thanks for the YouTube video @gempain

gempain commented 3 years ago

@alikat500 awesome, I am glad you got it working ! I will update the docs to emphasize the quotes. I did have a gut feeling the special chars had something to do with this, but I honestly don't see why it would be a problem.