• Stars
    star
    952
  • Rank 48,013 (Top 1.0 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate links that users can use to submit messages encrypted with your public key.

Hawkpost

Hawkpost lets you create unique links that you can share with the person that desires to send you important information but doesn't know how to deal with PGP.

You can deploy your own server using the code from this repository or use the official server (that is running an exact copy of this repo) at https://hawkpost.co.

Rationale

For many web and mobile development studios, no matter how hard they try to secure their client secrets (passwords, API keys, etc), the weakest link resides on the client most of the times, specially when he's not a tech savvy person. This project tries to help minimize this issue on the communication between both parties.

The way it works is like this:

  1. It fetches your public key.
  2. When the box is open and the secrets submitted, all the content is encrypted on the client side.
  3. The server then signs (experimental) the encrypted content.
  4. Finally the server forwards it to your e-mail address.

Setting up a development environment

In this section you can find the steps to setup a minimal development environment on your machine.

Base requirements:

  • Python 3
  • Redis
  • PostgreSQL

On Linux

On a Debian based operating system execute the following steps, after cloning the repository:

  • Install the dependencies
$ pipenv install
  • Create the local postgreSQL database with your user and no password

  • Migrate the database

$ pipenv run python manage.py migrate
  • Generate stylesheet with gulp (installation instructions for gulp can be found here)
$ gulp build
  • Now you should be able to launch the server and its workers
$ pipenv run python manage.py runserver
$ pipenv run celery -A hawkpost worker --beat -l info

You can avoid pipenv run in every command if you first active the virtual environment with pipenv shell.

Using Docker

To use this approach you need to have Docker and Docker Compose installed. Please note that since this project uses version 2 of the Compose file format you may need to update your Docker and Docker Compose to their latest versions.

Installation instructions for every platform are available at the Docker Engine Documentation. If you use Linux you'll have to install Docker Compose manually.

After having the latest Docker and Docker Compose installed, make the folder that will hold the GPG public keys keyring:

$ mkdir -p gpg_home

Some environment variables need to be set so the application works properly. Copy the provided .env.sample and name it .env:

$ cp .env.sample .env

Since this setup assumes containers talk to each other some of the variables need to be set in order to point to the containers' names.

Edit .env and set the following variables to these values:

DB_HOST=db
DB_USER=hawkpost
DB_PASSWORD=hawkpost
REDIS_URL=redis://redis:6379/0

Don't forget to set the remaining variables as well.

After setting .env correctly, just run (you may need to sudo depending on your setup)

# Run the databases in detached mode to avoid seeing the logs
$ docker-compose up -d db redis

# Perform the migrations
# (using `--rm` to remove the temporary container afterwards)
$ docker-compose run --rm web pipenv run python manage.py migrate

# Run the web and celery containers
# (`docker-compose up` would log db and redis as well)
$ docker-compose up web celery

These commands

  1. Run the db and the redis containers detached from the console, so we're not bothered by their logs while working on the application.
  2. Perform the migrations using a temporary web container; it is removed afterwards.
  3. Run the web and celery attached to the console.

The web container will reload on code changes.

You may access the application by opening http://<docker-network-ip> on your browser, which you can find by running (you may need to run this as root depending on your setup).

CID=$(docker ps | grep 'hawkpost_web' | cut -d ' ' -f 1)
docker inspect -f "{{ .NetworkSettings.Networks.hawkpost_default.Gateway }}" $CID

This IP won't change unless you remove every container and the corresponding network (manually), so you may alias it on your /etc/hosts (to something like hawkpost.test).

Note: This approach was not tested on OS X or Windows platforms, so the network feature may require additional steps.

Running the test suite

To execute our current test suite, you just need to execute the following command after setting up your local development environment:

$ pipenv run python manage.py test

In case you are using our docker setup the command should be:

$ docker-compose run --rm web pipenv run python manage.py test

Credits

Whitesmith

This project was born during an internal hackathon at Whitesmith, which is helping and supporting the current development.

More Repositories

1

rubycritic

A Ruby code quality reporter
Ruby
3,340
star
2

WSTagsField

An iOS text field that represents tags, hashtags, tokens in general.
Swift
1,283
star
3

MeasureThings

ARKit framework demo for our article
Swift
107
star
4

guard-rubycritic

Real time Ruby code smell detector
Ruby
45
star
5

capistrano-recipes

Our set of Capistrano Recipes
Ruby
12
star
6

quoi-app

Your Quiz Nights gone digital.
JavaScript
11
star
7

ulid

Universally Unique Lexicographically Sortable Identifier (Objective-C wrapper of the C++ lib)
C++
11
star
8

flooper

Use flex order to create an infinite animated loop of items.
JavaScript
10
star
9

react-native-template

A template to kickstart your React Native app!
JavaScript
9
star
10

meteor-motion

Ruby
9
star
11

saferpay-gem

Ruby
8
star
12

quoi-mobile

A mobile quiz app inspired by Buzz and Dr. Why.
JavaScript
8
star
13

WSAugmentedCamera

iOS Camera Manager helper for Augmented Reality implementations (experiment)
Swift
7
star
14

fig-tree

A collection of Fig development environments.
Shell
7
star
15

qnorr

Because there are moments in life when tastier is better. 🍆
CSS
7
star
16

WSLogger

An extensible iOS logger on top of OSLog
Swift
6
star
17

surveyor2

A Rails gem that lets you code surveys, questionnaires, quizzes, etc... and add them to your app.
Ruby
5
star
18

qoop

Qoop - Qooperative Qooking
JavaScript
4
star
19

go-opentsdb

Golang library to interact with OpenTSDB
Go
4
star
20

qnorr-styles

[WIP] A style agnostic, slightly opinionated, sass seasoning to bootstrap your projects
CSS
3
star
21

sidekiq-worker_stats

Statistics for sidekiq workers
Ruby
2
star
22

qultivator-firmware

Qultivator is a project built under 32h for the Whitesmith Hackathon (July 2016).
Arduino
2
star
23

fiware-orion-docker

Containerized FIWARE Orion using Docker and Docker Compose.
2
star
24

WSPopup

A simple and flexible way to show a view to the screen.
Swift
1
star
25

ARPlayground

Repo for AR experiences
JavaScript
1
star
26

prosperent

A rails wrapper for prosperent API
Ruby
1
star
27

fiware-orion-deps-docker

FIWARE Orion dependencies image.
1
star
28

rails-template

Whitesmith Ruby-on-Rails Template
Ruby
1
star
29

sassqit

Static Site Prototyper
CSS
1
star