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:
- Retrieve a database dump.
- Run this command in the folder of said dump:
cat db-filename.dump | gunzip | docker exec --interactive kemono-db psql --username=nano kemonodb
- Restart the archiver to trigger migrations:
If that didn't start the migrations, refer to FAQ section for manual instructions.
docker restart kemono-archiver
Files
Assuming the dev setup is running:
- Retrieve the files in required folder structure.
- Copy them into nginx image:
docker cp ./ kemono-nginx:/storage
- 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:
- Enter into database container:
docker exec --interactive --tty kemono-db psql --username=nano kemonodb
- Check the contents of the
posts
table:Most likely it has 0 rows.SELECT * FROM posts;
- Move contents of
booru_posts
toposts
:INSERT INTO posts SELECT * FROM booru_posts ON CONFLICT DO NOTHING;
- Restart the archiver:
If you see a bunch of log entries from
docker restart kemono-archiver
kemono-db
, then it means archiver is doing the job. - In case the frontend still doesn't show the artists/posts, clear redis cache:
docker exec kemono-redis redis-cli FLUSHALL