From bdf325c18a0d085b0095a2954ac8e790234584d6 Mon Sep 17 00:00:00 2001 From: hyponet Date: Sun, 16 Jun 2024 21:01:08 +0800 Subject: [PATCH 1/2] update: readme.md --- README.md | 35 ++++++++++++++++--------------- README_zh.md | 26 +++++++++++------------ cmd/apps/apis/fsapi/v1/service.go | 21 +++++++++++++------ 3 files changed, 46 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 42eb31b3..66031ca0 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,24 @@ -# NanaFS +# 🗄NanaFS ![unittest workflow](https://github.com/basenana/nanafs/actions/workflows/unittest.yml/badge.svg) ![pages-build-deployment](https://github.com/basenana/nanafs/actions/workflows/pages/pages-build-deployment/badge.svg)

[ English | 简体中文 ]

-NanaFS is a workflow engine that simplifies data management -by allowing users to manage structured and unstructured data in one place, -rather than across multiple sources. It's like a filing cabinet -that combines all your documents, emails, and to-do lists, -making it easier to manage everything at once. +NanaFS is a Reference Filing System inspired by the [GTD (Getting Things Done®) methodology](https://gettingthingsdone.com/wp-content/uploads/2014/10/Filing.pdf), +designed to collect, store, and process information that does not require immediate action but may be useful in the future. -NanaFS is also customizable through plugin support, -meaning users can tailor the workflow engine to their specific needs. -This makes NanaFS a versatile and valuable tool for personal, academic, and professional use. +In personal, academic, and professional life, vast amounts of data and materials are scattered across various information silos, +such as Office documents, emails, RSS feeds, and work notes. While isolated data may seem insignificant, +it can become crucial for future projects. Whether it's a paper in progress or a PowerPoint presentation, +data serves specific purposes. -## Key Features +NanaFS treats files as first-class citizens, aiming to build a system +that enables quick collection, intelligent categorization, complex querying, and AI enhancement. -### Cloud-Based Storage +## 🚩 Key Features + +### 🪄 Cloud-Based Storage NanaFS utilizes cloud-based storage as main backend storage, supporting not only object storage but also file-hosting service. @@ -30,7 +31,7 @@ The following storage options are already supported or planned to be supported: - **Cloud Drive**: Google Drive, OneDrive, AliyunDrive, BaiduWangpan - **Other Storage Protocols**: WebDAV -### POSIX Compatibility +### 🗃 POSIX Compatibility NanaFS offers a file system interface that complies with the POSIX standard through FUSE. This makes it easy to mount NanaFS onto the directory tree and manage NanaFS data using tools such as Finder on MacOS @@ -41,7 +42,7 @@ systems. This means that existing commands and tools can be used to efficiently process data in NanaFS. For specific needs, custom scripts or programs can also be written to process files in NanaFS. -### File-Centric Workflow +### ⚙️ File-Centric Workflow The actual value of data storage lies in its use. To facilitate this, NanaFS provides a file-centric workflow engine equipped with rule-based automatic file processing capabilities. @@ -50,7 +51,7 @@ With the workflow engine, tasks such as batch file renaming and creating semanti very simple. This eases data manipulation, makes data no longer "cold," and helps uncover more inherent value in the data. -### Plugin Support +### 🔌 Plugin Support NanaFS supports multiple types of plugins to extend its capabilities. Currently, NanaFS primarily supports three types of plugins: @@ -60,19 +61,19 @@ of plugins: - **Process Plugin**: provides file processing capabilities and enhances the functionality of workflows by extending Process Plugins. -### Data Security +### 🔐 Data Security Data security is a prerequisite for data storage and usage. NanaFS provides end-to-end encryption from storage to transmission, ensuring that your cloud data cannot be accessed even if it is stolen by hackers. Similarly, cloud service providers cannot access or modify your data, ensuring that your data is not leaked or misused. -## Usage +## 🚀 Usage NanaFS's usage guidelines, including its parameters and examples of tools and commands, are documented in [Instructions For Usage](https://github.com/basenana/nanafs/blob/main/docs/usage.md). -## Feedback +## ✉️ Feedback If you encounter any problems while using NanaFS, whether it's related to usage, bugs, or you have suggestions for new features, diff --git a/README_zh.md b/README_zh.md index 8491076a..8509287d 100644 --- a/README_zh.md +++ b/README_zh.md @@ -5,17 +5,17 @@

[ English | 简体中文 ]

-NanaFS 是一款文件系统风格的工作流引擎,也是一款尝试将结构化和非结构化数据的统一管理的数据仓库。 +NanaFS 是一款受 GTD 方法论启发的[参考资料归档系统](https://gettingthingsdone.com/wp-content/uploads/2014/10/Filing.pdf), +用于收集、存储、处理那些不需要立即采取行动,但可能在未来有用的信息。 -在个人工作、学习和生活中,大量的数据和材料存储在不同的信息孤岛之中,例如 Office 文件、电子邮件、RSS、工作笔记、待办记事等。 -孤立的数据没有价值,无论是一个刚起步的项目还是酝酿一篇论文,数据是为具体场景服务的。 我曾花费很多时间编写胶水脚本,使它们可以被一起管理。 -为什么不构建一个内建工作流,并提供具体场景数据入口的文件系统呢,于是 NanaFS 应运而生。 +在个人工作、学习和生活中,大量的数据和材料存储在不同的信息孤岛之中,例如 Office 文件、电子邮件、RSS、工作笔记等。 +孤立的数据没有价值,但有朝一日可能成为某个项目的重要素材。无论是一篇酝酿中的论文还是一份演讲 PPT,数据是为具体场景服务的。 -NanaFS 采用一个统一的文件模型,将来自多种数据源的数据汇总至同一位置,并基于统一的存储提供通用的工作流能力。 +NanaFS 以文件为第一公民,目标构建一套快速收集、智能归类、复杂查询、AI 加持的参考资料归档系统。 -## 核心特性 +## 🚩 核心特性 -### 基于云端存储 +### 🪄 基于云端存储 NanaFS 采用云端存储技术作为其主要后端存储方式,不仅仅支持对象存储,也支持网络硬盘。因此,凭借云端存储的能力,NanaFS 不但可以价格可控的拥有近乎无限的存储容量,也使得用户可以随时随地访问其保存在云端的数据。 @@ -26,7 +26,7 @@ NanaFS 采用云端存储技术作为其主要后端存储方式,不仅仅支 - **云盘类**:Google Drive、OneDrive、阿里云盘、百度网盘 - **其他存储协议**:WebDAV -### POSIX 兼容 +### 🗃 POSIX 兼容 NanaFS 通过 FUSE 提供了符合 POSIX 标准的文件系统接口。这使得在 Linux 和 MacOS 操作系统中,可以轻松地将 NanaFS 挂载到目录树上,并通过访达等工具管理 NanaFS 中的数据。 @@ -35,28 +35,28 @@ NanaFS 通过 FUSE 提供了符合 POSIX 标准的文件系统接口。这使得 NanaFS 中的数据进行处理。 对于特定需求,也可以通过编写处理文件的脚本或程序,实现自定义处理 NanaFS 中的文件。 -### 面向文件的工作流 +### ⚙️ 面向文件的工作流 数据存储的实际价值在于数据的使用。NanaFS 为此提供了面向文件的工作流引擎,并配备了基于规则的文件自动处理能力。 基于工作流的能力,无论是文件的批量重命名,还是创建基于文件内容语义的索引都变得十分简单。轻松地操控数据,让数据不再冰冷,发掘数据中蕴含的更多价值。 -### 支持插件 +### 🔌 支持插件 NanaFS 通过支持多种类型的插件,以实现对功能的拓展。目前 NanaFS 主要支持三种类型的插件: - **Source Plugin**:定期的从源地址同步数据并收纳到 NanaFS 中,比如聚合 RSS 信息,根据 SMTP 协议归档电子邮件; - **Process Plugin**:提供文件处理能力,通过拓展 Process Plugin,增强 Workflow 的功能。 -### 数据安全 +### 🔐 数据安全 数据安全是进行数据存储和使用的前提条件。NanaFS 提供从存储到传输的全链路加密,即使您的云端数据被窃取,黑客也无法获取您的数据。同样,云服务提供商也无法访问和修改您的数据,保证了您的数据不会被泄露和滥用。 -## 使用 +## 🚀 使用 NanaFS 的使用方式参数文档 [Instructions For Usage](https://github.com/basenana/nanafs/blob/main/docs/usage_zh.md)。 -## 反馈 +## ✉️ 反馈 如果您在使用NanaFS时遇到任何问题,无论是相关于使用方式、Bugs,还是您有新功能的建议,请随时创建 issue。 \ No newline at end of file diff --git a/cmd/apps/apis/fsapi/v1/service.go b/cmd/apps/apis/fsapi/v1/service.go index 5fea02a9..06d6bc25 100644 --- a/cmd/apps/apis/fsapi/v1/service.go +++ b/cmd/apps/apis/fsapi/v1/service.go @@ -516,9 +516,12 @@ func (s *services) GetEntryDetail(ctx context.Context, request *GetEntryDetailRe return nil, status.Error(common.FsApiError(err), "has no permission") } - p, err := s.ctrl.GetEntry(ctx, en.ParentID) - if err != nil { - return nil, status.Error(common.FsApiError(err), "query entry parent failed") + var p *types.Metadata + if en.ParentID != dentry.RootEntryID { + p, err = s.ctrl.GetEntry(ctx, en.ParentID) + if err != nil { + return nil, status.Error(common.FsApiError(err), "query entry parent failed") + } } properties, err := s.queryEntryProperties(ctx, en.ID, en.ParentID) @@ -1035,9 +1038,15 @@ func (s *services) TriggerWorkflow(ctx context.Context, request *TriggerWorkflow } func (s *services) queryEntryProperties(ctx context.Context, entryID, parentID int64) ([]*Property, error) { - properties, err := s.ctrl.ListEntryProperties(ctx, parentID) - if err != nil { - return nil, err + var ( + properties = make(map[string]types.PropertyItem) + err error + ) + if parentID != dentry.RootEntryID { + properties, err = s.ctrl.ListEntryProperties(ctx, parentID) + if err != nil { + return nil, err + } } entryProperties, err := s.ctrl.ListEntryProperties(ctx, entryID) if err != nil { From 75d7b526f7ffb6b911e7cd17426730fb35677a48 Mon Sep 17 00:00:00 2001 From: hyponet Date: Sun, 16 Jun 2024 21:03:17 +0800 Subject: [PATCH 2/2] update: links --- README.md | 2 +- README_zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 66031ca0..75d584ae 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

[ English | 简体中文 ]

-NanaFS is a Reference Filing System inspired by the [GTD (Getting Things Done®) methodology](https://gettingthingsdone.com/wp-content/uploads/2014/10/Filing.pdf), +NanaFS is a **Reference Filing System** inspired by the [GTD (Getting Things Done®)](https://gettingthingsdone.com/wp-content/uploads/2014/10/Filing.pdf) methodology, designed to collect, store, and process information that does not require immediate action but may be useful in the future. In personal, academic, and professional life, vast amounts of data and materials are scattered across various information silos, diff --git a/README_zh.md b/README_zh.md index 8509287d..52fa76df 100644 --- a/README_zh.md +++ b/README_zh.md @@ -5,7 +5,7 @@

[ English | 简体中文 ]

-NanaFS 是一款受 GTD 方法论启发的[参考资料归档系统](https://gettingthingsdone.com/wp-content/uploads/2014/10/Filing.pdf), +NanaFS 是一款受 [GTD®](https://gettingthingsdone.com/wp-content/uploads/2014/10/Filing.pdf) 方法论启发的**参考资料归档系统**, 用于收集、存储、处理那些不需要立即采取行动,但可能在未来有用的信息。 在个人工作、学习和生活中,大量的数据和材料存储在不同的信息孤岛之中,例如 Office 文件、电子邮件、RSS、工作笔记等。