Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set email footer from $SITE_ORIGIN #25

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# 【请修改】在导出文件及邮件中显示
SITE_NAME=萌翻local
SITE_ORIGIN=https://change-me.com
# 【请修改】用于加密用户 session,请配置一个很长的密钥,建议配置为 64 位以上字母数字组成的密钥
# 可用使用 python -c 'import secrets; print(secrets.token_hex())' 命令来随机生成一个
SECRET_KEY=CHANGE_ME
Expand Down
1 change: 1 addition & 0 deletions .env.test.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
TESTING=YES
LOG_LEVEL=DEBUG
SITE_NAME=萌翻TEST
SITE_ORIGIN=https://test.moeflow.org
SECRET_KEY=SECRET
[email protected]

Expand Down
1 change: 1 addition & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# 基础设置
# -----------
SITE_NAME = env["SITE_NAME"]
SITE_ORIGIN = env["SITE_ORIGIN"]
SECRET_KEY = env["SECRET_KEY"] # 必填 - 密钥
LOG_LEVEL = env.get("LOG_LEVEL", "INFO")
# DEPRECATED: please use modern container logging collector
Expand Down
2 changes: 1 addition & 1 deletion app/models/v_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def to_email(self, address: str) -> None:
template_data={
"code": self.content,
"site_name": current_app.config.get("SITE_NAME"),
"site_url": f'https://{current_app.config.get("DOMAIN")}',
"site_url": current_app.config.get("SITE_ORIGIN"),
},
)
self.send_time = datetime.datetime.utcnow()
Expand Down