Giter VIP home page Giter VIP logo

kemono2's Introduction

Kemono project

Setup

git clone https://github.com/OpenYiff/Kemono2.git kemono-2
cd kemono-2
cp .env.example .env # open .env and configure
cp flask.cfg.example flask.cfg # open flask.cfg and configure

Docker

cp kitsune.py.example kitsune.py # open kitsune.py and configure

Develop

docker-compose --file docker-compose.dev.yml build
docker-compose --file docker-compose.dev.yml up

Open http://localhost:5000/ in the browser.

Database

Assuming the dev setup is running:

  1. Retrieve a database dump.
  2. Run this command in the folder of said dump:
    cat db-filename.dump | gunzip | docker exec --interactive kemono-db psql --username=nano kemonodb
  3. Restart the archiver to trigger migrations:
    docker restart kemono-archiver
    If that didn't start the migrations, refer to FAQ section for manual instructions.

Files

Assuming the dev setup is running:

  1. Retrieve the files in required folder structure.
  2. Copy them into nginx image:
    docker cp ./ kemono-nginx:/storage
  3. Add required permissions to that folder:
    docker exec kemono-nginx chown --recursive nginx /storage

Build

docker-compose build
docker-compose up --detach

Open http://localhost:8000/ in the browser.

Manual

TODO: write installation and setup instructions

This assumes you have Python 3, Node 12+ installed and a running PostgreSQL server.

# make sure your database is initialized
# cd to kemono directory
pip install virtualenv
virtualenv venv
source venv/bin/activate # venv\Scripts\activate on Windows
pip install --requirement requirements.txt
cd client && npm install && npm run build && cd ..
cp .env.example .env # open .env and configure
cp flask.cfg.example flask.cfg # open flask.cfg and configure
set FLASK_APP=server.py
set FLASK_ENV=development
flask run

Frequently Asked Questions

My dump doesn't migrate.

Assuming the running setup:

  1. Enter into database container:
    docker exec --interactive --tty kemono-db psql --username=nano kemonodb
  2. Check the contents of the posts table:
    SELECT * FROM posts;
    Most likely it has 0 rows.
  3. Move contents of booru_posts to posts:
    INSERT INTO posts SELECT * FROM booru_posts ON CONFLICT DO NOTHING;
  4. Restart the archiver:
    docker restart kemono-archiver
    If you see a bunch of log entries from kemono-db, then it means archiver is doing the job.
  5. In case the frontend still doesn't show the artists/posts, clear redis cache:
    docker exec kemono-redis redis-cli FLUSHALL

kemono2's People

Contributors

asl97 avatar bassofbass avatar degreerm avatar jojo935 avatar randomsuperuser avatar wafflesk avatar

Forkers

people-team

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.