4.24.0
This commit is contained in:
parent
8ee4f9462e
commit
3f68a3e640
@ -6,8 +6,7 @@ from typing import Optional
|
|||||||
import itsdangerous
|
import itsdangerous
|
||||||
from app import config
|
from app import config
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import User
|
from app.models import User, AliasOptions
|
||||||
|
|
||||||
|
|
||||||
signer = itsdangerous.TimestampSigner(config.CUSTOM_ALIAS_SECRET)
|
signer = itsdangerous.TimestampSigner(config.CUSTOM_ALIAS_SECRET)
|
||||||
|
|
||||||
@ -43,7 +42,9 @@ def check_suffix_signature(signed_suffix: str) -> Optional[str]:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def verify_prefix_suffix(user: User, alias_prefix, alias_suffix) -> bool:
|
def verify_prefix_suffix(
|
||||||
|
user: User, alias_prefix, alias_suffix, alias_options: Optional[AliasOptions] = None
|
||||||
|
) -> bool:
|
||||||
"""verify if user could create an alias with the given prefix and suffix"""
|
"""verify if user could create an alias with the given prefix and suffix"""
|
||||||
if not alias_prefix or not alias_suffix: # should be caught on frontend
|
if not alias_prefix or not alias_suffix: # should be caught on frontend
|
||||||
return False
|
return False
|
||||||
@ -56,7 +57,7 @@ def verify_prefix_suffix(user: User, alias_prefix, alias_suffix) -> bool:
|
|||||||
alias_domain_prefix, alias_domain = alias_suffix.split("@", 1)
|
alias_domain_prefix, alias_domain = alias_suffix.split("@", 1)
|
||||||
|
|
||||||
# alias_domain must be either one of user custom domains or built-in domains
|
# alias_domain must be either one of user custom domains or built-in domains
|
||||||
if alias_domain not in user.available_alias_domains():
|
if alias_domain not in user.available_alias_domains(alias_options=alias_options):
|
||||||
LOG.e("wrong alias suffix %s, user %s", alias_suffix, user)
|
LOG.e("wrong alias suffix %s, user %s", alias_suffix, user)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -64,7 +65,7 @@ def verify_prefix_suffix(user: User, alias_prefix, alias_suffix) -> bool:
|
|||||||
# 1) alias_suffix must start with "." and
|
# 1) alias_suffix must start with "." and
|
||||||
# 2) alias_domain_prefix must come from the word list
|
# 2) alias_domain_prefix must come from the word list
|
||||||
if (
|
if (
|
||||||
alias_domain in user.available_sl_domains()
|
alias_domain in user.available_sl_domains(alias_options=alias_options)
|
||||||
and alias_domain not in user_custom_domains
|
and alias_domain not in user_custom_domains
|
||||||
# when DISABLE_ALIAS_SUFFIX is true, alias_domain_prefix is empty
|
# when DISABLE_ALIAS_SUFFIX is true, alias_domain_prefix is empty
|
||||||
and not config.DISABLE_ALIAS_SUFFIX
|
and not config.DISABLE_ALIAS_SUFFIX
|
||||||
@ -80,14 +81,18 @@ def verify_prefix_suffix(user: User, alias_prefix, alias_suffix) -> bool:
|
|||||||
LOG.e("wrong alias suffix %s, user %s", alias_suffix, user)
|
LOG.e("wrong alias suffix %s, user %s", alias_suffix, user)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if alias_domain not in user.available_sl_domains():
|
if alias_domain not in user.available_sl_domains(
|
||||||
|
alias_options=alias_options
|
||||||
|
):
|
||||||
LOG.e("wrong alias suffix %s, user %s", alias_suffix, user)
|
LOG.e("wrong alias suffix %s, user %s", alias_suffix, user)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_alias_suffixes(user: User) -> [AliasSuffix]:
|
def get_alias_suffixes(
|
||||||
|
user: User, alias_options: Optional[AliasOptions] = None
|
||||||
|
) -> [AliasSuffix]:
|
||||||
"""
|
"""
|
||||||
Similar to as get_available_suffixes() but also return custom domain that doesn't have MX set up.
|
Similar to as get_available_suffixes() but also return custom domain that doesn't have MX set up.
|
||||||
"""
|
"""
|
||||||
@ -99,7 +104,12 @@ def get_alias_suffixes(user: User) -> [AliasSuffix]:
|
|||||||
# for each user domain, generate both the domain and a random suffix version
|
# for each user domain, generate both the domain and a random suffix version
|
||||||
for custom_domain in user_custom_domains:
|
for custom_domain in user_custom_domains:
|
||||||
if custom_domain.random_prefix_generation:
|
if custom_domain.random_prefix_generation:
|
||||||
suffix = "." + user.get_random_alias_suffix() + "@" + custom_domain.domain
|
suffix = (
|
||||||
|
"."
|
||||||
|
+ user.get_random_alias_suffix(custom_domain)
|
||||||
|
+ "@"
|
||||||
|
+ custom_domain.domain
|
||||||
|
)
|
||||||
alias_suffix = AliasSuffix(
|
alias_suffix = AliasSuffix(
|
||||||
is_custom=True,
|
is_custom=True,
|
||||||
suffix=suffix,
|
suffix=suffix,
|
||||||
@ -134,7 +144,7 @@ def get_alias_suffixes(user: User) -> [AliasSuffix]:
|
|||||||
alias_suffixes.append(alias_suffix)
|
alias_suffixes.append(alias_suffix)
|
||||||
|
|
||||||
# then SimpleLogin domain
|
# then SimpleLogin domain
|
||||||
for sl_domain in user.get_sl_domains():
|
for sl_domain in user.get_sl_domains(alias_options=alias_options):
|
||||||
suffix = (
|
suffix = (
|
||||||
(
|
(
|
||||||
""
|
""
|
||||||
|
@ -357,7 +357,7 @@ def auth_payload(user, device) -> dict:
|
|||||||
|
|
||||||
|
|
||||||
@api_bp.route("/auth/forgot_password", methods=["POST"])
|
@api_bp.route("/auth/forgot_password", methods=["POST"])
|
||||||
@limiter.limit("10/minute")
|
@limiter.limit("2/minute")
|
||||||
def forgot_password():
|
def forgot_password():
|
||||||
"""
|
"""
|
||||||
User forgot password
|
User forgot password
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
import dataclasses
|
||||||
import enum
|
import enum
|
||||||
import hashlib
|
import hashlib
|
||||||
import hmac
|
import hmac
|
||||||
@ -18,7 +19,7 @@ from flanker.addresslib import address
|
|||||||
from flask import url_for
|
from flask import url_for
|
||||||
from flask_login import UserMixin
|
from flask_login import UserMixin
|
||||||
from jinja2 import FileSystemLoader, Environment
|
from jinja2 import FileSystemLoader, Environment
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm, or_
|
||||||
from sqlalchemy import text, desc, CheckConstraint, Index, Column
|
from sqlalchemy import text, desc, CheckConstraint, Index, Column
|
||||||
from sqlalchemy.dialects.postgresql import TSVECTOR
|
from sqlalchemy.dialects.postgresql import TSVECTOR
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
@ -273,6 +274,12 @@ class IntEnumType(sa.types.TypeDecorator):
|
|||||||
return self._enum_type(enum_value)
|
return self._enum_type(enum_value)
|
||||||
|
|
||||||
|
|
||||||
|
@dataclasses.dataclass
|
||||||
|
class AliasOptions:
|
||||||
|
show_sl_domains: bool = True
|
||||||
|
show_partner_domains: Optional[Partner] = None
|
||||||
|
|
||||||
|
|
||||||
class Hibp(Base, ModelMixin):
|
class Hibp(Base, ModelMixin):
|
||||||
__tablename__ = "hibp"
|
__tablename__ = "hibp"
|
||||||
name = sa.Column(sa.String(), nullable=False, unique=True, index=True)
|
name = sa.Column(sa.String(), nullable=False, unique=True, index=True)
|
||||||
@ -867,14 +874,16 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
|
|||||||
def custom_domains(self):
|
def custom_domains(self):
|
||||||
return CustomDomain.filter_by(user_id=self.id, verified=True).all()
|
return CustomDomain.filter_by(user_id=self.id, verified=True).all()
|
||||||
|
|
||||||
def available_domains_for_random_alias(self) -> List[Tuple[bool, str]]:
|
def available_domains_for_random_alias(
|
||||||
|
self, alias_options: Optional[AliasOptions] = None
|
||||||
|
) -> List[Tuple[bool, str]]:
|
||||||
"""Return available domains for user to create random aliases
|
"""Return available domains for user to create random aliases
|
||||||
Each result record contains:
|
Each result record contains:
|
||||||
- whether the domain belongs to SimpleLogin
|
- whether the domain belongs to SimpleLogin
|
||||||
- the domain
|
- the domain
|
||||||
"""
|
"""
|
||||||
res = []
|
res = []
|
||||||
for domain in self.available_sl_domains():
|
for domain in self.available_sl_domains(alias_options=alias_options):
|
||||||
res.append((True, domain))
|
res.append((True, domain))
|
||||||
|
|
||||||
for custom_domain in self.verified_custom_domains():
|
for custom_domain in self.verified_custom_domains():
|
||||||
@ -959,30 +968,55 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
|
|||||||
|
|
||||||
return None, "", False
|
return None, "", False
|
||||||
|
|
||||||
def available_sl_domains(self) -> [str]:
|
def available_sl_domains(
|
||||||
|
self, alias_options: Optional[AliasOptions] = None
|
||||||
|
) -> [str]:
|
||||||
"""
|
"""
|
||||||
Return all SimpleLogin domains that user can use when creating a new alias, including:
|
Return all SimpleLogin domains that user can use when creating a new alias, including:
|
||||||
- SimpleLogin public domains, available for all users (ALIAS_DOMAIN)
|
- SimpleLogin public domains, available for all users (ALIAS_DOMAIN)
|
||||||
- SimpleLogin premium domains, only available for Premium accounts (PREMIUM_ALIAS_DOMAIN)
|
- SimpleLogin premium domains, only available for Premium accounts (PREMIUM_ALIAS_DOMAIN)
|
||||||
"""
|
"""
|
||||||
return [sl_domain.domain for sl_domain in self.get_sl_domains()]
|
return [
|
||||||
|
sl_domain.domain
|
||||||
|
for sl_domain in self.get_sl_domains(alias_options=alias_options)
|
||||||
|
]
|
||||||
|
|
||||||
def get_sl_domains(self) -> List["SLDomain"]:
|
def get_sl_domains(
|
||||||
query = SLDomain.filter_by(hidden=False).order_by(SLDomain.order)
|
self, alias_options: Optional[AliasOptions] = None
|
||||||
|
) -> list["SLDomain"]:
|
||||||
if self.is_premium():
|
if alias_options is None:
|
||||||
return query.all()
|
alias_options = AliasOptions()
|
||||||
|
conditions = [SLDomain.hidden == False] # noqa: E712
|
||||||
|
if not self.is_premium():
|
||||||
|
conditions.append(SLDomain.premium_only == False) # noqa: E712
|
||||||
|
partner_domain_cond = [] # noqa:E711
|
||||||
|
if alias_options.show_partner_domains is not None:
|
||||||
|
partner_user = PartnerUser.filter_by(
|
||||||
|
user_id=self.id, partner_id=alias_options.show_partner_domains.id
|
||||||
|
).first()
|
||||||
|
if partner_user is not None:
|
||||||
|
partner_domain_cond.append(
|
||||||
|
SLDomain.partner_id == partner_user.partner_id
|
||||||
|
)
|
||||||
|
if alias_options.show_sl_domains:
|
||||||
|
partner_domain_cond.append(SLDomain.partner_id == None) # noqa:E711
|
||||||
|
if len(partner_domain_cond) == 1:
|
||||||
|
conditions.append(partner_domain_cond[0])
|
||||||
else:
|
else:
|
||||||
return query.filter_by(premium_only=False).all()
|
conditions.append(or_(*partner_domain_cond))
|
||||||
|
query = Session.query(SLDomain).filter(*conditions).order_by(SLDomain.order)
|
||||||
|
return query.all()
|
||||||
|
|
||||||
def available_alias_domains(self) -> [str]:
|
def available_alias_domains(
|
||||||
|
self, alias_options: Optional[AliasOptions] = None
|
||||||
|
) -> [str]:
|
||||||
"""return all domains that user can use when creating a new alias, including:
|
"""return all domains that user can use when creating a new alias, including:
|
||||||
- SimpleLogin public domains, available for all users (ALIAS_DOMAIN)
|
- SimpleLogin public domains, available for all users (ALIAS_DOMAIN)
|
||||||
- SimpleLogin premium domains, only available for Premium accounts (PREMIUM_ALIAS_DOMAIN)
|
- SimpleLogin premium domains, only available for Premium accounts (PREMIUM_ALIAS_DOMAIN)
|
||||||
- Verified custom domains
|
- Verified custom domains
|
||||||
|
|
||||||
"""
|
"""
|
||||||
domains = self.available_sl_domains()
|
domains = self.available_sl_domains(alias_options=alias_options)
|
||||||
|
|
||||||
for custom_domain in self.verified_custom_domains():
|
for custom_domain in self.verified_custom_domains():
|
||||||
domains.append(custom_domain.domain)
|
domains.append(custom_domain.domain)
|
||||||
@ -1000,16 +1034,21 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
|
|||||||
> 0
|
> 0
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_random_alias_suffix(self):
|
def get_random_alias_suffix(self, custom_domain: Optional["CustomDomain"] = None):
|
||||||
"""Get random suffix for an alias based on user's preference.
|
"""Get random suffix for an alias based on user's preference.
|
||||||
|
|
||||||
|
Use a shorter suffix in case of custom domain
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: the random suffix generated
|
str: the random suffix generated
|
||||||
"""
|
"""
|
||||||
if self.random_alias_suffix == AliasSuffixEnum.random_string.value:
|
if self.random_alias_suffix == AliasSuffixEnum.random_string.value:
|
||||||
return random_string(config.ALIAS_RANDOM_SUFFIX_LENGTH, include_digits=True)
|
return random_string(config.ALIAS_RANDOM_SUFFIX_LENGTH, include_digits=True)
|
||||||
return random_words(1, 3)
|
|
||||||
|
if custom_domain is None:
|
||||||
|
return random_words(1, 3)
|
||||||
|
|
||||||
|
return random_words(1)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"<User {self.id} {self.name} {self.email}>"
|
return f"<User {self.id} {self.name} {self.email}>"
|
||||||
@ -2763,6 +2802,31 @@ class Notification(Base, ModelMixin):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class Partner(Base, ModelMixin):
|
||||||
|
__tablename__ = "partner"
|
||||||
|
|
||||||
|
name = sa.Column(sa.String(128), unique=True, nullable=False)
|
||||||
|
contact_email = sa.Column(sa.String(128), unique=True, nullable=False)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def find_by_token(token: str) -> Optional[Partner]:
|
||||||
|
hmaced = PartnerApiToken.hmac_token(token)
|
||||||
|
res = (
|
||||||
|
Session.query(Partner, PartnerApiToken)
|
||||||
|
.filter(
|
||||||
|
and_(
|
||||||
|
PartnerApiToken.token == hmaced,
|
||||||
|
Partner.id == PartnerApiToken.partner_id,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.first()
|
||||||
|
)
|
||||||
|
if res:
|
||||||
|
partner, partner_api_token = res
|
||||||
|
return partner
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
class SLDomain(Base, ModelMixin):
|
class SLDomain(Base, ModelMixin):
|
||||||
"""SimpleLogin domains"""
|
"""SimpleLogin domains"""
|
||||||
|
|
||||||
@ -2780,6 +2844,13 @@ class SLDomain(Base, ModelMixin):
|
|||||||
sa.Boolean, nullable=False, default=False, server_default="0"
|
sa.Boolean, nullable=False, default=False, server_default="0"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
partner_id = sa.Column(
|
||||||
|
sa.ForeignKey(Partner.id, ondelete="cascade"),
|
||||||
|
nullable=True,
|
||||||
|
default=None,
|
||||||
|
sever_default="NULL",
|
||||||
|
)
|
||||||
|
|
||||||
# if enabled, do not show this domain when user creates a custom alias
|
# if enabled, do not show this domain when user creates a custom alias
|
||||||
hidden = sa.Column(sa.Boolean, nullable=False, default=False, server_default="0")
|
hidden = sa.Column(sa.Boolean, nullable=False, default=False, server_default="0")
|
||||||
|
|
||||||
@ -3226,31 +3297,6 @@ class ProviderComplaint(Base, ModelMixin):
|
|||||||
refused_email = orm.relationship(RefusedEmail, foreign_keys=[refused_email_id])
|
refused_email = orm.relationship(RefusedEmail, foreign_keys=[refused_email_id])
|
||||||
|
|
||||||
|
|
||||||
class Partner(Base, ModelMixin):
|
|
||||||
__tablename__ = "partner"
|
|
||||||
|
|
||||||
name = sa.Column(sa.String(128), unique=True, nullable=False)
|
|
||||||
contact_email = sa.Column(sa.String(128), unique=True, nullable=False)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def find_by_token(token: str) -> Optional[Partner]:
|
|
||||||
hmaced = PartnerApiToken.hmac_token(token)
|
|
||||||
res = (
|
|
||||||
Session.query(Partner, PartnerApiToken)
|
|
||||||
.filter(
|
|
||||||
and_(
|
|
||||||
PartnerApiToken.token == hmaced,
|
|
||||||
Partner.id == PartnerApiToken.partner_id,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.first()
|
|
||||||
)
|
|
||||||
if res:
|
|
||||||
partner, partner_api_token = res
|
|
||||||
return partner
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
class PartnerApiToken(Base, ModelMixin):
|
class PartnerApiToken(Base, ModelMixin):
|
||||||
__tablename__ = "partner_api_token"
|
__tablename__ = "partner_api_token"
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ def random_words(words: int = 2, numbers: int = 0):
|
|||||||
fields = [secrets.choice(_words) for i in range(words)]
|
fields = [secrets.choice(_words) for i in range(words)]
|
||||||
|
|
||||||
if numbers > 0:
|
if numbers > 0:
|
||||||
fields.append("".join([str(random.randint(0, 9)) for i in range(numbers)]))
|
digits = "".join([str(random.randint(0, 9)) for i in range(numbers)])
|
||||||
return "".join(fields)
|
return "_".join(fields) + digits
|
||||||
else:
|
else:
|
||||||
return "_".join(fields)
|
return "_".join(fields)
|
||||||
|
|
||||||
|
31
app/migrations/versions/2023_040318_5f4a5625da66_.py
Normal file
31
app/migrations/versions/2023_040318_5f4a5625da66_.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: 5f4a5625da66
|
||||||
|
Revises: 2c2093c82bc0
|
||||||
|
Create Date: 2023-04-03 18:30:46.488231
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '5f4a5625da66'
|
||||||
|
down_revision = '2c2093c82bc0'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('public_domain', sa.Column('partner_id', sa.Integer(), nullable=True, sever_default='NULL'))
|
||||||
|
op.create_foreign_key(None, 'public_domain', 'partner', ['partner_id'], ['id'], ondelete='cascade')
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_constraint(None, 'public_domain', type_='foreignkey')
|
||||||
|
op.drop_column('public_domain', 'partner_id')
|
||||||
|
# ### end Alembic commands ###
|
4400
app/poetry.lock
generated
4400
app/poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -110,7 +110,7 @@ twilio = "^7.3.2"
|
|||||||
Deprecated = "^1.2.13"
|
Deprecated = "^1.2.13"
|
||||||
cryptography = "37.0.1"
|
cryptography = "37.0.1"
|
||||||
SQLAlchemy = "1.3.24"
|
SQLAlchemy = "1.3.24"
|
||||||
redis = "^4.3.4"
|
redis = "^4.5.3"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
pytest = "^7.0.0"
|
pytest = "^7.0.0"
|
||||||
|
@ -8,7 +8,8 @@ function enableDragDropForPGPKeys(inputID) {
|
|||||||
let files = event.dataTransfer.files;
|
let files = event.dataTransfer.files;
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
let file = files[i];
|
let file = files[i];
|
||||||
if(file.type !== 'text/plain'){
|
const isValidPgpFile = file.type === 'text/plain' || file.name.endsWith('.asc') || file.name.endsWith('.pub') || file.name.endsWith('.pgp') || file.name.endsWith('.key');
|
||||||
|
if (!isValidPgpFile) {
|
||||||
toastr.warning(`File ${file.name} is not a public key file`);
|
toastr.warning(`File ${file.name} is not a public key file`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -16,6 +17,7 @@ function enableDragDropForPGPKeys(inputID) {
|
|||||||
reader.onloadend = onFileLoaded;
|
reader.onloadend = onFileLoaded;
|
||||||
reader.readAsBinaryString(file);
|
reader.readAsBinaryString(file);
|
||||||
}
|
}
|
||||||
|
dropArea.classList.remove("dashed-outline");
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFileLoaded(event) {
|
function onFileLoaded(event) {
|
||||||
@ -24,5 +26,20 @@ function enableDragDropForPGPKeys(inputID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const dropArea = $(inputID).get(0);
|
const dropArea = $(inputID).get(0);
|
||||||
|
dropArea.addEventListener("dragenter", (event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
dropArea.classList.add("dashed-outline");
|
||||||
|
});
|
||||||
|
dropArea.addEventListener("dragover", (event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
dropArea.classList.add("dashed-outline");
|
||||||
|
});
|
||||||
|
dropArea.addEventListener("dragleave", (event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
dropArea.classList.remove("dashed-outline");
|
||||||
|
});
|
||||||
dropArea.addEventListener("drop", drop, false);
|
dropArea.addEventListener("drop", drop, false);
|
||||||
}
|
}
|
||||||
|
5
app/static/style.css
vendored
5
app/static/style.css
vendored
@ -217,4 +217,9 @@ textarea.parsley-error {
|
|||||||
|
|
||||||
.italic {
|
.italic {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* dashed outline to indicate droppable area */
|
||||||
|
.dashed-outline {
|
||||||
|
outline: 4px dashed gray;
|
||||||
}
|
}
|
@ -43,7 +43,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label">PGP Public Key</label>
|
<label class="form-label">PGP Public Key</label>
|
||||||
<textarea name="pgp" {% if not current_user.is_premium() %} disabled {% endif %} class="form-control" rows=10 id="pgp-public-key" placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----">{{ contact.pgp_public_key or "" }}</textarea>
|
<textarea name="pgp" {% if not current_user.is_premium() %} disabled {% endif %} class="form-control" rows=10 id="pgp-public-key" placeholder="(Drag and drop or paste your pgp public key here) -----BEGIN PGP PUBLIC KEY BLOCK-----">{{ contact.pgp_public_key or "" }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-primary" name="action" {% if not current_user.is_premium() %}
|
<button class="btn btn-primary" name="action" {% if not current_user.is_premium() %}
|
||||||
disabled {% endif %} value="save">
|
disabled {% endif %} value="save">
|
||||||
|
@ -266,7 +266,9 @@
|
|||||||
<i>dkim._domainkey.{{ custom_domain.domain }}</i> as domain value instead.
|
<i>dkim._domainkey.{{ custom_domain.domain }}</i> as domain value instead.
|
||||||
<br />
|
<br />
|
||||||
If you are using a subdomain, e.g. <i>subdomain.domain.com</i>,
|
If you are using a subdomain, e.g. <i>subdomain.domain.com</i>,
|
||||||
you need to use <i>dkim._domainkey.subdomain</i> as domain value instead.
|
you need to use <i>dkim._domainkey.subdomain</i> as the domain instead.
|
||||||
|
<br />
|
||||||
|
That means, if your domain is <i>mail.domain.com</i> you should enter <i>dkim._domainkey.mail.domain.com</i> as the Domain.
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
{{ csrf_form.csrf_token }}
|
{{ csrf_form.csrf_token }}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label">PGP Public Key</label>
|
<label class="form-label">PGP Public Key</label>
|
||||||
<textarea name="pgp" {% if not current_user.is_premium() %} disabled {% endif %} class="form-control" rows=10 id="pgp-public-key" placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----">{{ mailbox.pgp_public_key or "" }}</textarea>
|
<textarea name="pgp" {% if not current_user.is_premium() %} disabled {% endif %} class="form-control" rows=10 id="pgp-public-key" placeholder="(Drag and drop or paste your pgp public key here) -----BEGIN PGP PUBLIC KEY BLOCK-----">{{ mailbox.pgp_public_key or "" }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="form-name" value="pgp">
|
<input type="hidden" name="form-name" value="pgp">
|
||||||
<button class="btn btn-primary" name="action" {% if not current_user.is_premium() %}
|
<button class="btn btn-primary" name="action" {% if not current_user.is_premium() %}
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
<script>
|
<script>
|
||||||
if (window.Paddle === undefined) {
|
if (window.Paddle === undefined) {
|
||||||
console.log("cannot load Paddle from CDN");
|
console.log("cannot load Paddle from CDN");
|
||||||
document.write('<script src="/static/vendor/paddle.js"><\/script>')
|
// split string to avoid djlint incorrectly formatting the file
|
||||||
|
document.write('<' + 'script src="/static/vendor/paddle.js"><\/script' + '>');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
html.mvc__a.mvc__lot.mvc__of.mvc__classes.mvc__to.mvc__increase.mvc__the.mvc__odds.mvc__of.mvc__winning.mvc__specificity, html.mvc__a.mvc__lot.mvc__of.mvc__classes.mvc__to.mvc__increase.mvc__the.mvc__odds.mvc__of.mvc__winning.mvc__specificity > body {
|
html.mvc__a.mvc__lot.mvc__of.mvc__classes.mvc__to.mvc__increase.mvc__the.mvc__odds.mvc__of.mvc__winning.mvc__specificity, html.mvc__a.mvc__lot.mvc__of.mvc__classes.mvc__to.mvc__increase.mvc__the.mvc__odds.mvc__of.mvc__winning.mvc__specificity > body {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
@ -25,191 +26,737 @@
|
|||||||
[data-toggle="collapse"]:not(.collapsed) .if-collapsed {
|
[data-toggle="collapse"]:not(.collapsed) .if-collapsed {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.btn-no-pointer {
|
||||||
|
pointer-events: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-yearly__badge {
|
||||||
|
top: -8px !important;
|
||||||
|
left: 52px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-2 {
|
||||||
|
border-width: 2px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-start {
|
||||||
|
text-align: start !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block announcement %}
|
{% block announcement %}
|
||||||
|
|
||||||
{# TODO: to remove#}
|
{# TODO: to remove#}
|
||||||
{# <div class="alert alert-danger text-center mb-0" role="alert">#}
|
{# <div class="alert alert-danger text-center mb-0" role="alert">#}
|
||||||
{# Our payment provider Paddle is experiencing#}
|
{# Our payment provider Paddle is experiencing#}
|
||||||
{# <a href="https://paddle.status.io" target="_blank">server issue <i class="fe fe-external-link"></i></a>#}
|
{# <a href="https://paddle.status.io" target="_blank">server issue <i class="fe fe-external-link"></i></a>#}
|
||||||
{# that can make our checkout page unusable. <br />#}
|
{# that can make our checkout page unusable. <br />#}
|
||||||
{# Please retry later and sorry for this issue!#}
|
{# Please retry later and sorry for this issue!#}
|
||||||
{# </div>#}
|
{# </div>#}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block default_content %}
|
{% block default_content %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="pb-8">
|
||||||
<div class="col-sm-6 col-lg-6">
|
<div class="text-center mx-md-auto mb-8 mt-6">
|
||||||
<div class="card">
|
<h1>Upgrade to unlock premium features</h1>
|
||||||
<div class="card-body text-center">
|
</div>
|
||||||
<div class="h3">Premium</div>
|
{% if manual_sub %}
|
||||||
<ul class="list-unstyled leading-loose mb-3">
|
|
||||||
<li>
|
|
||||||
<i class="fe fe-check text-success mr-2" aria-hidden="true"></i>
|
|
||||||
Unlimited aliases
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<i class="fe fe-check text-success mr-2" aria-hidden="true"></i>
|
|
||||||
Unlimited custom domains
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<i class="fe fe-check text-success mr-2" aria-hidden="true"></i>
|
|
||||||
Catch-all (or wildcard) aliases
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<i class="fe fe-check text-success mr-2" aria-hidden="true"></i>
|
|
||||||
Up to 50 directories (or usernames)
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<i class="fe fe-check text-success mr-2" aria-hidden="true"></i>
|
|
||||||
Unlimited mailboxes
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<i class="fe fe-check text-success mr-2" aria-hidden="true"></i>
|
|
||||||
PGP Encryption
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="small-text">
|
|
||||||
More information on our
|
|
||||||
<a href="https://simplelogin.io/pricing" target="_blank" rel="noopener noreferrer">
|
|
||||||
Pricing
|
|
||||||
Page <i class="fe fe-external-link"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-6 col-lg-6">
|
|
||||||
{% if manual_sub %}
|
|
||||||
|
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info mt-0 mb-6">
|
||||||
You currently have a subscription until <b>{{ manual_sub.end_at.format("YYYY-MM-DD") }}</b>
|
You currently have a subscription until <b>{{ manual_sub.end_at.format("YYYY-MM-DD") }}</b>
|
||||||
({{ (manual_sub.end_at - now).days }} days left).
|
({{ (manual_sub.end_at - now).days }} days left).
|
||||||
<br />
|
<br />
|
||||||
Please note that the time left will <b>not</b> be taken into account in a new subscription.
|
Please note that the time left will <b>not</b> be taken into account in a new subscription.
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if proton_upgrade %}
|
{% set sub = current_user.get_paddle_subscription() %}
|
||||||
|
{% if sub and sub.cancelled %}
|
||||||
|
|
||||||
<div id="proton-upgrade">
|
<div class="alert alert-primary mt-0 mb-6" role="alert">
|
||||||
<h4>Proton Unlimited, Business and Visionary plans include SimpleLogin premium and more!</h4>
|
You have an active subscription until {{ sub.next_bill_date.strftime("%Y-%m-%d") }}.
|
||||||
<a class="btn btn-primary" role="button" href="https://account.proton.me/u/0/mail/upgrade">
|
<br />
|
||||||
<b>Upgrade your Proton account</b>
|
Please note that if you re-subscribe now, this will be a completely
|
||||||
</a>
|
new subscription and
|
||||||
<p class="mt-2 small">
|
your payment method will be charged <b>immediately</b>.
|
||||||
Starts at $9.99/month (billed yearly), starting with 500GB of storage, VPN, encrypted
|
</div>
|
||||||
calendar & file storage and more.
|
{% endif %}
|
||||||
</p>
|
{% if coinbase_sub %}
|
||||||
<div class="middle-line my-5 h4">OR</div>
|
|
||||||
<div id="normal-upgrade-button">
|
|
||||||
<a class="btn btn-secondary collapsed" data-toggle="collapse" href="#normal-upgrade" role="button">
|
|
||||||
Upgrade your SimpleLogin account
|
|
||||||
<span class="if-collapsed">
|
|
||||||
<i class="fe fe-chevron-down"></i>
|
|
||||||
</span>
|
|
||||||
<span class="if-not-collapsed">
|
|
||||||
<i class="fe fe-chevron-up"></i>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
<p class="mt-2 small">Starts at $2.5/month (billed yearly)</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div id="normal-upgrade" class="{% if proton_upgrade %} collapse{% endif %}">
|
|
||||||
<div class="display-6 my-3">
|
|
||||||
🔐 Secure payments by
|
|
||||||
<a href="https://paddle.com" target="_blank" rel="noopener noreferrer">
|
|
||||||
Paddle <i class="fe fe-external-link"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% set sub = current_user.get_paddle_subscription() %}
|
|
||||||
{% if sub and sub.cancelled %}
|
|
||||||
|
|
||||||
<div class="alert alert-primary" role="alert">
|
<div class="alert alert-info mt-0 mb-6">
|
||||||
You have an active subscription until {{ sub.next_bill_date.strftime("%Y-%m-%d") }}.
|
You currently have a Coinbase subscription until <b>{{ coinbase_sub.end_at.format("YYYY-MM-DD") }}</b>
|
||||||
<br />
|
({{ (coinbase_sub.end_at - now).days }} days left).
|
||||||
Please note that if you re-subscribe now, this will be a completely
|
<br />
|
||||||
new subscription and
|
Please note that the time left will <b>not</b> be taken into account in a new Paddle subscription.
|
||||||
your payment method will be charged <b>immediately</b>.
|
</div>
|
||||||
</div>
|
{% endif %}
|
||||||
{% endif %}
|
<div class="nav btn-group mb-4 justify-content-center position-relative flex-nowrap d-flex"
|
||||||
{% if coinbase_sub %}
|
id="pills-tab"
|
||||||
|
role="tablist">
|
||||||
|
<a class="btn btn-outline-primary flex-grow-0 px-8 py-2"
|
||||||
|
id="monthly-plan-tab"
|
||||||
|
data-toggle="tab"
|
||||||
|
href="#monthly-plan"
|
||||||
|
role="tab"
|
||||||
|
aria-controls="monthly-plan"
|
||||||
|
aria-selected="false">Monthly</a>
|
||||||
|
<a class="btn btn-outline-primary flex-grow-0 px-8 py-2 position-relative active"
|
||||||
|
id="yearly-plan-tab"
|
||||||
|
data-toggle="tab"
|
||||||
|
href="#yearly-plan"
|
||||||
|
role="tab"
|
||||||
|
aria-controls="yearly-plan"
|
||||||
|
aria-selected="true">Yearly<span class="badge badge-success position-absolute tab-yearly__badge"
|
||||||
|
style="font-size: 12px">Save $18</span></a>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content mb-8">
|
||||||
|
<!-- monthly tab content -->
|
||||||
|
<div class="tab-pane"
|
||||||
|
id="monthly-plan"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="monthly-plan-tab">
|
||||||
|
<div class="row row-cards">
|
||||||
|
<!-- monthly free plan -->
|
||||||
|
<div class="{{ 'col-md-6 col-lg-4' if proton_upgrade else 'col-md-6' }}">
|
||||||
|
<div class="card card-md flex-grow-1">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="h3">Free</div>
|
||||||
|
<div class="h3 my-3">$0</div>
|
||||||
|
<div class="text-center mt-4 mb-6">
|
||||||
|
{% set sub = current_user.get_paddle_subscription() %}
|
||||||
|
<button class="{{ 'invisible' if sub or manual_sub or coinbase_sub }} btn btn-lg btn-outline-secondary w-100 btn-no-pointer"
|
||||||
|
aria-disabled="true"
|
||||||
|
disabled>
|
||||||
|
Current plan
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
10 aliases
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
1 mailbox
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END monthly free plan -->
|
||||||
|
<!-- monthly premium plan -->
|
||||||
|
<div class="{{ 'col-md-6 col-lg-4' if proton_upgrade else 'col-md-6' }}">
|
||||||
|
<div class="card card-md flex-grow-1 border-primary border-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="h3">SimpleLogin Premium</div>
|
||||||
|
<div class="h3 my-3">$4 / month</div>
|
||||||
|
<div class="text-center mt-4 mb-6">
|
||||||
|
<button class="btn btn-primary btn-lg w-100"
|
||||||
|
onclick="upgradePaddle({{ PADDLE_MONTHLY_PRODUCT_ID }})">
|
||||||
|
Upgrade to Premium
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Unlimited aliases
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Unlimited mailboxes
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Custom domains: bring your own domain to create aliases like contact@your-domain.com
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Catch-all (or wildcard) domain
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Initiate a new email from your alias
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
5 subdomains
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
50 directories
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
PGP Encryption
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END monthly premium plan -->
|
||||||
|
<!-- monthly Proton plan -->
|
||||||
|
{% if proton_upgrade %}
|
||||||
|
|
||||||
<div class="alert alert-info">
|
<div class="col-md-6 col-lg-4">
|
||||||
You currently have a Coinbase subscription until <b>{{ coinbase_sub.end_at.format("YYYY-MM-DD") }}</b>
|
<div class="card card-md flex-grow-1">
|
||||||
({{ (coinbase_sub.end_at - now).days }} days left).
|
<div class="card-body">
|
||||||
<br />
|
<div class="text-center">
|
||||||
Please note that the time left will <b>not</b> be taken into account in a new Paddle subscription.
|
<div class="h3">Proton plan</div>
|
||||||
</div>
|
<div class="h3 my-3">Starts at $11.99 / month</div>
|
||||||
{% endif %}
|
<div class="text-center mt-4 mb-6">
|
||||||
<div class="mb-3">
|
<a class="btn btn-lg btn-outline-primary w-100"
|
||||||
Paddle supports bank cards
|
role="button"
|
||||||
(Mastercard, Visa, American Express, etc) and PayPal.
|
href="https://account.proton.me/u/0/mail/upgrade"
|
||||||
</div>
|
target="_blank">Upgrade your Proton account</a>
|
||||||
<button class="btn btn-primary" onclick="upgrade({{ PADDLE_YEARLY_PRODUCT_ID }})">
|
</div>
|
||||||
Yearly billing
|
</div>
|
||||||
<span class="badge badge-success">Save $18</span>
|
<p>Proton Unlimited / Business plans include:</p>
|
||||||
<br />
|
<ul class="list-unstyled">
|
||||||
<span style="font-size: 18px">$30/year</span>
|
<li class="d-flex">
|
||||||
</button>
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
<button class="btn btn-secondary" onclick="upgrade({{ PADDLE_MONTHLY_PRODUCT_ID }})">
|
SimpleLogin Premium
|
||||||
Monthly billing
|
</li>
|
||||||
<br />
|
<li class="d-flex">
|
||||||
<b>
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
$4/month
|
500 GB storage
|
||||||
</b>
|
</li>
|
||||||
</button>
|
<li class="d-flex">
|
||||||
<hr />
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
<i class="fa fa-bitcoin"></i>
|
15 email addresses
|
||||||
Payment via
|
</li>
|
||||||
<a href="https://commerce.coinbase.com/?lang=en" target="_blank" rel="noopener noreferrer">
|
<li class="d-flex">
|
||||||
Coinbase Commerce<i class="fe fe-external-link"></i>
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
</a>
|
Unlimited folders, labels, and filters
|
||||||
<br />
|
</li>
|
||||||
Currently Bitcoin, Bitcoin Cash, Dai, Ethereum, Litecoin and USD Coin are supported.
|
<li class="d-flex">
|
||||||
<br />
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
<a class="btn btn-outline-primary" href="{{ url_for('dashboard.coinbase_checkout_route') }}" target="_blank" rel="noopener noreferrer">
|
Unlimited messages per day
|
||||||
Yearly billing - Crypto
|
</li>
|
||||||
<br />
|
<li class="d-flex">
|
||||||
$30/year
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
<i class="fe fe-external-link"></i>
|
15 email addresses
|
||||||
</a>
|
</li>
|
||||||
<hr />
|
<li class="d-flex">
|
||||||
If you have bought a coupon, please go to the
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
<a href="{{ url_for('dashboard.coupon_route') }}">coupon page</a>
|
20 Calendars
|
||||||
to apply the coupon code.
|
</li>
|
||||||
</div>
|
<li class="d-flex">
|
||||||
</div>
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
</div>
|
10 high-speed VPN connections
|
||||||
<script type="text/javascript">
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
3 custom email domains
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<!-- END monthly Proton plan -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END monthly tab content -->
|
||||||
|
<!-- yearly tab content -->
|
||||||
|
<div class="tab-pane show active"
|
||||||
|
id="yearly-plan"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="yearly-plan-tab">
|
||||||
|
<div class="row row-cards">
|
||||||
|
<!-- yearly free plan (identical to monthly) -->
|
||||||
|
<div class="{{ 'col-md-6 col-lg-4' if proton_upgrade else 'col-md-6' }}">
|
||||||
|
<div class="card card-md flex-grow-1">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="h3">Free</div>
|
||||||
|
<div class="h3 my-3">$0</div>
|
||||||
|
<div class="text-center mt-4 mb-6">
|
||||||
|
{% set sub = current_user.get_paddle_subscription() %}
|
||||||
|
<button class="{{ 'invisible' if sub or manual_sub or coinbase_sub }} btn btn-lg btn-outline-secondary w-100 btn-no-pointer"
|
||||||
|
aria-disabled="true"
|
||||||
|
disabled>
|
||||||
|
Current plan
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
10 aliases
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
1 mailbox
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END yearly free plan -->
|
||||||
|
<!-- yearly premium plan -->
|
||||||
|
<div class="{{ 'col-md-6 col-lg-4' if proton_upgrade else 'col-md-6' }}">
|
||||||
|
<div class="card card-md flex-grow-1 border-primary border-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="h3">SimpleLogin Premium</div>
|
||||||
|
<div class="h3 my-3">$30 / year</div>
|
||||||
|
<div class="text-center mt-4 mb-6">
|
||||||
|
<button class="btn btn-primary btn-lg w-100"
|
||||||
|
onclick="upgradePaddle({{ PADDLE_YEARLY_PRODUCT_ID }})">
|
||||||
|
Upgrade to Premium
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Unlimited aliases
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Unlimited mailboxes
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Custom domains: bring your own domain to create aliases like contact@your-domain.com
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Catch-all (or wildcard) domain
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Initiate a new email from your alias
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
5 subdomains
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
50 directories
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
PGP Encryption
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END yearly premium plan -->
|
||||||
|
<!-- yearly Proton plan -->
|
||||||
|
{% if proton_upgrade %}
|
||||||
|
|
||||||
|
<div class="col-md-6 col-lg-4">
|
||||||
|
<div class="card card-md flex-grow-1">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="h3">Proton plan</div>
|
||||||
|
<div class="h3 my-3">Starts at $119.88 / year</div>
|
||||||
|
<div class="text-center mt-4 mb-6">
|
||||||
|
<a class="btn btn-lg btn-outline-primary w-100"
|
||||||
|
role="button"
|
||||||
|
href="https://account.proton.me/u/0/mail/upgrade"
|
||||||
|
target="_blank">Upgrade your Proton account</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>Proton Unlimited / Business plans include:</p>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
SimpleLogin Premium
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
500 GB storage
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
15 email addresses/aliases
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Unlimited folders, labels, and filters
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
Unlimited messages per day
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
15 email addresses/aliases
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
20 Calendars
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
10 high-speed VPN connections
|
||||||
|
</li>
|
||||||
|
<li class="d-flex">
|
||||||
|
<i class="fe fe-check text-success mr-2 mt-1" aria-hidden="true"></i>
|
||||||
|
3 custom email domains
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<!-- END yearly Proton plan -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END yearly tab content -->
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<!-- FAQ section -->
|
||||||
|
<div>
|
||||||
|
<h3 class="text-center mb-5 mt-7">Frequently asked questions</h3>
|
||||||
|
<div id="pricing-faq">
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-payment-methods">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-payment-methods"
|
||||||
|
aria-controls="pricing-faq-answer-payment-methods"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">Which payment methods (credit cards, PayPal, cryptocurrencies...) do you support?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-payment-methods"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-payment-methods"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
We use <a href="https://paddle.com" target="_blank" rel="noopener noreferrer">Paddle <i class="fe fe-external-link"></i></a> by default for handling payments via credit cards and PayPal. Paddle currently supports the following payment methods:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
Cards (including Mastercard, Visa, Maestro, American Express, Discover, Diners Club, JCB, UnionPay, and Mada)
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
PayPal
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Apple Pay
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Wire Transfers (ACH/SEPA/BACS)
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
More information can be found on
|
||||||
|
<a href="https://paddle.com/support/which-payment-methods-do-you-support/"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer">
|
||||||
|
Paddle supported payment methods <i class="fe fe-external-link"></i>
|
||||||
|
</a>.
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
<p>
|
||||||
|
Furthermore we also support cryptocurrencies for the yearly plan via
|
||||||
|
<a href="https://commerce.coinbase.com"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer">
|
||||||
|
Coinbase Commerce <i class="fe fe-external-link"></i>
|
||||||
|
</a>, which currently supports Bitcoin, Bitcoin Cash, DAI, ApeCoin, Dogecoin, Ethereum, Litecoin, SHIBA INU, Tether and USD Coin.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
In the future, we are going to support Monero as well. In the meantime, please send us an email at <a href="mailto:support@simplelogin.zendesk.com">support@simplelogin.zendesk.com</a> if you want to use this cryptocurrency.
|
||||||
|
</p>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
<a class="btn btn-outline-primary text-center"
|
||||||
|
href="{{ url_for('dashboard.coinbase_checkout_route') }}"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer">
|
||||||
|
Upgrade to Premium - cryptocurrency
|
||||||
|
<br />
|
||||||
|
$30 / year
|
||||||
|
<i class="fe fe-external-link"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-coupon">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-coupon"
|
||||||
|
aria-controls="pricing-faq-answer-coupon"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">Where can I redeem / buy a coupon?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-coupon"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-coupon"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
To redeem or buy a coupon, please go to the
|
||||||
|
<a href="{{ url_for('dashboard.coupon_route') }}">coupon page</a>. The coupon code can be used by you or given to someone as a gift.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-aliases-sub-stopped">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-aliases-sub-stopped"
|
||||||
|
aria-controls="pricing-faq-answer-aliases-sub-stopped"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">What happens to my aliases when I stop the subscription?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-aliases-sub-stopped"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-aliases-sub-stopped"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
When your subscription ends, all aliases you created continue working normally, both on receiving and
|
||||||
|
sending emails. Concretely:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
All aliases/domains/directories/mailboxes you have created are kept and continue working normally.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
You cannot create new aliases if you exceed the free plan limit, i.e. have more than 10 aliases.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
As features like catch-all or directory allow you to create aliases on-the-fly, those aliases cannot be automatically created if you have more than 10 aliases.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
You cannot add new domain, directory or mailbox.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
For example, if you have 100 aliases by the time your subscription ends, these 100 aliases will continue receiving and sending emails normally. You cannot however create new aliases.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-aliases-max">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-aliases-max"
|
||||||
|
aria-controls="pricing-faq-answer-aliases-max"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">What happens when I reach the maximum number of alias in free plan?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-aliases-max"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-aliases-max"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
If you are in the free plan, you cannot create new aliases when you reach the maximum number of aliases
|
||||||
|
(i.e. 10 aliases).
|
||||||
|
<br>
|
||||||
|
Aliases that would otherwise be created automatically via the catch-all domain or directory feature also cannot be created.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-discounts">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-discounts"
|
||||||
|
aria-controls="pricing-faq-answer-discounts"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">Do you offer discounts?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-discounts"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-discounts"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
We offer important discounts or free premium for:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
students, professors or technical staffs working at an educational institute
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
activists, dissidents or journalists
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
charity organizations
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Please send us an email at <a href="mailto:support@simplelogin.zendesk.com">support@simplelogin.zendesk.com</a> for more info.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
We used to offer free premium accounts for students but this program ended at June 17 2021. Please note this doesn't affect existing accounts who have already benefited from the program or requests sent before this date.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-refund">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-refund"
|
||||||
|
aria-controls="pricing-faq-answer-refund"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">Do you have a refund policy?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-refund"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-refund"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
No we don't have a refund policy because SimpleLogin has a trial period where you can try all premium features.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-family">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-family"
|
||||||
|
aria-controls="pricing-faq-answer-family"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">Do you have a family plan?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-family"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-family"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
No we don't have a family plan but offer 30% reduction for additional subscriptions. Please contact us at <a href="mailto:support@simplelogin.zendesk.com">support@simplelogin.zendesk.com</a> for more information.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header card-collapse p-0"
|
||||||
|
id="pricing-faq-question-other-ways">
|
||||||
|
<h5 class="mb-0 w-100">
|
||||||
|
<button class="btn btn-link btn-block d-flex justify-content-between card-btn p-4 collapsed text-decoration-none"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#pricing-faq-answer-other-ways"
|
||||||
|
aria-controls="pricing-faq-answer-other-ways"
|
||||||
|
aria-expanded="false">
|
||||||
|
<span class="text-start">Are there other ways to buy SimpleLogin subscriptions?</span>
|
||||||
|
<span class="if-collapsed">
|
||||||
|
<i class="fe fe-chevron-down"></i>
|
||||||
|
</span>
|
||||||
|
<span class="if-not-collapsed">
|
||||||
|
<i class="fe fe-chevron-up"></i>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<div id="pricing-faq-answer-other-ways"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="pricing-faq-question-other-ways"
|
||||||
|
data-parent="#pricing-faq">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
Yes you can also buy SimpleLogin subscription coupon via <a href="https://proxysto.re/en/index.html" target="_blank">ProxyStore <i class="fe fe-external-link"></i></a>, our official reseller.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END FAQ section -->
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
Paddle.Setup({vendor: {{ PADDLE_VENDOR_ID }}});
|
Paddle.Setup({vendor: {{ PADDLE_VENDOR_ID }}});
|
||||||
|
|
||||||
function upgrade(productId) {
|
function upgradePaddle(productId) {
|
||||||
bootbox.dialog({
|
Paddle.Checkout.open({
|
||||||
title: `Payment with credit card or PayPal via Paddle`,
|
product: productId,
|
||||||
message: `Paddle will ask for an email address for sending out the invoices, please feel free to use an alias. <br />
|
success: "{{ success_url }}",
|
||||||
You don't have to use your SimpleLogin account email address`,
|
passthrough: "{\"user_id\": {{current_user.id}} }"
|
||||||
size: 'large',
|
|
||||||
onEscape: true,
|
|
||||||
backdrop: true,
|
|
||||||
buttons: {
|
|
||||||
got_it: {
|
|
||||||
label: 'Got it!',
|
|
||||||
className: 'btn-outline-primary',
|
|
||||||
callback: function () {
|
|
||||||
Paddle.Checkout.open({
|
|
||||||
product: productId,
|
|
||||||
success: "{{ success_url }}",
|
|
||||||
passthrough: "{\"user_id\": {{current_user.id}} }"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
plausible("visit pricing");
|
</script>
|
||||||
</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -15,5 +15,4 @@
|
|||||||
<a class="btn btn-primary" href="/">Close</a>
|
<a class="btn btn-primary" href="/">Close</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>plausible("upgraded")</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
from app import config
|
from app import config
|
||||||
from app.db import Session
|
from app.db import Session
|
||||||
from app.models import User, Job
|
from app.models import User, Job
|
||||||
from tests.utils import create_new_user, random_email
|
from tests.utils import random_email
|
||||||
|
|
||||||
|
|
||||||
def test_available_sl_domains(flask_client):
|
|
||||||
user = create_new_user()
|
|
||||||
|
|
||||||
assert set(user.available_sl_domains()) == {"d1.test", "d2.test", "sl.local"}
|
|
||||||
|
|
||||||
|
|
||||||
def test_create_from_partner(flask_client):
|
def test_create_from_partner(flask_client):
|
||||||
|
130
app/tests/test_domains.py
Normal file
130
app/tests/test_domains.py
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
from app.db import Session
|
||||||
|
from app.models import SLDomain, PartnerUser, AliasOptions
|
||||||
|
from app.proton.utils import get_proton_partner
|
||||||
|
from init_app import add_sl_domains
|
||||||
|
from tests.utils import create_new_user, random_token
|
||||||
|
|
||||||
|
|
||||||
|
def setup_module():
|
||||||
|
Session.query(SLDomain).delete()
|
||||||
|
SLDomain.create(
|
||||||
|
domain="hidden", premium_only=False, flush=True, order=5, hidden=True
|
||||||
|
)
|
||||||
|
SLDomain.create(domain="free_non_partner", premium_only=False, flush=True, order=4)
|
||||||
|
SLDomain.create(
|
||||||
|
domain="premium_non_partner", premium_only=True, flush=True, order=3
|
||||||
|
)
|
||||||
|
SLDomain.create(
|
||||||
|
domain="free_partner",
|
||||||
|
premium_only=False,
|
||||||
|
flush=True,
|
||||||
|
partner_id=get_proton_partner().id,
|
||||||
|
order=2,
|
||||||
|
)
|
||||||
|
SLDomain.create(
|
||||||
|
domain="premium_partner",
|
||||||
|
premium_only=True,
|
||||||
|
flush=True,
|
||||||
|
partner_id=get_proton_partner().id,
|
||||||
|
order=1,
|
||||||
|
)
|
||||||
|
Session.commit()
|
||||||
|
|
||||||
|
|
||||||
|
def teardown_module():
|
||||||
|
Session.query(SLDomain).delete()
|
||||||
|
add_sl_domains()
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_non_partner_domains():
|
||||||
|
user = create_new_user()
|
||||||
|
domains = user.get_sl_domains()
|
||||||
|
# Premium
|
||||||
|
assert len(domains) == 2
|
||||||
|
assert domains[0].domain == "premium_non_partner"
|
||||||
|
assert domains[1].domain == "free_non_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains()
|
||||||
|
# Free
|
||||||
|
user.trial_end = None
|
||||||
|
Session.flush()
|
||||||
|
domains = user.get_sl_domains()
|
||||||
|
assert len(domains) == 1
|
||||||
|
assert domains[0].domain == "free_non_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains()
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_free_with_partner_domains():
|
||||||
|
user = create_new_user()
|
||||||
|
user.trial_end = None
|
||||||
|
PartnerUser.create(
|
||||||
|
partner_id=get_proton_partner().id,
|
||||||
|
user_id=user.id,
|
||||||
|
external_user_id=random_token(10),
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
domains = user.get_sl_domains()
|
||||||
|
# Default
|
||||||
|
assert len(domains) == 1
|
||||||
|
assert domains[0].domain == "free_non_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains()
|
||||||
|
# Show partner domains
|
||||||
|
options = AliasOptions(
|
||||||
|
show_sl_domains=True, show_partner_domains=get_proton_partner()
|
||||||
|
)
|
||||||
|
domains = user.get_sl_domains(alias_options=options)
|
||||||
|
assert len(domains) == 2
|
||||||
|
assert domains[0].domain == "free_partner"
|
||||||
|
assert domains[1].domain == "free_non_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains(
|
||||||
|
alias_options=options
|
||||||
|
)
|
||||||
|
# Only partner domains
|
||||||
|
options = AliasOptions(
|
||||||
|
show_sl_domains=False, show_partner_domains=get_proton_partner()
|
||||||
|
)
|
||||||
|
domains = user.get_sl_domains(alias_options=options)
|
||||||
|
assert len(domains) == 1
|
||||||
|
assert domains[0].domain == "free_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains(
|
||||||
|
alias_options=options
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_premium_with_partner_domains():
|
||||||
|
user = create_new_user()
|
||||||
|
PartnerUser.create(
|
||||||
|
partner_id=get_proton_partner().id,
|
||||||
|
user_id=user.id,
|
||||||
|
external_user_id=random_token(10),
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
domains = user.get_sl_domains()
|
||||||
|
# Default
|
||||||
|
assert len(domains) == 2
|
||||||
|
assert domains[0].domain == "premium_non_partner"
|
||||||
|
assert domains[1].domain == "free_non_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains()
|
||||||
|
# Show partner domains
|
||||||
|
options = AliasOptions(
|
||||||
|
show_sl_domains=True, show_partner_domains=get_proton_partner()
|
||||||
|
)
|
||||||
|
domains = user.get_sl_domains(alias_options=options)
|
||||||
|
assert len(domains) == 4
|
||||||
|
assert domains[0].domain == "premium_partner"
|
||||||
|
assert domains[1].domain == "free_partner"
|
||||||
|
assert domains[2].domain == "premium_non_partner"
|
||||||
|
assert domains[3].domain == "free_non_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains(
|
||||||
|
alias_options=options
|
||||||
|
)
|
||||||
|
# Only partner domains
|
||||||
|
options = AliasOptions(
|
||||||
|
show_sl_domains=False, show_partner_domains=get_proton_partner()
|
||||||
|
)
|
||||||
|
domains = user.get_sl_domains(alias_options=options)
|
||||||
|
assert len(domains) == 2
|
||||||
|
assert domains[0].domain == "premium_partner"
|
||||||
|
assert domains[1].domain == "free_partner"
|
||||||
|
assert [d.domain for d in domains] == user.available_sl_domains(
|
||||||
|
alias_options=options
|
||||||
|
)
|
@ -13,7 +13,7 @@ def test_random_words():
|
|||||||
assert s.count("_") == 1
|
assert s.count("_") == 1
|
||||||
assert len(s) > 3
|
assert len(s) > 3
|
||||||
s = random_words(2, 3)
|
s = random_words(2, 3)
|
||||||
assert s.count("_") == 0
|
assert s.count("_") == 1
|
||||||
assert s[-1] in (str(i) for i in range(10))
|
assert s[-1] in (str(i) for i in range(10))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user