更新代码清理工具

This commit is contained in:
zeaslity
2026-07-01 16:30:30 +08:00
parent 093f1cddef
commit 205ee0ba4f
9 changed files with 1217 additions and 54 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
/.idea/
/.fastRequest/
/.vscode/

74
.idea/workspace.xml generated
View File

@@ -4,61 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="5b79c488-edbc-40fd-80a0-510f37a69556" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/0-archived/41-202410-珠海横琴/260616-漏洞修复.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/70-202511-XA低空平台/real-nginx-proxy.conf" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/2.3.4-b版本/2.3.3-b新增微服务/cmii-uas-airespace.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/2.3.4-b版本/2.3.3-b新增微服务/cmii-uas-foundation.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/2.3.4-b版本/2.3.3-b新增微服务/cmii-uas-la-defense.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/2.3.4-b版本/2.3.3-b新增微服务/cmii-uas-parser-worker.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/2.3.4-b版本/2.3.4-b-upgrade.sql" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/2.3.4-b版本/image.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/2.3.4-b版本/动态密钥.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/260629-证书升级/xadcity.com.key" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/260629-证书升级/xadcity.com.pem" afterDir="false" />
<change afterPath="$PROJECT_DIR$/71-202601-XA监管平台/反向代理/haikang-reverse-proxy.conf" afterDir="false" />
<change afterPath="$PROJECT_DIR$/75-202603-重庆二级平台/4-nginx代理/gaode-reverse-proxy.conf" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/TCP暴露面.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/k8s-app/cmii-nginx-cm.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/k8s-app/cmii-uav-platform-uas.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/k8s-app/cmii-uav-platform-uasms.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/k8s-app/k8s-ingress-13014.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/公网暴露/real-nginx-proxy.conf" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/服务暴露面.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/all-configmap.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/cmii-live-helper-deployment.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/cmii-live-op-deployment.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/cmii-live-proxy-deployment.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/media-suite-deployment.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/nginx-proxy.conf" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/pvc.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/替换模板.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/视频流媒体/镜像列表.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/镜像/监管2.3-arm.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/81-202604-深圳龙华监管/镜像/视频流媒体.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/84-202605-北京三河测试/sense_adapter_v2.3.0_init_mysql.sql" afterDir="false" />
<change afterPath="$PROJECT_DIR$/85-20260617-江西环境整理/0-资源草稿.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/85-20260617-江西环境整理/1-节点驱逐.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/85-20260617-江西环境整理/江西移动-老平台.doc" afterDir="false" />
<change afterPath="$PROJECT_DIR$/85-20260617-江西环境整理/江西移动二期通感平台.doc" afterDir="false" />
<change afterPath="$PROJECT_DIR$/997-项目VPN虚拟机/rmdc-cluster/40-50-rke-cluster.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/997-项目VPN虚拟机/rmdc-cluster/rmdc-cluster-bootstrap.json" afterDir="false" />
<change afterPath="$PROJECT_DIR$/999-部署模板/中间件版本-260615.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2025_05_15_10_33_[Changes]/shelved.patch" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2025_05_15_10_33__Changes_.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sqldialects.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sqldialects.xml" afterDir="false" />
<list default="true" id="5b79c488-edbc-40fd-80a0-510f37a69556" name="Changes" comment="大量更新">
<change afterPath="$PROJECT_DIR$/998-常用脚本/更新脚本/cmii-clean母脚本.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/0-archived/26-开发高可用集群/批量命令.sh" beforeDir="false" afterPath="$PROJECT_DIR$/0-archived/26-开发高可用集群/批量命令.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/1-2025年/54-202501-深圳规自-ARM/部署yaml/ts2mp4.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/1-2025年/54-202501-深圳规自-ARM/部署yaml/ts2mp4.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/1-2025年/58-202503-新DEMO环境/批量指令.sh" beforeDir="false" afterPath="$PROJECT_DIR$/1-2025年/58-202503-新DEMO环境/批量指令.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/71-202601-XA监管平台/1-批量脚本.sh" beforeDir="false" afterPath="$PROJECT_DIR$/71-202601-XA监管平台/1-批量脚本.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/997-项目VPN虚拟机/3-ubuntu2204虚拟机模板.sh" beforeDir="false" afterPath="$PROJECT_DIR$/997-项目VPN虚拟机/3-ubuntu2204虚拟机模板.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/998-常用脚本/f-nginx暴露/真实nginx-reverse-proxy.conf" beforeDir="false" afterPath="$PROJECT_DIR$/998-常用脚本/f-nginx暴露/真实nginx-reverse-proxy.conf" afterDir="false" />
<change beforePath="$PROJECT_DIR$/998-常用脚本/故障恢复脚本/删除状态不为Running的Pod.sh" beforeDir="false" afterPath="$PROJECT_DIR$/998-常用脚本/故障恢复脚本/删除状态不为Running的Pod.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/999-数据库脚本/a_rmdc-db-operator.sh" beforeDir="false" afterPath="$PROJECT_DIR$/999-数据库脚本/a_rmdc-db-operator.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/999-部署模板/202604-监管模板/cmii-nginx-cm.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/999-部署模板/202604-监管模板/cmii-nginx-cm.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/999-部署模板/202604-监管模板/cmii-uas-gateway.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/999-部署模板/202604-监管模板/cmii-uas-gateway.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/999-部署模板/202604-飞服模板/镜像包.txt" beforeDir="false" afterPath="$PROJECT_DIR$/999-部署模板/202604-飞服模板/镜像包.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/999-部署模板/关键参数说明.txt" beforeDir="false" afterPath="$PROJECT_DIR$/999-部署模板/关键参数说明.txt" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -126,11 +78,29 @@
<workItem from="1782699586146" duration="3663000" />
<workItem from="1782720549494" duration="4240000" />
<workItem from="1782790589954" duration="285000" />
<workItem from="1782790906317" duration="68000" />
<workItem from="1782790906317" duration="175000" />
<workItem from="1782800347262" duration="1413000" />
<workItem from="1782813019054" duration="2507000" />
<workItem from="1782874240779" duration="1849000" />
<workItem from="1782885333690" duration="2058000" />
<workItem from="1782893101973" duration="1358000" />
</task>
<task id="LOCAL-00001" summary="大量更新">
<option name="closed" value="true" />
<created>1782791068556</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1782791068556</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="大量更新" />
<option name="LAST_COMMIT_MESSAGE" value="大量更新" />
</component>
</project>

View File

@@ -28,5 +28,8 @@ ssh root@192.168.40.50 <<< 'scyd@lab1234'
192.168.40.58
192.168.40.64
192.168.40.60
root
SuperCyy@123
boge14@Good

View File

@@ -0,0 +1,98 @@
upstream proxy_server {
ip_hash;
server 10.22.57.8:30500;
server 10.22.57.5:30500;
server 10.22.57.6:30500;
server 10.22.57.7:30500;
}
server {
http2 on;
listen 443 ssl;
server_name airtraffic.xadcity.com;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
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;
ssl_certificate /etc/nginx/conf.d/ssl_key/x.xadcity.com.cert.pem;
ssl_certificate_key /etc/nginx/conf.d/ssl_key/x.xadcity.com.key.pem;
location / {
proxy_pass http://proxy_server;
client_max_body_size 5120m;
client_body_buffer_size 5120m;
client_body_timeout 6000s;
proxy_send_timeout 10000s;
proxy_read_timeout 10000s;
proxy_connect_timeout 600s;
proxy_max_temp_file_size 5120m;
proxy_request_buffering on;
proxy_buffering off;
proxy_buffer_size 4k;
proxy_buffers 4 12k;
proxy_set_header Host fake-domain.xa-dcity-uas-260116.io;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /_AMapService/v4/map/styles {
set $args "$args&jscode=cf66cea95bdcdfcf8048456b36f357a1";
proxy_pass https://webapi.amap.com/v4/ap/styles;
}
location /_AMapService/ {
set $args "$args&jscode=cf66cea95bdcdfcf8048456b36f357a1";
proxy_pass https://restapi.amap.com/;
}
location /rtc/v1/ {
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
proxy_pass http://127.0.0.1:30985/rtc/v1/;
}
location ~ ^/\w*/actuator/ {
return 403;
}
location /live-play/flv/ {
proxy_pass http://192.168.10.1:7088/;
}
location /live-play/hls/ {
proxy_pass http://192.168.10.1:7088/zlm/hls/;
}
location /live-play/webrtc {
proxy_pass http://192.168.10.1:7088/index/api/webrtc;
}
location /live-play/whip {
proxy_pass http://192.168.10.1:7088/index/api/whip;
}
location /live-replay/hls-by-time-range/ {
proxy_pass http://192.168.10.1:8088/api/v2/storage/hls-by-time-range/;
}
location /live-replay/fetch_file/ {
proxy_pass http://192.168.10.1:8088/api/v2/storage/fetch_file/;
}
location /live-replay/hls-downloader {
proxy_pass http://192.168.10.1:7080/hls-downloader;
}
location /player {
proxy_pass http://144.7.88.50:8081/player;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
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;
#WebSocket 超时设置
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -32,6 +32,19 @@ virsh start ubuntu2204-vm
virsh destroy ubuntu2204-vm
python3 vm_manager.py clone-linux \
--template ubuntu2204-vm\
--name-prefix RMDC-ubuntu2204 \
--ip 192.168.11.20 \
--prefix 24 \
--gateway 192.168.11.1 \
--dns 192.168.34.40,223.5.5.5 \
--vcpus 4 \
--memory 8192 \
--data-size 20000G \
--autostart
python3 vm_manager.py clone-linux \
--template ubuntu2204-vm\
--name-prefix ubuntu2204 \

View File

@@ -12,6 +12,8 @@ server {
listen 8088;
server_name localhost;
underscores_in_headers on;
location / {
proxy_pass http://proxy_server;

View File

@@ -10,7 +10,7 @@ chmod +x /usr/local/bin/jq
export name_space_list=(bj-sh-uas-260511)
export name_space_list=(kube-system kubernetes-dashboard ingress-nginx bj-sh-uas-260511)
export name_space_list=(kube-system kubernetes-dashboard ingress-nginx xayd)
for name_space in ${name_space_list[*]};do

View File

@@ -0,0 +1,40 @@
#!/bin/bash
set -euo pipefail
TARGET_DIR="${1:-.}"
RETENTION_DAYS="${2:-0}" # 0 表示不限时间,直接清理
PATTERNS=(
"*.tar.gz" "*.tar.gz.*" "*.tgz"
"*.tar.bz2" "*.tbz2"
"*.tar.xz" "*.txz"
"*.zip" "*.7z" "*.rar"
"*.tar"
"wget-log*" "wget.log*" "*.wget.log"
)
cd "$TARGET_DIR" || { echo "无法进入目录: $TARGET_DIR"; exit 1; }
LOG_FILE="./cleanup_$(date +%Y%m%d).log"
log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" | tee -a "$LOG_FILE"; }
log "开始清理目录: $(pwd) 保留天数: $RETENTION_DAYS"
TOTAL_COUNT=0; TOTAL_SIZE=0
for pattern in "${PATTERNS[@]}"; do
if [ "$RETENTION_DAYS" -gt 0 ]; then
mapfile -d '' files < <(find . -maxdepth 1 -type f -name "$pattern" -mtime +"$RETENTION_DAYS" -print0)
else
mapfile -d '' files < <(find . -maxdepth 1 -type f -name "$pattern" -print0)
fi
for f in "${files[@]}"; do
[ -e "$f" ] || continue
size=$(stat -c%s "$f" 2>/dev/null || stat -f%z "$f" 2>/dev/null || echo 0)
TOTAL_SIZE=$((TOTAL_SIZE + size)); TOTAL_COUNT=$((TOTAL_COUNT + 1))
log "删除: $f (${size} 字节)"
rm -f -- "$f"
done
done
HUMAN_SIZE=$(numfmt --to=iec --suffix=B "$TOTAL_SIZE" 2>/dev/null || echo "${TOTAL_SIZE}B")
log "清理完成,共删除 ${TOTAL_COUNT} 个文件,释放 ${HUMAN_SIZE} 空间"
find . -maxdepth 1 -type f -name "cleanup_*.log" -mtime +30 -delete