Code Monkey home page Code Monkey logo

Comments (4)

ronnyandre avatar ronnyandre commented on July 17, 2024

I did some more tests by creating a new user. Everything OK, though I needed to change the value of verified in the registered_user table to make sure that the user could log in.

Docker logs:

2023-09-20 12:36:42 piglet-db  | 2023-09-20 12:36:42 20 [Warning] Access denied for user 'root'@'192.168.16.1' (using password: YES)
2023-09-20 12:36:42 piglet-db  | 2023-09-20 12:36:42 21 [Warning] Access denied for user 'root'@'192.168.16.1' (using password: YES)
2023-09-20 12:36:42 piglet-db  | 2023-09-20 12:36:42 22 [Warning] Access denied for user 'root'@'192.168.16.1' (using password: YES)
2023-09-20 12:37:16 piglet     | INFO:     127.0.0.1:37112 - "POST /admin/token HTTP/1.1" 200 OK
2023-09-20 12:37:16 piglet     | INFO:     127.0.0.1:37114 - "GET /user/login-user HTTP/1.1" 200 OK
2023-09-20 12:37:16 piglet     | INFO:     127.0.0.1:37118 - "GET /budget/ HTTP/1.1" 200 OK

So somehow I get 200 OK on requests, but now the database is claiming that root has not access to database. This is very weird as I am actually logged into the database using the root user and a third party application.

from piglet.

ronnyandre avatar ronnyandre commented on July 17, 2024

Logging in with admin@localhost generated the following error in the Docker log:

2023-09-20 12:40:22 piglet-db  | 2023-09-20 12:40:22 19 [Warning] Aborted connection 19 to db: 'piglet' user: 'piglet' host: '192.168.16.3' (Got an error reading communication packets)

from piglet.

k3nd0x avatar k3nd0x commented on July 17, 2024

Hey Ronny, i see. First of all currently i dont know why this login error message comes :) But here is an updated Version of the docker-compose and the .env file. Can you try it with them please?
And please be sure you delete the old mariadb data from your volume/mount.

docker-compose.yml

services:
    piglet:
      restart: unless-stopped
      container_name: piglet
      depends_on:
        - database
      ports:
        - '0.0.0.0:80:80' # Piglet
        - '0.0.0.0:8080:8080' # API
      image: k3nd0x/piglet:latest
      environment:
        DB_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
        MYSQL_DATABASE: ${MYSQL_DATABASE} # Default 'piglet'
        MYSQL_USER: ${MYSQL_USER} # Default 'piglet'
        MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        MYSQL_HOST: ${MYSQL_HOST}
      volumes:
        - "/etc/timezone:/etc/timezone:ro"
        - "/etc/localtime:/etc/localtime:ro"
    database:
      image: mariadb:11.1.2
      container_name: piglet-db
      volumes:
        - database-data:/var/lib/mysql
      environment:
        MARIADB_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
        MARIADB_DATABASE: ${MYSQL_DATABASE}
        MARIADB_USER: ${MYSQL_USER}
        MARIADB_PASSWORD: ${MYSQL_PASSWORD}
volumes:
  database-data:

.env

MYSQL_PASSWORD=piglet-123
MYSQL_USER=piglet
MYSQL_DATABASE=piglet
MYSQL_HOST=database
DOMAIN=localhost
SECURE_COOKIE=False
MYSQL_ROOT_PASSWORD='changeme'

For explanation:
The mariadb container changed and the MYSQL_ROOT_PASSWORD env variable are not longer working. So you have to set 'MARIADB_ROOT_PASSWORD'
These variables are creating the database at the container.

MARIADB_DATABASE: ${MYSQL_DATABASE}
MARIADB_USER: ${MYSQL_USER}
MARIADB_PASSWORD: ${MYSQL_PASSWORD}

In a few days there will be an updated version of piglet. I changed the startup procedure and and the database creation script to make the start smoother :) Thanks for your issue and keep me updated if it works with this changes.

from piglet.

k3nd0x avatar k3nd0x commented on July 17, 2024

Newest startup process should work

from piglet.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.