Skip to content

sethips/shhh

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Shhh

Shhh is a tiny Flask App to write secrets and share them with people with a secure link.
The user can set up an expire date and a passphrase to access the secret.

Secrets and Passphrases are encypted in order to make the data anonymous, especially in MySQL.

Sender demo:
Alt Text

Reader demo:
Alt Text

โš™๏ธ Set up & Dependencies

MySql

Create a MySQL database and run the following script to generate the table links that will store our data.

CREATE TABLE `links` (
  `slug_link` text,
  `passphrase` text,
  `encrypted_text` text,
  `date_created` datetime DEFAULT NULL,
  `date_expires` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

We need to make sure the event_scheduler in MySql is activated to schedule database clean-ups (in order to remove the records that has expired).

In MySQL run the following to activate the event_scheduler

SET GLOBAL event_scheduler = ON;

Then we need to schedule a run at least every 2 hours to remove our expired records.

CREATE EVENT AutoDeleteExpiredRecords
ON SCHEDULE
EVERY 2 HOUR
DO 
  DELETE FROM links WHERE date_expires <= now();

Launch Shhh in local

We need to create a virtual environment, enter it, and install the needed dependencies.

$ virtualenv -p python3 venv --no-site-package
$ source venv/bin/activate
$ pip install -r requirements.txt

We then need to set-up our Environment Variables.

export FLASK_APP=shhh
export FLASK_ENV=<development/production>
export HOST_MYSQL=<localhost>
export USER_MYSQL=<username>
export PASS_MYSQL=<password>
export DB_MYSQL=<name>

Then run the below command to launch Shhh in local.

$ python3 -m flask run --host='0.0.0.0'

๐Ÿ’ก Idea credits

About

๐Ÿ”’ Flask app to share encrypted secrets with people using custom links, passphrases and expiration dates.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%