Skip to content

Commit

Permalink
Merge branch 'develop' into version-14
Browse files Browse the repository at this point in the history
  • Loading branch information
developmentforpeople committed Oct 22, 2023
2 parents 27d40ef + d08e970 commit 97e4b88
Show file tree
Hide file tree
Showing 13 changed files with 539 additions and 120 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@ Simplest cloud file management for Frappe / ERPNext. S3 compatible external buck
[![Frappe files within S3 buckets](/dfp_external_storage/public/image/demo.png)](https://www.youtube.com/embed/2uTnWZxhtug)


## Examples / Use cases

### All Frappe / ERPNext files into external S3 compatible bucket

[upload_frappe_erpnext_files_s3_compatible_bucket.webm](https://github.com/developmentforpeople/dfp_external_storage/assets/47140294/68592d26-4391-45fc-bd75-d4d5f06ce899)

### Move files / objects from S3 compatible bucket to another S3 compatible bucket (between buckets in same or different connection)

[move_objects_from_one_s3_compatible_bucket_to_another.webm](https://github.com/developmentforpeople/dfp_external_storage/assets/47140294/9c4d7197-d19e-422e-85a9-8af7725014f0)

### Move files / objects from S3 compatible bucket to local file system

[move_objects_from_s3_compatible_to_local_filesystem.webm](https://github.com/developmentforpeople/dfp_external_storage/assets/47140294/2d4eccf1-f7e2-4c89-9694-95ec36b6856d)

### Move files in local filesystem to S3 compatible bucket

[move_local_files_to_s3_compatible_bucket.webm](https://github.com/developmentforpeople/dfp_external_storage/assets/47140294/6a19d3b6-48c6-46a1-a08d-29d3555b4419)

### Per file examples

[move_file_from_s3_compatible_bucket_to_different_one_then_to_local_file.webm](https://github.com/developmentforpeople/dfp_external_storage/assets/47140294/1a4f216a-a6b4-4728-a27e-efdf4cbcf983)

### List all remote files in bucket

Shows all files in bucket, even the ones not in Frappe File doctype.

[list_files_in_remote_s3_bucket.webm](https://github.com/developmentforpeople/dfp_external_storage/assets/47140294/fbd38418-686e-45b4-b23b-048bed4d1143)


## Requirements

- Frappe version >= 14
Expand All @@ -16,12 +45,14 @@ Simplest cloud file management for Frappe / ERPNext. S3 compatible external buck
- Files accesible with custom URLs: /file/[File ID]/[file name.extension]
- Frappe / ERPNext private/public functionality is preserved for external files. If an external private file is loaded not having access a not found page will be showed.
- External Storages can be write disabled, but files will be visible yet.
- Bulk file relocation (upload and download). You can filter by local S3 bucket/local filesystem and then change all those files to a different S3 bucket or to local filesystem.
- Bulk file relocation (upload and download). You can filter by local S3 bucket/local filesystem and then change all those files to a different S3 bucket or to local filesystem. All files are "moved" without load them fully in memory optimizing large ones transfer.
- Small icon allows you visualize if file is within an S3 bucket.
- Same file upload (same file hash) will reuse existent S3 key and is not reuploaded. Same functionality as Frappe has with local files.
- Choosed S3 bucket file listing tool.
- S3 bucket can not be deleted if has "File"s assigned / within it.
- If bucket is not accesible file will be uploaded to local filesystem.
- Streaming data to and from S3 without reading whole files into memory (thanks to [Khoran](https://github.com/khoran)
- Stream data in chunks to and from S3 without reading whole files into memory (thanks to [Khoran](https://github.com/khoran)
- List all remote objects in bucket (includes too the ones not uploaded trough Frappe)
- ... maybe I am forgetting something ;)


Expand Down
2 changes: 1 addition & 1 deletion dfp_external_storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

__version__ = '0.9.2'
__version__ = '1.0.0'

10 changes: 10 additions & 0 deletions dfp_external_storage/change_log/v1/v1_0_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Updates detailed

- Considered stable now! 🥳
- All remote buckets you want
- Private and public files works as expected
- Buckets per folder setup
- Move files from local filesystem to bucket
- Move files from bucket to local filesystem
- Move files directly between buckets
- View all objects in remote buckets
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@

frappe.ui.form.on('DFP External Storage', {

setup: frm => {
frm.button_remote_files_list = null
},

refresh: function(frm) {
if (frm.doc.enabled) {
frm.button_remote_files_list = frm.add_custom_button(
__('List files in bucket'),
() => frappe.set_route('dfp-s3-bucket-list', frm.doc.name)
// () => frappe.set_route('dfp-s3-bucket-list', { storage: frm.doc.name })
)
}

frm.set_query('folders', function() {
return {
Expand All @@ -19,7 +30,6 @@ frappe.ui.form.on('DFP External Storage', {
let folders_name_not_assigned = data
.filter(d => d.name != frm.doc.name ? d : null)
.map(d => d.folder)
console.log('folders_name_not_assigned: ', folders_name_not_assigned)
frm.set_query('folders', function () {
return {
filters: {
Expand Down
Loading

0 comments on commit 97e4b88

Please sign in to comment.