mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Update Cloudflare R2 upload to use minimal permissions and add progress bar
- Removed requirement for Cloudflare API Token, Zone ID, and Worker Token from Upload Modal and R2Service. - Simplified R2 configuration to require only Account ID, S3 Access Keys, and a user-provided Public Bucket URL. - Added a read-only field in Upload Modal displaying the derived target bucket name (npub-based) for user reference. - Implemented client-side torrent info hash calculation using `WebTorrent` (via `js/utils/torrentHash.js`) to generate magnet links before upload. - Added a visual upload progress bar to the Upload Modal. - Updated `js/r2.js` to ensure the Public Bucket URL always includes the `https://` protocol.
This commit is contained in:
1 parent
01d4335fda
commit
7dc2977cf2
5 files changed
+224
-350
No files matched your search
@@ -10,8 +10,12 @@ function sanitizeBaseDomain(domain) {
|
||||
return "";
|
||||
}
|
||||
let value = String(domain).trim().toLowerCase();
|
||||
value = value.replace(/^https?:\/\//, "");
|
||||
value = value.replace(/\/.*$/, "");
|
||||
// Ensure it starts with https:// if it doesn't already
|
||||
if (!/^https?:\/\//.test(value)) {
|
||||
value = `https://${value}`;
|
||||
}
|
||||
// Remove trailing slashes
|
||||
value = value.replace(/\/+$/, "");
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user