-
- Navicat™
- The gateway to your database!
-
-
-
-
-
Copyright © PremiumSoft ™ CyberTech Ltd. All Rights Reserved.
-
-
-
\ No newline at end of file
diff --git a/codes/agent/game-docker/docker/nginx/default.conf.template b/codes/agent/game-docker/docker/nginx/default.conf.template
index 3e0096e..7252e7b 100644
--- a/codes/agent/game-docker/docker/nginx/default.conf.template
+++ b/codes/agent/game-docker/docker/nginx/default.conf.template
@@ -10,6 +10,14 @@ upstream wxserver_service {
server wxserver:3000;
}
+# ── 限速区域定义(在 http 块级别,此处用 geo 标记 + limit_req_zone)──
+# 登录接口:每个 IP 每秒最多 5 次请求,突发缓冲 10 次
+limit_req_zone $binary_remote_addr zone=login_limit:10m rate=5r/s;
+# 通用 API:每个 IP 每秒最多 30 次请求
+limit_req_zone $binary_remote_addr zone=api_limit:10m rate=30r/s;
+# 连接数限制:每个 IP 同时最多 20 个连接
+limit_conn_zone $binary_remote_addr zone=conn_limit:10m;
+
# =============================================
# 域名路由模式 + SSL(Let's Encrypt 自动证书)
#
@@ -108,10 +116,45 @@ server {
ssl_certificate_key /etc/letsencrypt/live/${API_DOMAIN}/privkey.pem;
include /etc/nginx/snippets/ssl-params.conf;
+ # 隐藏服务器版本信息
+ server_tokens off;
+
+ # 请求体大小限制(防止大请求攻击)
+ client_max_body_size 10m;
+ client_body_timeout 30s;
+ client_header_timeout 30s;
+
+ # 连接数限制
+ limit_conn conn_limit 20;
+
+ # ── 屏蔽敏感文件(直接返回 404,不暴露文件存在)──
+ location ~* \.(env|sh|bak|sql|log|git|svn|htaccess|htpasswd|ini|conf)$ {
+ return 404;
+ }
+ location ~* /(ntunnel_mysql|phpMyAdmin|phpmyadmin|adminer|debug)\.php$ {
+ return 404;
+ }
+ location ~ /\. {
+ return 404;
+ }
+
+ # ── 登录接口限速(防爆破)──
+ location ~* /source/login/ {
+ limit_req zone=login_limit burst=10 nodelay;
+ limit_req_status 429;
+ proxy_pass http://api_service;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-Port $server_port;
+ }
+
# wxserver 路由:/wx/ 前缀转发给 wxserver 容器,自动去除 /wx 前缀
# 例:/wx/auth/oa/callback → wxserver:/auth/oa/callback
# 例:/wx/api/login → wxserver:/api/login
location /wx/ {
+ limit_req zone=api_limit burst=50 nodelay;
proxy_pass http://wxserver_service/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -132,6 +175,7 @@ server {
# PHP API(所有其他请求)
location / {
+ limit_req zone=api_limit burst=50 nodelay;
proxy_pass http://api_service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -151,7 +195,30 @@ server {
ssl_certificate_key /etc/letsencrypt/live/${DLWEB_DOMAIN}/privkey.pem;
include /etc/nginx/snippets/ssl-params.conf;
+ # 隐藏服务器版本信息
+ server_tokens off;
+
+ # 请求体大小限制
+ client_max_body_size 10m;
+ client_body_timeout 30s;
+ client_header_timeout 30s;
+
+ # 连接数限制
+ limit_conn conn_limit 20;
+
+ # ── 屏蔽敏感文件 ──
+ location ~* \.(env|sh|bak|sql|log|git|svn|htaccess|htpasswd|ini|conf)$ {
+ return 404;
+ }
+ location ~* /(ntunnel_mysql|phpMyAdmin|phpmyadmin|adminer|debug)\.php$ {
+ return 404;
+ }
+ location ~ /\. {
+ return 404;
+ }
+
location / {
+ limit_req zone=api_limit burst=50 nodelay;
proxy_pass http://dlweb_service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
diff --git a/codes/agent/game-docker/docker/nginx/ssl-params.conf b/codes/agent/game-docker/docker/nginx/ssl-params.conf
index a018610..e7fb388 100644
--- a/codes/agent/game-docker/docker/nginx/ssl-params.conf
+++ b/codes/agent/game-docker/docker/nginx/ssl-params.conf
@@ -5,8 +5,8 @@ ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
-# HSTS (取消注释以启用,请确认所有子域都支持 HTTPS 后再启用)
-# add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
+# HSTS:强制浏览器只用 HTTPS 连接(去掉 includeSubDomains,避免影响其他未配置 HTTPS 的子域名)
+add_header Strict-Transport-Security "max-age=31536000" always;
# OCSP Stapling
ssl_stapling on;
@@ -21,3 +21,17 @@ ssl_session_tickets off;
# DH 参数 (如果生成了 dhparam.pem)
# ssl_dhparam /etc/nginx/ssl/dhparam.pem;
+
+# ── 安全响应头 ──────────────────────────────────────────────────────
+# 防点击劫持:禁止页面被嵌入 iframe
+add_header X-Frame-Options "SAMEORIGIN" always;
+# 防 MIME 类型嗅探
+add_header X-Content-Type-Options "nosniff" always;
+# 启用浏览器内置 XSS 过滤(旧浏览器兼容)
+add_header X-XSS-Protection "1; mode=block" always;
+# 限制 Referer 信息泄露
+add_header Referrer-Policy "strict-origin-when-cross-origin" always;
+# 隐藏 nginx 版本号(在 nginx.conf 中配合 server_tokens off 使用)
+# Content Security Policy:按需调整,当前允许同源 + 必要的外部资源
+# frame-ancestors 额外放开微信支付收银台来源,避免微信 H5 支付 iframe 被拦截
+add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' res.wx.qq.com; img-src 'self' data: https:; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; frame-ancestors 'self' https://wx.tenpay.com https://*.weixin.qq.com https://*.qq.com;" always;
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250726.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250726.log.gz
new file mode 100644
index 0000000..4f47aba
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250726.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250727.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250727.log.gz
new file mode 100644
index 0000000..7296ad3
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250727.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250728.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250728.log.gz
new file mode 100644
index 0000000..638b1ac
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250728.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250729.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250729.log.gz
new file mode 100644
index 0000000..a960c35
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250729.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250730.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250730.log.gz
new file mode 100644
index 0000000..9fd9450
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250730.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250731.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250731.log.gz
new file mode 100644
index 0000000..3878796
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250731.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250801.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250801.log.gz
new file mode 100644
index 0000000..7db953b
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250801.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250802.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250802.log.gz
new file mode 100644
index 0000000..10d9c87
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250802.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250803.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250803.log.gz
new file mode 100644
index 0000000..d2b4ff8
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250803.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250804.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250804.log.gz
new file mode 100644
index 0000000..7b2b49e
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250804.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250805.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250805.log.gz
new file mode 100644
index 0000000..252a557
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250805.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250806.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250806.log.gz
new file mode 100644
index 0000000..588a8d4
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250806.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250807.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250807.log.gz
new file mode 100644
index 0000000..ffd4f81
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250807.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250808.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250808.log.gz
new file mode 100644
index 0000000..cffff5e
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250808.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250809.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250809.log.gz
new file mode 100644
index 0000000..5f766a8
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250809.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250810.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250810.log.gz
new file mode 100644
index 0000000..f4ec956
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250810.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250811.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250811.log.gz
new file mode 100644
index 0000000..ea42a46
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250811.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250812.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250812.log.gz
new file mode 100644
index 0000000..df0181f
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250812.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250813.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250813.log.gz
new file mode 100644
index 0000000..543e6a1
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250813.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250814.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250814.log.gz
new file mode 100644
index 0000000..5eddcd3
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250814.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250815.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250815.log.gz
new file mode 100644
index 0000000..405fc87
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250815.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250816.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250816.log.gz
new file mode 100644
index 0000000..ee10660
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250816.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250817.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250817.log.gz
new file mode 100644
index 0000000..5fcf5e2
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250817.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250818.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250818.log.gz
new file mode 100644
index 0000000..62a0818
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250818.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250819.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250819.log.gz
new file mode 100644
index 0000000..72b5790
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250819.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250820.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250820.log.gz
new file mode 100644
index 0000000..7d5989d
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250820.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250821.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250821.log.gz
new file mode 100644
index 0000000..898f83c
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250821.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250822.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250822.log.gz
new file mode 100644
index 0000000..0274a12
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250822.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250823.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250823.log.gz
new file mode 100644
index 0000000..97748c6
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250823.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250824.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250824.log.gz
new file mode 100644
index 0000000..548597e
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250824.log.gz differ
diff --git a/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250825.log.gz b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250825.log.gz
new file mode 100644
index 0000000..fb0f78b
Binary files /dev/null and b/codes/yunhost/ftplogs/vsftpd_hyu3136430001_20250825.log.gz differ
diff --git a/codes/yunhost/htdocs/1.txt b/codes/yunhost/htdocs/1.txt
new file mode 100644
index 0000000..56a6051
--- /dev/null
+++ b/codes/yunhost/htdocs/1.txt
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/codes/yunhost/htdocs/logreport/no_delete b/codes/yunhost/htdocs/logreport/no_delete
new file mode 100644
index 0000000..e69de29
diff --git a/codes/yunhost/htdocs/mysql.php b/codes/yunhost/htdocs/mysql.php
new file mode 100644
index 0000000..2ff753d
--- /dev/null
+++ b/codes/yunhost/htdocs/mysql.php
@@ -0,0 +1,147 @@
+ "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"];
+ }
+}
+?>
\ No newline at end of file
diff --git a/codes/yunhost/htdocs/mysql_agent.php b/codes/yunhost/htdocs/mysql_agent.php
new file mode 100644
index 0000000..2819b59
--- /dev/null
+++ b/codes/yunhost/htdocs/mysql_agent.php
@@ -0,0 +1,147 @@
+ "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"];
+ }
+}
+?>
\ No newline at end of file
diff --git a/codes/yunhost/htdocs/mysql_grade.php b/codes/yunhost/htdocs/mysql_grade.php
new file mode 100644
index 0000000..903a12c
--- /dev/null
+++ b/codes/yunhost/htdocs/mysql_grade.php
@@ -0,0 +1,147 @@
+ "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"];
+ }
+}
+?>
\ No newline at end of file
diff --git a/codes/yunhost/htdocs/zhuye.html b/codes/yunhost/htdocs/zhuye.html
new file mode 100644
index 0000000..9eaad2c
--- /dev/null
+++ b/codes/yunhost/htdocs/zhuye.html
@@ -0,0 +1,106 @@
+
+
+
+
+