Simple webapp for storing encrypted credentials using client-side encryption, and client-side hasing of password for authentication.
# Install build essentials (Linux Debian/Ubuntu)
sudo apt-get install python3-dev python3-venv default-libmysqlclient-dev build-essential pkg-config libxml2-dev
# Setup log directory
sudo mkdir -p /var/log/django/vault.haxor.no/
# Install Python dependencies
python3 -m venv venv
chmod +x venv/bin/activate
source venv/bin/activate
pip install -r requirements.txt
# Install JavaScript dependencies
npm install
-- Crate DB
CREATE DATABASE vaulthaxor;
-- Local database user
CREATE USER vaulthaxor@localhost IDENTIFIED BY 'vaulthaxor';
GRANT ALL PRIVILEGES ON vaulthaxor.* TO vaulthaxor@localhost;
FLUSH PRIVILEGES;
-- WSL database user
CREATE USER vaulthaxor@'%' IDENTIFIED BY 'vaulthaxor';
GRANT ALL PRIVILEGES ON vaulthaxor.* TO vaulthaxor@'%';
FLUSH PRIVILEGES;
Copy the example .env file, and add correct data.
# Create .env file
cp .env.example .env
# Edit .env file
vim .env
Populate DB with tables and base data.
# Crate DB tables and add basic data
python3 manage.py migrate
# Create superuser account
python3 manage.py createsuperuser
In the .env file set the follownig variables
DEBUG=True
DEV_MODE=True
S3_ACTIVATED=False
Start services.
# start python devserver
python3 devsearch/manage.py runserver
# In separte shell
npm run dev
# The site will be accessable (with live reload) at http://localhost:8000
npm run prod
python3 manage.py collectstatic -v 2 --no-input
In the .env file set the follownig variables
DEBUG=False
DEV_MODE=False
S3_ACTIVATED=True
uwsgi --socket vaulthaxor.sock --module vaulthaxor.wsgi --chmod-socket=666
On prod server:
sudo -u www-data git pull
sudo supervisorctl restart vault_haxor
deactivate
pip freeze > requirements.txt