Scripts to manage export import from papad database to handover to syncthing folders.
main.py
is the watcher for changes in the configured (syncthing folders) and if any changes willimport_json()
content into dbdump.py
exports the contents of db and saves into json file in the configured path (syncthing folders), this should be run in a crontab to run in intervals- The dumped JSON file naming convention is macid.json
load.py
is whereimport_json()
is defined, and manages the merging of content, ex. tags.
- Clone this repository
git clone https://github.com/janastu/papad-monitor.git
- Setup python virtual environment and activate (for more on how to setup virtual env https://docs.python.org/3.6/tutorial/venv.html)
- Install all dependencies, run this command
pip install -r requirements.txt
- Run this command
python main.py path/to/sync/folder
to start the watcher - In another terminal, activate virtual env in the root of the project
- set environment variable
export SYNCTHING_FOLDER=path/to/sunc/folder
- run this command
python dump.py
(although this should be run in crontab for automatically exporting in fixed intervals)
- Device A and Device B are running papad web application (api server and frontend client)
- User X and Y access papad through Device A via the url https://deviceA.local
- User Z access papad through Device B via the url https://deviceB.local
- User X adds a tag "gulab jamoon recipe" to
jamoon.mp3
at https://deviceA.local - User Y adds a image
jamoon.png
tojamoon.mp3
at https://deviceA.local - User Z should be able to see
jamoon.mp3
with the tags and images User X and Y at https://deviceB.local
The dry run user stories, and other test cases are documented in the below document with diagrams. https://hackmd.io/@sagesalus/ByUUI1BT8