80 lines
3.5 KiB
Plaintext
80 lines
3.5 KiB
Plaintext
In here we can put instructions on how to run this / any general info
|
|
|
|
|
|
ubuntu packages:
|
|
sudo apt-get install -y mediainfo cmake python3-flask
|
|
|
|
pip packages:
|
|
* pymediainfo
|
|
* PIL (should be there by default)
|
|
- on ubuntu, need to do: pip3 install --upgrade pillow --user
|
|
* ExifRead
|
|
* opencv-python
|
|
* datetime
|
|
* pytz
|
|
* face_recognition
|
|
#### dlib (might need to install this before face_recognitioin, but it might not be needed, cmake clearly was)
|
|
|
|
|
|
upstream packages...
|
|
mkdir static/upstream
|
|
cd static/upstream
|
|
|
|
# for boostrap:
|
|
wget https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css
|
|
wget https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js
|
|
|
|
# for jquery
|
|
https://code.jquery.com/jquery-3.6.0.min.js
|
|
|
|
# for jquery/smart context menu
|
|
wget https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.contextMenu.css
|
|
wget https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.contextMenu.min.js
|
|
wget https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.contextMenu.min.js.map
|
|
wget https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.9.2/jquery.ui.position.min.js
|
|
|
|
# font-awesome
|
|
### browse to https://fontawesome.com/download, grab zip, unzip it into static/upstream
|
|
# in fa-stack hand change width:2.5em to width:2em
|
|
|
|
### I tried to update via pip3, with this:
|
|
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev libgirepository1.0-dev libcups2-dev
|
|
pip3 list | tail -n +3 | grep -v mysqlclient | grep -v duplicity | grep -v gpg | awk ' { print $1 } ' | xargs pip3 install --upgrade
|
|
|
|
To run debug version of web server:
|
|
FLASK_APP=main FLASK_ENV=development flask run --host=192.168.0.2
|
|
|
|
to run prod version of web server:
|
|
gunicorn --bind="192.168.0.2:5000" --threads=2 --workers=2 main:app
|
|
|
|
Also have to run the job manager for jobs to work:
|
|
python3 pa_job_manager.py
|
|
|
|
To rebuild DB from scratch/empty data:
|
|
|
|
###BE CAREFUL this completely destroys the database contents and starts from
|
|
#scratch, when we get real data, we will instead cp a backup file not the
|
|
#tables.sql
|
|
|
|
( cd /srv/docker/config/ ; sudo docker-compose stop padb ; yes | sudo docker-compose rm padb ; sudo rm -rf /srv/docker/container/padb/data/ ; sudo cp /home/ddp/src/photoassistant/tables.sql /srv/docker/container/padb/docker-entrypoint-initdb.d/tables.sql ; sudo docker-compose up padb )
|
|
|
|
To get back a 'working' but scanned set of data:
|
|
|
|
# make a backup and store it in DB_BACKUP:
|
|
|
|
sudo docker exec -it padb bash
|
|
root@2881f871e1c2:/# pg_dump --user=pa --password pa > /docker-entrypoint-initdb.d/tables.sql
|
|
cp /srv/docker/container/padb/docker-entrypoint-initdb.d/tables.sql /home/ddp/src/photoassistant/DB_BACKUP/
|
|
mv /home/ddp/src/photoassistant/DB_BACKUP/tables.sql /home/ddp/src/photoassistant/DB_BACKUP/`date +%Y%m%d-tables.sql`
|
|
gzip /home/ddp/src/photoassistant/DB_BACKUP/`date +%Y%m%d-tables.sql`
|
|
# mv /home/ddp/src/photoassistant/DB_BACKUP/`date +%Y%m%d-tables.sql`.gz /home/ddp/src/photoassistant/DB_BACKUP/<meaningfulname>......
|
|
|
|
|
|
# start db, using new tables.sql
|
|
### decide what tables.sql you want, e.g.
|
|
|
|
sudo bash
|
|
# gunzip -c /home/ddp/src/photoassistant/DB_BACKUP/20200126-all-imported-no-duplicates.sql.gz > /srv/docker/container/padb/docker-entrypoint-initdb.d/tables.sql
|
|
|
|
( cd /srv/docker/config/ ; sudo docker-compose stop padb ; yes | sudo docker-compose rm padb ; sudo rm -rf /srv/docker/container/padb/data/ ; sudo docker-compose up padb )
|