A self-service web application for Mail-in-a-box (https://mailinabox.email/).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
david 96d746cb29 added docker config and requirements.txt 1 year ago
static small changes 4 years ago
views fixed defunct forwarding feature 4 years ago
.gitignore edited .gitignor 4 years ago
CHANGELOG changed changelog 4 years ago
Dockerfile added docker config and requirements.txt 1 year ago
LICENSE Add license 4 years ago
README.md added email forwarding feature 4 years ago
app.conf.sample working alias management 4 years ago
app.py added docker config and requirements.txt 1 year ago
docker-compose.yml added docker config and requirements.txt 1 year ago
requirements.txt added docker config and requirements.txt 1 year ago

README.md

accounts

A self-service web application for Mail-in-a-box.
We run it here: https://accounts.socialnerds.org

It is a very simple web application for users to manage their Mail-in-a-box account. I wrote this as a python/bottlepy learning project and to service users at my own Mail-in-a-box. There might be more features in the future.

Features

  • Login with Mail-in-a-box account
  • Change password
  • Manage email aliases
  • Delete own account (softdelete)

Installation

You need python installed (v3 or v2). Needed modules: requests, configparser, bottle(or just download bottlepy like below)

git clone git@socialg.it:socialnerds.org/accounts.git
cd accounts
wget https://raw.githubusercontent.com/bottlepy/bottle/0.12.10/bottle.py

Configure your app by renaming app.conf.sample into app.conf and edit accordingly.
Start it with:

python3 app.py

You should be able to see the login page at http://localhost:8000.

Deployment

If you want to host this somewhere more prominent following links could help: (someday i might write up some real documentation)

This is what i did on an Ubuntu 16.04 server with apache2:

I enabled following Apache modules (for future instance balancing plans):

a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html
a2enmod xml2enc

Apache vhost config:

<VirtualHost *:80>
    DocumentRoot /var/www/accounts/static
    ServerAdmin admin@domain.tld
    ServerName accounts.domain.tld

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/accounts_access.log combined

    Redirect permanent / https://accounts.domain.tld/
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost _default_:443>

	ServerAdmin admin@domain.tld
	ServerName accounts.domain.tld
	DocumentRoot /var/www/accounts/static

  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>

	ErrorLog ${APACHE_LOG_DIR}/accounts_ssl_error.log
	LogLevel warn
	CustomLog ${APACHE_LOG_DIR}/accounts_ssl_access.log combined

	SSLEngine on
  SSLCertificateFile /path/to/fullchain.pem
  SSLCertificateKeyFile /path/to/key.pem

  ProxyPreserveHost On
  ProxyPass / http://localhost:8000/
  ProxyPassReverse / http://localhost:8000/

</VirtualHost>
</IfModule>

Unit file for systemd. /lib/systemd/system/accounts.service
Enable service with sudo systemctl enable accounts.service

[Unit]
Description=Accounts App
After=multi-user.target

[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/var/www/accounts
ExecStart=/usr/bin/python3 /var/www/accounts/app.py
StandardOutput=syslog
StandardError=syslog
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target