nocobase-drive
Fungsinya
Skill ini mengonfigurasi penyimpanan file dalam aplikasi NocoBase 3, mencakup folder lokal, layanan kompatibel S3, dan Aliyun OSS. Cocok untuk pengembang yang menangani unggahan dan pengaturan penyimpanan.
Kapan dipakai
- ✓Saat Anda perlu mengubah lokasi penyimpanan file unggahan aplikasi NocoBase.
- ✓Saat Anda ingin menghubungkan aplikasi ke penyimpanan S3 atau Aliyun OSS.
- ✓Saat Anda perlu memperbaiki cara URL penyimpanan atau operasi file dikonfigurasi.
Link skill
https://github.com/nocobase/nocobase/blob/v3-develop/packages/libs/drive/skills/nocobase-drive/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Bisakah Anda mengatur aplikasi NocoBase saya agar menyimpan file unggahan di bucket S3, bukan di disk lokal?”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI mengedit konfigurasi penyimpanan dan memilih driver yang sesuai untuk jenis penyimpanan tersebut. Setelah itu AI memeriksa operasi file dan URL yang dihasilkan aplikasi.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.
Pertanyaan umum
Apakah ini mencakup izin unggah?
Tidak. Koleksi file dan izin unggah termasuk tanggung jawab plugin File.
Bisakah saya memakai jenis penyimpanan yang tidak tercantum?
Bisa. Skill mencakup pabrik driver kustom untuk layanan penyimpanan lain.
Apakah ini mencakup kredensial penyimpanan?
Ya. Skill menjelaskan cara kredensial penyimpanan dikonfigurasi untuk setiap jenis penyimpanan.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 25k
- Peringkat
- #10084
- Lisensi
- —
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
nocobase-app-development
25kMembantu agent Anda membangun halaman, rute, data, izin, dan tes untuk aplikasi bisnis NocoBase 3 yang lengkap.
shadcn
25kMembantu agent Anda menemukan, menambahkan, memperbaiki, dan memberi gaya komponen shadcn/ui pada proyek web, dengan memakai dokumentasi resmi dan registry-nya.
nocobase-app-plugin-development
25kMembantu agent Anda membuat dan memelihara plugin NocoBase 3 di dalam aplikasi yang sudah ada, mencakup bagian server, klien, database, dan registrasi.
nocobase-app-upgrade
25kMembantu agent Anda meningkatkan aplikasi NocoBase ke rilis template yang lebih baru, membawa perubahan template sambil tetap mempertahankan pekerjaan Anda sendiri.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.