Skip to content

mEsUsah/haxor-vault

Repository files navigation

Vault Haxor

Simple webapp for storing encrypted credentials using client-side encryption, and client-side hasing of password for authentication.

Getting Started

Installation

# 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

MySQL / MariaDB setup

-- 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;

Setup

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

Dev

Start developing

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

Prod

Build assets

npm run prod

Sync static files to S3 bucket

python3 manage.py collectstatic -v 2 --no-input

Env. variables

In the .env file set the follownig variables

DEBUG=False
DEV_MODE=False
S3_ACTIVATED=True

Runs uWSGI server

uwsgi --socket vaulthaxor.sock  --module vaulthaxor.wsgi --chmod-socket=666

Deploy new commits

On prod server:

sudo -u www-data git pull
sudo supervisorctl restart vault_haxor

Cleanup / Uninstalling

Uninstall

deactivate

Update Python dependency list

pip freeze > requirements.txt

Resourcese

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published