diff --git a/backend/__pycache__/main.cpython-311.pyc b/backend/__pycache__/main.cpython-311.pyc
index 2533e85..2c02d95 100644
Binary files a/backend/__pycache__/main.cpython-311.pyc and b/backend/__pycache__/main.cpython-311.pyc differ
diff --git a/backend/database/__pycache__/models.cpython-311.pyc b/backend/database/__pycache__/models.cpython-311.pyc
index 930b851..43ad793 100644
Binary files a/backend/database/__pycache__/models.cpython-311.pyc and b/backend/database/__pycache__/models.cpython-311.pyc differ
diff --git a/backend/database/__pycache__/schemas.cpython-311.pyc b/backend/database/__pycache__/schemas.cpython-311.pyc
index ea07441..9a2735c 100644
Binary files a/backend/database/__pycache__/schemas.cpython-311.pyc and b/backend/database/__pycache__/schemas.cpython-311.pyc differ
diff --git a/backend/database/models.py b/backend/database/models.py
index 1ab0eba..8ea8700 100644
--- a/backend/database/models.py
+++ b/backend/database/models.py
@@ -27,6 +27,7 @@ class IssueCategory(str, enum.Enum):
design_error = "design_error" # 설계미스 (기존 dimension_defect 대체)
incoming_defect = "incoming_defect"
inspection_miss = "inspection_miss" # 검사미스 (신규 추가)
+ etc = "etc" # 기타
class User(Base):
__tablename__ = "users"
diff --git a/backend/database/schemas.py b/backend/database/schemas.py
index 8b08e80..4e7b467 100644
--- a/backend/database/schemas.py
+++ b/backend/database/schemas.py
@@ -17,6 +17,7 @@ class IssueCategory(str, Enum):
design_error = "design_error" # 설계미스 (기존 dimension_defect 대체)
incoming_defect = "incoming_defect"
inspection_miss = "inspection_miss" # 검사미스 (신규 추가)
+ etc = "etc" # 기타
# User schemas
class UserBase(BaseModel):
diff --git a/backend/main.py b/backend/main.py
index d28307f..157d19e 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -20,13 +20,14 @@ app = FastAPI(
version="1.0.0"
)
-# CORS 설정
+# CORS 설정 (완전 개방 - CORS 문제 해결)
app.add_middleware(
CORSMiddleware,
- allow_origins=["*"], # 프로덕션에서는 구체적인 도메인으로 변경
- allow_credentials=True,
- allow_methods=["*"],
+ allow_origins=["*"],
+ allow_credentials=False, # * origin과 credentials는 함께 사용 불가
+ allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_headers=["*"],
+ expose_headers=["*"]
)
# 라우터 등록
diff --git a/backend/migrations/009_add_project_daily_works_table.sql b/backend/migrations/009_add_project_daily_works_table.sql
index 3a479d9..9b0fdbd 100644
--- a/backend/migrations/009_add_project_daily_works_table.sql
+++ b/backend/migrations/009_add_project_daily_works_table.sql
@@ -23,3 +23,4 @@ SELECT
created_at
FROM daily_works
WHERE total_hours > 0;
+
diff --git a/backend/routers/__pycache__/auth.cpython-311.pyc b/backend/routers/__pycache__/auth.cpython-311.pyc
index 7cb5703..77a4f57 100644
Binary files a/backend/routers/__pycache__/auth.cpython-311.pyc and b/backend/routers/__pycache__/auth.cpython-311.pyc differ
diff --git a/backend/routers/__pycache__/issues.cpython-311.pyc b/backend/routers/__pycache__/issues.cpython-311.pyc
index 5f7acc8..c22b607 100644
Binary files a/backend/routers/__pycache__/issues.cpython-311.pyc and b/backend/routers/__pycache__/issues.cpython-311.pyc differ
diff --git a/backend/routers/__pycache__/projects.cpython-311.pyc b/backend/routers/__pycache__/projects.cpython-311.pyc
index 1005bdd..9cdddd0 100644
Binary files a/backend/routers/__pycache__/projects.cpython-311.pyc and b/backend/routers/__pycache__/projects.cpython-311.pyc differ
diff --git a/backend/routers/auth.py b/backend/routers/auth.py
index a6a677e..67951bc 100644
--- a/backend/routers/auth.py
+++ b/backend/routers/auth.py
@@ -36,6 +36,11 @@ async def get_current_admin(current_user: User = Depends(get_current_user)):
)
return current_user
+@router.options("/login")
+async def login_options():
+ """OPTIONS preflight 요청 처리"""
+ return {"message": "OK"}
+
@router.post("/login", response_model=schemas.Token)
async def login(form_data: OAuth2PasswordRequestForm = Depends(), db: Session = Depends(get_db)):
user = authenticate_user(db, form_data.username, form_data.password)
diff --git a/backend/routers/projects.py b/backend/routers/projects.py
index 7896290..c14f066 100644
--- a/backend/routers/projects.py
+++ b/backend/routers/projects.py
@@ -20,6 +20,11 @@ def check_admin_permission(current_user: User = Depends(get_current_user)):
)
return current_user
+@router.options("/")
+async def projects_options():
+ """OPTIONS preflight 요청 처리"""
+ return {"message": "OK"}
+
@router.post("/", response_model=ProjectSchema)
async def create_project(
project: ProjectCreate,
@@ -53,8 +58,7 @@ async def get_projects(
skip: int = 0,
limit: int = 100,
active_only: bool = True,
- db: Session = Depends(get_db),
- current_user: User = Depends(get_current_user)
+ db: Session = Depends(get_db)
):
"""프로젝트 목록 조회"""
query = db.query(Project)
@@ -68,8 +72,7 @@ async def get_projects(
@router.get("/{project_id}", response_model=ProjectSchema)
async def get_project(
project_id: int,
- db: Session = Depends(get_db),
- current_user: User = Depends(get_current_user)
+ db: Session = Depends(get_db)
):
"""특정 프로젝트 조회"""
project = db.query(Project).filter(Project.id == project_id).first()
diff --git a/backend/services/__pycache__/auth_service.cpython-311.pyc b/backend/services/__pycache__/auth_service.cpython-311.pyc
index 217c9f5..fa1fa55 100644
Binary files a/backend/services/__pycache__/auth_service.cpython-311.pyc and b/backend/services/__pycache__/auth_service.cpython-311.pyc differ
diff --git a/backend/services/auth_service.py b/backend/services/auth_service.py
index 09fedc9..f537ba8 100644
--- a/backend/services/auth_service.py
+++ b/backend/services/auth_service.py
@@ -13,13 +13,18 @@ SECRET_KEY = os.getenv("SECRET_KEY", "your-secret-key-here")
ALGORITHM = os.getenv("ALGORITHM", "HS256")
ACCESS_TOKEN_EXPIRE_MINUTES = int(os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES", "10080")) # 7 days
-# 비밀번호 암호화
-pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
+# 비밀번호 암호화 (pbkdf2_sha256 사용 - bcrypt 문제 회피)
+pwd_context = CryptContext(
+ schemes=["pbkdf2_sha256"],
+ deprecated="auto"
+)
def verify_password(plain_password: str, hashed_password: str) -> bool:
+ """비밀번호 검증 (pbkdf2_sha256 - 길이 제한 없음)"""
return pwd_context.verify(plain_password, hashed_password)
def get_password_hash(password: str) -> str:
+ """비밀번호 해시 생성 (pbkdf2_sha256 - 길이 제한 없음)"""
return pwd_context.hash(password)
def create_access_token(data: dict, expires_delta: Optional[timedelta] = None):
diff --git a/docker-compose.yml b/docker-compose.yml
index ee6d9ee..b26a362 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -28,13 +28,13 @@ services:
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 10080 # 7 days
ADMIN_USERNAME: hyungi
- ADMIN_PASSWORD: djg3-jj34-X3Q3
+ ADMIN_PASSWORD: "123456"
TZ: Asia/Seoul
volumes:
- ./backend:/app
- uploads:/app/uploads
ports:
- - "16000:8000"
+ - "0.0.0.0:16000:8000" # 모든 IP에서 접근 허용
depends_on:
- db
networks:
diff --git a/frontend/admin.html b/frontend/admin.html
index 1e5878d..44dccf4 100644
--- a/frontend/admin.html
+++ b/frontend/admin.html
@@ -225,20 +225,43 @@
-
+
+