Fix S3 test (use HeadBucket like VPM-Uploader), replace UDP button with grayed Electron App

This commit is contained in:
Zac Gaetano 2026-04-07 00:30:28 -04:00
parent db25255472
commit ae4360e85a
2 changed files with 5 additions and 14 deletions

View file

@ -464,11 +464,12 @@ body::before{content:'';position:fixed;inset:0;background:radial-gradient(ellips
<div style="margin-top:1.5rem;margin-bottom:1.25rem"> <div style="margin-top:1.5rem;margin-bottom:1.25rem">
<div style="display:flex;gap:.5rem;margin-bottom:.75rem"> <div style="display:flex;gap:.5rem;margin-bottom:.75rem">
<button class="mode-btn active-http" id="btn-http" onclick="setMode('http')">🌐 HTTP Mode</button> <button class="mode-btn active-http" id="btn-http" onclick="setMode('http')">🌐 HTTP Mode</button>
<button class="mode-btn" id="btn-udp" onclick="setMode('udp')">⚡ UDP Mode</button> <button class="mode-btn" id="btn-udp" disabled style="opacity:.4;cursor:not-allowed;pointer-events:none">🖥️ Electron App</button>
</div> </div>
<div class="mode-desc" id="mode-desc" style="margin-bottom:0"> <div class="mode-desc" id="mode-desc" style="margin-bottom:0">
<strong id="mode-label">HTTP Mode:</strong> <span id="mode-detail">Parallel chunked HTTP upload (6 concurrent 32MB parts). Aspera-class speed — no UDP needed.</span> <strong id="mode-label">HTTP Mode:</strong> <span id="mode-detail">Parallel chunked HTTP upload (6 concurrent 32MB parts). Aspera-class speed — no UDP needed.</span>
</div> </div>
<div style="text-align:right;margin-top:.3rem;font-size:.7rem;color:var(--text-dim);opacity:.6">Electron App — Aspera-speed desktop application (coming soon)</div>
</div> </div>
<div style="margin-bottom:1.5rem"> <div style="margin-bottom:1.5rem">

View file

@ -455,22 +455,12 @@ app.post("/api/s3/test", requireAdmin, async (req, res) => {
return res.status(400).json({ success: false, error: "Bucket, Access Key ID, and Secret Key are required to test" }); return res.status(400).json({ success: false, error: "Bucket, Access Key ID, and Secret Key are required to test" });
const testClient = buildS3Client(testCfg); const testClient = buildS3Client(testCfg);
const testKey = `_dragonwind_test_${Date.now()}.txt`;
try { try {
// Upload a tiny test file // Test by checking if bucket exists and is accessible
await testClient.send(new PutObjectCommand({ await testClient.send(new HeadBucketCommand({ Bucket: testCfg.bucket }));
Bucket: testCfg.bucket,
Key: testKey,
Body: Buffer.from("Dragon Wind S3 connection test"),
ContentType: "text/plain",
}));
// Delete it immediately
try {
await testClient.send(new DeleteObjectCommand({ Bucket: testCfg.bucket, Key: testKey }));
} catch (_) { /* delete failure is non-fatal */ }
res.json({ success: true, message: "S3 connection confirmed! Test file uploaded and deleted successfully." }); res.json({ success: true, message: "✓ S3 connection confirmed! Credentials are valid and the bucket is accessible." });
} catch (err) { } catch (err) {
let friendly = err.message; let friendly = err.message;
if (err.name === "NoSuchBucket") friendly = `Bucket "${testCfg.bucket}" does not exist`; if (err.name === "NoSuchBucket") friendly = `Bucket "${testCfg.bucket}" does not exist`;