본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)25k · #10084

nocobase-drive

하는 일

이 스킬은 로컬 폴더, S3 호환 서비스, Aliyun OSS를 포함해 NocoBase 3 앱의 파일 저장소를 설정합니다. 업로드와 저장소 설정을 다루는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓NocoBase 앱이 업로드된 파일을 저장하는 위치를 바꿔야 할 때.
  • ✓앱을 S3나 Aliyun OSS 저장소에 연결하고 싶을 때.
  • ✓저장소 URL이나 파일 작업의 설정 문제를 고쳐야 할 때.

스킬 링크

https://github.com/nocobase/nocobase/blob/v3-develop/packages/libs/drive/skills/nocobase-drive/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/nocobase/nocobase/blob/v3-develop/packages/libs/drive/skills/nocobase-drive/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“NocoBase 앱이 업로드된 파일을 로컬 디스크 대신 S3 버킷에 저장하도록 설정해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 저장소 설정을 편집하며, 저장소 종류에 맞는 드라이버를 고릅니다. 그다음 파일 작업과 앱이 생성하는 URL을 확인합니다.

기술 내용 (원본 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
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬