项目作者: triplepy

项目描述 :
Anonymous, silent and lockable email service
高级语言: Python
项目地址: git://github.com/triplepy/sh8email-django.git
创建时间: 2016-07-22T03:41:32Z
项目社区:https://github.com/triplepy/sh8email-django

开源协议:

下载


Build Status

sh8email-django

sh8email is an anonymous, silent and lockable email service.

This is a django-implementation of sh8email.

Usage

Starting/stopping server in development machine

Starting

  • Web application: python manage.py runserver
  • Mail receiver: python manage.py runrecv
  • Mail delete batch: python manage.py runbatch

Stopping

  • Web application: Press Ctrl+C
  • Mail receiver: python manage.py runrecv --stop
  • Mail delete batch: python manage.py runbatch --stop

Deploying new code in production machine

Enter python virtual environment and type invoke deploy.

Running tests

  • Unit tests: invoke test.unit
  • Functional tests: invoke test.func

Note

For running tests in development environment, port 25 should be forwarded to 2525.
It can be performed using rinetd in Linux system.

  1. # /etc/rinetd.conf
  2. #
  3. # forwarding rules come here
  4. #
  5. # you may specify allow and deny rules after a specific forwarding rule
  6. # to apply to only that forwarding rule
  7. #
  8. # bindadress bindport connectaddress connectport
  9. 0.0.0.0 25 127.0.0.1 2525

Setting up development environment

Setting up development database

1. Install postgresql.

In Ubuntu,

  1. $ sudo apt install postgresql

In OSX (brew required),

  1. $ brew install postgresql

If you want to start up postgresql server automatically after your macOS boots,

  1. $ brew services start postgresql

2. Login as postgres, and enter the psql which is command line tool for postgresql.

In ubuntu
  1. $ sudo su postgres
  2. $ psql
In OSX
  1. $ psql postgres

3. Add a user named sh8email.

  1. postgres=# CREATE USER sh8email WITH PASSWORD 'password';
  2. CREATE ROLE

4. Create a database named sh8email.

  1. postgres=# CREATE DATABASE sh8email;
  2. CREATE DATABASE

5. Grant access to user.

  1. postgres=# GRANT ALL PRIVILEGES ON DATABASE sh8email to sh8email;
  2. GRANT

6. Add a privilege to create database which used for creating test database.

  1. postgres=# ALTER USER sh8email CREATEDB;
  2. ALTER ROLE

7. Edit pg_hba.conf to disable SSL connection in localhost connection.

In Ubuntu, edit /etc/postgresql/9.5/main/pg_hba.conf.

In OS X or macOS, edit /usr/local/var/postgres/pg_hba.conf.

From

  1. # IPv4 local connections:
  2. host all all 127.0.0.1/32 md5
  3. # IPv6 local connections:
  4. host all all ::1/128 md5

to

  1. # IPv4 local connections:
  2. hostnossl all all 127.0.0.1/32 md5
  3. # IPv6 local connections:
  4. hostnossl all all ::1/128 md5

Structures

Design of REST-API

  • Retrieve the mail list of an user.
    • GET rest/mail/{nickname}/list/
  • Retrieve a mail content.
    • GET rest/mail/{nickname}/{mail_pk}/
    • POST rest/mail/{nickname}/{mail_pk}/ (for secret_email)
      • It needs “secret_code” parameter

Trouble Shooting

django.db.utils.OperationalError: SSL error: decryption failed or bad record mac

See Edit pg_hba.conf to disable SSL connection in localhost connection.

Contact us

Please mail to eightsh8@gmail.com.