r2-explorer 0.6.0 → 1.0.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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -90
  3. package/bin/cli.js +29970 -0
  4. package/dist/index.js +1 -0
  5. package/dist/index.mjs +1 -0
  6. package/dist/src/authentication/api/access.d.ts +4 -0
  7. package/dist/src/buckets/api/createFolder.d.ts +8 -0
  8. package/dist/src/buckets/api/deleteObject.d.ts +8 -0
  9. package/dist/src/buckets/api/downloadObject.d.ts +8 -0
  10. package/dist/src/buckets/api/getObject.d.ts +8 -0
  11. package/dist/src/buckets/api/headObject.d.ts +8 -0
  12. package/dist/src/buckets/api/listBuckets.d.ts +10 -0
  13. package/dist/src/buckets/api/listObjects.d.ts +8 -0
  14. package/dist/src/buckets/api/moveObject.d.ts +8 -0
  15. package/dist/src/buckets/api/multipart/completeUpload.d.ts +11 -0
  16. package/dist/src/buckets/api/multipart/createUpload.d.ts +11 -0
  17. package/dist/src/buckets/api/multipart/partUpload.d.ts +8 -0
  18. package/dist/src/buckets/api/putMetadata.d.ts +8 -0
  19. package/dist/src/buckets/api/putObject.d.ts +8 -0
  20. package/dist/src/buckets/api/renameObject.d.ts +8 -0
  21. package/dist/src/buckets/api/uploadObject.d.ts +10 -0
  22. package/dist/src/buckets/router.d.ts +1 -0
  23. package/dist/src/dashbord.d.ts +2 -0
  24. package/dist/src/dates.d.ts +2 -0
  25. package/dist/src/emails/receiveEmail.d.ts +2 -0
  26. package/dist/src/index.d.ts +5 -0
  27. package/dist/src/interfaces.d.ts +21 -0
  28. package/dist/src/server/api/createFolder.d.ts +8 -0
  29. package/dist/src/server/api/deleteObject.d.ts +10 -0
  30. package/dist/src/server/api/downloadObject.d.ts +8 -0
  31. package/dist/src/server/api/getInfo.d.ts +14 -0
  32. package/dist/src/server/api/listBuckets.d.ts +14 -0
  33. package/dist/src/server/api/listObjects.d.ts +11 -0
  34. package/dist/src/server/api/multipart/completeUpload.d.ts +11 -0
  35. package/dist/src/server/api/multipart/createUpload.d.ts +11 -0
  36. package/dist/src/server/api/multipart/partUpload.d.ts +8 -0
  37. package/dist/src/server/api/renameObject.d.ts +10 -0
  38. package/dist/src/server/api/uploadObject.d.ts +10 -0
  39. package/dist/src/server/router.d.ts +1 -0
  40. package/dist/src/settings.d.ts +5 -0
  41. package/package.json +48 -29
  42. package/bin/r2-explorer.js +0 -70
  43. package/dist/umd/index.js +0 -679
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Gabriel Massadas
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
@@ -5,14 +5,13 @@ A Google Drive Interface for your Cloudflare R2 Buckets!
5
5
  This project is deployed/self-hosted in your own Cloudflare Account as a Worker, and no credential/token is required to
6
6
  start using it.
7
7
 
8
- You can see an live example, in `read-only` mode, in your browser at https://r2-explorer.massadas.com/
8
+ - Documentation: [r2explorer.dev](https://r2explorer.dev)
9
+ - Live Demo: [demo.r2explorer.dev](https://demo.r2explorer.dev)
9
10
 
10
- This project is still in development, and there are definitely going to be some weird issues sometimes, but when you
11
- find something
12
- please [open an new issue](https://github.com/G4brym/R2-Explorer/issues/new) for it to get solved.
13
11
 
14
12
  ## Features
15
13
 
14
+ - [Email Explorer](https://r2explorer.dev/guides/setup-email-explorer/) (using Cloudflare Email Routing)
16
15
  - Very quick bucket/folder navigation
17
16
  - pdf, image, txt, markdown, csv, etc in-browser preview
18
17
  - Drag-and-Drop upload
@@ -25,65 +24,12 @@ please [open an new issue](https://github.com/G4brym/R2-Explorer/issues/new) for
25
24
  - Multipart upload for big files
26
25
  - Cloudflare Access validation using jwt
27
26
 
28
- ## Configurations
29
-
30
- These options are defined in the `index.js` file, in the `R2Explorer({ readonly: false, ... })`.
31
-
32
- | Name | Type(s) | Description | Examples |
33
- |--------------------|--------------------------|-----------------------------------------------------------------------|-----------------------------------------------------------|
34
- | `readonly` | `boolean` or `undefined` | Controls the write access globally, default: `true` | `true` |
35
- | `cors` | `boolean` or `undefined` | Enables or disables CORS access to the internal API, default: `false` | `true` |
36
- | `cfAccessTeamName` | `string` or `undefined` | When set enforces Cloudflare Access in all requests | `radar` (taken from https://radar.cloudflareaccess.com/) |
37
-
38
-
39
- ## FAQ
40
-
41
- Q. Is there any Authentication for r2-explorer?
42
-
43
- A. No. If you want authenticated access, you must
44
- setup [Cloudflare Access](https://www.cloudflare.com/products/zero-trust/access/) in your account.
45
- Access is free up to 50 users.
46
-
47
- ___
48
-
49
- Q. Can i upload files bigger than 100MB?
50
-
51
- A. Yes! R2-Explorer now
52
- support's [Multipart Upload](https://developers.cloudflare.com/r2/data-access/workers-api/workers-multipart-usage/),
53
- that splits the files you are uploading in about 95MB chunks for uploading within the Cloudflare 100MB uploading limit.
54
-
55
27
  ## Getting Started
56
28
 
57
29
  Run this command to get an example project setup
58
30
 
59
31
  ```bash
60
- npx r2-explorer my-r2-explorer
61
- ```
62
-
63
- Change into the newly created directory and install the packages
64
-
65
- ```bash
66
- cd my-r2-explorer
67
- npm install
68
- ```
69
-
70
- Update the `wrangler.toml` with your R2 Buckets (tip: you can setup as many Buckets as your want)
71
-
72
- ```
73
- - wrangler.toml -
74
- ...
75
- [[r2_buckets]]
76
- binding = 'my-bucket-name'
77
- bucket_name = 'my-bucket-name'
78
- preview_bucket_name = 'my-bucket-name'
79
- ```
80
-
81
- If you want to be able to upload/modify your buckets, you must update the `readonly` flag in `src/index.ts` file.
82
-
83
- After that just run publish and the project will be up and running for you and everyone you invite to use the Buckets
84
-
85
- ```bash
86
- wrangler publish
32
+ npm create r2-explorer@latest
87
33
  ```
88
34
 
89
35
  ## Upgrading your installation
@@ -108,46 +54,19 @@ wrangler publish
108
54
  - Image thumbnail's using Cloudflare workers
109
55
  - Tooltip when hovering a file with absolute time in "x days time ago" format
110
56
  - Automatically load more files, when the bottom is reached (current limit is 1000 files)
111
- - Download files bigger than 2gb with presigned url's
112
- - set file navigation in the url to allow direct share of a specific file
113
- - only support previews to files under 100mb
57
+ - bundle bootstrap icons instead of importing
114
58
 
115
59
  ## Known issues
116
60
 
117
61
  - Rename files with special characters is not possible with
118
62
  current [sdk issue here](https://github.com/aws/aws-sdk-js/issues/1949)
119
63
 
120
- ## Images
121
-
122
- Home Page
123
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/home.png)
124
-
125
- Image Previewer
126
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/image-preview.png)
127
-
128
- Pdf Previewer
129
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/pdf-preview.png)
130
-
131
- New Folder
132
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/new-folder.png)
133
64
 
134
- Uploading Files
135
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/uploading-files.png)
136
-
137
- ### Compiles and hot-reloads for development
138
-
139
- ```
140
- npm run serve
141
- ```
142
-
143
- ### Compiles and minifies for production
65
+ ## Development
144
66
 
67
+ Publish Dashboard into dev branch
145
68
  ```
69
+ cd packages/dashboard/
146
70
  npm run build
147
- ```
148
-
149
- ### Lints and fixes files
150
-
151
- ```
152
- npm run lint
71
+ wrangler pages publish --branch dev --project-name r2-explorer-dashboard dist/
153
72
  ```