From 6041bc34199f0bb43a83780ff9279c5aeda7aee0 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Thu, 14 May 2026 05:50:44 -0700 Subject: [PATCH] x --- .gitea/workflows/docker.yml | 2 +- aaa.conf | 76 +++++++++++++++++++ .../json/aws-rds-redis-overview.json | 24 +++--- .../dashboards/json/ppanel-server-logs.json | 10 +-- 4 files changed, 94 insertions(+), 18 deletions(-) create mode 100644 aaa.conf diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index e356bab..b944c1a 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -20,7 +20,7 @@ env: SSH_KEY: ${{ secrets.AWS }} # TG通知 TG_BOT_TOKEN: 8114337882:AAHkEx03HSu7RxN4IHBJJEnsK9aPPzNLIk0 - TG_CHAT_ID: "-49402438031" + TG_CHAT_ID: "-4940243803" # Go构建变量 SERVICE: vpn SERVICE_STYLE: vpn diff --git a/aaa.conf b/aaa.conf new file mode 100644 index 0000000..685d49c --- /dev/null +++ b/aaa.conf @@ -0,0 +1,76 @@ +upstream api_backend { + server 127.0.0.1:8080; +} + +server { + + listen 80; + server_name api.hifast.biz 4d3vsw888xgaen.hifast.biz; + location /.well-known/acme-challenge/ { + root /var/www/html; + allow all; + } + location / { + return 301 https://$host$request_uri; + } +} + +server { + listen 443 ssl http2; + server_name api.hifast.biz; + client_max_body_size 150M; + ssl_certificate /etc/nginx/ssl/hifast.biz/_.hifast.biz.pem; # managed by Certbot + ssl_certificate_key /etc/nginx/ssl/hifast.biz/_.hifast.biz.key; # managed by Certbot + + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + add_header X-Frame-Options "DENY"; + + add_header X-Content-Type-Options nosniff; + if ($http_user_agent ~* '(9999|91\.78)') { + return 444; + } + location ~ ^/v1/common/client/download/file/(?Hi快VPN-(?windows|mac|android)-1.0.0-ic-.*\.(?exe|dmg|apk))$ { + alias /var/www/download/Hi快VPN-$os-1.0.0.$ext; + charset utf-8; + add_header Content-Disposition 'attachment; filename="$download_name"'; + add_header Content-Type application/octet-stream; + } + + location /v1/common/client/download/file/ { + alias /var/www/download/; + } + + location / { + proxy_pass http://api_backend; + 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_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + +} + +server { + listen 443 ssl http2; + server_name 4d3vsw888xgaen.hifast.biz; + client_max_body_size 150M; + ssl_certificate /etc/nginx/ssl/hifast.biz/_.hifast.biz.pem; # managed by Certbot + ssl_certificate_key /etc/nginx/ssl/hifast.biz/_.hifast.biz.key; # managed by Certbot + + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json image/svg+xml; + root /var/www/admin; + location / { + try_files $uri $uri/ /index.html; + } + +} \ No newline at end of file diff --git a/grafana/provisioning/dashboards/json/aws-rds-redis-overview.json b/grafana/provisioning/dashboards/json/aws-rds-redis-overview.json index 7325401..97f4820 100644 --- a/grafana/provisioning/dashboards/json/aws-rds-redis-overview.json +++ b/grafana/provisioning/dashboards/json/aws-rds-redis-overview.json @@ -34,7 +34,7 @@ }, "id": 1, "options": { - "content": "AWS CloudWatch overview
Region: ap-east-1 (Hong Kong)
RDS DBInstanceIdentifier: database-1
Redis ReplicationGroupId: hifastapp-redis

Note: Redis panels are configured using ReplicationGroupId. If a panel shows no data in your account, switch that dimension to the concrete CacheClusterId in Grafana query editor.", + "content": "AWS CloudWatch overview
Region: ap-east-1 (Hong Kong)
RDS DBInstanceIdentifier: hifast-mysql-prod-v2
Redis: current production uses a local Docker Redis container (hifast-redis) on EC2 rather than AWS ElastiCache.

This dashboard keeps the RDS CloudWatch panels. Redis should be observed from the local ops dashboard via Prometheus/cAdvisor instead of ElastiCache metrics.", "mode": "html" }, "pluginVersion": "11.0.0", @@ -75,7 +75,7 @@ "uid": "cloudwatch" }, "dimensions": { - "DBInstanceIdentifier": "database-1" + "DBInstanceIdentifier": "hifast-mysql-prod-v2" }, "metricName": "CPUUtilization", "namespace": "AWS/RDS", @@ -122,7 +122,7 @@ "uid": "cloudwatch" }, "dimensions": { - "DBInstanceIdentifier": "database-1" + "DBInstanceIdentifier": "hifast-mysql-prod-v2" }, "metricName": "DatabaseConnections", "namespace": "AWS/RDS", @@ -169,7 +169,7 @@ "uid": "cloudwatch" }, "dimensions": { - "DBInstanceIdentifier": "database-1" + "DBInstanceIdentifier": "hifast-mysql-prod-v2" }, "metricName": "FreeStorageSpace", "namespace": "AWS/RDS", @@ -216,7 +216,7 @@ "uid": "cloudwatch" }, "dimensions": { - "DBInstanceIdentifier": "database-1" + "DBInstanceIdentifier": "hifast-mysql-prod-v2" }, "metricName": "ReadLatency", "namespace": "AWS/RDS", @@ -231,7 +231,7 @@ "uid": "cloudwatch" }, "dimensions": { - "DBInstanceIdentifier": "database-1" + "DBInstanceIdentifier": "hifast-mysql-prod-v2" }, "metricName": "WriteLatency", "namespace": "AWS/RDS", @@ -278,7 +278,7 @@ "uid": "cloudwatch" }, "dimensions": { - "DBInstanceIdentifier": "database-1" + "DBInstanceIdentifier": "hifast-mysql-prod-v2" }, "metricName": "ReadIOPS", "namespace": "AWS/RDS", @@ -293,7 +293,7 @@ "uid": "cloudwatch" }, "dimensions": { - "DBInstanceIdentifier": "database-1" + "DBInstanceIdentifier": "hifast-mysql-prod-v2" }, "metricName": "WriteIOPS", "namespace": "AWS/RDS", @@ -350,7 +350,7 @@ "statistic": "Average" } ], - "title": "Redis Host CPU", + "title": "Redis Host CPU (Legacy ElastiCache)", "type": "timeseries" }, { @@ -397,7 +397,7 @@ "statistic": "Average" } ], - "title": "Redis Engine CPU", + "title": "Redis Engine CPU (Legacy ElastiCache)", "type": "timeseries" }, { @@ -444,7 +444,7 @@ "statistic": "Average" } ], - "title": "Redis Connections", + "title": "Redis Connections (Legacy ElastiCache)", "type": "timeseries" }, { @@ -491,7 +491,7 @@ "statistic": "Average" } ], - "title": "Redis Memory Usage %", + "title": "Redis Memory Usage % (Legacy ElastiCache)", "type": "timeseries" } ], diff --git a/grafana/provisioning/dashboards/json/ppanel-server-logs.json b/grafana/provisioning/dashboards/json/ppanel-server-logs.json index 21fabbb..864f1c5 100644 --- a/grafana/provisioning/dashboards/json/ppanel-server-logs.json +++ b/grafana/provisioning/dashboards/json/ppanel-server-logs.json @@ -58,7 +58,7 @@ "uid": "P8E80F9AEF21F6940" }, "editorMode": "code", - "expr": "sum(count_over_time({container=\"ppanel-server\"} |~ \"${user_id:raw}\" |~ \"${email:raw}\" |~ \"${order:raw}\" |~ \"${keyword:raw}\" |~ \"${level:raw}\" [5m]))", + "expr": "sum(count_over_time({compose_service=\"ppanel-server\"}[5m]))", "queryType": "range", "refId": "A" } @@ -103,7 +103,7 @@ "uid": "P8E80F9AEF21F6940" }, "editorMode": "code", - "expr": "sum(count_over_time({container=\"ppanel-server\"} |~ \"${user_id:raw}\" |~ \"${email:raw}\" |~ \"${order:raw}\" |~ \"${keyword:raw}\" |~ \"(?i)(error|panic|fatal)\" [5m]))", + "expr": "sum(count_over_time({compose_service=\"ppanel-server\"} |~ \"(?i)(error|panic|fatal)\" [5m]))", "queryType": "range", "refId": "A" } @@ -140,7 +140,7 @@ "uid": "P8E80F9AEF21F6940" }, "editorMode": "code", - "expr": "{container=\"ppanel-server\"} |~ \"${user_id:raw}\" |~ \"${email:raw}\" |~ \"${order:raw}\" |~ \"${keyword:raw}\" |~ \"${level:raw}\"", + "expr": "{compose_service=\"ppanel-server\"}", "queryType": "range", "refId": "A" } @@ -177,7 +177,7 @@ "uid": "P8E80F9AEF21F6940" }, "editorMode": "code", - "expr": "{container=\"ppanel-server\"} |~ \"${user_id:raw}\" |~ \"${email:raw}\" |~ \"${order:raw}\" |~ \"${keyword:raw}\" |~ \"(?i)(error|panic|fatal)\"", + "expr": "{compose_service=\"ppanel-server\"} |~ \"(?i)(error|panic|fatal)\"", "queryType": "range", "refId": "A" } @@ -318,7 +318,7 @@ ] }, "time": { - "from": "now-7d", + "from": "now-1h", "to": "now" }, "timepicker": {},