Giter Club home page Giter Club logo

drive's Introduction

Frappe Drive logo

An easy to use, document sharing and management solution.

home

More screenshots

 

search

 

upload

 

share

 

file-preview

 

file-preview

 

file-preview

Warning

Frappe Drive is currently in beta, and will let breaking changes through, do not use it as your sole backup/data storage.

Note: Frappe Drive is not currently accepting pull requests. File an issue to open a discussion to discuss an idea/feature request.

Features

  • Upload and store files across multiple platforms.
  • View files and folders in List or Grid view and sort them by preference.
  • Preview files such as images, videos, PDFs, etc.
  • Share files or folders with others and manage their permissions.
  • Post comments on files shared with you.
  • Add files or folders to favourites to make them easily accessible.
  • Use the Search Bar to search for any file or folder in your Drive.
  • Supports sharing files and folders with individual users and user groups.
  • Ships with a robust document editor that seamlessly integrates with Frappe Drive and supports real time collaborative editing.

Installation

To set up the repository locally, follow the steps mentioned below:

  1. Install bench and set up a frappe-bench directory by following the installation steps.

  2. Move into your frappe-bench directory and get the Drive app

    bench get-app https://github.com/frappe/drive
  3. Create a new site

    bench new-site drive.site
  4. Map your site to localhost

    bench --site drive.site add-to-hosts
  5. Install the app onto your site

    bench --site drive.site install-app drive
  6. Start the bench server

    bench start
  7. Start the frontend development server

    cd apps/drive && yarn dev
  8. Finally, open the URL http://drive.site:8000/drive in your browser to see the app running.

Contributions and Community

There are many ways you can contribute even if you don't code:

  1. You can start by giving a star to this repository!
  2. If you find any issues, even if it is a typo, you can raise an issue to inform us.

License

GNU Affero General Public License v3.0

Warning

Frappe drive is currently marked as beta expect breaking changes between versions.

drive's People

Contributors

agritheory avatar ankush avatar arunmathaisk avatar humenth avatar krantheman avatar mituldavid avatar netchampfaris avatar surajshetty3416 avatar uhrjun avatar zaqoutabed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drive's Issues

automatically logged in to /drive after sign - in

I had Erpnext production installed in a web server erp.example.com . Later I installed Frappe Drive.

Now when I login to erp.example.com, instead of erp.example.com/app, now it goes to erp.example.com/drive. What I wanted is, it logged in as usual but at the sidebar in erpnext, a link appeared that takes to Drive.

Feature request - disallow Download

Hello Frappe, community. Awesome apps you guys are brewing lately!

Frappe Drive seem like it can basically replace our Nextcloud in many ways, and allow our users to have a single-source-of-truth in a single Frappe / ERPNext instance :)

Just one feature request to make it happen for us though, can you guys look into "disallow download" when sharing a document with a user? It'll mostly be .pdfs and user should be able to view the document.

Perhaps the document is sensitive, and company policy does not allow employees to download certain documents. Certain users will be able to get into the source code of the system, or take screenshots, that's fine :) it's just the policy is there, so system should follow.

Feature request - share with "Role"

Hello Frappe, community.

I came across another feature request that makes sense.

Can we have the option to share a document, or maybe a folder with users under a specific role? Like, create a folder named "Company policy" and be able to share it with users with the Employee role.

Thanks!

When i try to share doesn't work

When i try to share a file, or copy a link i get error both ways.. I tried with invite but i get an error aswell..

When i try invite i get: Cannot read properties of undefined (reading 'exc_type')
When i try to copy link i get: Some error occured while copying the link

Installation Steps

What is the right way to install / use Drive in production server ?

these steps that i follow to use Drive

  1. get-app
  2. install-app
  3. go to /drive/frontend/ and run yarn build
  4. I found there is files generated in public/frontend/ folder

and in the server i try to access /drive i get 404 error
image

could you help and create installation steps in production server plz.?

Username and Password Required.

I have Frappe drive running. However, when accessing it on the network, I am taken to the sign-in page where i need to either login or sign-up. What are the default login details? I can't sigup either.

Edit existing file

I've uploaded a bunch of files on drive and want to edit them, I cannot.

IMAGE 2023-08-05 12:43:59

Request for Comment: Entity Context Menu

While testing out Drive, one of the first things that was obviously missing to me was a context menu on folders and files. This POC just takes the options that would available from the 'Actions' Menu and puts them into a context menu.
image

Frappe-UI's Dialog class is not a good fit for this use case and the ListItem component also wasn't much help, so this is minimally styled with semantic HTML elements.

I've done enough work to get this to open and function correctly, but there are some behaviors that still need attention. I'm at a spot where this feature needs some feedback. And I'd like to understand likelihood that it will be accepted, otherwise I am happy to continue additional development on a fork.

No permission issue

logged in as a website user (login with Frappe), got no role assigned (by default). then got the following error.

image
Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 83, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 53, in handle
    return _RESTAPIHandler(call, doctype, name).get_response()
  File "apps/frappe/frappe/api.py", line 69, in get_response
    return self.handle_method()
  File "apps/frappe/frappe/api.py", line 79, in handle_method
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 48, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1650, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 30, in wrapper
    return func(*args, **kwargs)
  File "apps/drive/drive/api/files.py", line 421, in get_entity
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 550, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 518, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 467, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.PermissionError: Cannot access path due to insufficient permissions

Recent-5d1a3bd8.js:1 Object
Recent-5d1a3bd8.js:1 Error: /api/method/drive.api.files.get_entity PermissionError
    at frappe-ui-71ce1c0a.js:5:2440
    at Generator.next (<anonymous>)
    at s (frappe-ui-71ce1c0a.js:1:660)

Shouldn't I get assigned some role by default?

Feature request - Show Shared with me files in Home

Hello community, Frappe devs :)

As I'm starting to use this app with couple of my co-workers, and really liking this, I came with another area where an improvement could be implemented. Which is:

Show Shared With Me files along with my own uploaded apps in Home. Or perhaps a Drive Settings to make that happen so it doesn't affect everyone else..?

Thanks guys, hope you consider this one along with my other feature requests :)

Mobile client

When i try to see files example PDF files on mobile they dont open, its not compatible with other openings aswell.
Can we have an update about it? or a way to fix it

Icon previews

Hello,

Is there a way to show icon previews for folders of images and videos?

Gracefully handle a failed upload

  • For when a large file is being uploaded, and it's irrecoverably interrupted (wipe/rename the failed upload)
  • Duplicate files (suggest rename or replace dialogue)
  • Existing Folders (suggest merge or rename dialogue)
  • dropzone.js defaults to retryChunks: false

Some error occurred while copying the link (with Google Chrome Versión 111.0.5563.110 Build oficial 64 bits)

"await navigator.clipboard.writeText(link)" line 291 of drive/frontend/src/components/ShareDialog.vue does not copy the link.

With a change in the code I get it to perform the copy correctly. It is not an elegant development but I leave it here in case it can serve to guide a solution.

  try {
    await navigator.clipboard.writeText(link);
    this.alertMessage = "Link copied successfully";
    this.showAlert = true;
  } catch ($e) {
    try {
      await forceWrite(link);
      this.alertMessage = "Link copied successfully__";
      this.showAlert = true;
    } catch ($e) {
      this.alertMessage = "Some error occurred while copying the link";
      this.showAlert = true;
    }
  }
function forceWrite(link) {
    return new Promise((resolve, reject) => {
        if (typeof navigator !== "undefined" && typeof navigator.clipboard !== "undefined" && navigator.permissions !== "undefined") {
            const type = "text/plain";
            const blob = new Blob([link], { type });
            const data = [new ClipboardItem({ [type]: blob })];
            navigator.permissions.query({name: "clipboard-write"}).then((permission) => {
                if (permission.state === "granted" || permission.state === "prompt") {
                    navigator.clipboard.write(data).then(resolve, reject).catch(reject);
                }
                else {
                    reject(new Error("Permission denied the copy of the link is not possible"));
                }
            });
        }
        else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
            var textarea = document.createElement("textarea");
            textarea.textContent = link;
            textarea.style.position = "fixed";
            textarea.style.width = '2em';
            textarea.style.height = '2em';
            textarea.style.padding = 0;
            textarea.style.border = 'none';
            textarea.style.outline = 'none';
            textarea.style.boxShadow = 'none';
            textarea.style.background = 'transparent';
            document.body.appendChild(textarea);
            textarea.focus();
            textarea.select();
            try {
                document.execCommand("copy");
                document.body.removeChild(textarea);
                resolve();
            }
            catch (e) {
                document.body.removeChild(textarea);
                reject(e);
            }
        }
        else {
            reject(new Error("No method has made the copy of the link"));
        }
    });    
}

Feature Request: Activity Log (Document timeline)

Feature Request: Can we have a feature that who has viewed and downloaded the shared content?

This functionality will be helpful when we shared an important document to someone and that we can track user has viewed or downloaded.

FileNotFoundError: User directory does not exist

I've uninstalled and re-installed the app on one of my sites, and now I can't seem to create folders or upload files. I get the following error:

`Traceback (most recent call last):
File "apps/drive/drive/api/files.py", line 101, in create_folder
user_directory = get_user_directory()
File "apps/drive/drive/utils/files.py", line 53, in get_user_directory
raise FileNotFoundError('User directory does not exist')
FileNotFoundError: User directory does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 69, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 45, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1585, in call
return fn(*args, **newargs)
File "apps/drive/drive/api/files.py", line 103, in create_folder
user_directory = create_user_directory()
File "apps/drive/drive/utils/files.py", line 19, in create_user_directory
user_directory_path.mkdir(exist_ok=False)
File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
FileExistsError: [Errno 17] File exists: 'my.site/private/7b7bc2512ee1fedcd76bdc68926d4f7b'`

Uninstalling the app and re-installing again does not fix the issue. What can I do at this point?

Proper deletion of files to avoid orphaned entities

It so happens that an entity record in DB gets deleted but the corresponding actual file on disk does not get deleted due to various plausible OS level stuff, namely (File not found, Invalid path, I/O errors, Race conditions).

As of now.., every file is being recursively deleted using Path.unlink() in a sequential manner, which is very bad in terms of performance and otherwise.

Ideally, we should use shutil.rmtree() ...
and "batch" remove all entity records from DB corresponding to actual files within the directory .
instead of manually deleting one file after the other.

On a fresh install, creating a folder raises Internal Server Error

drive 0.0.1
erpnext 13.27.0
frappe 13.26.1

16:58:53 web.1            | 127.0.0.1 - - [15/Sep/2022 16:58:53] "POST /api/method/drive.api.files.list_folder_contents HTTP/1.1" 200 -
16:59:00 web.1            | Traceback (most recent call last):
16:59:00 web.1            |   File "apps/frappe/frappe/app.py", line 69, in application
16:59:00 web.1            |     response = frappe.api.handle()
16:59:00 web.1            |   File "apps/frappe/frappe/api.py", line 55, in handle
16:59:00 web.1            |     return frappe.handler.handle()
16:59:00 web.1            |   File "apps/frappe/frappe/handler.py", line 37, in handle
16:59:00 web.1            |     data = execute_cmd(cmd)
16:59:00 web.1            |   File "apps/frappe/frappe/handler.py", line 75, in execute_cmd
16:59:00 web.1            |     return frappe.call(method, **frappe.form_dict)
16:59:00 web.1            |   File "apps/frappe/frappe/__init__.py", line 1447, in call
16:59:00 web.1            |     return fn(*args, **newargs)
16:59:00 web.1            |   File "apps/drive/drive/api/files.py", line 122, in create_folder
16:59:00 web.1            |     drive_entity.share(frappe.session.user, write=1, share=1)
16:59:00 web.1            |   File "apps/drive/drive/drive/doctype/drive_entity/drive_entity.py", line 151, in share
16:59:00 web.1            |     for child in self.get_children():
16:59:00 web.1            | AttributeError: 'DriveEntity' object has no attribute 'get_children'
16:59:00 web.1            |
16:59:00 web.1            | Traceback (most recent call last):
16:59:00 web.1            |   File "apps/frappe/frappe/app.py", line 69, in application
16:59:00 web.1            |     response = frappe.api.handle()
16:59:00 web.1            |   File "apps/frappe/frappe/api.py", line 55, in handle
16:59:00 web.1            |     return frappe.handler.handle()
16:59:00 web.1            |   File "apps/frappe/frappe/handler.py", line 37, in handle
16:59:00 web.1            |     data = execute_cmd(cmd)
16:59:00 web.1            |   File "apps/frappe/frappe/handler.py", line 75, in execute_cmd
16:59:00 web.1            |     return frappe.call(method, **frappe.form_dict)
16:59:00 web.1            |   File "apps/frappe/frappe/__init__.py", line 1447, in call
16:59:00 web.1            |     return fn(*args, **newargs)
16:59:00 web.1            |   File "apps/drive/drive/api/files.py", line 122, in create_folder
16:59:00 web.1            |     drive_entity.share(frappe.session.user, write=1, share=1)
16:59:00 web.1            |   File "apps/drive/drive/drive/doctype/drive_entity/drive_entity.py", line 151, in share
16:59:00 web.1            |     for child in self.get_children():
16:59:00 web.1            | AttributeError: 'DriveEntity' object has no attribute 'get_children'

Google Drive

Is it possible to use frappe drive as a user interface while saving the data in a Google Drive?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.