runlot
데이터스토리지

CLI

켜고, 끄고, 사용량을 봅니다. 파일을 직접 올리고 내리는 명령은 아직 없습니다.

runlot storage create [dir]      오브젝트 스토리지를 켜요 (Worker 에서 env.storage)
runlot storage [status] [dir]    사용량과 상한 (--json 으로 원본 출력)
runlot storage delete [dir]      스토리지를 해제해요 (admin)

켜기

runlot storage create

runlot add storage 와 같은 일을 합니다. runlot.json"storage": true 가 기록되고, 다음 배포부터 워커가 env.storage 를 받습니다.

상태 보기

runlot storage status
runlot storage status --json

끄기

runlot storage delete

admin 역할이 필요하고, 확인을 받습니다.

아직 없는 것

ls · cp · rm 처럼 파일을 직접 다루는 명령은 아직 없습니다. 지금은 워커 안에서 env.storage 로 다루시거나, 서명 URL 을 만들어 쓰셔야 합니다.

임시로 쓰실 수 있는 방법은, 관리용 경로를 워커에 하나 두고 접근 제어 로 조직 멤버만 열리게 하는 것입니다.

app.get("/admin/files", async (c) => {
  const who = identity(c.req.raw);
  if (who.orgRole !== "admin") return new Response(null, { status: 403 });
  const page = await c.env.storage.list({ limit: 1000 });
  return Response.json(page.objects);
});

이 페이지에서