mirror of
https://github.com/rclone/rclone.git
synced 2025-04-19 01:59:00 +08:00
Add FileLu backend
This commit is contained in:
parent
205667143c
commit
b4e366d87c
@ -18,6 +18,7 @@ import (
|
||||
_ "github.com/rclone/rclone/backend/dropbox"
|
||||
_ "github.com/rclone/rclone/backend/fichier"
|
||||
_ "github.com/rclone/rclone/backend/filefabric"
|
||||
_ "github.com/rclone/rclone/backend/filelu"
|
||||
_ "github.com/rclone/rclone/backend/filescom"
|
||||
_ "github.com/rclone/rclone/backend/ftp"
|
||||
_ "github.com/rclone/rclone/backend/gofile"
|
||||
|
60
backend/filelu/api/types.go
Normal file
60
backend/filelu/api/types.go
Normal file
@ -0,0 +1,60 @@
|
||||
// Package api defines types for interacting with the FileLu API.
|
||||
package api
|
||||
|
||||
// FolderListResponse represents the response from the folder/list API.
|
||||
type FolderListResponse struct {
|
||||
Status int `json:"status"` // HTTP status code of the response.
|
||||
Msg string `json:"msg"` // Message describing the response.
|
||||
Result struct {
|
||||
Files []FolderListFile `json:"files"` // List of files in the folder.
|
||||
Folders []FolderListFolder `json:"folders"` // List of folders in the folder.
|
||||
} `json:"result"` // Nested result structure containing files and folders.
|
||||
}
|
||||
|
||||
// FolderListFile represents a file in the FolderListResponse.
|
||||
type FolderListFile struct {
|
||||
Name string `json:"name"` // File name.
|
||||
Size int64 `json:"size"` // File size in bytes.
|
||||
Uploaded string `json:"uploaded"` // Upload date as a string.
|
||||
Thumbnail string `json:"thumbnail"` // URL to the file's thumbnail.
|
||||
Link string `json:"link"` // URL to access the file.
|
||||
FldID int `json:"fld_id"` // Folder ID containing the file.
|
||||
FileCode string `json:"file_code"` // Unique code for the file.
|
||||
Hash string `json:"hash"` // Hash of the file for verification.
|
||||
}
|
||||
|
||||
// FolderListFolder represents a folder in the FolderListResponse.
|
||||
type FolderListFolder struct {
|
||||
Name string `json:"name"` // Folder name.
|
||||
Code string `json:"code"` // Unique code for the folder.
|
||||
FldID int `json:"fld_id"` // Folder ID.
|
||||
FldPublic int `json:"fld_public"` // Indicates if the folder is public.
|
||||
Filedrop int `json:"filedrop"` // Indicates if the folder supports file drop.
|
||||
}
|
||||
|
||||
// AccountInfoResponse represents the response for account information.
|
||||
type AccountInfoResponse struct {
|
||||
Status int `json:"status"` // HTTP status code of the response.
|
||||
Msg string `json:"msg"` // Message describing the response.
|
||||
Result struct {
|
||||
PremiumExpire string `json:"premium_expire"` // Expiration date of premium access.
|
||||
Email string `json:"email"` // User's email address.
|
||||
UType string `json:"utype"` // User type (e.g., premium or free).
|
||||
Storage string `json:"storage"` // Total storage available to the user.
|
||||
StorageUsed string `json:"storage_used"` // Amount of storage used.
|
||||
} `json:"result"` // Nested result structure containing account details.
|
||||
}
|
||||
|
||||
// FolderDeleteResponse represents the response for deleting a folder.
|
||||
type FolderDeleteResponse struct {
|
||||
Status int `json:"status"` // HTTP status code of the response.
|
||||
Msg string `json:"msg"` // Message describing the response.
|
||||
Result string `json:"result"` // Result of the deletion operation.
|
||||
ServerTime string `json:"server_time"` // Server timestamp of the operation.
|
||||
}
|
||||
|
||||
// DeleteResponse represents the response for deleting a file or folder.
|
||||
type DeleteResponse struct {
|
||||
Status int `json:"status"` // HTTP status code of the response.
|
||||
Msg string `json:"msg"` // Message describing the response.
|
||||
}
|
2314
backend/filelu/filelu.go
Normal file
2314
backend/filelu/filelu.go
Normal file
File diff suppressed because it is too large
Load Diff
15
backend/filelu/filelu_test.go
Normal file
15
backend/filelu/filelu_test.go
Normal file
@ -0,0 +1,15 @@
|
||||
package filelu_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/rclone/rclone/fstest/fstests"
|
||||
)
|
||||
|
||||
// TestIntegration runs integration tests for the FileLu backend
|
||||
func TestIntegration(t *testing.T) {
|
||||
fstests.Run(t, &fstests.Opt{
|
||||
RemoteName: "TestFileLu:",
|
||||
NilObject: nil,
|
||||
})
|
||||
}
|
15
backend/filelu/utils.go
Normal file
15
backend/filelu/utils.go
Normal file
@ -0,0 +1,15 @@
|
||||
package filelu
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// parseStorageToBytes converts a storage string (e.g., "10") to bytes
|
||||
func parseStorageToBytes(storage string) (int64, error) {
|
||||
var gb float64
|
||||
_, err := fmt.Sscanf(storage, "%f", &gb)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("failed to parse storage: %w", err)
|
||||
}
|
||||
return int64(gb * 1024 * 1024 * 1024), nil
|
||||
}
|
@ -43,6 +43,7 @@ docs = [
|
||||
"combine.md",
|
||||
"dropbox.md",
|
||||
"filefabric.md",
|
||||
"filelu.md",
|
||||
"filescom.md",
|
||||
"ftp.md",
|
||||
"gofile.md",
|
||||
|
@ -124,6 +124,7 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="Enterprise File Fabric" home="https://storagemadeeasy.com/about/" config="/filefabric/" >}}
|
||||
{{< provider name="Fastmail Files" home="https://www.fastmail.com/" config="/webdav/#fastmail-files" >}}
|
||||
{{< provider name="Files.com" home="https://www.files.com/" config="/filescom/" >}}
|
||||
{{< provider name="FileLu Cloud Storage" home="https://filelu.com/" config="/filelu/" >}}
|
||||
{{< provider name="FTP" home="https://en.wikipedia.org/wiki/File_Transfer_Protocol" config="/ftp/" >}}
|
||||
{{< provider name="Gofile" home="https://gofile.io/" config="/gofile/" >}}
|
||||
{{< provider name="Google Cloud Storage" home="https://cloud.google.com/storage/" config="/googlecloudstorage/" >}}
|
||||
|
243
docs/content/filelu.md
Normal file
243
docs/content/filelu.md
Normal file
@ -0,0 +1,243 @@
|
||||
---
|
||||
title: "FileLu"
|
||||
description: "Rclone docs for FileLu"
|
||||
versionIntroduced: "v1.0"
|
||||
---
|
||||
|
||||
# {{< icon "fa fa-folder" >}} FileLu
|
||||
|
||||
[FileLu](https://filelu.com/) is a reliable cloud storage provider offering features like secure file uploads, downloads, flexible storage options, and sharing capabilities. With support for high storage limits and seamless integration with RCLONE, FileLu makes managing files in the cloud easy. Its cross-platform file backup services let you upload and back up files from any internet-connected device. Available upload options include:
|
||||
• File Upload
|
||||
• Folder Upload
|
||||
• URL Remote Upload
|
||||
• FTP/FTPS
|
||||
• WebDAV
|
||||
• FileDrop
|
||||
• Mobile App
|
||||
• Create text file
|
||||
• FileLuSync
|
||||
• Upload via Email
|
||||
• Browser Extensions
|
||||
• Web App
|
||||
• Upload via API
|
||||
• Terminal CLI
|
||||
|
||||
|
||||
|
||||
Paths are specified as `remote:FolderID`.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
Here is an example of how to make a remote called `filelu`. First, run:
|
||||
|
||||
rclone config
|
||||
|
||||
This will guide you through an interactive setup process:
|
||||
|
||||
```
|
||||
No remotes found, make a new one?
|
||||
n) New remote
|
||||
s) Set configuration password
|
||||
q) Quit config
|
||||
n/s/q> n
|
||||
name> filelu
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value
|
||||
[snip]
|
||||
xx / FileLu Cloud Storage
|
||||
\ "filelu"
|
||||
[snip]
|
||||
Storage> filelu
|
||||
Enter your FileLu Rclone Key:
|
||||
Rclone Key> YOUR_FILELU_RCLONE_KEY RC_xxxxxxxxxxxxxxxxxxxxxxxx
|
||||
Configuration complete.
|
||||
|
||||
Keep this "filelu" remote?
|
||||
y) Yes this is OK
|
||||
e) Edit this remote
|
||||
d) Delete this remote
|
||||
y/e/d> y
|
||||
```
|
||||
|
||||
### Example Commands
|
||||
|
||||
Create a new folder named `foldername`:
|
||||
|
||||
rclone mkdir filelu:foldername
|
||||
|
||||
Delete a folder on FileLu:
|
||||
|
||||
rclone rmdir filelu:/folder/path/
|
||||
|
||||
Rename a folder on FileLu:
|
||||
|
||||
rclone backend renamefolder filelu:/folder-path/folder-name "new-folder-name"
|
||||
|
||||
Move a folder on remote FileLu:
|
||||
|
||||
rclone backend movefolder filelu:/sorce-fld-path/hello-folder/ /destication-fld-path/hello-folder/
|
||||
|
||||
Delete a file on FileLu:
|
||||
|
||||
rclone delete filelu:/hello.txt
|
||||
|
||||
List files from your FileLu account:
|
||||
|
||||
rclone ls filelu:
|
||||
|
||||
List all folders:
|
||||
|
||||
rclone lsd filelu:
|
||||
|
||||
Copy a specific file to the FileLu root:
|
||||
|
||||
rclone copy D:\\hello.txt filelu:
|
||||
|
||||
Copy files from a local directory to a FileLu directory:
|
||||
|
||||
rclone copy D:/local-folder filelu:/remote-folder/path/
|
||||
|
||||
Rename file on remote FileLu directory:
|
||||
|
||||
rclone backend rename filelu:/file-path/hello.txt "hello_new_name.txt"
|
||||
|
||||
Download a file from FileLu into a local directory:
|
||||
|
||||
rclone copy filelu:/file-path/hello.txt D:/local-folder
|
||||
|
||||
Move files from a local directory to a FileLu directory:
|
||||
|
||||
rclone move D:\\local-folder filelu:/remote-path/
|
||||
|
||||
Move file within the remote FileLu directory:
|
||||
|
||||
rclone backend movefile filelu:/source-path/hello.txt /destination-path/
|
||||
|
||||
Sync files from a local directory to a FileLu directory (directory id `366238`):
|
||||
|
||||
rclone sync D:/local-folder filelu:/remote-path/
|
||||
|
||||
Mount remote to local Linux:
|
||||
|
||||
rclone mount filelu: /root/mnt --vfs-cache-mode full
|
||||
|
||||
Mount remote to local Windows:
|
||||
|
||||
rclone mount filelu: D:/local_mnt --vfs-cache-mode full
|
||||
|
||||
|
||||
Get storage info about the FileLu account:
|
||||
|
||||
rclone about filelu:
|
||||
|
||||
And many other commands are supported by Rclone.
|
||||
|
||||
### FolderID instead of folder path
|
||||
|
||||
We use the FolderID instead of the folder name to prevent errors when users have identical folder names or paths. For example, if a user has two or three folders named "test_folders," the system may become confused and won't know which folder to move. In large storage systems, some clients have hundred of thousands of folders and a few millions of files, duplicate folder names or paths are quite common.
|
||||
|
||||
### Modification Times and Hashes
|
||||
|
||||
FileLu supports both modification times and MD5 hashes.
|
||||
|
||||
### Restricted Filename Characters
|
||||
|
||||
| Character | Value | Replacement |
|
||||
|-----------|---------|-------------|
|
||||
| @ | 0x40 | _ |
|
||||
| ! | 0x21 | _ |
|
||||
| ~ | 0x7E | _ |
|
||||
| ` | 0x60 | _ |
|
||||
| % | 0x25 | _ |
|
||||
| & | 0x26 | _ |
|
||||
| ^ | 0x5E | _ |
|
||||
| ( | 0x28 | _ |
|
||||
| ) | 0x29 | _ |
|
||||
| { | 0x7B | _ |
|
||||
| } | 0x7D | _ |
|
||||
| ; | 0x3B | _ |
|
||||
| ' | 0x27 | _ |
|
||||
| , | 0x2C | _ |
|
||||
| [ | 0x5B | _ |
|
||||
| ] | 0x5D | _ |
|
||||
| + | 0x2B | _ |
|
||||
| = | 0x3D | _ |
|
||||
| $ | 0x24 | _ |
|
||||
| * | 0x2A | _ |
|
||||
| ? | 0x3F | _ |
|
||||
| < | 0x3C | _ |
|
||||
| > | 0x3E | _ |
|
||||
| : | 0x3A | _ |
|
||||
| \ | 0x5C | _ |
|
||||
| / | 0x2F | _ |
|
||||
| " | 0x22 | _ |
|
||||
| # | 0x23 | _ |
|
||||
|
||||
|
||||
|
||||
FileLu only supports filenames and folder names up to 255 characters in length, where a
|
||||
character is a Unicode character.
|
||||
|
||||
### Duplicated Files
|
||||
|
||||
When uploading and syncing via Rclone, FileLu does not allow uploading duplicate files within the same directory. However, you can upload duplicate files, provided they are in different directories (folders).
|
||||
|
||||
### Failure to Log / Invalid Credentials or KEY
|
||||
|
||||
Ensure that you have the correct Rclone key, which can be found in [My Account](https://filelu.com/account/). Every time you toggle Rclone OFF and ON in My Account, a new RC_xxxxxxxxxxxxxxxxxxxx key is generated. Be sure to update your Rclone configuration with the new key.
|
||||
|
||||
If you are connecting to your FileLu remote for the first time and encounter an error such as:
|
||||
|
||||
```
|
||||
Failed to create file system for "my-filelu-remote:": couldn't login: Invalid credentials
|
||||
```
|
||||
|
||||
Ensure your Rclone Key is correct.
|
||||
|
||||
### Process `killed`
|
||||
|
||||
Accounts with large files or extensive metadata may experience significant memory usage during list/sync operations. Ensure the system running `rclone` has sufficient memory and CPU to handle these operations.
|
||||
|
||||
## Limitations
|
||||
|
||||
This backend uses a custom library implementing the FileLu API. While it supports file transfers, some advanced features may not yet be available. Please report any issues to the [rclone forum](https://forum.rclone.org/) for troubleshooting and updates.
|
||||
|
||||
### Standard Options
|
||||
|
||||
Here are the standard options specific to FileLu:
|
||||
|
||||
#### --filelu-rclone-key
|
||||
|
||||
You can get the key in [My Account](https://filelu.com/account/).
|
||||
|
||||
FileLu Rclone Key format: RC_xxxxxxxxxxxxxxxxxxxx.
|
||||
|
||||
- **NB:** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/).
|
||||
|
||||
#### --filelu-debug
|
||||
|
||||
Output more debug information.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: debug
|
||||
- Env Var: RCLONE_FILELU_DEBUG
|
||||
- Type: bool
|
||||
- Default: false
|
||||
|
||||
#### --filelu-use-https
|
||||
|
||||
Use HTTPS for transfers.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: use_https
|
||||
- Env Var: RCLONE_FILELU_USE_HTTPS
|
||||
- Type: bool
|
||||
- Default: true
|
||||
|
||||
---
|
||||
|
||||
For further information, visit [FileLu's website](https://filelu.com/).
|
||||
"""
|
@ -26,6 +26,7 @@ Here is an overview of the major features of each cloud storage system.
|
||||
| Dropbox | DBHASH ¹ | R | Yes | No | - | - |
|
||||
| Enterprise File Fabric | - | R/W | Yes | No | R/W | - |
|
||||
| Files.com | MD5, CRC32 | DR/W | Yes | No | R | - |
|
||||
| FileLu Cloud Storage | MD5 | R/W | No | Yes | R | - |
|
||||
| FTP | - | R/W ¹⁰ | No | No | - | - |
|
||||
| Gofile | MD5 | DR/W | No | Yes | R | - |
|
||||
| Google Cloud Storage | MD5 | R/W | No | No | R/W | - |
|
||||
|
@ -66,7 +66,8 @@
|
||||
<a class="dropdown-item" href="/koofr/#digi-storage"><i class="fa fa-cloud fa-fw"></i> Digi Storage</a>
|
||||
<a class="dropdown-item" href="/dropbox/"><i class="fab fa-dropbox fa-fw"></i> Dropbox</a>
|
||||
<a class="dropdown-item" href="/filefabric/"><i class="fa fa-cloud fa-fw"></i> Enterprise File Fabric</a>
|
||||
<a class="dropdown-item" href="/filescom/"><i class="fa fa-brands fa-files-pinwheel fa-fw"></i> Files.com</a>
|
||||
<a class="dropdown-item" href="/filelu/"><i class="fa fa-brands fa-files-pinwheel fa-fw"></i> Files.com</a>
|
||||
<a class="dropdown-item" href="/filescom/"><i class="fa fa-cloud fa-fw"></i> FileLu Cloud Storage</a>
|
||||
<a class="dropdown-item" href="/ftp/"><i class="fa fa-file fa-fw"></i> FTP</a>
|
||||
<a class="dropdown-item" href="/gofile/"><i class="fa fa-folder fa-fw"></i> Gofile</a>
|
||||
<a class="dropdown-item" href="/googlecloudstorage/"><i class="fab fa-google fa-fw"></i> Google Cloud Storage</a>
|
||||
|
@ -522,3 +522,6 @@ backends:
|
||||
- backend: "iclouddrive"
|
||||
remote: "TestICloudDrive:"
|
||||
fastlist: false
|
||||
- backend: "filelu"
|
||||
remote: "filelu"
|
||||
fastlist: false
|
||||
|
Loading…
x
Reference in New Issue
Block a user