mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 00:48:32 +01:00
optimize import
This commit is contained in:
parent
adff510359
commit
0a4fc76b61
15 changed files with 15 additions and 24 deletions
|
@ -1,5 +1,6 @@
|
||||||
import json
|
import json
|
||||||
import secrets
|
import secrets
|
||||||
|
|
||||||
import webauthn
|
import webauthn
|
||||||
from flask import (
|
from flask import (
|
||||||
request,
|
request,
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
import socket
|
||||||
import string
|
import string
|
||||||
import subprocess
|
import subprocess
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
import socket
|
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
import arrow
|
import arrow
|
||||||
from flask import render_template, flash, request, redirect, url_for
|
from flask import render_template, flash, request, redirect, url_for
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from flask_wtf import FlaskForm
|
|
||||||
from wtforms import StringField, validators
|
|
||||||
|
|
||||||
from app import s3
|
from app import s3
|
||||||
from app.config import JOB_BATCH_IMPORT
|
from app.config import JOB_BATCH_IMPORT
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import CustomDomain, File, BatchImport, Job
|
from app.models import File, BatchImport, Job
|
||||||
from app.utils import random_string
|
from app.utils import random_string
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,7 @@ from itsdangerous import TimestampSigner, SignatureExpired
|
||||||
|
|
||||||
from app.config import (
|
from app.config import (
|
||||||
DISABLE_ALIAS_SUFFIX,
|
DISABLE_ALIAS_SUFFIX,
|
||||||
ALIAS_DOMAINS,
|
|
||||||
CUSTOM_ALIAS_SECRET,
|
CUSTOM_ALIAS_SECRET,
|
||||||
PREMIUM_ALIAS_DOMAINS,
|
|
||||||
)
|
)
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
|
|
|
@ -3,7 +3,7 @@ from flask_login import login_required, current_user
|
||||||
from flask_wtf import FlaskForm
|
from flask_wtf import FlaskForm
|
||||||
from wtforms import StringField, validators
|
from wtforms import StringField, validators
|
||||||
|
|
||||||
from app.config import EMAIL_SERVERS_WITH_PRIORITY, ALIAS_DOMAINS
|
from app.config import EMAIL_SERVERS_WITH_PRIORITY
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
from app.email_utils import get_email_domain_part
|
from app.email_utils import get_email_domain_part
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
from functools import wraps
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
from flask import render_template, flash, redirect, url_for, session, request
|
from flask import render_template, flash, redirect, url_for, session, request
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from flask_wtf import FlaskForm
|
from flask_wtf import FlaskForm
|
||||||
from wtforms import PasswordField, validators
|
from wtforms import PasswordField, validators
|
||||||
from functools import wraps
|
|
||||||
|
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
|
|
|
@ -4,10 +4,10 @@ from flask_wtf import FlaskForm
|
||||||
from wtforms import HiddenField, validators
|
from wtforms import HiddenField, validators
|
||||||
|
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
|
from app.dashboard.views.enter_sudo import sudo_required
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import RecoveryCode, Fido
|
from app.models import RecoveryCode, Fido
|
||||||
from app.dashboard.views.enter_sudo import sudo_required
|
|
||||||
|
|
||||||
|
|
||||||
class FidoManageForm(FlaskForm):
|
class FidoManageForm(FlaskForm):
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import json
|
import json
|
||||||
import secrets
|
import secrets
|
||||||
import uuid
|
import uuid
|
||||||
from time import time
|
|
||||||
|
|
||||||
import webauthn
|
import webauthn
|
||||||
from flask import render_template, flash, redirect, url_for, session
|
from flask import render_template, flash, redirect, url_for, session
|
||||||
|
@ -11,10 +10,10 @@ from wtforms import StringField, HiddenField, validators
|
||||||
|
|
||||||
from app.config import RP_ID, URL
|
from app.config import RP_ID, URL
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
|
from app.dashboard.views.enter_sudo import sudo_required
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import Fido, RecoveryCode
|
from app.models import Fido, RecoveryCode
|
||||||
from app.dashboard.views.enter_sudo import sudo_required
|
|
||||||
|
|
||||||
|
|
||||||
class FidoTokenForm(FlaskForm):
|
class FidoTokenForm(FlaskForm):
|
||||||
|
|
|
@ -14,7 +14,7 @@ from app.email_utils import email_can_be_used_as_mailbox
|
||||||
from app.email_utils import mailbox_already_used, render, send_email
|
from app.email_utils import mailbox_already_used, render, send_email
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import Alias, DeletedAlias, AuthorizedAddress
|
from app.models import Alias, AuthorizedAddress
|
||||||
from app.models import Mailbox
|
from app.models import Mailbox
|
||||||
from app.pgp_utils import PGPException, load_public_key
|
from app.pgp_utils import PGPException, load_public_key
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ from flask_wtf import FlaskForm
|
||||||
from wtforms import StringField, validators
|
from wtforms import StringField, validators
|
||||||
|
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
|
from app.dashboard.views.enter_sudo import sudo_required
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.dashboard.views.enter_sudo import sudo_required
|
|
||||||
|
|
||||||
|
|
||||||
class OtpTokenForm(FlaskForm):
|
class OtpTokenForm(FlaskForm):
|
||||||
|
|
|
@ -34,7 +34,6 @@ from app.models import (
|
||||||
EmailChange,
|
EmailChange,
|
||||||
User,
|
User,
|
||||||
Alias,
|
Alias,
|
||||||
DeletedAlias,
|
|
||||||
CustomDomain,
|
CustomDomain,
|
||||||
Client,
|
Client,
|
||||||
AliasGeneratorEnum,
|
AliasGeneratorEnum,
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import email
|
import email
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
from email.header import decode_header
|
from email.header import decode_header
|
||||||
from email.message import Message
|
from email.message import Message
|
||||||
from email.mime.base import MIMEBase
|
|
||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
from email.utils import make_msgid, formatdate, parseaddr
|
from email.utils import make_msgid, formatdate, parseaddr
|
||||||
from smtplib import SMTP
|
from smtplib import SMTP
|
||||||
from typing import Optional
|
|
||||||
import re
|
|
||||||
|
|
||||||
import arrow
|
import arrow
|
||||||
import dkim
|
import dkim
|
||||||
|
@ -32,7 +30,6 @@ from app.config import (
|
||||||
SENDER,
|
SENDER,
|
||||||
URL,
|
URL,
|
||||||
LANDING_PAGE_URL,
|
LANDING_PAGE_URL,
|
||||||
PREMIUM_ALIAS_DOMAINS,
|
|
||||||
)
|
)
|
||||||
from app.dns_utils import get_mx_domains
|
from app.dns_utils import get_mx_domains
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
|
|
|
@ -9,7 +9,7 @@ import bcrypt
|
||||||
from arrow import Arrow
|
from arrow import Arrow
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
from flask_login import UserMixin
|
from flask_login import UserMixin
|
||||||
from sqlalchemy import text, desc, CheckConstraint, and_, func, case
|
from sqlalchemy import text, desc, CheckConstraint
|
||||||
from sqlalchemy_utils import ArrowType
|
from sqlalchemy_utils import ArrowType
|
||||||
|
|
||||||
from app import s3
|
from app import s3
|
||||||
|
@ -24,9 +24,6 @@ from app.config import (
|
||||||
LANDING_PAGE_URL,
|
LANDING_PAGE_URL,
|
||||||
FIRST_ALIAS_DOMAIN,
|
FIRST_ALIAS_DOMAIN,
|
||||||
DISABLE_ONBOARDING,
|
DISABLE_ONBOARDING,
|
||||||
PAGE_LIMIT,
|
|
||||||
ALIAS_DOMAINS,
|
|
||||||
PREMIUM_ALIAS_DOMAINS,
|
|
||||||
)
|
)
|
||||||
from app.errors import AliasInTrashError
|
from app.errors import AliasInTrashError
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
|
|
|
@ -7,7 +7,6 @@ from memory_profiler import memory_usage
|
||||||
from app.config import GNUPGHOME
|
from app.config import GNUPGHOME
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import Mailbox, Contact
|
from app.models import Mailbox, Contact
|
||||||
from app.utils import random_string
|
|
||||||
|
|
||||||
gpg = gnupg.GPG(gnupghome=GNUPGHOME)
|
gpg = gnupg.GPG(gnupghome=GNUPGHOME)
|
||||||
gpg.encoding = "utf-8"
|
gpg.encoding = "utf-8"
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
"""Inspired from
|
"""Inspired from
|
||||||
https://github.com/petermat/spamassassin_client
|
https://github.com/petermat/spamassassin_client
|
||||||
"""
|
"""
|
||||||
import socket, select, re, logging
|
import logging
|
||||||
|
import re
|
||||||
|
import select
|
||||||
|
import socket
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
|
|
Loading…
Reference in a new issue