mbkbucket 3.5.1 → 3.7.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/.env.example +14 -14
- package/.mbkbucket.config.example.json +14 -14
- package/LICENSE +20 -20
- package/README.md +377 -350
- package/index.js +30 -30
- package/lib/cli.js +5 -4
- package/lib/public/bucketadmin.css +1695 -1420
- package/lib/public/bucketadmin.js +1229 -1229
- package/lib/public/mbkbucket-helper-demo.html +1184 -1184
- package/lib/public/mbkbucket-helper.css +1235 -1235
- package/lib/public/mbkbucket-helper.js +1557 -1557
- package/lib/src/app.js +109 -109
- package/lib/src/cli/auth-helper.js +141 -150
- package/lib/src/config/index.js +110 -112
- package/lib/src/config/validation.js +73 -73
- package/lib/src/controllers/api.controller.js +410 -410
- package/lib/src/controllers/dashboard.controller.js +49 -48
- package/lib/src/controllers/info.controller.js +33 -34
- package/lib/src/controllers/view.controller.js +231 -233
- package/lib/src/middleware/async-handler.js +19 -23
- package/lib/src/middleware/bucket-resolver.js +37 -37
- package/lib/src/middleware/error-handler.js +50 -54
- package/lib/src/middleware/rate-limiter.js +22 -22
- package/lib/src/middleware/security.js +21 -27
- package/lib/src/routes/api.routes.js +53 -40
- package/lib/src/routes/index.js +60 -21
- package/lib/src/routes/info.routes.js +9 -9
- package/lib/src/routes/view.routes.js +25 -20
- package/lib/src/services/s3.service.js +594 -603
- package/lib/src/utils/errors.js +46 -54
- package/lib/src/utils/helpers.js +212 -251
- package/lib/src/utils/logger.js +17 -17
- package/package.json +83 -83
- package/views/bucket.handlebars +196 -196
- package/views/bucketadmin_alerts.handlebars +15 -15
- package/views/bucketadmin_delete_modal.handlebars +36 -36
- package/views/bucketadmin_filelist_skeleton.handlebars +32 -32
- package/views/bucketadmin_newfolder_modal.handlebars +29 -29
- package/views/bucketadmin_preview_modal.handlebars +40 -40
- package/views/bucketadmin_upload_modal.handlebars +54 -54
- package/views/bucketadmincontent.handlebars +141 -141
- package/views/mbkbucket_info.handlebars +232 -232
package/.env.example
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
mbkautheVar={"APP_NAME":"mbkbucket","loginRedirectURL":"/dashboard","bucket":"R2_Bucket"}
|
|
2
|
-
mbkauthShared={"Main_SECRET_TOKEN": 123,"DOMAIN":"mbktech.org","IS_DEPLOYED":"false","EncPass":"false","DEVICE_TRUST_DURATION_DAYS":7,"SESSION_SECRET_KEY":"123","LOGIN_DB":"postgres://","MBKAUTH_TWO_FA_ENABLE":"true","COOKIE_EXPIRE_TIME":2,"GITHUB_LOGIN_ENABLED":"f","GITHUB_CLIENT_ID":"123","GITHUB_CLIENT_SECRET":"123","GOOGLE_LOGIN_ENABLED":"f","GOOGLE_CLIENT_ID":"123","GOOGLE_CLIENT_SECRET":"123"}
|
|
3
|
-
# See @node_modules/mbkauthe/docs/env.md for more details
|
|
4
|
-
NODE_ENV=development
|
|
5
|
-
|
|
6
|
-
BucketConnection={"R2_Bucket":{"BUCKET_NAME":"my-r2-bucket","ACCESS_KEY_ID":"your-r2-access-key","SECRET_ACCESS_KEY":"your-r2-secret","ENDPOINT":"https://accountid.r2.cloudflarestorage.com"},"S3_Bucket":{"BUCKET_NAME":"my-s3-bucket","ACCESS_KEY_ID":"your-s3-access-key","SECRET_ACCESS_KEY":"your-s3-secret","ENDPOINT":"https://s3.ap-southeast-1.amazonaws.com"}}
|
|
7
|
-
# Region is optional
|
|
8
|
-
|
|
9
|
-
mbkbucketVar={"publiView_enabled":"true","p_view_inline":"true"}
|
|
10
|
-
# publiView_enabled mean if this app storage is public or private. If true, then anyone can access the files if they have the link. If false, then only authenticated users can access the files.
|
|
11
|
-
# p_view_inline means if the file should be displayed inline in the browser (proxy) or redirect to s3 signed url if false.
|
|
12
|
-
|
|
13
|
-
PORT=3005
|
|
14
|
-
|
|
1
|
+
mbkautheVar={"APP_NAME":"mbkbucket","loginRedirectURL":"/dashboard","bucket":"R2_Bucket"}
|
|
2
|
+
mbkauthShared={"Main_SECRET_TOKEN": 123,"DOMAIN":"mbktech.org","IS_DEPLOYED":"false","EncPass":"false","DEVICE_TRUST_DURATION_DAYS":7,"SESSION_SECRET_KEY":"123","LOGIN_DB":"postgres://","MBKAUTH_TWO_FA_ENABLE":"true","COOKIE_EXPIRE_TIME":2,"GITHUB_LOGIN_ENABLED":"f","GITHUB_CLIENT_ID":"123","GITHUB_CLIENT_SECRET":"123","GOOGLE_LOGIN_ENABLED":"f","GOOGLE_CLIENT_ID":"123","GOOGLE_CLIENT_SECRET":"123"}
|
|
3
|
+
# See @node_modules/mbkauthe/docs/env.md for more details
|
|
4
|
+
NODE_ENV=development
|
|
5
|
+
|
|
6
|
+
BucketConnection={"R2_Bucket":{"BUCKET_NAME":"my-r2-bucket","ACCESS_KEY_ID":"your-r2-access-key","SECRET_ACCESS_KEY":"your-r2-secret","ENDPOINT":"https://accountid.r2.cloudflarestorage.com"},"S3_Bucket":{"BUCKET_NAME":"my-s3-bucket","ACCESS_KEY_ID":"your-s3-access-key","SECRET_ACCESS_KEY":"your-s3-secret","ENDPOINT":"https://s3.ap-southeast-1.amazonaws.com"}}
|
|
7
|
+
# Region is optional
|
|
8
|
+
|
|
9
|
+
mbkbucketVar={"publiView_enabled":"true","p_view_inline":"true"}
|
|
10
|
+
# publiView_enabled mean if this app storage is public or private. If true, then anyone can access the files if they have the link. If false, then only authenticated users can access the files.
|
|
11
|
+
# p_view_inline means if the file should be displayed inline in the browser (proxy) or redirect to s3 signed url if false.
|
|
12
|
+
|
|
13
|
+
PORT=3005
|
|
14
|
+
|
|
15
15
|
DEBUG=mbkbucket*
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_schema": "mbkbucket CLI config — stored at ~/.mbkbucket/config.json",
|
|
3
|
-
|
|
4
|
-
"token": "mbk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
5
|
-
"tokenPrefix": "mbk_xxxx",
|
|
6
|
-
"username": "your-username",
|
|
7
|
-
"serverUrl": "https://your-app.example.com",
|
|
8
|
-
"profile": {
|
|
9
|
-
"name": "Read-Write CLI",
|
|
10
|
-
"scope": "read-write",
|
|
11
|
-
"allowedApps": ["mbkbucket"]
|
|
12
|
-
},
|
|
13
|
-
"loggedInAt": "2026-01-01T00:00:00.000Z"
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_schema": "mbkbucket CLI config — stored at ~/.mbkbucket/config.json",
|
|
3
|
+
|
|
4
|
+
"token": "mbk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
5
|
+
"tokenPrefix": "mbk_xxxx",
|
|
6
|
+
"username": "your-username",
|
|
7
|
+
"serverUrl": "https://your-app.example.com",
|
|
8
|
+
"profile": {
|
|
9
|
+
"name": "Read-Write CLI",
|
|
10
|
+
"scope": "read-write",
|
|
11
|
+
"allowedApps": ["mbkbucket"]
|
|
12
|
+
},
|
|
13
|
+
"loggedInAt": "2026-01-01T00:00:00.000Z"
|
|
14
|
+
}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Muhammad Bin Khalid
|
|
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
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Muhammad Bin Khalid
|
|
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
21
|
SOFTWARE.
|