# -*- coding: utf-8 -*-
# type: ignore
from __future__ import annotations

import os

from .webapp import *  # noqa: F403

DEBUG = (
    os.environ.get('HOTPOCKET_BACKEND_DEBUG', 'false').lower() == 'true'
)

ALLOWED_HOSTS = os.environ.get('HOTPOCKET_BACKEND_ALLOWED_HOSTS', '*').split(',')

MIDDLEWARE = [
    *MIDDLEWARE,  # noqa: F405
    'whitenoise.middleware.WhiteNoiseMiddleware',
]

SESSION_COOKIE_SAMESITE = 'Lax'
SESSION_COOKIE_SECURE = False

STORAGES['staticfiles'] = {  # noqa: F405
    'BACKEND': 'whitenoise.storage.CompressedManifestStaticFilesStorage',
}

ROOT_URLCONF = 'hotpocket_backend.urls.aio'

UPLOADS_PATH = Path(  # noqa: F405
    os.environ.get(
        'HOTPOCKET_BACKEND_UPLOADS_PATH',
        '/srv/run/uploads',
    ),
)
