nocobase-drive
ما الذي تفعله
تضبط هذه المهارة تخزين الملفات في تطبيق NocoBase 3، وتشمل المجلدات المحلية وخدمات متوافقة مع S3 وAliyun OSS. وهي مخصصة للمطورين الذين يتعاملون مع الرفع وإعدادات التخزين.
متى تستخدمها
- ✓عندما تريد تغيير المكان الذي يخزن فيه التطبيق الملفات المرفوعة.
- ✓عندما تريد ربط التطبيق بتخزين S3 أو Aliyun OSS.
- ✓عندما تحتاج إلى إصلاح طريقة إعداد عناوين التخزين أو عمليات الملفات.
رابط المهارة
https://github.com/nocobase/nocobase/blob/v3-develop/packages/libs/drive/skills/nocobase-drive/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل يمكنك ضبط تطبيق NocoBase الخاص بي ليخزن الملفات المرفوعة في حاوية S3 بدل القرص المحلي؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يعدّل الذكاء الاصطناعي إعداد التخزين، ويختار المشغّل المناسب لنوع التخزين. ثم يتحقق من عمليات الملفات والعناوين التي يولّدها التطبيق.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
File storage with NocoBase Drive
Use @nocobase/drive for storage operations. It wraps Flydrive with application configuration and a native Aliyun OSS driver. Choose the relevant reference before changing a disk:
| Storage | Driver | Read |
|---|---|---|
| A local or mounted filesystem | fs |
Filesystem configuration, paths, and URLs |
| Amazon S3 or an S3-compatible service | s3 |
S3 configuration, credentials, and ACLs |
| Native Aliyun OSS with access keys or an ECS RAM role | oss |
OSS configuration, credentials, and networking |
| An application-owned or third-party Flydrive driver | Factory function | Custom driver factories |
Configuration and application integration
Configure default and disks in server/config/drive.ts; config.yml can override serializable object options. A disk name is the key in disks, while driver selects an implementation. For example, local: { driver: 'fs', ... } is selected by drive.use('local'). default must name an entry in disks. Objects and synchronous factories can coexist; no separate services configuration or driver registry is required.
Keep the application's existing DriveProvider and import driveManagerToken from @nocobase/app-server/drive. In server code that already has an application instance:
import { driveManagerToken } from '@nocobase/app-server/drive';
const drive = app.container.resolve(driveManagerToken);
const disk = drive.use();
await disk.put('reports/example.txt', 'Example report');
const contents = await disk.get('reports/example.txt');
Use drive.use(name) to select another disk. Pass storage keys relative to that disk, such as reports/example.txt; do not pass an absolute filesystem path, a URL, or a pre-encoded key. The manager creates disks on first use and caches successful creation. Resolve the shared manager instead of constructing one per request.
File Repository selects these same disks by name. Use the installed File plugin for file records, Repository upload/download operations, and their permissions. Direct Drive operations do not create File Repository records or perform its authorization checks. Changing the default disk does not move stored objects or rewrite existing records.
Boundaries and verification
visibility does not itself guarantee HTTP access or isolation. Filesystem serving and object storage policies determine actual access; generating a public URL does not grant permission to a private object. Read the selected driver's URL behavior before exposing a link.
Release artifact storage needs serializable configuration. Custom factories are rejected when selected by releases.artifact.disk. Named artifact references currently accept private fs and s3 objects; use the complete OSS object directly under releases.artifact or host.artifact for OSS, as the OSS guide describes.
For standalone use, call prepareDriveStorage(config) before createDriveManager(config) when filesystem directory preparation is needed. The application Provider already performs preparation. Tests can supply createDriveManager(config, { fakes: { location } }) and use Flydrive's fake()/restore(); fakes verify application behavior without proving remote credentials, ACLs, or network access.
Verify a configuration change with a write, read or streamed download, and deletion under a disposable key. Check public or signed links from the intended client's network when the feature uses them. Report whether verification used local storage, fakes, or the real remote service. For custom drivers, also verify lazy creation and repeated use through the shared manager.
الأسئلة الشائعة
هل تغطي صلاحيات الرفع؟
لا. مجموعات الملفات وصلاحيات الرفع تنتمي إلى إضافة File.
هل يمكنني استخدام نوع تخزين غير مذكور؟
نعم. تغطي المهارة مصانع المشغّلات المخصصة لخدمات تخزين أخرى.
هل تغطي بيانات اعتماد التخزين؟
نعم. توضح كيف تُضبط بيانات الاعتماد لكل نوع تخزين.
التفاصيل
الوصف الأصلي من المؤلف
Configure and use file storage with @nocobase/drive in NocoBase 3 applications, including local filesystem, S3-compatible storage, native Aliyun OSS, and custom driver factories. Use when changing drive configuration, storage credentials, file operations, or storage URLs. File Repository collections and upload permissions belong to the File plugin.
repo: nocobase/nocobase
الشعبية
- نجوم GitHub
- 25k
- الترتيب
- #10084
- الترخيص
- —
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
nocobase-app-development
25kيساعد وكيلك على بناء صفحات ومسارات وبيانات وصلاحيات واختبارات لتطبيق أعمال كامل على NocoBase 3.
shadcn
25kيساعد وكيلك على إيجاد مكونات shadcn/ui وإضافتها وإصلاحها وتنسيقها في مشروع ويب، باستخدام وثائقها الرسمية وسجلاتها.
nocobase-app-plugin-development
25kيساعد وكيلك على إنشاء إضافات NocoBase 3 وصيانتها داخل تطبيق موجود، بما في ذلك أجزاء الخادم والعميل وقاعدة البيانات والتسجيل.
nocobase-app-upgrade
25kيساعد وكيلك على ترقية تطبيق NocoBase إلى إصدار أحدث من القالب، فيأخذ تغييرات القالب ويحتفظ بعملك الخاص.
مهارات مشابهة
api-connector-builder
280kيبني وكيلك اتصالات API جديدة على النمط الموجود، ويفيد عندما تحتاج إلى تكامل إضافي دون ابتكار طريقة جديدة للعمل.
api-design
280kيساعد وكيلك على تصميم واجهات REST API وفق أفضل الممارسات، ويوضح كيف تتواصل وكيف تُعرض الأخطاء وكيف تُنظَّم البيانات.
backend-patterns
280kيساعد وكيلك على أنماط بنية الخادم وتحسين قاعدة البيانات، ويفيد في بناء الشيفرة التي تعمل على الخادم أو مراجعتها.