Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
luolongfei committed Feb 3, 2024
2 parents 2a9a733 + 4306361 commit ee11630
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 1,601 deletions.
12 changes: 10 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#####################################################################

# .env 文件版本
ENV_FILE_VERSION='v3.0'
ENV_FILE_VERSION='v3.1'

###################### 账户配置 Account config #########################
# Freenom 账户 Freenom Account
Expand Down Expand Up @@ -184,4 +184,12 @@ FF_SECRET_KEY='https://github.com/luolongfei/freenom'
# aws waf solver 接口地址
# aws waf solver url
AWS_WAF_SOLVER_URL='aws-waf-solver:2019/aws_waf_token'
###################### end AWS WAF SOLVER #########################

# 使用开源的 AWS WAF Solver API 0:不使用 1:使用
# Use open-source AWS WAF Solver API 0: Do not use, 1: Use
USE_OPEN_SOURCE_WAF_SOLVER_API=1

# 开源的 AWS WAF Solver URL
# Open-source AWS WAF Solver URL
OPEN_SOURCE_WAF_SOLVER_URL='https://aws-waf-solver.llf.app/token'
###################### end AWS WAF SOLVER #########################
12 changes: 7 additions & 5 deletions app/Console/FreeNom.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class FreeNom extends Base
{
const VERSION = 'v0.6.0';
const VERSION = 'v0.6.1';

const TIMEOUT = 33;

Expand Down Expand Up @@ -93,7 +93,7 @@ private function __construct()
'headers' => [
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Accept-Encoding' => 'gzip, deflate, br',
'User-Agent' => sprintf('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36', get_random_user_agent()),
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
],
'timeout' => self::TIMEOUT,
CURLOPT_FOLLOWLOCATION => true,
Expand Down Expand Up @@ -435,6 +435,8 @@ public function handle()
$accounts = $this->getAccounts();
$totalAccounts = count($accounts);

$awsWafToken = getAwsWafToken();

system_log(sprintf(lang('100049'), $totalAccounts));

foreach ($accounts as $index => $account) {
Expand All @@ -446,9 +448,9 @@ public function handle()
system_log(sprintf(lang('100050'), get_local_num($num), $this->username, $num, $totalAccounts));

$this->jar = new CookieJar(); // 所有请求共用一个 CookieJar 实例

$awsWafToken = getAwsWafToken();
$this->jar->setCookie(buildAwsWafCookie($awsWafToken));
if ($awsWafToken !== '') {
$this->jar->setCookie(buildAwsWafCookie($awsWafToken));
}

$this->login($this->username, $this->password);

Expand Down
Loading

0 comments on commit ee11630

Please sign in to comment.