Code Monkey home page Code Monkey logo

piglet's Introduction

Hi ๐Ÿ‘‹, I'm k3nd0x

A passionate sysadmin and fullstack-developer from Germany

- ๐Ÿ”ญ Iโ€™m currently working on https://github.com/k3nd0x/piglet

- ๐ŸŒฑ Iโ€™m currently learning **Python Flask, FastAPI**

- ๐Ÿ’ฌ Ask me about **Linux System Administration, icinga2, grafana, bacula**

Languages and Tools:

bootstrap docker elasticsearch flask git grafana html5 kibana linux mariadb mongodb mysql photoshop postgresql python rabbitMQ redis sqlite

piglet's People

Contributors

k3nd0x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

piglet's Issues

Login with admin user not working

Tried logging in with the normal admin@localhost user, but I can't get past the login screen. No error message or anything. The Docker logs says:

2023-09-20 12:32:25 piglet     | INFO:     Application startup complete.
2023-09-20 12:32:25 piglet     | INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
2023-09-20 12:32:42 piglet     | [2023-09-20 10:32:25] - Starting Piglet API...
2023-09-20 12:32:42 piglet     | INFO:     127.0.0.1:50860 - "POST /admin/token HTTP/1.1" 200 OK
2023-09-20 12:32:42 piglet     | INFO:     127.0.0.1:50872 - "GET /user/login-user HTTP/1.1" 200 OK
2023-09-20 12:32:42 piglet     | INFO:     127.0.0.1:50874 - "GET /budget/ HTTP/1.1" 200 OK
2023-09-20 12:32:44 piglet     | 2023-09-20 10:32:44,679 INFO success: piglet-redis entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2023-09-20 12:32:44 piglet     | 2023-09-20 10:32:44,682 INFO success: piglet-api entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2023-09-20 12:32:44 piglet     | 2023-09-20 10:32:44,684 INFO success: piglet-app entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2023-09-20 12:33:44 piglet     | INFO:     127.0.0.1:34508 - "POST /admin/token HTTP/1.1" 200 OK
2023-09-20 12:33:44 piglet     | INFO:     127.0.0.1:34510 - "GET /user/login-user HTTP/1.1" 200 OK
2023-09-20 12:33:44 piglet     | INFO:     127.0.0.1:34526 - "GET /budget/ HTTP/1.1" 200 OK

So it returns 200 OK on login user and trying to fetch /budget but still no luck.

My docker-compose.yml file:

version: '3.3'
services:
    piglet:
      restart: unless-stopped
      container_name: piglet
      depends_on:
        - database
      ports:
        - 80:80 # Piglet
        - 8080:8080 # API
      image: k3nd0x/piglet:latest
      environment:
        DB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
        MYSQL_USER: ${MYSQL_USER}
        MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        MYSQL_HOST: ${MYSQL_HOST}
        MYSQL_DATABASE: ${MYSQL_DATABASE}
        TZ: ${TZ}
    database:
      image: mariadb:latest
      container_name: piglet-db
      ports:
        - 3306:3306
      volumes:
        - ./database-data:/var/lib/mysql
      environment:
        MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
        MYSQL_DATABASE: ${MYSQL_DATABASE}
        MYSQL_USER: ${MYSQL_USER}
        MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        TZ: ${TZ}

My .env file:

DB_ROOT_PASSWORD=[redacted]
MYSQL_PASSWORD=piglet
MYSQL_USER=piglet
MYSQL_DATABASE=piglet
MYSQL_HOST=database
TZ=Europe/Oslo

separate port for api and dashboard?

Hello,
Why are those separate ports? You can connect it only for port 80 and api is reachable on /api. This saves unnecessary setup, and will free some ports.

Piglet is "waiting for database host"

Hi everyone, here's my compose:

version: "3.8"
services:
  piglet:
    restart: unless-stopped
    container_name: piglet
    depends_on:
      - database
    ports:
      - 8089:80
      - 8087:8080
    image: k3nd0x/piglet:latest
    networks:
      - shyDockerServer
    environment:
      DB_ROOT_PASSWORD: ${PIGLET_DB_ROOT_PASSWORD}
      #MYSQL_DATABASE: ${MYSQL_DATABASE} # Default 'piglet'
      #MYSQL_USER: ${MYSQL_USER} # Default 'piglet'
      #MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      #MYSQL_HOST: ${MYSQL_HOST}
      #MAIL_SERVER: ${MAIL_SERVER}
      #MAIL_USER: ${MAIL_USER}
      #MAIL_PASSWORD: ${MAIL_PASSWORD}
      #MAIL_PORT: ${MAIL_PORT}
      #MAIL_ENCRYPTIONPROTOCOL: ${MAIL_ENCRYPTIONPROTOCOL}
      #DOMAIN: ${DOMAIN} # Default 'localhost'
      #SECURE_COOKIE: ${SECURE_COOKIE}
    volumes:
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
    labels:
      - swag=enable
      - swag_auth=authelia
  database:
    image: mariadb:latest
    container_name: piglet-db
    volumes:
      - ${DOCKERCONFDIR}/piglet/mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: ${PIGLET_DB_ROOT_PASSWORD}

networks:
  shyDockerServer:
    driver: bridge
    external: true

And here are the container logs:

  • piglet:
2023-08-18 00:48:03,154 INFO Set uid to user 0 succeeded
2023-08-18 00:48:03,159 INFO supervisord started with pid 1
2023-08-18 00:48:04,162 INFO spawned: 'import_db' with pid 7
2023-08-18 00:48:04,165 INFO spawned: 'piglet-redis' with pid 8
2023-08-18 00:48:04,168 INFO spawned: 'piglet-api' with pid 9
2023-08-18 00:48:04,171 INFO spawned: 'piglet-app' with pid 10
2023-08-18 00:48:04,187 INFO success: import_db entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
[2023-08-18 00:48:04 +0200] [10] [INFO] Starting gunicorn 21.2.0
[2023-08-18 00:48:04 +0200] [10] [INFO] Listening at: http://0.0.0.0:80 (10)
[2023-08-18 00:48:04 +0200] [10] [INFO] Using worker: sync
[2023-08-18 00:48:04 +0200] [16] [INFO] Booting worker with pid: 16
INFO:     Started server process [9]
INFO:     Waiting for application startup.
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:48:24,212 INFO success: piglet-redis entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2023-08-18 00:48:24,214 INFO success: piglet-api entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2023-08-18 00:48:24,214 INFO success: piglet-app entered RUNNING state, process has stayed up for > than 20 seconds (startsecs)
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
2023-08-18 00:08:04 waiting for database host
  • piglet-db:
2023-08-14 12:11:09+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.
2023-08-14 12:11:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-08-14 12:11:10+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.
2023-08-14 12:11:12+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2023-08-14 12:11:12 0 [Note] Starting MariaDB 11.0.2-MariaDB-1:11.0.2+maria~ubu2204 source revision 0005f2f06c8e1aea4915887decad67885108a929 as process 1
2023-08-14 12:11:13 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-08-14 12:11:13 0 [Note] InnoDB: Number of transaction pools: 1
2023-08-14 12:11:13 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-08-14 12:11:13 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-08-14 12:11:13 0 [Note] InnoDB: Using liburing
2023-08-14 12:11:13 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2023-08-14 12:11:13 0 [Note] InnoDB: Completed initialization of buffer pool
2023-08-14 12:11:13 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2023-08-14 12:11:14 0 [Note] InnoDB: Opened 3 undo tablespaces
2023-08-14 12:11:14 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2023-08-14 12:11:14 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-08-14 12:11:14 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-08-14 12:11:14 0 [Note] InnoDB: log sequence number 47897; transaction id 16
2023-08-14 12:11:14 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-08-14 12:11:14 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-08-14 12:11:14 0 [Note] Plugin 'wsrep-provider' is disabled.
2023-08-14 12:11:14 0 [Note] Server socket created on IP: '0.0.0.0'.
2023-08-14 12:11:14 0 [Note] Server socket created on IP: '::'.
2023-08-14 12:11:14 0 [Note] InnoDB: Buffer pool(s) load completed at 230814 12:11:14
2023-08-14 12:11:15 0 [Note] mariadbd: ready for connections.
Version: '11.0.2-MariaDB-1:11.0.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

Why doesn't the Piglet main container connect? I've basically used the default compose + some networking stuff.

Access denied on database unable to login as admin

using original docker-compose file. logs show

Access denied for user 'piglet'@'%' to database '$DATABASE'

i have .env file in same folder as compose file. I am unable to login with default credentials.

CSV Import

  • normalization of data
  • let user choose which data should be imported
  • let user choose the category

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.