Fix S3 test (use HeadBucket like VPM-Uploader), replace UDP button with grayed Electron App
This commit is contained in:
parent
db25255472
commit
ae4360e85a
2 changed files with 5 additions and 14 deletions
|
|
@ -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="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" 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 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 32 MB parts). Aspera-class speed — no UDP needed.</span>
|
||||
</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 style="margin-bottom:1.5rem">
|
||||
|
|
|
|||
16
server.js
16
server.js
|
|
@ -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" });
|
||||
|
||||
const testClient = buildS3Client(testCfg);
|
||||
const testKey = `_dragonwind_test_${Date.now()}.txt`;
|
||||
|
||||
try {
|
||||
// Upload a tiny test file
|
||||
await testClient.send(new PutObjectCommand({
|
||||
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 */ }
|
||||
// Test by checking if bucket exists and is accessible
|
||||
await testClient.send(new HeadBucketCommand({ Bucket: testCfg.bucket }));
|
||||
|
||||
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) {
|
||||
let friendly = err.message;
|
||||
if (err.name === "NoSuchBucket") friendly = `Bucket "${testCfg.bucket}" does not exist`;
|
||||
|
|
|
|||
Loading…
Reference in a new issue