s3deck 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 s3deck contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,502 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # s3deck
4
+
5
+ **A fast, modern web UI for S3 and S3-compatible storage, started with one command.**
6
+
7
+ Browse buckets, preview files, upload and download gigabytes, share links and
8
+ manage bucket settings on AWS S3, Cloudflare R2, MinIO, Backblaze B2 and more,
9
+ all from your browser.
10
+
11
+ [![npm version](https://img.shields.io/npm/v/s3deck?style=flat-square&logo=npm&color=cb3837)](https://www.npmjs.com/package/s3deck)
12
+ [![npm downloads](https://img.shields.io/npm/dm/s3deck?style=flat-square&color=cb3837)](https://www.npmjs.com/package/s3deck)
13
+ [![CI](https://img.shields.io/github/actions/workflow/status/kamdev-bharatai/s3deck/ci.yml?branch=main&style=flat-square&logo=github&label=CI)](https://github.com/kamdev-bharatai/s3deck/actions/workflows/ci.yml)
14
+ [![Node.js](https://img.shields.io/badge/Node.js-20%2B-339933?style=flat-square&logo=nodedotjs&logoColor=white)](https://nodejs.org)
15
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org)
16
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](./LICENSE)
17
+ [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square)](https://github.com/kamdev-bharatai/s3deck/pulls)
18
+
19
+ [**Quick start**](#quick-start) ·
20
+ [**Features**](#features) ·
21
+ [**Providers**](#supported-providers) ·
22
+ [**Usage**](#usage) ·
23
+ [**Reverse proxy**](#behind-a-reverse-proxy) ·
24
+ [**Security**](#security) ·
25
+ [**Development**](#development)
26
+
27
+ </div>
28
+
29
+ > [!NOTE]
30
+ > s3deck is pre-1.0. It is usable today, but options and APIs may change
31
+ > between minor versions until 1.0. Check the
32
+ > [releases](https://github.com/kamdev-bharatai/s3deck/releases) before upgrading.
33
+
34
+ ---
35
+
36
+ ## Quick start
37
+
38
+ ```bash
39
+ # AWS S3, using your usual AWS credentials (env vars, ~/.aws, SSO, …)
40
+ npx s3deck
41
+
42
+ # Any S3-compatible endpoint
43
+ AWS_ACCESS_KEY_ID=… AWS_SECRET_ACCESS_KEY=… npx s3deck http://localhost:9000
44
+ ```
45
+
46
+ s3deck connects to your storage, starts a local web app, and prints a URL and
47
+ a login. Open it to browse every bucket the credentials can see. Put it behind
48
+ any reverse proxy to reach it remotely.
49
+
50
+ ```
51
+ s3deck v0.1.0
52
+
53
+ ✓ Connected MinIO at http://localhost:9000 (region us-east-1)
54
+ Buckets 8 available
55
+ ➜ Web UI http://127.0.0.1:47715/
56
+ Reachable from this machine only (remote: ssh -L 47715:127.0.0.1:47715 …)
57
+ Login admin / 3fH9kQ2xLmP_
58
+ ```
59
+
60
+ > [!TIP]
61
+ > No install needed. `npx` always runs the latest release. To pin a version,
62
+ > use `npx s3deck@0.1.0`, or install globally with `npm i -g s3deck`.
63
+
64
+ ## Why s3deck?
65
+
66
+ | | |
67
+ | --- | --- |
68
+ | **Zero setup** | One `npx` command. No Docker image, no desktop app, no bucket CORS changes. |
69
+ | **Any S3 provider** | AWS, R2, MinIO, B2, Spaces, Wasabi and more. Features a provider doesn't support are hidden, not broken. |
70
+ | **Built for big buckets** | Lists millions of objects page by page; uploads and downloads stream, so file size doesn't matter. |
71
+ | **Keys stay on the server** | The browser never sees your access keys. Every request is signed server-side. |
72
+ | **Secure by default** | Generated password, localhost binding, CSRF protection, optional read-only mode. |
73
+
74
+ ## Features
75
+
76
+ ### Browse
77
+
78
+ - **Every bucket in one place.** Switch from the sidebar (or press <kbd>⌘</kbd> <kbd>K</kbd>).
79
+ The bucket and folder are in the URL, so links and bookmarks keep them.
80
+ - **Folders that feel like folders.** Navigate prefixes with breadcrumbs, sort
81
+ by name, size, date or storage class, and filter the current folder as you
82
+ type. Large folders load page by page while you scroll.
83
+ - **Search by prefix** across the whole bucket, not just the current folder.
84
+ - **Previews.** Images, video, audio, PDF, text and code (with syntax
85
+ highlighting), JSON (formatted), CSV (as a table) and Markdown open in a side
86
+ panel. Large files are previewed from their first bytes only.
87
+ - **Object details.** Size, ETag, storage class, last modified, version ID,
88
+ content type and every header and custom metadata field.
89
+
90
+ ### Move files
91
+
92
+ - **Upload anything.** Drag files or whole folders onto the page, or paste
93
+ (<kbd>⌘</kbd> <kbd>V</kbd>) a screenshot. Large files go up in parallel parts
94
+ with progress, speed, time left, pause and cancel. Uploads stream through
95
+ s3deck, so the bucket needs no CORS rules.
96
+ - **Resumable uploads.** Parts are retried automatically. If the network drops
97
+ or you close the tab, add the same file again and it continues from the parts
98
+ already uploaded.
99
+ - **Download anything.** Single files stream straight from storage. Select
100
+ several files or a folder to download them as one ZIP, built on the fly
101
+ without temporary files.
102
+ - **Copy, move and rename** files and folders, inside a bucket or between
103
+ buckets, using server-side copy (multipart copy for files over 5 GB). Nothing
104
+ passes through your machine.
105
+ - **Drag to move.** Drop files and folders onto a folder, a breadcrumb or the
106
+ up arrow to move them there.
107
+ - **Delete safely.** Deleting a folder shows how many objects and bytes it
108
+ contains before you confirm, then removes them in batches of 1,000. On
109
+ versioned buckets, **Show deleted files** lists deleted objects so you can
110
+ restore them in one click.
111
+ - **Sync and compare.** Compare two folders, even on different connections or
112
+ providers (say R2 → S3), see what's missing or different, then copy or mirror
113
+ in a background job with live progress.
114
+
115
+ ### Share
116
+
117
+ - **Presigned links.** Create a download link for any object with an expiry
118
+ from minutes to 7 days, and copy it in one click. Create upload links that let
119
+ someone put one file at a given key.
120
+ - **Public URLs.** For public buckets, copy the object's direct URL (or your
121
+ custom domain's URL, if you set one).
122
+
123
+ ### Manage
124
+
125
+ - **Buckets.** Create and delete buckets (with an "empty it first" option),
126
+ choose the region and see each bucket's settings at a glance.
127
+ - **Metadata and tags.** Edit `Content-Type`, `Cache-Control`,
128
+ `Content-Disposition`, custom `x-amz-meta-*` fields and object tags, on one
129
+ object or many at once.
130
+ - **Versions.** On versioned buckets, list an object's versions and delete
131
+ markers, preview or download any of them, restore an older version and
132
+ permanently delete versions.
133
+ - **Bucket settings.** Turn versioning on or off, and edit CORS rules,
134
+ lifecycle rules, the bucket policy and public access settings, each with a
135
+ JSON editor that validates before saving.
136
+ - **Storage usage.** Calculate the size and object count of a bucket or folder,
137
+ broken down by subfolder and storage class. It runs on demand, because it has
138
+ to list every object. Any folder row can also show its size on demand.
139
+ - **Storage classes and archives.** Move objects between storage classes, and
140
+ restore Glacier / Deep Archive objects (choose the speed and how long the copy
141
+ stays). Archived objects are marked, and their preview explains what to do.
142
+ - **Encryption and object lock.** See each object's encryption and KMS key,
143
+ retention and legal hold, and the bucket's default encryption and lock rules.
144
+ - **Incomplete uploads.** List multipart uploads that never finished (they're
145
+ billed until aborted) and clean them up.
146
+
147
+ ### And also
148
+
149
+ - **Safe defaults.** Login page with a generated password, binds to
150
+ `127.0.0.1`, CSRF protection, optional read-only mode.
151
+ - **Grid view.** Switch the folder view to a grid with image thumbnails.
152
+ - **Light and dark themes.** Follows your system, or pick one.
153
+
154
+ ### Teams
155
+
156
+ - **Users and roles.** Add people with their own login: **viewers** browse,
157
+ preview, download and share; **editors** also upload, edit, move and delete;
158
+ **admins** also manage buckets, bucket settings, users and the activity log.
159
+ - **Single sign-on.** Let people sign in with Google, Microsoft, Okta, Auth0,
160
+ Keycloak or any OpenID Connect provider (see [Single sign-on](#single-sign-on)).
161
+ - **Remembered connections.** Tick *Remember this connection* when entering
162
+ keys in the browser. They're stored on the server encrypted (AES-256-GCM),
163
+ belong to your user, and are still there after a restart.
164
+ - **Activity log.** Every change (uploads, deletes, moves, settings, sign-ins)
165
+ with who, when and from which address, filterable by user and bucket.
166
+
167
+ ## Supported providers
168
+
169
+ s3deck talks the S3 API, so it works with any compatible service. Features a
170
+ provider doesn't implement (such as versioning on R2) are detected and hidden.
171
+
172
+ | Provider | Endpoint example | Notes |
173
+ | --- | --- | --- |
174
+ | [AWS S3](https://aws.amazon.com/s3/) | *(none needed)* | Every feature |
175
+ | [Cloudflare R2](https://developers.cloudflare.com/r2/) | `https://<account-id>.r2.cloudflarestorage.com` | Region `auto`. No versioning or object tags |
176
+ | [MinIO](https://min.io) | `http://localhost:9000` | Uses path-style URLs automatically |
177
+ | [Backblaze B2](https://www.backblaze.com/cloud-storage) | `https://s3.us-west-004.backblazeb2.com` | |
178
+ | [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces) | `https://nyc3.digitaloceanspaces.com` | |
179
+ | [Wasabi](https://wasabi.com) | `https://s3.eu-central-1.wasabisys.com` | |
180
+ | [Ceph RGW](https://docs.ceph.com/en/latest/radosgw/), [Garage](https://garagehq.deuxfleurs.fr), [LocalStack](https://www.localstack.cloud) | your gateway URL | Path-style URLs; use `--path-style` if needed |
181
+
182
+ ## Requirements
183
+
184
+ | | Version |
185
+ | --- | --- |
186
+ | [Node.js](https://nodejs.org) | 20 or newer |
187
+ | Credentials | An access key with permission to list buckets, or `--bucket` to open one bucket directly |
188
+
189
+ ## Usage
190
+
191
+ ```bash
192
+ npx s3deck [endpoint] [options]
193
+ ```
194
+
195
+ Leave out the endpoint for AWS S3. For any other provider, pass its S3
196
+ endpoint URL. Credentials come from the standard AWS sources, in this order:
197
+
198
+ 1. `--access-key` and `--secret-key`
199
+ 2. `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (and `AWS_SESSION_TOKEN`)
200
+ 3. A profile from `~/.aws/credentials` or `~/.aws/config` (`--profile` or
201
+ `AWS_PROFILE`), including SSO and assumed roles
202
+ 4. Instance, container or web identity credentials when running in AWS
203
+
204
+ No credentials? s3deck still starts, and you can **enter them in the browser**:
205
+ pick a provider (AWS, R2, MinIO, B2, Spaces, Wasabi or any S3-compatible
206
+ endpoint), paste an access key and connect. Keys entered this way are sent once
207
+ to the s3deck server, kept only in its memory for your session, never sent back
208
+ to the browser and forgotten on logout or restart. You can add several
209
+ connections and switch between them from the sidebar. Disable this with
210
+ `--no-browser-connections`.
211
+
212
+ ### Options
213
+
214
+ | Option | Default | Description |
215
+ | --- | --- | --- |
216
+ | `-p, --port <port>` | `47715` (or `$PORT`) | Port for the web UI |
217
+ | `-H, --host <host>` | `127.0.0.1` | Interface to bind. Use `0.0.0.0` in containers or to expose on a LAN |
218
+ | `-u, --user <name>` | `admin` | Login username |
219
+ | `-P, --password <password>` | random | Login password (or `$S3DECK_PASSWORD`). A new random one is printed on each start if not set |
220
+ | `--no-auth` | | Disable the login page. Only on a trusted machine |
221
+ | `--region <region>` | from config, else `us-east-1` | Region to sign requests for (or `$AWS_REGION`) |
222
+ | `--profile <name>` | | AWS profile to use (or `$AWS_PROFILE`) |
223
+ | `--access-key <id>` | | Access key ID. Prefer the environment variable, so it stays out of shell history |
224
+ | `--secret-key <secret>` | | Secret access key. Same advice |
225
+ | `--session-token <token>` | | Session token for temporary credentials (or `$AWS_SESSION_TOKEN`) |
226
+ | `--path-style` | auto | Use path-style URLs (`host/bucket/key`) instead of virtual-hosted style |
227
+ | `--bucket <name>` | | Open this bucket directly. Use it when the key may not list buckets. Repeat for several |
228
+ | `--readonly` | | Disable uploads, edits and deletes in the UI and the API |
229
+ | `--base-path <path>` | | Serve under a path prefix such as `/s3` (see [reverse proxy](#behind-a-reverse-proxy)) |
230
+ | `--open` | | Open the UI in your browser |
231
+ | `--data-dir <dir>` | `~/.config/s3deck` | Where users, remembered connections and the activity log are kept (or `$S3DECK_DATA_DIR`) |
232
+ | `--no-persist` | | Write nothing to disk: no extra users, remembered connections or activity file |
233
+ | `--public-url <url>` | from the request | Public URL of s3deck, for single sign-on redirects (or `$S3DECK_PUBLIC_URL`) |
234
+ | `--no-browser-connections` | | Don't let users enter credentials in the browser |
235
+ | `-v, --version` | | Print the version |
236
+ | `-h, --help` | | Show help |
237
+
238
+ ### Environment variables
239
+
240
+ | Variable | Used for |
241
+ | --- | --- |
242
+ | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` | Credentials |
243
+ | `AWS_PROFILE`, `AWS_REGION` | Profile and region (same as `--profile`, `--region`) |
244
+ | `AWS_ENDPOINT_URL_S3`, `AWS_ENDPOINT_URL` | Endpoint when none is passed as an argument |
245
+ | `S3DECK_PASSWORD` | Login password (same as `--password`) |
246
+ | `PORT` | Web UI port (same as `--port`) |
247
+ | `S3DECK_DATA_DIR` | Data directory (same as `--data-dir`) |
248
+ | `S3DECK_SECRET` | Passphrase that encrypts remembered connections. If unset, a random key is created in the data directory |
249
+ | `S3DECK_PUBLIC_URL` | Public URL (same as `--public-url`) |
250
+ | `S3DECK_OIDC_*` | Single sign-on, see below |
251
+
252
+ ### Examples
253
+
254
+ ```bash
255
+ # AWS with a named profile, open the browser automatically
256
+ npx s3deck --profile prod --open
257
+
258
+ # Local MinIO with its default credentials
259
+ AWS_ACCESS_KEY_ID=minioadmin AWS_SECRET_ACCESS_KEY=minioadmin npx s3deck http://localhost:9000
260
+
261
+ # Cloudflare R2, read-only
262
+ npx s3deck "https://$CF_ACCOUNT_ID.r2.cloudflarestorage.com" --region auto --readonly
263
+
264
+ # A key that can only access one bucket
265
+ npx s3deck --bucket my-app-uploads
266
+
267
+ # Inside Docker / on a LAN
268
+ npx s3deck http://minio:9000 --host 0.0.0.0 --password "$SECRET"
269
+ ```
270
+
271
+ ### Keyboard shortcuts
272
+
273
+ | Shortcut | Action |
274
+ | --- | --- |
275
+ | <kbd>⌘</kbd> <kbd>K</kbd> | Switch bucket / command menu |
276
+ | <kbd>⌘</kbd> <kbd>U</kbd> | Upload files |
277
+ | <kbd>Space</kbd> | Preview the selected file |
278
+ | <kbd>Enter</kbd> | Open a folder |
279
+ | <kbd>⌫</kbd> | Go up one folder |
280
+ | <kbd>⌘</kbd> <kbd>A</kbd> | Select everything in the folder |
281
+ | <kbd>⌘</kbd> <kbd>V</kbd> | Upload pasted files or screenshots |
282
+ | <kbd>/</kbd> | Filter the folder |
283
+ | <kbd>↑</kbd> <kbd>↓</kbd> | Move between rows |
284
+ | <kbd>Esc</kbd> | Close the preview, or clear the selection |
285
+
286
+ <sub>On Windows and Linux, use <kbd>Ctrl</kbd> in place of <kbd>⌘</kbd>.</sub>
287
+
288
+ ## Users, data and single sign-on
289
+
290
+ The login printed at startup is always an **admin**. Admins add more people on
291
+ the **Users** page. Users, remembered connections and the activity log live in
292
+ the data directory (`~/.config/s3deck` by default, mode `0700`):
293
+
294
+ | File | Contents |
295
+ | --- | --- |
296
+ | `users.json` | Users, roles and scrypt password hashes |
297
+ | `connections.enc` | Remembered connections, encrypted with AES-256-GCM |
298
+ | `secret.key` | The encryption key, unless `S3DECK_SECRET` is set |
299
+ | `activity.jsonl` | The activity log (rotated at 10 MB) |
300
+
301
+ Back up the data directory together with its key: without `secret.key` (or the
302
+ same `S3DECK_SECRET`), remembered connections can't be decrypted.
303
+
304
+ ### Single sign-on
305
+
306
+ Any OpenID Connect provider works. Register s3deck as a web application with
307
+ the redirect URL `https://<your s3deck>/api/auth/sso/callback`, then:
308
+
309
+ ```bash
310
+ S3DECK_OIDC_ISSUER=https://accounts.google.com \
311
+ S3DECK_OIDC_CLIENT_ID=… S3DECK_OIDC_CLIENT_SECRET=… \
312
+ S3DECK_OIDC_LABEL="Sign in with Google" \
313
+ S3DECK_OIDC_ALLOW="@example.com, contractor@gmail.com" \
314
+ S3DECK_OIDC_DEFAULT_ROLE=viewer \
315
+ S3DECK_PUBLIC_URL=https://files.example.com \
316
+ npx s3deck
317
+ ```
318
+
319
+ | Variable | Meaning |
320
+ | --- | --- |
321
+ | `S3DECK_OIDC_ISSUER` | Issuer URL (discovery is automatic) |
322
+ | `S3DECK_OIDC_CLIENT_ID`, `S3DECK_OIDC_CLIENT_SECRET` | Client credentials |
323
+ | `S3DECK_OIDC_LABEL` | Button text on the login page |
324
+ | `S3DECK_OIDC_ALLOW` | Emails or `@domains` allowed in. People added on the Users page (by email) are always allowed, with their own role |
325
+ | `S3DECK_OIDC_DEFAULT_ROLE` | Role for allowed people who aren't on the Users page (`viewer` by default) |
326
+
327
+ Sign-in uses the authorization code flow with PKCE, and only accepts verified
328
+ email addresses.
329
+
330
+ ## Behind a reverse proxy
331
+
332
+ s3deck is a single server on one port, and the UI uses relative URLs, so it
333
+ works at the root of a domain or under a path. Two things matter:
334
+
335
+ 1. **Large transfers.** Uploads and downloads stream through s3deck, so turn
336
+ off the proxy's body-size limit and request buffering, and allow long
337
+ requests.
338
+ 2. **Under a path, either strip the prefix in the proxy, or pass the same
339
+ prefix with `--base-path`.** Either way, open the URL with a trailing slash
340
+ (`https://example.com/s3/`).
341
+
342
+ <details>
343
+ <summary><b>nginx</b></summary>
344
+
345
+ ```nginx
346
+ # s3deck started with: npx s3deck --base-path /s3 --password "$SECRET"
347
+ location /s3/ {
348
+ proxy_pass http://127.0.0.1:47715;
349
+ proxy_http_version 1.1;
350
+ proxy_set_header Host $host;
351
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
352
+ proxy_set_header X-Forwarded-Proto $scheme;
353
+
354
+ # Large uploads and downloads: no body limit, stream both ways, long requests.
355
+ client_max_body_size 0;
356
+ proxy_request_buffering off;
357
+ proxy_buffering off;
358
+ proxy_read_timeout 1h;
359
+ proxy_send_timeout 1h;
360
+ }
361
+ ```
362
+
363
+ </details>
364
+
365
+ <details>
366
+ <summary><b>Caddy</b></summary>
367
+
368
+ ```caddy
369
+ example.com {
370
+ handle_path /s3/* {
371
+ reverse_proxy 127.0.0.1:47715
372
+ }
373
+ }
374
+ ```
375
+
376
+ `handle_path` strips `/s3`, so start s3deck **without** `--base-path` here.
377
+
378
+ </details>
379
+
380
+ ### Health check
381
+
382
+ `GET /healthz` returns `{"ok":true}` without logging in.
383
+
384
+ ## Security
385
+
386
+ > [!WARNING]
387
+ > s3deck gives anyone who logs in everything the access key can do. Treat it
388
+ > like the key itself.
389
+
390
+ - **Keys never reach the browser.** The server signs every S3 request. The UI
391
+ only ever receives object data and presigned links you create on purpose.
392
+ - **Login.** On by default, with a random password printed at startup. Sessions
393
+ are HTTP-only, `SameSite=Strict` cookies kept in memory. Restarting s3deck
394
+ logs everyone out. Failed logins are rate-limited per client address.
395
+ - **Roles.** Every request is checked against the user's current role, so
396
+ changing someone's role or disabling them takes effect immediately. Passwords
397
+ are stored as scrypt hashes.
398
+ - **Stored secrets.** Remembered connections are encrypted with AES-256-GCM.
399
+ All files in the data directory are created owner-only (`0600`).
400
+ - **Single sign-on.** Authorization code flow with PKCE, state and nonce checks;
401
+ unverified email addresses are refused.
402
+ - **Network.** Binds to `127.0.0.1` unless you pass `--host`. s3deck warns at
403
+ startup if you combine a public interface with `--no-auth`.
404
+ - **CSRF.** API calls require a custom header, so other websites can't use your
405
+ session.
406
+ - **Previews.** HTML and SVG files are never rendered as pages. They are shown
407
+ as source or in a sandboxed frame, so a file in a bucket can't run scripts
408
+ in s3deck.
409
+ - **HTTPS.** s3deck serves plain HTTP. Terminate TLS at your reverse proxy; the
410
+ session cookie is marked `Secure` when the proxy sends
411
+ `X-Forwarded-Proto: https`.
412
+ - **Least privilege.** For anything sensitive, use a key scoped to the buckets
413
+ and actions you need. `--readonly` blocks writes in s3deck, but the real
414
+ boundary is the key's IAM policy. A read-only key is the safest choice.
415
+
416
+ Found a vulnerability? Please report it privately through
417
+ [GitHub security advisories](https://github.com/kamdev-bharatai/s3deck/security/advisories/new)
418
+ rather than a public issue.
419
+
420
+ ## Troubleshooting
421
+
422
+ | Symptom | Likely cause and fix |
423
+ | --- | --- |
424
+ | `AccessDenied` when listing buckets | The key can't call `ListBuckets`. Pass the buckets it can reach with `--bucket <name>` (repeat for several). |
425
+ | `SignatureDoesNotMatch` or `AuthorizationHeaderMalformed` | Wrong region. Set `--region` (R2 uses `auto`). |
426
+ | Bucket not found / DNS errors on self-hosted storage | The server needs path-style URLs. Add `--path-style`. |
427
+ | Uploads fail or stall behind a proxy | The proxy is limiting or buffering bodies. See [Behind a reverse proxy](#behind-a-reverse-proxy). |
428
+ | Logged out after restarting | Expected: sessions live in memory. Set `--password` / `S3DECK_PASSWORD` to keep the same login. |
429
+ | Remembered connections are gone | The data directory or its `secret.key` changed. Keep `S3DECK_SECRET` or the key file with the data directory. |
430
+
431
+ ## Development
432
+
433
+ ```bash
434
+ git clone https://github.com/kamdev-bharatai/s3deck.git
435
+ cd s3deck
436
+ pnpm install
437
+
438
+ # Optional: a local MinIO to develop against
439
+ docker run -d -p 9000:9000 -p 9001:9001 minio/minio server /data --console-address :9001
440
+
441
+ # API on :47715 (no login) + Vite UI with hot reload on :47716
442
+ AWS_ACCESS_KEY_ID=minioadmin AWS_SECRET_ACCESS_KEY=minioadmin \
443
+ AWS_ENDPOINT_URL=http://localhost:9000 pnpm dev
444
+ ```
445
+
446
+ Open <http://localhost:47716>.
447
+
448
+ | Script | What it does |
449
+ | --- | --- |
450
+ | `pnpm dev` | API with auto-restart and the UI with hot reload |
451
+ | `pnpm build` | Build the UI (Vite) and the CLI (tsdown) into `dist/` |
452
+ | `pnpm start` | Run the built CLI |
453
+ | `pnpm typecheck` | Type-check the server, the UI and the tests |
454
+ | `pnpm test` | Unit and API tests (Vitest). Add `S3DECK_TEST_ENDPOINT` to also run the S3 integration tests |
455
+ | `pnpm test:integration` | Integration tests against `http://localhost:9000` (or `$S3DECK_TEST_ENDPOINT`) |
456
+ | `pnpm pack:check` | Build and list exactly what would be published |
457
+
458
+ ### Project layout
459
+
460
+ ```
461
+ src/
462
+ cli/ command-line entry, options, credential resolution, startup banner
463
+ server/ Hono app: auth, roles, API routes, SSO, jobs, static UI
464
+ store/ data directory: users, encrypted connections, activity log
465
+ s3/ S3 client, provider detection, listing, transfers, multipart, sync
466
+ shared/ zod schemas and types shared by the server and the UI
467
+ test/
468
+ unit/ schemas, providers, crypto, users, API (no S3 needed)
469
+ integration/ real S3: uploads, multipart, copy, presign, sync
470
+ web/
471
+ src/
472
+ api/ typed API client, React Query hooks
473
+ components/ shadcn/ui primitives (ui/) and app components (app/)
474
+ views/ buckets, object browser, preview, bucket settings, sync, activity, users, login
475
+ lib/ router, theme, formatting, resumable upload queue
476
+ ```
477
+
478
+ ### Built with
479
+
480
+ [![Hono](https://img.shields.io/badge/Hono-E36002?style=flat-square&logo=hono&logoColor=white)](https://hono.dev)
481
+ [![AWS SDK v3](https://img.shields.io/badge/AWS_SDK-v3-232F3E?style=flat-square&logo=amazonwebservices&logoColor=white)](https://github.com/aws/aws-sdk-js-v3)
482
+ [![React](https://img.shields.io/badge/React-20232A?style=flat-square&logo=react&logoColor=61DAFB)](https://react.dev)
483
+ [![TanStack Query](https://img.shields.io/badge/TanStack_Query-FF4154?style=flat-square&logo=reactquery&logoColor=white)](https://tanstack.com/query)
484
+ [![shadcn/ui](https://img.shields.io/badge/shadcn%2Fui-000000?style=flat-square&logo=shadcnui&logoColor=white)](https://ui.shadcn.com)
485
+ [![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-06B6D4?style=flat-square&logo=tailwindcss&logoColor=white)](https://tailwindcss.com)
486
+ [![Vite](https://img.shields.io/badge/Vite-646CFF?style=flat-square&logo=vite&logoColor=white)](https://vite.dev)
487
+ [![tsdown](https://img.shields.io/badge/tsdown-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://tsdown.dev)
488
+
489
+ ## Contributing
490
+
491
+ Contributions are welcome! Bug reports and feature requests go in
492
+ [issues](https://github.com/kamdev-bharatai/s3deck/issues). For code changes:
493
+
494
+ 1. Fork the repo and create a branch from `main`.
495
+ 2. Run `pnpm dev` against a local MinIO (see [Development](#development)) and
496
+ make your change.
497
+ 3. Make sure `pnpm typecheck` and `pnpm build` pass.
498
+ 4. Open a pull request describing what changed and why.
499
+
500
+ ## License
501
+
502
+ Released under the [MIT License](./LICENSE).