mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 18:20:43 +00:00
琚帶绔?- 淇 MTU 闂锛氬す MSS + 璺緞 MTU 鎺㈡祴锛堝叕缃戝彲鐢ㄧ巼 48% -> 100%锛?- 澶嶇敤 HTTP 杩炴帴锛堝厤鎺夋瘡娆℃柊寤?TLS 鐨?30% 鎻℃墜澶辫触锛?- 姣忓垎閽熷洖澶存壘灞€鍩熺綉锛岃嚜鍔ㄥ垏鍥炲揩 400 鍊嶇殑璺緞 - 鐢婚潰蹇冭烦甯э細闈欐鏃剁渷娴侀噺锛屽鎴风浠嶇煡閬撴祦鏄椿鐨?- 閿佸睆鏃剁粰鍑哄彲鎿嶄綔鐨勬彁绀? 鎵嬭〃绔?- 鍐呯疆 GTS Root R4 / GlobalSign Root CA锛屼慨 SSLHandshakeException - 杩炴帴閿欒缈昏瘧鎴愪汉璇濓紙璇佷功/鏃堕棿/瑙f瀽/瓒呮椂鍒嗗埆鎻愮ず锛?- 缁忎腑杞繛涓婂悗鐢ㄦ湇鍔″櫒鎶ョ殑鍦板潃鍒锋柊宸查厤瀵硅褰?- 鏂板灞€鍩熺綉杩炴帴椤甸潰銆佹湇鍔″櫒寤惰繜妫€娴? 鏈嶅姟鍣ㄧ - 鏀寔 chunked 璇锋眰浣擄紙淇瘡 16 绉掍竴娆$殑杩炴帴閿欎贡涓庡ぇ闈㈢Н 502锛?- 缃戠粶璋冧紭鑴氭湰 net-tune.sh锛堝紑鏈鸿嚜鍔ㄥ簲鐢級 - 绠$悊椤碉細鎵归噺鍒犻櫎銆佺綉缁滀綋妫€銆佷笅杞藉尯 - 闅ч亾鏀?HTTP/2 + 鍙岃繛鎺? 鏂囨。 - 璁稿彲鍗忚 / 瀹夎鍓嶅繀璇?/ 瀹夎鍚庨』鐭ワ紙浣滆€咃細灏忛害瀛愶級
126 lines
3.7 KiB
PowerShell
126 lines
3.7 KiB
PowerShell
# 配置 Gitee 仓库:生成 SSH 密钥 + 建 .gitignore + 初始化提交
|
||
# 用法: powershell -NoProfile -ExecutionPolicy Bypass -File _build\setup_gitee.ps1
|
||
|
||
$ErrorActionPreference = "Continue"
|
||
$git = "C:\Program Files\Git\bin\git.exe"
|
||
$root = "C:\Users\shu\Desktop\deepseekagent\LanRemote"
|
||
$sshDir = Join-Path $env:USERPROFILE ".ssh"
|
||
Set-Location $root
|
||
|
||
Write-Host ""
|
||
Write-Host "===== 1. 生成 SSH 密钥(如果没有)=====" -ForegroundColor Cyan
|
||
if (-not (Test-Path $sshDir)) { New-Item -ItemType Directory -Path $sshDir -Force | Out-Null }
|
||
$keyPath = Join-Path $sshDir "id_ed25519_gitee"
|
||
if (Test-Path $keyPath) {
|
||
Write-Host " 密钥已存在: $keyPath"
|
||
} else {
|
||
& "$env:ProgramFiles\Git\usr\bin\ssh-keygen.exe" -t ed25519 -C "ykxmz-gitee" -f $keyPath -N '""' 2>&1 | Out-Null
|
||
if (Test-Path $keyPath) { Write-Host " ✓ 已生成 $keyPath" } else { Write-Host " ✗ 生成失败" -ForegroundColor Red }
|
||
}
|
||
|
||
Write-Host ""
|
||
Write-Host "===== 2. 配置 SSH(让 gitee.com 用这个密钥)=====" -ForegroundColor Cyan
|
||
$sshConfig = Join-Path $sshDir "config"
|
||
$marker = "# ykxmz-gitee"
|
||
$existing = if (Test-Path $sshConfig) { Get-Content $sshConfig -Raw } else { "" }
|
||
if ($existing -notmatch [regex]::Escape($marker)) {
|
||
$block = @"
|
||
|
||
$marker
|
||
Host gitee.com
|
||
HostName gitee.com
|
||
User git
|
||
IdentityFile $($keyPath -replace '\\','/')
|
||
IdentitiesOnly yes
|
||
StrictHostKeyChecking accept-new
|
||
"@
|
||
Add-Content -Path $sshConfig -Value $block -Encoding UTF8
|
||
Write-Host " 已写入 $sshConfig"
|
||
} else {
|
||
Write-Host " SSH 配置已存在"
|
||
}
|
||
|
||
Write-Host ""
|
||
Write-Host "===== 3. 建 .gitignore =====" -ForegroundColor Cyan
|
||
$ignore = @'
|
||
# ---- 构建产物(不提交,release 里单独发)----
|
||
/dist/
|
||
/dist_exe/
|
||
/_build/jc*/
|
||
/_build/out*/
|
||
/_build/*.png
|
||
/_build/icon_source.png
|
||
/_build/icon_preview.png
|
||
/_build/admin_preview*.png
|
||
/_build/ui_preview.png
|
||
/_build/_unit.txt
|
||
/_tests/out_java/
|
||
/_tests/out_app/
|
||
/_tests/received/
|
||
/_tests/_stubdata/
|
||
/_tests/shots/
|
||
|
||
# ---- Python ----
|
||
__pycache__/
|
||
*.py[cod]
|
||
*.egg-info/
|
||
.venv/
|
||
venv/
|
||
|
||
# ---- 编辑器 / 系统 ----
|
||
.vscode/
|
||
.idea/
|
||
*.swp
|
||
Thumbs.db
|
||
desktop.ini
|
||
.DS_Store
|
||
|
||
# ---- 其它 ----
|
||
*.log
|
||
*.tmp
|
||
'@
|
||
Set-Content -Path (Join-Path $root ".gitignore") -Value $ignore -Encoding UTF8
|
||
Write-Host " 已写入 .gitignore"
|
||
|
||
Write-Host ""
|
||
Write-Host "===== 4. git 初始化 =====" -ForegroundColor Cyan
|
||
if (-not (Test-Path (Join-Path $root ".git"))) {
|
||
& $git init -q -b main 2>&1 | Out-Null
|
||
Write-Host " ✓ git init"
|
||
} else {
|
||
Write-Host " 仓库已存在"
|
||
}
|
||
& $git config user.name "xmz7891" 2>&1 | Out-Null
|
||
& $git config user.email "xmz7891@gitee.com" 2>&1 | Out-Null
|
||
& $git config core.quotepath false 2>&1 | Out-Null
|
||
& $git config core.autocrlf false 2>&1 | Out-Null
|
||
Write-Host " ✓ 配置完成"
|
||
|
||
Write-Host ""
|
||
Write-Host "===== 5. 加 remote =====" -ForegroundColor Cyan
|
||
$remotes = & $git remote 2>&1
|
||
if ($remotes -notcontains "origin") {
|
||
& $git remote add origin "git@gitee.com:xmz7891/ykxmz.git" 2>&1 | Out-Null
|
||
Write-Host " ✓ origin = git@gitee.com:xmz7891/ykxmz.git"
|
||
} else {
|
||
Write-Host " origin 已存在: $(& $git remote get-url origin)"
|
||
}
|
||
|
||
Write-Host ""
|
||
Write-Host "===== 6. 待提交文件统计 =====" -ForegroundColor Cyan
|
||
& $git add -A 2>&1 | Out-Null
|
||
$staged = (& $git diff --cached --name-only 2>&1)
|
||
Write-Host " 暂存文件数: $($staged.Count)"
|
||
$size = 0
|
||
foreach ($f in $staged) {
|
||
$p = Join-Path $root $f
|
||
if (Test-Path $p -PathType Leaf) { $size += (Get-Item $p).Length }
|
||
}
|
||
Write-Host " 总体积: $([math]::Round($size/1MB,2)) MB"
|
||
|
||
Write-Host ""
|
||
Write-Host "===== 7. 你的公钥(要加到 Gitee)=====" -ForegroundColor Yellow
|
||
if (Test-Path "$keyPath.pub") {
|
||
Get-Content "$keyPath.pub" | ForEach-Object { Write-Host " $_" -ForegroundColor White }
|
||
}
|