r2-explorer 0.5.1 → 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 +17 -83
  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 -459
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
@@ -2,15 +2,16 @@
2
2
 
3
3
  A Google Drive Interface for your Cloudflare R2 Buckets!
4
4
 
5
- This project is deployed/self-hosted in your own Cloudflare Account as a Worker, and no credential/token is required to start using it.
5
+ This project is deployed/self-hosted in your own Cloudflare Account as a Worker, and no credential/token is required to
6
+ start using it.
6
7
 
7
- 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)
8
10
 
9
- This project is still in development, and there are definitely going to be some weird issues sometimes, but when you find something
10
- please [open an new issue](https://github.com/G4brym/R2-Explorer/issues/new) for it to get solved.
11
11
 
12
12
  ## Features
13
13
 
14
+ - [Email Explorer](https://r2explorer.dev/guides/setup-email-explorer/) (using Cloudflare Email Routing)
14
15
  - Very quick bucket/folder navigation
15
16
  - pdf, image, txt, markdown, csv, etc in-browser preview
16
17
  - Drag-and-Drop upload
@@ -21,59 +22,20 @@ please [open an new issue](https://github.com/G4brym/R2-Explorer/issues/new) for
21
22
  - Delete files
22
23
  - Right click in file for extra options
23
24
  - Multipart upload for big files
24
-
25
-
26
- ## FAQ
27
-
28
- Q. Is there any Authentication for r2-explorer?
29
-
30
- A. No. If you want authenticated access, you must setup [Cloudflare Access](https://www.cloudflare.com/products/zero-trust/access/) in your account.
31
- Access is free up to 50 users.
32
-
33
- ___
34
-
35
- Q. Can i upload files bigger than 100MB?
36
-
37
- A. Yes! R2-Explorer now support's [Multipart Upload](https://developers.cloudflare.com/r2/data-access/workers-api/workers-multipart-usage/),
38
- that splits the files you are uploading in about 95MB chunks for uploading within the Cloudflare 100MB uploading limit.
39
-
25
+ - Cloudflare Access validation using jwt
40
26
 
41
27
  ## Getting Started
42
28
 
43
29
  Run this command to get an example project setup
44
30
 
45
31
  ```bash
46
- npx r2-explorer my-r2-explorer
47
- ```
48
-
49
- Change into the newly created directory and install the packages
50
-
51
- ```bash
52
- cd my-r2-explorer
53
- npm install
54
- ```
55
-
56
- Update the `wrangler.toml` with your R2 Buckets (tip: you can setup as many Buckets as your want)
57
-
58
- ```
59
- - wrangler.toml -
60
- ...
61
- [[r2_buckets]]
62
- binding = 'my-bucket-name'
63
- bucket_name = 'my-bucket-name'
64
- preview_bucket_name = 'my-bucket-name'
65
- ```
66
-
67
- If you want to be able to upload/modify your buckets, you must update the `readonly` flag in `src/index.ts` file.
68
-
69
- After that just run publish and the project will be up and running for you and everyone you invite to use the Buckets
70
-
71
- ```bash
72
- wrangler publish
32
+ npm create r2-explorer@latest
73
33
  ```
74
34
 
75
35
  ## Upgrading your installation
76
- In order to update to the latest version you just need to install the latest r2-explorer package from npm and re-deploy your application
36
+
37
+ In order to update to the latest version you just need to install the latest r2-explorer package from npm and re-deploy
38
+ your application
77
39
 
78
40
  ```bash
79
41
  npm install r2-explorer@latest --save
@@ -83,10 +45,8 @@ npm install r2-explorer@latest --save
83
45
  wrangler publish
84
46
  ```
85
47
 
86
-
87
48
  ## TODO
88
49
 
89
- - Integration with cloudflare access
90
50
  - allow bucket names with spaces
91
51
  - Search files
92
52
  - Rename folders
@@ -94,45 +54,19 @@ wrangler publish
94
54
  - Image thumbnail's using Cloudflare workers
95
55
  - Tooltip when hovering a file with absolute time in "x days time ago" format
96
56
  - Automatically load more files, when the bottom is reached (current limit is 1000 files)
97
- - Download files bigger than 2gb with presigned url's
98
- - set file navigation in the url to allow direct share of a specific file
99
- - only support previews to files under 100mb
57
+ - bundle bootstrap icons instead of importing
100
58
 
101
59
  ## Known issues
102
60
 
103
- - Rename files with special characters is not possible with current [sdk issue here](https://github.com/aws/aws-sdk-js/issues/1949)
104
-
105
- ## Images
106
-
107
- Home Page
108
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/home.png)
109
-
110
- Image Previewer
111
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/image-preview.png)
112
-
113
- Pdf Previewer
114
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/pdf-preview.png)
61
+ - Rename files with special characters is not possible with
62
+ current [sdk issue here](https://github.com/aws/aws-sdk-js/issues/1949)
115
63
 
116
- New Folder
117
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/new-folder.png)
118
64
 
119
- Uploading Files
120
- ![Home](https://github.com/G4brym/R2-Explorer/raw/main/docs/images/uploading-files.png)
121
-
122
- ### Compiles and hot-reloads for development
123
-
124
- ```
125
- npm run serve
126
- ```
127
-
128
- ### Compiles and minifies for production
65
+ ## Development
129
66
 
67
+ Publish Dashboard into dev branch
130
68
  ```
69
+ cd packages/dashboard/
131
70
  npm run build
132
- ```
133
-
134
- ### Lints and fixes files
135
-
136
- ```
137
- npm run lint
71
+ wrangler pages publish --branch dev --project-name r2-explorer-dashboard dist/
138
72
  ```