Skip to content

✨feat: 프로필 이미지 업로드 기능 추가#14

Merged
swfs0417 merged 8 commits into
mainfrom
feat/profilepic
Jul 12, 2026
Merged

✨feat: 프로필 이미지 업로드 기능 추가#14
swfs0417 merged 8 commits into
mainfrom
feat/profilepic

Conversation

@swfs0417

@swfs0417 swfs0417 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

What feature does this PR add?

  • 프로필 사진 업로드 기능 추가했습니다.
  • 프로필 사진 Object Storage 링크가 db에 저장되며, 프론트에서 이 주소를 바로 넣으면 됩니다.

Are there any caveats or things to watch out for?

  • 용량 제한과 파일 종류 제한(어차피 서버에서 볼 일을 없지만)을 위해 프로필 사진이 백엔드를 거쳐갑니다.

swfs0417 added 4 commits July 8, 2026 22:25
- Implemented OCIObjectStorageService to handle uploading and deleting profile images to Oracle Cloud Infrastructure (OCI) Object Storage.
- Added methods for uploading images, deleting images, generating public URLs, and extracting object names from URLs.
- Included error handling for OCI package import and object storage configuration.
- Defined supported image file extensions for profile images.
@swfs0417
swfs0417 marked this pull request as ready for review July 9, 2026 13:42
Comment thread app/services/object_storage.py Outdated
if not all((self.namespace, self.bucket, self.region)):
raise ObjectStorageError("OCI object storage is not configured")

config_file = os.getenv("OCI_CONFIG_FILE")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OCI_CONFIG_FILE 에 대해서 secret을 등록한거죠 지금 ? ?

OCI_CONFIG 자체를 불러오는게 만약 목적이라면, namespace, bucket, region은 하드코딩 or env 불러오는걸로 해도 될 거같고 InstancePrincipal 방식을 사용하는 것도 방법이 될수 있을것 같네요

나머지 public_base_url이나 이런것은 지금과 같이 해도 좋을것같습니다.

https://github.com/wafflestudio/siksha-api/commit/44187bcfac978ea7280e033ba6ffa07374c30b1c#diff-83677b3c4e84132d2f58f0d1db929aa4c41b389e9da15795c3006e4eb58b1860

요거에서 InstancePrincipal을 이용하는걸 참고해보시면 좋을 것같아요

https://github.com/wafflestudio/waffle-world-oci/blob/main/argocd/siksha-prod/siksha-api-server.yaml (env에 등록은 여기에서)

@swfs0417
swfs0417 requested a review from youngunghan July 11, 2026 11:24
Comment thread app/services/__init__.py
"ProjectService",
"MemberService",
"S3Service",
"OCIObjectStorageService",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S3Service, OCIObjectStorageService 이거 추상화 한번만 해주시겠어요 ?

혹시나 인프라 수정할 경우에 갈아끼기 쉽게 하는게 좋을것같아요

BucketService
ㄴ S3Service
ㄴ OCIObjectStorageService

Comment thread app/services/object_storage.py Outdated
auth_mode = os.getenv("OCI_OBJECT_STORAGE_AUTH", "instance_principal")
try:
if auth_mode == "config_file":
config_file = os.getenv("OCI_CONFIG_FILE")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getenv 하면, https://github.com/wafflestudio/waffle-world-oci/blob/main/argocd/siksha-prod/siksha-api-server.yaml 여기에 환경변수를 주입해두는건데,

authMode 받는거 자체는 좋은데

이제 OCI_CONFIG_FILE은 getenv에서 가져오는게 아니라 아래와 같은 메소드 oci.config.from_file() 로 가져올수있어
이걸 가져오려면 InstancePrincipal이라는 노드에 인증 권한 주입이 필요한데 설명은 아래 참고

  • InstancePrincipal : "OCI 컴퓨트 인스턴스(VM/노드) 자체에게 신원(identity)을 부여해서, API 키 없이도 그 인스턴스가 OCI 리소스에 접근할 수 있게 하는 인증 방식"

Infra 팀에서 oracle node 에 이미 instance principal 인증을 해두어서 가능합니다.

from config import (
OBJECT_STORAGE_BACKEND,
OBJECT_STORAGE_LOCAL_ROOT,
OBJECT_STORAGE_PUBLIC_BASE_URL,
OCI_OBJECT_STORAGE_AUTH,
OCI_OBJECT_STORAGE_BUCKET,
OCI_OBJECT_STORAGE_NAMESPACE,
OCI_OBJECT_STORAGE_REGION,
)
from error.exception.object_storage_error_503 import ObjectStorageClientException, ObjectStorageException
from util.ecs_log import logger

@lru_cache
def get_oci_object_storage_client():
import oci

if OCI_OBJECT_STORAGE_AUTH == "config_file":
    config = oci.config.from_file()
    return oci.object_storage.ObjectStorageClient(config)

@swfs0417
swfs0417 merged commit a40b1bf into main Jul 12, 2026
1 check passed
@swfs0417
swfs0417 deleted the feat/profilepic branch July 12, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants