from flask import Blueprint

from src.config import Configuration

from .overview import get_file_overview, set_file_password

file_bp = Blueprint("file", __name__, url_prefix="/file")

file_bp.get("/<file_hash>")(get_file_overview)

if Configuration().archive_server["enabled"]:
    file_bp.patch("/<file_hash>")(set_file_password)
