alexantoniades / scout

A simple ansible playbook and nodejs app to watch file changes and log them to a PouchDB databse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scout ⌚ 🔭

A simple ansible playbook and nodejs app to watch file changes and log them to a PouchDB database

Dependencies

  • NPM
  • NodeJS
  • Python3
  • Ansible

Installing dependencies

Ubuntu

# Update repositories
sudo apt update && sudo apt upgrade
# Install dependencies 
sudo apt install python3 python3-pip nodejs git
# Install Ansible using PIP3
sudo pip3 install ansible
git clone https://github.com/alexantoniades/scout.git
cd scout
sudo ansible-playbook install.yml

CentOS/RHEL

# Update repositories
sudo yum update && sudo yum upgrade
# Install dependencies 
sudo yum install python3 python3-pip nodejs git
# Install Ansible using PIP3
sudo pip3 install ansible
git clone https://github.com/alexantoniades/scout.git
cd scout
sudo ansible-playbook install.yml

OpenSUSE

# Update repositories
sudo zypper update && sudo zypper dup
# Install dependencies 
sudo zypper install python3 python3-pip nodejs git
# Install Ansible using PIP3
sudo pip3 install ansible
git clone https://github.com/alexantoniades/scout.git
cd scout
sudo ansible-playbook install.yml

MacOS

# Install dependencies 
sudo brew install python3 python3-pip nodejs git
# Install Ansible using PIP3
sudo pip3 install ansible
git clone https://github.com/alexantoniades/scout.git
cd scout
sudo ansible-playbook install.yml

Start PouchDB Server

If the database server is used, the admin panel can be accessed at "http://localhost:8080/_utils"

The "--dir" parameter specifies the path to the database files

A server log can be found in the repo directory after initial start of the server (log.txt)

# Default port and directory is 8080 and ./database
pouchdb-server --port 8080 --dir ./database

Running the ansible playbook install.yml, the PouchDB server is added to systemd as a service

# Start PouchDB server service as scout_server.service using systemctl
sudo systemctl start scout_server.service

Start file watch

  • /path/to/directory should be replaced with the target directory to watch
  • database name should be replaced with the database name or the URl of the server if initialised (https://localhost:8080/database_name)
node scout.js /path/to/directory database_name

About

A simple ansible playbook and nodejs app to watch file changes and log them to a PouchDB databse

License:Apache License 2.0


Languages

Language:JavaScript 100.0%