Skip to content

Commit c36e115

Browse files
authored
fix: set email footer from $SITE_ORIGIN (#25)
* set email footer from $SITE_ORIGIN
1 parent 5d66052 commit c36e115

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# 【请修改】在导出文件及邮件中显示
55
SITE_NAME=萌翻local
6+
SITE_ORIGIN=https://change-me.com
67
# 【请修改】用于加密用户 session,请配置一个很长的密钥,建议配置为 64 位以上字母数字组成的密钥
78
# 可用使用 python -c 'import secrets; print(secrets.token_hex())' 命令来随机生成一个
89
SECRET_KEY=CHANGE_ME

.env.test.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
TESTING=YES
33
LOG_LEVEL=DEBUG
44
SITE_NAME=萌翻TEST
5+
SITE_ORIGIN=https://test.moeflow.org
56
SECRET_KEY=SECRET
67
78

app/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# 基础设置
1010
# -----------
1111
SITE_NAME = env["SITE_NAME"]
12+
SITE_ORIGIN = env["SITE_ORIGIN"]
1213
SECRET_KEY = env["SECRET_KEY"] # 必填 - 密钥
1314
LOG_LEVEL = env.get("LOG_LEVEL", "INFO")
1415
# DEPRECATED: please use modern container logging collector

app/models/v_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def to_email(self, address: str) -> None:
322322
template_data={
323323
"code": self.content,
324324
"site_name": current_app.config.get("SITE_NAME"),
325-
"site_url": f'https://{current_app.config.get("DOMAIN")}',
325+
"site_url": current_app.config.get("SITE_ORIGIN"),
326326
},
327327
)
328328
self.send_time = datetime.datetime.utcnow()

0 commit comments

Comments
 (0)