Skip to content

WebUI GUI in Flask Python3

runout-at edited this page Jun 13, 2018 · 21 revisions

This Page contains Ideas about a new WebUI/GUI implementation in Flask/Python3.

Requirements

Install & Upgrade

If you get some Duplicate index warnings - ignore them.

Install Python3 environment

Call bash pysetup.sh

This creates a virtual environment under venv and modified templates for nginx and uwsgi under doc

If a domain/server name is provided as first parameter it will be used for the nginx template.

install a new vexim DB

Create a DB and a DB user.

Then simply call:

bash dbreinit.sh <targetDBname>

This will create tables in the DB . If <targetDBname> is ommited, 'veximdbtest' will be used. This script will copy app/models/models_orig.py with the <targetDBname> as DB to app/models/models.py

upgrade an existing vexim2 DB

Migration will be done to a new DB. (in-place-migration is not supported)

Create a DB user for the new DB.

Then call (with 3 parameters):

bash dbmigration-mysql.sh <dumpfile.sql> <originDBname> <targetDBname>

You will be prompted for a target DB host, port, user and password. It will call the bash dbreinit.sh <targetDBname> script in the end. More information can be found inside this script file.

NGINX, UWSGI

Sample files can be found under the doc directory.

Make sure you have certificates for the domain(s)

Review, edit and copy these files to /etc/nginx/sites-available and /etc/uwsgi/apps-available. Set appropriate symlinks in the *-enabled directories and restart nginx/uwsgi.

Already implemented

  • Full login support for Siteadmin, Postmaster and Users with a role System.

  • Intelligent login: try first given login, then add domain from actual URI and try to strip subdomain parts (one by one)

  • Config of password characters per domain

  • Config of defaults and settings in app/config/settings.py

  • List-Views for Local Domains

    • Domain name
    • IP where an Relay points to
    • Number of Local Accounts, Account-List-Button, Account-Add-Button
    • Number of Alias Accounts, Account-List-Button, Account-Add-Button
    • Number of Postmasters
    • Number of Aliases pointing to this Domain
    • Domain-Enabled-Button to indicate and change state
    • Domain-Edit-Button
    • Domain-Delete-Button
  • List-Views for Alias Domains

    • Domain name
    • Domain name where an Alias points to
    • Domain-Enabled-Button to indicate and change state
    • Domain-Edit-Button
    • Domain-Delete-Button
  • List-Views for Relay Domains

    • Domain name
    • Domain-Enabled-Button to indicate and change state
    • Domain-Edit-Button
    • Domain-Delete-Button
  • List-Views for Local Accounts

    • Realname
    • Username
    • Loclpart
    • Piped
    • Forwarded
    • Siteadmin
    • Postmaster
    • Account-Enabled-Button to indicate and change state
    • Account-Edit-Button
    • Account-Delete-Button
  • View for add/edit Alias Domain

  • Enable/Disable for Domains and Accounts.

  • Add/Edit/Delete Domain

  • Add/Edit/Delete Local Account

  • Branding. Logo in header from domain related ressource directory

  • Some automated tests for Login, Views, Validators

Wishlist

Needed changes

  • Add role field to user table
  • Add enabled field to domainalias table
  • Add comment fields for domains and users

Screenshots

Domainlist

Domainlist

Accountlist

Accountlist

Add/edit domain

Accountlist