Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
/ qpt-drive Public archive

This is an application to share your data on your local network, which makes it easy to transfer data between devices

License

Notifications You must be signed in to change notification settings

Guillex387/qpt-drive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qpt-drive

This is an application to share your data on your local network, which makes it easy to transfer data between devices.

Browser Tested
Chrome ✔️
Brave ✔️
Firefox ✔️

The shared space is protected with a login system, next to the executable has a file called server.key which contains the password for access to the shared space.

All of the files uploaded and the folder created are in the uploads/ directory.

Executables

You can download the portable app for windows and linux last version.

In linux for execute this, you need the executable permission, this command only needs to be used once:

$ sudo chmod +x ./drive

And then you can use the app:

$ sudo ./drive --help

API docs:

Error codes:

  • None error 0
  • Item not found 1
  • Item already exists 2
  • Body format error 3
  • Invalid token 4
  • Expired token 5
  • Invalid pass 6
  • Invalid item name 7
  • Token GET /api/token/:pass

    This route is use for obtain the token, for access to server. The pass variable is the server key in base64.

    The response:

    {
      "error": 0,
      "token": "some token"
    }
  • Files & Folders GET /api/:token/path/...

    Put the path of the file or folder in the end of the url, this will return: If is a file will return a blob. Else will return a json which represent the content of the same, following this model:

    {
      "originPath": "the/container/folder",
      "childs": [
        {
          "type": "file",
          "name": "some_file.txt",
          "size": 56
        },
        {
          "type": "folder",
          "name": "some_folder",
          "size": 0
        }
      ]
    }

    If some errors happenss:

    {
      "error": 2
    }
  • Files & Folders DELETE /api/:token/path/...

    This route is for delete some file or folder. Put the path of the file or folder in the end of the url.

    The response:

    {
      "error": 0
    }
  • Upload POST & PUT /api/:token/upload

    This url is for upload a single file, if is PUT req they will override the file if this exists, if is POST req and the file already exists a error will happenss.

    Request body model is a form data body following this model:

    Param Type
    path string
    file File

    The response:

    {
      "error": 0
    }
  • Make dir POST /api/:token/mkdir

    This url is for make a new directory. Use this model for the req body:

    {
      "path": "container/newFolder"
    }

    The response:

    {
      "error": 0
    }
  • Rename PUT /api/:token/rename

    This route is for rename files or folders.

    Req body:

    {
      "path": "parent/child.png",
      "newName": "new name.png"
    }

    The response:

    {
      "error": 0
    }

Frontend

I make the frontend using react and boostrap.

Resources

All icons in the app are provided by boostrap icons in .svg format.

License

Licensed under the GNU AGPLv3. Copyright 2022 Guillex387.

About

This is an application to share your data on your local network, which makes it easy to transfer data between devices

Topics

Resources

License

Stars

Watchers

Forks