添加云虚拟主机文件部署,增加game-docker的安全加固

This commit is contained in:
2026-04-14 14:19:25 +08:00
parent f98091bb54
commit f381ae2e8f
48 changed files with 631 additions and 549 deletions

View File

@@ -0,0 +1 @@
1

View File

View File

@@ -0,0 +1,147 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE");
header("Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With");
header("Access-Control-Allow-Credentials: true");
header("Content-Type: textml; charset=utf-8");
///////////////////////////// 全局常量 /////////////////////////////
//mysql数据库连接
$G_MySql = array(
"host" => "rm-bp1749tfxu2rpq670lo.mysql.rds.aliyuncs.com",
"name" => "game_db",
"user" => "games",
"pwd" => "Games0791!!",
"port" => "3306"
// "host" => "120.25.60.74",
// "name" => "youle_games",
// "user" => "root",
// "pwd" => "root",
// "port" => "3333"
);
//错误编码及提示
$G_Error = array(
"condb" => array("code" => 81, "msg" => "连接数据库失败"),
"execsql" => array("code" => 82, "msg" => "操作数据库失败"),
"d_wrong" => array("code" => 83, "msg" => "data参数错误"),
"m_wrong" => array("code" => 84, "msg" => "m参数错误"),
"s_wrong" => array("code" => 85, "msg" => "s参数错误"),
"p_wrong" => array("code" => 86, "msg" => "p参数错误"),
);
///////////////////////////// 全局变量 /////////////////////////////
//接口函数返回的json对象
$G_Result = array(
"state" => 0, //0:成功 <>0:错误编码
"error" => "", //错误时的描述
"param" => "", //接收的参数
"data" => array() //成功时的数据
);
//返回结果$G_G_Result
function do_return(){
global $G_Result;
// if (count($G_Result["data"]) == 0) {
// $G_Result["data"] = new stdClass;
// }
echo json_encode($G_Result);
exit();
}
////////////////////////// 连接MYSQL数据库 /////////////////////////
$PDO = null;
try
{
$PDO = new PDO("mysql:host=".$G_MySql["host"].";port=".$G_MySql["port"].";dbname=".$G_MySql["name"], $G_MySql["user"], $G_MySql["pwd"]);
$PDO->exec("set names utf8;");
$PDO->exec("use ".$G_MySql["name"].";");
}
catch (Exception $e)
{
$G_Result['state'] = $G_Error["condb"]["code"];
$G_Result['error'] = $G_Error["condb"]["msg"];
do_return();
}
//////////////////////////// 读取参数 ////////////////////////////
//读取data参数
$str_data = GetRequest("data");
$str_data = stripslashes($str_data); //解决表单POST传参数时自动加转义字符的问题
$str_data = str_replace("^","=",$str_data);
$str_data = str_replace("#","+",$str_data);
$str_data = str_replace("!","&",$str_data);
$G_Result['param'] = $str_data;
//检查data是否为空
if ($str_data == "") {
$G_Result['state'] = $G_Error["d_wrong"]["code"];
$G_Result['error'] = $G_Error["d_wrong"]["msg"];
do_return();
}
//检查data是否能转成json
$json_para = json_decode($str_data);
if ($json_para == null) {
$G_Result['state'] = $G_Error["d_wrong"]["code"];
$G_Result['error'] = $G_Error["d_wrong"]["msg"];
do_return();
}
$m = $json_para->m;
$s = $json_para->s;
$p = $json_para->p;
//检查m值
if (($m == null) || ($m == "") || (!function_exists($m))) {
$G_Result['state'] = $G_Error["m_wrong"]["code"];
$G_Result['error'] = $G_Error["m_wrong"]["msg"];
do_return();
}
//检查s值
if (($s == null) || ($s == "")) {
$G_Result['state'] = $G_Error["s_wrong"]["code"];
$G_Result['error'] = $G_Error["s_wrong"]["msg"];
do_return();
}
//检查p值
if (($p != null) && (!is_array($p))) {
$G_Result['state'] = $G_Error["p_wrong"]["code"];
$G_Result['error'] = $G_Error["p_wrong"]["msg"];
do_return();
}
$m($s, $p);
do_return();
//根据参数名获取参数
function GetRequest($name) {
return isset($_REQUEST[$name])?$_REQUEST[$name]:'';
}
//执行sql语句返回结果
function opensql($sql, $para) {
global $G_Result, $G_Error, $PDO;
$stmt = $PDO->prepare($sql.";");
if ($stmt->execute($para))
{
while ($aryData = $stmt->fetch(PDO::FETCH_NAMED)) {
$G_Result["data"][] = $aryData;
}
} else {
$G_Result['state'] = $G_Error["execsql"]["code"];
$G_Result['error'] = $G_Error["execsql"]["msg"];
}
}
//执行sql语句无返回结果
function execsql($sql, $para){
global $G_Result, $G_Error, $PDO;
$stmt = $PDO->prepare($sql.";");
if ($stmt->execute($para))
{} else {
$G_Result['state'] = $G_Error["execsql"]["code"];
$G_Result['error'] = $G_Error["execsql"]["msg"];
}
}
?>

View File

@@ -0,0 +1,147 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE");
header("Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With");
header("Access-Control-Allow-Credentials: true");
header("Content-Type: textml; charset=utf-8");
///////////////////////////// 全局常量 /////////////////////////////
//mysql数据库连接
$G_MySql = array(
"host" => "rm-bp1btyuwq77591x0jpo.mysql.rds.aliyuncs.com",
"name" => "agent_db",
"user" => "games",
"pwd" => "Games0791!!",
"port" => "3306"
// "host" => "120.92.140.132",
// "name" => "game_db",
// "user" => "root",
// "pwd" => "root_root",
// "port" => "3309"
);
//错误编码及提示
$G_Error = array(
"condb" => array("code" => 81, "msg" => "连接数据库失败"),
"execsql" => array("code" => 82, "msg" => "操作数据库失败"),
"d_wrong" => array("code" => 83, "msg" => "data参数错误"),
"m_wrong" => array("code" => 84, "msg" => "m参数错误"),
"s_wrong" => array("code" => 85, "msg" => "s参数错误"),
"p_wrong" => array("code" => 86, "msg" => "p参数错误"),
);
///////////////////////////// 全局变量 /////////////////////////////
//接口函数返回的json对象
$G_Result = array(
"state" => 0, //0:成功 <>0:错误编码
"error" => "", //错误时的描述
"param" => "", //接收的参数
"data" => array() //成功时的数据
);
//返回结果$G_G_Result
function do_return(){
global $G_Result;
// if (count($G_Result["data"]) == 0) {
// $G_Result["data"] = new stdClass;
// }
echo json_encode($G_Result);
exit();
}
////////////////////////// 连接MYSQL数据库 /////////////////////////
$PDO = null;
try
{
$PDO = new PDO("mysql:host=".$G_MySql["host"].";port=".$G_MySql["port"].";dbname=".$G_MySql["name"], $G_MySql["user"], $G_MySql["pwd"]);
$PDO->exec("set names utf8;");
$PDO->exec("use ".$G_MySql["name"].";");
}
catch (Exception $e)
{
$G_Result['state'] = $G_Error["condb"]["code"];
$G_Result['error'] = $G_Error["condb"]["msg"];
do_return();
}
//////////////////////////// 读取参数 ////////////////////////////
//读取data参数
$str_data = GetRequest("data");
$str_data = stripslashes($str_data); //解决表单POST传参数时自动加转义字符的问题
$str_data = str_replace("^","=",$str_data);
$str_data = str_replace("#","+",$str_data);
$str_data = str_replace("!","&",$str_data);
$G_Result['param'] = $str_data;
//检查data是否为空
if ($str_data == "") {
$G_Result['state'] = $G_Error["d_wrong"]["code"];
$G_Result['error'] = $G_Error["d_wrong"]["msg"];
do_return();
}
//检查data是否能转成json
$json_para = json_decode($str_data);
if ($json_para == null) {
$G_Result['state'] = $G_Error["d_wrong"]["code"];
$G_Result['error'] = $G_Error["d_wrong"]["msg"];
do_return();
}
$m = $json_para->m;
$s = $json_para->s;
$p = $json_para->p;
//检查m值
if (($m == null) || ($m == "") || (!function_exists($m))) {
$G_Result['state'] = $G_Error["m_wrong"]["code"];
$G_Result['error'] = $G_Error["m_wrong"]["msg"];
do_return();
}
//检查s值
if (($s == null) || ($s == "")) {
$G_Result['state'] = $G_Error["s_wrong"]["code"];
$G_Result['error'] = $G_Error["s_wrong"]["msg"];
do_return();
}
//检查p值
if (($p != null) && (!is_array($p))) {
$G_Result['state'] = $G_Error["p_wrong"]["code"];
$G_Result['error'] = $G_Error["p_wrong"]["msg"];
do_return();
}
$m($s, $p);
do_return();
//根据参数名获取参数
function GetRequest($name) {
return isset($_REQUEST[$name])?$_REQUEST[$name]:'';
}
//执行sql语句返回结果
function opensql($sql, $para) {
global $G_Result, $G_Error, $PDO;
$stmt = $PDO->prepare($sql.";");
if ($stmt->execute($para))
{
while ($aryData = $stmt->fetch(PDO::FETCH_NAMED)) {
$G_Result["data"][] = $aryData;
}
} else {
$G_Result['state'] = $G_Error["execsql"]["code"];
$G_Result['error'] = $G_Error["execsql"]["msg"];
}
}
//执行sql语句无返回结果
function execsql($sql, $para){
global $G_Result, $G_Error, $PDO;
$stmt = $PDO->prepare($sql.";");
if ($stmt->execute($para))
{} else {
$G_Result['state'] = $G_Error["execsql"]["code"];
$G_Result['error'] = $G_Error["execsql"]["msg"];
}
}
?>

View File

@@ -0,0 +1,147 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE");
header("Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With");
header("Access-Control-Allow-Credentials: true");
header("Content-Type: textml; charset=utf-8");
///////////////////////////// 全局常量 /////////////////////////////
//mysql数据库连接
$G_MySql = array(
"host" => "rm-bp1749tfxu2rpq670lo.mysql.rds.aliyuncs.com",
"name" => "grade_db",
"user" => "games",
"pwd" => "Games0791!!",
"port" => "3306"
// "host" => "120.25.60.74",
// "name" => "youle_games",
// "user" => "root",
// "pwd" => "root",
// "port" => "3333"
);
//错误编码及提示
$G_Error = array(
"condb" => array("code" => 81, "msg" => "连接数据库失败"),
"execsql" => array("code" => 82, "msg" => "操作数据库失败"),
"d_wrong" => array("code" => 83, "msg" => "data参数错误"),
"m_wrong" => array("code" => 84, "msg" => "m参数错误"),
"s_wrong" => array("code" => 85, "msg" => "s参数错误"),
"p_wrong" => array("code" => 86, "msg" => "p参数错误"),
);
///////////////////////////// 全局变量 /////////////////////////////
//接口函数返回的json对象
$G_Result = array(
"state" => 0, //0:成功 <>0:错误编码
"error" => "", //错误时的描述
"param" => "", //接收的参数
"data" => array() //成功时的数据
);
//返回结果$G_G_Result
function do_return(){
global $G_Result;
// if (count($G_Result["data"]) == 0) {
// $G_Result["data"] = new stdClass;
// }
echo json_encode($G_Result);
exit();
}
////////////////////////// 连接MYSQL数据库 /////////////////////////
$PDO = null;
try
{
$PDO = new PDO("mysql:host=".$G_MySql["host"].";port=".$G_MySql["port"].";dbname=".$G_MySql["name"], $G_MySql["user"], $G_MySql["pwd"]);
$PDO->exec("set names utf8;");
$PDO->exec("use ".$G_MySql["name"].";");
}
catch (Exception $e)
{
$G_Result['state'] = $G_Error["condb"]["code"];
$G_Result['error'] = $G_Error["condb"]["msg"];
do_return();
}
//////////////////////////// 读取参数 ////////////////////////////
//读取data参数
$str_data = GetRequest("data");
$str_data = stripslashes($str_data); //解决表单POST传参数时自动加转义字符的问题
$str_data = str_replace("^","=",$str_data);
$str_data = str_replace("#","+",$str_data);
$str_data = str_replace("!","&",$str_data);
$G_Result['param'] = $str_data;
//检查data是否为空
if ($str_data == "") {
$G_Result['state'] = $G_Error["d_wrong"]["code"];
$G_Result['error'] = $G_Error["d_wrong"]["msg"];
do_return();
}
//检查data是否能转成json
$json_para = json_decode($str_data);
if ($json_para == null) {
$G_Result['state'] = $G_Error["d_wrong"]["code"];
$G_Result['error'] = $G_Error["d_wrong"]["msg"];
do_return();
}
$m = $json_para->m;
$s = $json_para->s;
$p = $json_para->p;
//检查m值
if (($m == null) || ($m == "") || (!function_exists($m))) {
$G_Result['state'] = $G_Error["m_wrong"]["code"];
$G_Result['error'] = $G_Error["m_wrong"]["msg"];
do_return();
}
//检查s值
if (($s == null) || ($s == "")) {
$G_Result['state'] = $G_Error["s_wrong"]["code"];
$G_Result['error'] = $G_Error["s_wrong"]["msg"];
do_return();
}
//检查p值
if (($p != null) && (!is_array($p))) {
$G_Result['state'] = $G_Error["p_wrong"]["code"];
$G_Result['error'] = $G_Error["p_wrong"]["msg"];
do_return();
}
$m($s, $p);
do_return();
//根据参数名获取参数
function GetRequest($name) {
return isset($_REQUEST[$name])?$_REQUEST[$name]:'';
}
//执行sql语句返回结果
function opensql($sql, $para) {
global $G_Result, $G_Error, $PDO;
$stmt = $PDO->prepare($sql.";");
if ($stmt->execute($para))
{
while ($aryData = $stmt->fetch(PDO::FETCH_NAMED)) {
$G_Result["data"][] = $aryData;
}
} else {
$G_Result['state'] = $G_Error["execsql"]["code"];
$G_Result['error'] = $G_Error["execsql"]["msg"];
}
}
//执行sql语句无返回结果
function execsql($sql, $para){
global $G_Result, $G_Error, $PDO;
$stmt = $PDO->prepare($sql.";");
if ($stmt->execute($para))
{} else {
$G_Result['state'] = $G_Error["execsql"]["code"];
$G_Result['error'] = $G_Error["execsql"]["msg"];
}
}
?>

View File

@@ -0,0 +1,106 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta charset="utf-8" />
<title>领先的云计算服务提供商-中国万网(www.net.cn)</title>
<style type="text/css">
body {width:100%; margin:0 auto;font-family:'Microsoft YaHei';color:#5d5d5d;font-size:12px; }
.host-top {width: 800px; height: 60px; margin: 0 auto; vertical-align: middle;padding:10px 0; }
.host-top-title{float: left; font-size: 14px;margin-left:12px;padding-top:22px;}
.host-top-right { float: right; margin-right: 5px; line-height: 25px; margin-top: 35px;}
.host-top-right a {color:#5d5d5d;text-decoration:none;font-size:12px;}
.host-middle {background-color:#f0fbff;border-bottom:1px solid #c0c0c0;border-top:2px solid #c0c0c0; height:auto; }
.host-content{width: 800px; margin: 0 auto;padding:40px 0 30px 0;}
.host-operation-title{font-size:16px;text-align:center;padding:10px 0; }
.host-line { border-bottom: 1px solid #c0c0c0; margin-bottom: 10px; height: 15px; }
.host-step{background:url(http://gtms01.alicdn.com/tps/i1/TB1GnvVFVXXXXbMXVXXMak49XXX-799-72.gif) no-repeat; height:70px;padding:20px 0;}
.host-step-one { position:relative;float:left;left:60px;width:205px; }
.host-step-two { position:relative;float:right;width:375px;right:35px; }
.host-middle a {color:#0f79bb;text-decoration:underline;font-size:12px;}
.host-open-title{font-size:16px;padding:5px 10px 10px 10px;}
.host-open-content{padding-left: 10px; text-align: left;font-size:12px;}
.host-bottom{width: 800px;line-height: 60px; margin: 0 auto; text-align:center;}
</style>
</head>
<body>
<div>
<div class="host-top">
<div style="float: left;">
<img src="http://gtms04.alicdn.com/tps/i4/TB1j6r2FVXXXXcwXXXX79lWFFXX-144-60.gif" border="0" />
</div>
<div class="host-top-title">
领先的云计算服务提供商
</div>
<div class="host-top-right"><a href="http://wanwang.aliyun.com/" target="_blank">万网首页</a> | <a href="http://help.aliyun.com" target="_blank">帮助中心</a></div>
</div>
<div class="host-middle">
<div class="host-content">
<div style="height:140px;">
<div style="float: left;">
<img src="http://gtms02.alicdn.com/tps/i2/TB1f5r6FVXXXXc7XpXXkTnU2pXX-190-116.gif" border="0" />
</div>
<div style="float: left; padding:28px 35px;">
<div style="font-size:25px;">您已正式开通主机服务</div>
<div style="font-size:18px;line-height:32px;">这是万网主机提供的测试访问页,您可以随时进行删除或替换</div>
</div>
</div>
<div class="host-operation-title">
<table width="100%" cellspacing="0" cellpadding="0" style="line-height: 32px;text-align:center;">
<tr>
<td style="width: 240px;">
<div class="host-line"></div>
</td>
<td>如需访问到您的网站,请按照以下步骤操作</td>
<td style="width: 240px;">
<div class="host-line"></div>
</td>
</tr>
</table>
</div>
<div class="host-step">
<div class="host-step-one">
您的首页文件及网站程序需上传至FTP下的HTDOCS目录下</div>
<div class="host-step-two">
您自行设定的首页文件名,需要添加至<a href="http://cp.aliyun.com/" target="_blank">控制面板</a>默认首页设置的列表中<a href="http://help.aliyun.com/knowledge_detail/6555122.html" target="_blank">操作帮助</a> </div>
</div>
<div class="host-open-title">
站点开通流程
</div>
<div style="margin-bottom:20px;">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="host-open-content">1、<a href="http://help.aliyun.com/knowledge_detail/6563876.html" target="_blank">获取FTP/数据库信息</a></td>
<td>
<img src="http://gtms03.alicdn.com/tps/i3/TB12J61FVXXXXXfXpXX_YiWFVXX-30-26.gif" border="0" />
</td>
<td class="host-open-content">2、<a href="http://help.aliyun.com/knowledge_detail/5974952.html" target="_blank">网站备案(或申请接入)</a></td>
<td>
<img src="http://gtms03.alicdn.com/tps/i3/TB12J61FVXXXXXfXpXX_YiWFVXX-30-26.gif" border="0" />
</td>
<td class="host-open-content">3、<a href="http://help.aliyun.com/knowledge_detail/6555034.html" target="_blank">上传网站程序</a></td>
<td>
<img src="http://gtms03.alicdn.com/tps/i3/TB12J61FVXXXXXfXpXX_YiWFVXX-30-26.gif" border="0" />
</td>
<td class="host-open-content">4、<a href="http://help.aliyun.com/knowledge_detail/6554963.html" target="_blank">网站调试</a></td>
<td>
<img src="http://gtms03.alicdn.com/tps/i3/TB12J61FVXXXXXfXpXX_YiWFVXX-30-26.gif" border="0" />
</td>
<td class="host-open-content">5、<a href="http://help.aliyun.com/knowledge_detail/6563877.html" target="_blank">域名绑定</a></td>
</tr>
</table>
</div>
</div>
</div>
<div class="host-bottom">
Copyright &copy; 1998 - 2014 中国万网 版权所有
</div>
</div>
</body>
</html>