Skip to content

Commit 22b33cf

Browse files
authored
验证执行权限
1 parent 6733721 commit 22b33cf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"FF_TOKEN": {
1818
"description": "令牌,在触发执行的时候,需要跟上此参数的值。假设 FF_TOKEN 的值为 123,则传参的格式为 https://xxx.herokuapp.com/?ff-token=123",
19-
"generator": "secret"
19+
"value": ""
2020
},
2121
"FREENOM_USERNAME": {
2222
"description": "Freenom 账户 Freenom Account",

heroku/html/index.php

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
header('X-Accel-Buffering: no');
66

77
echo '<pre>';
8+
9+
$FF_TOKEN = $_GET('ff-token');
10+
if ($FF_TOKEN !== getenv('FF_TOKEN')) {
11+
die('你没有权限触发执行');
12+
}
13+
814
echo "Freenom 自动续期\n\n";
915
echo "开始执行\n\n";
1016

0 commit comments

Comments
 (0)