Files
kappa 6f92cacfea feat: 에디터 이미지 업로드 R2 훅 추가
- cheditor5, smarteditor2 에디터 이미지 업로드 지원
- get_editor_upload_url 훅을 통한 R2 스토리지 연동
- 업로드 성공 시 로컬 파일 자동 삭제
- Presigned URL 생성으로 보안 접근 제공

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:08:46 +09:00

67 lines
2.3 KiB
PHP

<?php
/**
* Cloudflare R2 Storage Configuration
*
* 이 파일을 복사하여 실제 값으로 수정하세요.
* r2_config.php.example -> r2_config.php
*/
if (!defined('_GNUBOARD_')) exit;
// ============================================
// Cloudflare R2 Credentials
// ============================================
// Cloudflare Dashboard > R2 > Manage R2 API Tokens 에서 생성
define('R2_ACCOUNT_ID', 'd8e5997eb4040f8b489f09095c0f623c');
define('R2_ACCESS_KEY_ID', 'b4a23ea18a1e766d9d9af87898c03bfd');
define('R2_SECRET_ACCESS_KEY', 'cf3fbe8533553aafbc26a98110a9138e49d16e0d64322b322290b5f606678567');
// ============================================
// Bucket Settings
// ============================================
define('R2_BUCKET_NAME', 'gnuboard-files');
define('R2_ENDPOINT', 'https://' . R2_ACCOUNT_ID . '.r2.cloudflarestorage.com');
// Public URL (CDN 또는 Public Bucket URL)
// 예: https://pub-xxxxx.r2.dev 또는 Custom Domain
define('R2_PUBLIC_URL', '');
// ============================================
// Storage Options
// ============================================
// R2 스토리지 활성화 여부
define('R2_ENABLED', true);
// Presigned URL 사용 여부 (권장: true)
define('R2_USE_PRESIGNED_URL', true);
// Presigned URL 만료 시간 (초) - 기본 1시간
define('R2_PRESIGNED_EXPIRY', 3600);
// 대용량 파일 멀티파트 업로드 임계값 (bytes) - 기본 100MB
define('R2_MULTIPART_THRESHOLD', 100 * 1024 * 1024);
// R2 연결 실패 시 로컬 저장 폴백
define('R2_FALLBACK_TO_LOCAL', true);
// ============================================
// Path Prefix Settings
// ============================================
// 유저별 경로 사용 여부
define('R2_USE_USER_PREFIX', true);
// 기본 경로 구조
// {user_id} - 회원 ID
// {bo_table} - 게시판 테이블명
// {date} - 날짜 (Y-m-d)
define('R2_PATH_BOARD', 'users/{user_id}/board/{bo_table}');
define('R2_PATH_EDITOR', 'users/{user_id}/editor/{date}');
define('R2_PATH_PROFILE', 'users/{user_id}/profile');
define('R2_PATH_PUBLIC', 'public/board/{bo_table}');
// ============================================
// Allowed File Types
// ============================================
define('R2_ALLOWED_IMAGE_EXT', 'jpg,jpeg,gif,png,webp,svg');
define('R2_ALLOWED_FILE_EXT', 'jpg,jpeg,gif,png,webp,svg,pdf,doc,docx,xls,xlsx,ppt,pptx,hwp,txt,zip,rar,7z');