diff --git a/server/cn/etc/nginx/nginx.conf b/server/cn/etc/nginx/nginx.conf index f0669ab..db36998 100644 --- a/server/cn/etc/nginx/nginx.conf +++ b/server/cn/etc/nginx/nginx.conf @@ -78,7 +78,7 @@ http { server { #listen 80; - server_name www.eee.dog eee.dog ovo.re www.ovo.re photo.ovo.re acg.watch www.acg.watch iotcat.me www.iotcat.me iotcat.xyz www.iotcat.xyz www.yimian.xyz yimian.xyz api.yimian.xyz cdn.yimian.xyz msc.yimian.xyz mail.yimian.xyz video.yimian.xyz sms.yimian.xyz vpn.yimian.xyz login.yimian.xyz log.yimian.xyz blog.yimian.xyz dans.yimian.ac.cn cdn.yimian.ac.cn cn.yimian.xyz video.api.yimian.xyz photo.yimian.xyz login.api.yimian.xyz moe.api.yimian.xyz photo.api.yimian.xyz mikutap.yimian.xyz gugu.yimian.xyz; #1 + server_name www.eee.dog eee.dog ovo.re www.ovo.re photo.ovo.re acg.watch www.acg.watch iotcat.me www.iotcat.me iotcat.xyz www.iotcat.xyz www.yimian.xyz yimian.xyz api.yimian.xyz cdn.yimian.xyz msc.yimian.xyz mail.yimian.xyz video.yimian.xyz sms.yimian.xyz vpn.yimian.xyz login.yimian.xyz log.yimian.xyz blog.yimian.xyz dans.yimian.ac.cn cdn.yimian.ac.cn cn.yimian.xyz video.api.yimian.xyz photo.yimian.xyz login.api.yimian.xyz moe.api.yimian.xyz photo.api.yimian.xyz mikutap.yimian.xyz gugu.yimian.xyz report.yimian.xyz; #1 rewrite ^(.*)$ https://$host$1 permanent; } @@ -654,6 +654,37 @@ http { } + server { + listen 443 ssl; + #listen 80; + + server_name report.yimian.xyz; #1 + + root /home/www/report; + + index index.php index.html; + client_max_body_size 1000M; + + ssl_certificate /etc/letsencrypt/live/report.yimian.xyz/fullchain.pem; #2 + ssl_certificate_key /etc/letsencrypt/live/report.yimian.xyz/privkey.pem; #3 + + ssl_session_cache shared:SSL:1m; + ssl_session_timeout 5m; + ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + error_page 404 = /404.php; + + location ~ \.php$ { + try_files $uri =404; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + } + + server { listen 443 ssl; #listen 80; diff --git a/server/cn/home/www/report/index.php b/server/cn/home/www/report/index.php new file mode 100644 index 0000000..6411323 --- /dev/null +++ b/server/cn/home/www/report/index.php @@ -0,0 +1,58 @@ + time() - 3600 * 24){ + + if(!in_array(long2ip($row['ip']), $api_ip)) array_push($api_ip, long2ip($row['ip'])); + + if($row['api'] == "moe") $api_moe++; + elseif($row['api'] == "pic") $api_pic++; + elseif($row['api'] == "words") $api_words++; + elseif($row['api'] == "mail") $api_mail++; + elseif($row['api'] == "gugu") $api_gugu++; + } +} + +$report .= "访问人数:".count($api_ip)."\n"; +$report .= "总访问次数:".($api_moe + $api_pic + $api_words + $api_mail + $api_gugu)."\n\n"; + +$report .= "访问者:"; + +foreach($api_ip as $ip){ + + $report .= $ip.", "; +} + +$report .= "\n\n"; + +$report .= "moe访问次数: ".$api_moe."次\npic访问次数: ".$api_pic."次\nwords访问次数: ".$api_words."次\nmail访问次数: ".$api_mail."次\ngugu访问次数: ".$api_gugu."次\n\n"; + +$report .= "------------------------"; + + +curl__post("https://gugu.yimian.xyz", array("body" => $report)); + + +die(); \ No newline at end of file diff --git a/server/cn/home/www/sms/index.php b/server/cn/home/www/sms/index.php index 8dff2fc..c4de482 100644 --- a/server/cn/home/www/sms/index.php +++ b/server/cn/home/www/sms/index.php @@ -1,2 +1,229 @@ -

Welcome to Yimian SMS

-

Go to IoTcat's Home Page

\ No newline at end of file +sendWithParam("86", $phoneNumbers[0], $templateId, + $params, $smsSign, "", ""); // 签名参数未提供或者为空时,会使用默认签名发送短信 + $rsp = json_decode($result); + echo $result; +} catch(\Exception $e) { + echo var_dump($e); +} +echo "\n"; + +$conn=database_cnnct(); + +$ip= getip(); + +$time=time(); + +$shu='||'; +$cnnct=$msg1.$shu.$msg2.$shu.$msg3.$shu.$result; + +$tel=$_POST['tel']; + +$sql="INSERT sms set ip='$ip',time=$time,tel='$phoneNumbers[0]',tpl='$tpl',val='$msg3',cnnct='$cnnct' "; + + if ($conn->query($sql) === TRUE) {$return_array = array(status=>1);} +} + + +// 短信模板ID,需要在短信应用中申请 +if($tpl==2){ +$templateId = 223060; // NOTE: 这里的模板ID`7839`只是一个示例,真实的模板ID需要在短信控制台中申请 + +// 签名 +$smsSign = "Yimian"; // NOTE: 这里的签名只是示例,请使用真实的已申请的签名,签名参数使用的是`签名内容`,而不是`签名ID` + +try { + $ssender = new SmsSingleSender($appid, $appkey); + $params = [$msg1,$msg2,"VPN",$msg3]; + $result = $ssender->sendWithParam("86", $phoneNumbers[0], $templateId, + $params, $smsSign, "", ""); // 签名参数未提供或者为空时,会使用默认签名发送短信 + $rsp = json_decode($result); + echo $result; +} catch(\Exception $e) { + echo var_dump($e); +} +echo "\n"; + +$conn=database_cnnct(); + +$ip= getip(); + +$time=time(); + +$shu='||'; +$cnnct=$msg1.$shu.$msg2.$shu.$msg3.$shu.$result; + +$tel=$_POST['tel']; + +$sql="INSERT sms set ip='$ip',time=$time,tel='$phoneNumbers[0]',tpl='$tpl',val='$msg3',cnnct='$cnnct' "; + + if ($conn->query($sql) === TRUE) {$return_array = array(status=>1);} +} + +// 短信模板ID,需要在短信应用中申请 +if($tpl==3){ +$templateId = 244004; // NOTE: 这里的模板ID`7839`只是一个示例,真实的模板ID需要在短信控制台中申请 + +// 签名 +$smsSign = "Yimian"; // NOTE: 这里的签名只是示例,请使用真实的已申请的签名,签名参数使用的是`签名内容`,而不是`签名ID` + +try { + $ssender = new SmsSingleSender($appid, $appkey); + $params = [$msg1,"VPN"]; + $result = $ssender->sendWithParam("86", $phoneNumbers[0], $templateId, + $params, $smsSign, "", ""); // 签名参数未提供或者为空时,会使用默认签名发送短信 + $rsp = json_decode($result); + echo $result; +} catch(\Exception $e) { + echo var_dump($e); +} +echo "\n"; + +$conn=database_cnnct(); + +$ip= getip(); + +$time=time(); + +$shu='||'; +$cnnct=$msg1.$shu.$msg2.$shu.$msg3.$shu.$result; + +$tel=$_POST['tel']; + +$sql="INSERT sms set ip='$ip',time=$time,tel='$phoneNumbers[0]',tpl='$tpl',val='$msg3',cnnct='$cnnct' "; + + if ($conn->query($sql) === TRUE) {$return_array = array(status=>1);} +} + + +// 短信模板ID,需要在短信应用中申请 +if($tpl==4){ +$templateId = 278516; // NOTE: 这里的模板ID`7839`只是一个示例,真实的模板ID需要在短信控制台中申请 + +// 签名 +$smsSign = "Yimian"; // NOTE: 这里的签名只是示例,请使用真实的已申请的签名,签名参数使用的是`签名内容`,而不是`签名ID` +$params = []; + +try { + $ssender = new SmsSingleSender($appid, $appkey); + $result = $ssender->sendWithParam("86", $phoneNumbers[0], $templateId, $params, $smsSign, "", ""); // 签名参数未提供或者为空时,会使用默认签名发送短信 + $rsp = json_decode($result); + echo $result; +} catch(\Exception $e) { + echo var_dump($e); +} +echo "\n"; + +$conn=database_cnnct(); + +$ip= getip(); + +$time=time(); + +$shu='||'; +$cnnct="加水"; + +$tel=$_POST['tel']; + +$sql="INSERT sms set ip='$ip',time=$time,tel='$phoneNumbers[0]',tpl='$tpl',cnnct='$cnnct' "; + + if ($conn->query($sql) === TRUE) {$return_array = array(status=>1);} +} + +//fnct of get usr ip::()::(ip) +function getip() +{ + if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) + { + $ip = getenv("HTTP_CLIENT_IP"); + } + else + if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) + { + $ip = getenv("HTTP_X_FORWARDED_FOR"); + } + else + if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) + { + $ip = getenv("REMOTE_ADDR"); + } + else + if (isset ($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) + { + $ip = $_SERVER['REMOTE_ADDR']; + } + else + { + $ip = "unknown"; + } +return ($ip); +} + + +//fnct of connecting database::()::(database conn) +function database_cnnct () +{ +$servername = "114.116.65.152"; +$username = "yimian"; +$password = "Lymian0904@112"; +$dbname = "yimian"; + +// 创建连接 +$conn = new mysqli($servername, $username, $password, $dbname); +// Check connection + + +if ($conn->connect_error) +{ + die("连接失败: " . $conn->connect_error); +} + +return ($conn); +} +