mirror of
https://github.com/Mailu/Mailu.git
synced 2025-04-02 22:05:25 +02:00
Start moving things out of the admin module
This commit is contained in:
parent
0223999a04
commit
9358a76d89
admin/mailu
__init__.pyaccess.py
admin
dkim.pyforms.pymodels.pystatic
adminlte
app.cssbootstrap
css
fonts
glyphicons-halflings-regular.eotglyphicons-halflings-regular.svgglyphicons-halflings-regular.ttfglyphicons-halflings-regular.woffglyphicons-halflings-regular.woff2
js
jquery/js
select2
css
js
templates
admin
alias
alternative
announcement.htmlbase.htmlconfirm.htmldocker-error.htmldomain
fetch
form.htmlhelpers.htmlindex.htmllogin.htmlmacros.htmlmanager
relay
services.htmlsidebar.htmluser
@ -11,6 +11,8 @@ import docker
|
||||
|
||||
from apscheduler.schedulers import background
|
||||
|
||||
from mailu import models
|
||||
|
||||
|
||||
# Create application
|
||||
app = flask.Flask(__name__, static_url_path='/admin/app_static')
|
||||
@ -41,36 +43,45 @@ default_config = {
|
||||
for key, value in default_config.items():
|
||||
app.config[key] = os.environ.get(key, value)
|
||||
|
||||
# Setup components
|
||||
# Base application
|
||||
flask_bootstrap.Bootstrap(app)
|
||||
db = flask_sqlalchemy.SQLAlchemy(app)
|
||||
migrate = flask_migrate.Migrate(app, db)
|
||||
login_manager = flask_login.LoginManager()
|
||||
login_manager.init_app(app)
|
||||
babel = flask_babel.Babel(app)
|
||||
translations = list(map(str, babel.list_translations()))
|
||||
scheduler = background.BackgroundScheduler({
|
||||
'apscheduler.timezone': 'UTC'
|
||||
})
|
||||
|
||||
# Manager commnad
|
||||
manager = flask_script.Manager(app)
|
||||
manager.add_command('db', flask_migrate.MigrateCommand)
|
||||
|
||||
# Task scheduling
|
||||
scheduler = background.BackgroundScheduler({
|
||||
'apscheduler.timezone': 'UTC'
|
||||
})
|
||||
if not app.debug or os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
|
||||
scheduler.start()
|
||||
from mailu import tlstasks
|
||||
|
||||
# Babel configuration
|
||||
babel = flask_babel.Babel(app)
|
||||
translations = list(map(str, babel.list_translations()))
|
||||
|
||||
@babel.localeselector
|
||||
def get_locale():
|
||||
return flask.request.accept_languages.best_match(translations)
|
||||
|
||||
# Finally setup the blueprint and redirect /
|
||||
from mailu import admin
|
||||
app.register_blueprint(admin.app, url_prefix='/admin')
|
||||
# Login configuration
|
||||
login_manager = flask_login.LoginManager()
|
||||
login_manager.init_app(app)
|
||||
login_manager.login_view = "admin.login"
|
||||
login_manager.user_loader(models.User.query.get)
|
||||
|
||||
@app.context_processor
|
||||
def inject_user():
|
||||
return dict(current_user=flask_login.current_user)
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return flask.redirect("/webmail/")
|
||||
|
||||
|
||||
# Import views
|
||||
from mailu.views import *
|
||||
|
@ -1,33 +0,0 @@
|
||||
from flask import Blueprint
|
||||
from mailu import login_manager, db
|
||||
|
||||
import flask_login
|
||||
|
||||
|
||||
app = Blueprint(
|
||||
'admin', __name__,
|
||||
template_folder='templates',
|
||||
static_folder='static')
|
||||
|
||||
# Import models
|
||||
from mailu.admin import models
|
||||
|
||||
# Register the login components
|
||||
login_manager.login_view = "admin.login"
|
||||
login_manager.user_loader(models.User.query.get)
|
||||
|
||||
@app.context_processor
|
||||
def inject_user():
|
||||
return dict(current_user=flask_login.current_user)
|
||||
|
||||
# Import views
|
||||
from mailu.admin.views import \
|
||||
admins, \
|
||||
managers, \
|
||||
base, \
|
||||
aliases, \
|
||||
users, \
|
||||
domains, \
|
||||
relays, \
|
||||
alternatives, \
|
||||
fetches
|
0
admin/mailu/admin/static/adminlte/js/app.min.js → admin/mailu/static/adminlte/js/app.min.js
vendored
0
admin/mailu/admin/static/adminlte/js/app.min.js → admin/mailu/static/adminlte/js/app.min.js
vendored
Before (image error) Size: 106 KiB After (image error) Size: 106 KiB |
0
admin/mailu/admin/static/select2/js/i18n/ar.js → admin/mailu/static/select2/js/i18n/ar.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ar.js → admin/mailu/static/select2/js/i18n/ar.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/az.js → admin/mailu/static/select2/js/i18n/az.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/az.js → admin/mailu/static/select2/js/i18n/az.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/bg.js → admin/mailu/static/select2/js/i18n/bg.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/bg.js → admin/mailu/static/select2/js/i18n/bg.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ca.js → admin/mailu/static/select2/js/i18n/ca.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ca.js → admin/mailu/static/select2/js/i18n/ca.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/cs.js → admin/mailu/static/select2/js/i18n/cs.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/cs.js → admin/mailu/static/select2/js/i18n/cs.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/da.js → admin/mailu/static/select2/js/i18n/da.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/da.js → admin/mailu/static/select2/js/i18n/da.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/de.js → admin/mailu/static/select2/js/i18n/de.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/de.js → admin/mailu/static/select2/js/i18n/de.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/el.js → admin/mailu/static/select2/js/i18n/el.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/el.js → admin/mailu/static/select2/js/i18n/el.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/en.js → admin/mailu/static/select2/js/i18n/en.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/en.js → admin/mailu/static/select2/js/i18n/en.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/es.js → admin/mailu/static/select2/js/i18n/es.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/es.js → admin/mailu/static/select2/js/i18n/es.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/et.js → admin/mailu/static/select2/js/i18n/et.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/et.js → admin/mailu/static/select2/js/i18n/et.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/eu.js → admin/mailu/static/select2/js/i18n/eu.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/eu.js → admin/mailu/static/select2/js/i18n/eu.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/fa.js → admin/mailu/static/select2/js/i18n/fa.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/fa.js → admin/mailu/static/select2/js/i18n/fa.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/fi.js → admin/mailu/static/select2/js/i18n/fi.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/fi.js → admin/mailu/static/select2/js/i18n/fi.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/fr.js → admin/mailu/static/select2/js/i18n/fr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/fr.js → admin/mailu/static/select2/js/i18n/fr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/gl.js → admin/mailu/static/select2/js/i18n/gl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/gl.js → admin/mailu/static/select2/js/i18n/gl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/he.js → admin/mailu/static/select2/js/i18n/he.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/he.js → admin/mailu/static/select2/js/i18n/he.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/hi.js → admin/mailu/static/select2/js/i18n/hi.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/hi.js → admin/mailu/static/select2/js/i18n/hi.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/hr.js → admin/mailu/static/select2/js/i18n/hr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/hr.js → admin/mailu/static/select2/js/i18n/hr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/hu.js → admin/mailu/static/select2/js/i18n/hu.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/hu.js → admin/mailu/static/select2/js/i18n/hu.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/id.js → admin/mailu/static/select2/js/i18n/id.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/id.js → admin/mailu/static/select2/js/i18n/id.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/is.js → admin/mailu/static/select2/js/i18n/is.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/is.js → admin/mailu/static/select2/js/i18n/is.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/it.js → admin/mailu/static/select2/js/i18n/it.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/it.js → admin/mailu/static/select2/js/i18n/it.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ja.js → admin/mailu/static/select2/js/i18n/ja.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ja.js → admin/mailu/static/select2/js/i18n/ja.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/km.js → admin/mailu/static/select2/js/i18n/km.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/km.js → admin/mailu/static/select2/js/i18n/km.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ko.js → admin/mailu/static/select2/js/i18n/ko.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ko.js → admin/mailu/static/select2/js/i18n/ko.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/lt.js → admin/mailu/static/select2/js/i18n/lt.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/lt.js → admin/mailu/static/select2/js/i18n/lt.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/lv.js → admin/mailu/static/select2/js/i18n/lv.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/lv.js → admin/mailu/static/select2/js/i18n/lv.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/mk.js → admin/mailu/static/select2/js/i18n/mk.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/mk.js → admin/mailu/static/select2/js/i18n/mk.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ms.js → admin/mailu/static/select2/js/i18n/ms.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ms.js → admin/mailu/static/select2/js/i18n/ms.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/nb.js → admin/mailu/static/select2/js/i18n/nb.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/nb.js → admin/mailu/static/select2/js/i18n/nb.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/nl.js → admin/mailu/static/select2/js/i18n/nl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/nl.js → admin/mailu/static/select2/js/i18n/nl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/pl.js → admin/mailu/static/select2/js/i18n/pl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/pl.js → admin/mailu/static/select2/js/i18n/pl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/pt-BR.js → admin/mailu/static/select2/js/i18n/pt-BR.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/pt-BR.js → admin/mailu/static/select2/js/i18n/pt-BR.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/pt.js → admin/mailu/static/select2/js/i18n/pt.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/pt.js → admin/mailu/static/select2/js/i18n/pt.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ro.js → admin/mailu/static/select2/js/i18n/ro.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ro.js → admin/mailu/static/select2/js/i18n/ro.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ru.js → admin/mailu/static/select2/js/i18n/ru.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/ru.js → admin/mailu/static/select2/js/i18n/ru.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sk.js → admin/mailu/static/select2/js/i18n/sk.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sk.js → admin/mailu/static/select2/js/i18n/sk.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sr-Cyrl.js → admin/mailu/static/select2/js/i18n/sr-Cyrl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sr-Cyrl.js → admin/mailu/static/select2/js/i18n/sr-Cyrl.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sr.js → admin/mailu/static/select2/js/i18n/sr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sr.js → admin/mailu/static/select2/js/i18n/sr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sv.js → admin/mailu/static/select2/js/i18n/sv.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/sv.js → admin/mailu/static/select2/js/i18n/sv.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/th.js → admin/mailu/static/select2/js/i18n/th.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/th.js → admin/mailu/static/select2/js/i18n/th.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/tr.js → admin/mailu/static/select2/js/i18n/tr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/tr.js → admin/mailu/static/select2/js/i18n/tr.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/uk.js → admin/mailu/static/select2/js/i18n/uk.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/uk.js → admin/mailu/static/select2/js/i18n/uk.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/vi.js → admin/mailu/static/select2/js/i18n/vi.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/vi.js → admin/mailu/static/select2/js/i18n/vi.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/zh-CN.js → admin/mailu/static/select2/js/i18n/zh-CN.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/zh-CN.js → admin/mailu/static/select2/js/i18n/zh-CN.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/zh-TW.js → admin/mailu/static/select2/js/i18n/zh-TW.js
vendored
0
admin/mailu/admin/static/select2/js/i18n/zh-TW.js → admin/mailu/static/select2/js/i18n/zh-TW.js
vendored
0
admin/mailu/admin/static/select2/js/select2.min.js → admin/mailu/static/select2/js/select2.min.js
vendored
0
admin/mailu/admin/static/select2/js/select2.min.js → admin/mailu/static/select2/js/select2.min.js
vendored
0
admin/mailu/admin/templates/alternative/create.html → admin/mailu/templates/alternative/create.html
0
admin/mailu/admin/templates/alternative/create.html → admin/mailu/templates/alternative/create.html
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user