no message

This commit is contained in:
hellcat 2026-08-17 17:59:17 +08:00
parent 1cd1034651
commit c92af8eec5
3 changed files with 21 additions and 6 deletions

View File

@ -205,6 +205,13 @@ class CronV2Controller
private function run($aArticle) private function run($aArticle)
{ {
$shabi = "https://";
if (env("www_master") == "dd.loc") {
$shabi = "http://";
}
// echo 111;exit;
foreach ($aArticle as $row) { foreach ($aArticle as $row) {
$this->sUserName = $row["user_name"]; $this->sUserName = $row["user_name"];
$this->sMailName = $row["mail_name"]; $this->sMailName = $row["mail_name"];
@ -230,7 +237,7 @@ class CronV2Controller
$oHttp = new Http(); $oHttp = new Http();
$oHttp->sMethod = "post"; $oHttp->sMethod = "post";
$sMasterUrl = "https://".env("www_master")."/api/github/get"; $sMasterUrl = $shabi.env("www_master")."/api/github/get";
// $oHttp->bIsJson = true; // $oHttp->bIsJson = true;
$oHttp->aData = $row; $oHttp->aData = $row;
$sReadMe = $oHttp->send($sMasterUrl); $sReadMe = $oHttp->send($sMasterUrl);
@ -273,7 +280,7 @@ class CronV2Controller
$oHttp->sMethod = "get"; $oHttp->sMethod = "get";
// $sMasterUrl = env("api_url_freenode_base")."/api/github/getfntoday/".$sFnCode; // $sMasterUrl = env("api_url_freenode_base")."/api/github/getfntoday/".$sFnCode;
// /api/v1/freenode/url_feed_today/{siteCode}/{client?} // /api/v1/freenode/url_feed_today/{siteCode}/{client?}
$sMasterUrl = "https://".env("www_master")."/api/v1/freenode/url_feed_today/".$row["fn_code_short"]; $sMasterUrl = $shabi.env("www_master")."/api/v1/freenode/url_feed_today/".$row["fn_code_short"];
$sReturn = $oHttp->send($sMasterUrl); $sReturn = $oHttp->send($sMasterUrl);
$aReturn = json_decode($sReturn, true); $aReturn = json_decode($sReturn, true);
@ -286,9 +293,9 @@ class CronV2Controller
} }
if ($aReturn["code"] == "200") { if ($aReturn["code"] == "200") {
file_put_contents($this->sProjectPath."/feed/clash-".$sFnCode.".yaml", $aReturn["data"]["clash"]); file_put_contents($this->sProjectPath."/feed/clash-".$sFnCode.".yaml", file_get_contents($aReturn["data"]["clash"]));
file_put_contents($this->sProjectPath."/feed/v2ray-".$sFnCode.".txt", $aReturn["data"]["v2ray"]); file_put_contents($this->sProjectPath."/feed/v2ray-".$sFnCode.".txt", file_get_contents($aReturn["data"]["v2ray"]));
file_put_contents($this->sProjectPath."/feed/singbox-".$sFnCode.".txt", $aReturn["data"]["singbox"]); file_put_contents($this->sProjectPath."/feed/singbox-".$sFnCode.".txt", file_get_contents($aReturn["data"]["singbox"]));
} }
// 写入内容 // 写入内容

View File

@ -52,6 +52,7 @@ class Test extends Base {
public function cronV2($aParam) public function cronV2($aParam)
{ {
// echo 111;exit;
if (($aParam["aArg"][1] ?? false) == "?") { if (($aParam["aArg"][1] ?? false) == "?") {
return "#cron__{type:id,i_in10,rand}__{bSendTg:y,n-default}__{bPull:y,n-defulat}"; return "#cron__{type:id,i_in10,rand}__{bSendTg:y,n-default}__{bPull:y,n-defulat}";
} }
@ -74,10 +75,17 @@ class Test extends Base {
// $is_test = true; // $is_test = true;
// } else if ($sIsText == "no") { // } else if ($sIsText == "no") {
// $is_test = false; // $is_test = false;
// }
// $shabi = "https://";
//
// if (env("www_master") == "dd.loc") {
// $shabi = "http://";
// } // }
$this->oHttp->sMethod = "get"; $this->oHttp->sMethod = "get";
$this->oHttp->sToUrl = env("APP_URL")."/cronv2"; $this->oHttp->sToUrl = env("APP_URL")."/cronv2";
// var_dump($this->oHttp->sToUrl);exit;
$this->oHttp->bIsJson = true; $this->oHttp->bIsJson = true;
$this->oHttp->aData = [ $this->oHttp->aData = [
"is_test" => true, "is_test" => true,

View File

@ -89,7 +89,7 @@ tg测试
到SSH config updated successfully. 到SSH config updated successfully.
到git push -u origin main错误就基本ok了到linux上提交确认kownhost 到git push -u origin main错误就基本ok了到linux上提交确认kownhost
sudo -u www-data git add . sudo -u www-data git add .
sudo -u www-data git push -u origin main sudo -u www-data git push -u origin main --force
提交成功就ok,通了 提交成功就ok,通了
最后挂上cron* * * * * curl -s https://github-2.diaodu.us/cron > /dev/null 最后挂上cron* * * * * curl -s https://github-2.diaodu.us/cron > /dev/null