Introduce S3-compatible storage support and update local/dev configuration. - .claude: add "WebSearch" to local settings - backend/.env.example: add USE_S3 flag and detailed S3/MinIO (RustFS) example env vars + comments to explain dev vs production usage - backend/vontor_cz/settings.py: refactor to use USE_S3 boolean; set STATIC_ROOT; configure STORAGES for local filesystem vs S3 backends; add handling for S3 endpoint (MinIO/RustFS) vs real AWS S3 including path-style addressing, URL construction, and sensible AWS defaults - docker-compose.yml: add rustfs to service dependencies, include rustfs in networks, change frontend port mapping to 8001:80, and add rustfs-data volume binding These changes enable using a local S3-compatible backend (RustFS/MinIO) in development while keeping the option to swap to real AWS S3 for production.
83 lines
2.5 KiB
Plaintext
83 lines
2.5 KiB
Plaintext
FRONTEND_URL=http://localhost:5173
|
|
#FRONTEND_URL=http://localhost:5173
|
|
|
|
|
|
# ------------------ CORE ------------------
|
|
DEBUG=True
|
|
SILK=False
|
|
SSL=False
|
|
DJANGO_SECRET_KEY=CHANGE_ME_SECURE_RANDOM_KEYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
|
|
# ------------------ DATABASE (Postgres in Docker) ------------------
|
|
USE_DOCKER_DB=True
|
|
DATABASE_ENGINE=django.db.backends.postgresql
|
|
DATABASE_HOST=db
|
|
DATABASE_PORT=5432
|
|
|
|
POSTGRES_DB=djangoDB
|
|
POSTGRES_USER=dockerDBuser
|
|
POSTGRES_PASSWORD=AWSJeMocDrahaZalezitost
|
|
|
|
# ------------------ MEDIA / STATIC ------------------
|
|
# USE_S3=True enables S3-compatible storage (MinIO or AWS).
|
|
# Leave USE_S3=False (default) to use local filesystem in development.
|
|
MEDIA_URL=/media/
|
|
|
|
# ------------------ REDIS / CACHING / CHANNELS ------------------
|
|
# Was REDIS=... (not used). Docker expects REDIS_PASSWORD.
|
|
# REDIS_PASSWORD=eTrznicePasswd ... not needed if in docker network
|
|
|
|
# ------------------ CELERY ------------------
|
|
CELERY_BROKER_URL=redis://redis:6379/0
|
|
CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
CELERY_ACCEPT_CONTENT=json
|
|
CELERY_TASK_SERIALIZER=json
|
|
CELERY_TIMEZONE=Europe/Prague
|
|
CELERY_BEAT_SCHEDULER=django_celery_beat.schedulers:DatabaseScheduler
|
|
CELERY_ENABLED=True
|
|
|
|
# ------------------ EMAIL (dev/prod logic in settings) ------------------
|
|
EMAIL_HOST=localhost
|
|
EMAIL_PORT=1025
|
|
EMAIL_USE_SSL=True
|
|
EMAIL_USE_TLS=False
|
|
EMAIL_USER=
|
|
EMAIL_USER_PASSWORD=
|
|
DEFAULT_FROM_EMAIL=
|
|
|
|
# ------------------ S3 STORAGE ------------------
|
|
# Set USE_S3=True to enable. AWS_S3_ENDPOINT_URL selects the backend:
|
|
# set → MinIO / S3-compatible
|
|
# empty → real AWS S3
|
|
|
|
USE_S3=False
|
|
|
|
# RustFS (docker-compose default — S3-compatible MinIO successor)
|
|
AWS_S3_ENDPOINT_URL=http://rustfs:9000
|
|
AWS_S3_CUSTOM_DOMAIN=localhost:9000/vontor
|
|
AWS_STORAGE_BUCKET_NAME=vontor
|
|
AWS_ACCESS_KEY_ID=rustfsadmin
|
|
AWS_SECRET_ACCESS_KEY=rustfsadmin
|
|
RUSTFS_ACCESS_KEY=rustfsadmin
|
|
RUSTFS_SECRET_KEY=rustfsadmin
|
|
RUSTFS_BUCKET_NAME=vontor
|
|
|
|
# AWS S3 (swap in for production — clear AWS_S3_ENDPOINT_URL)
|
|
# AWS_STORAGE_BUCKET_NAME=my-bucket
|
|
# AWS_ACCESS_KEY_ID=
|
|
# AWS_SECRET_ACCESS_KEY=
|
|
# AWS_S3_REGION_NAME=eu-central-1
|
|
# AWS_S3_ENDPOINT_URL=
|
|
|
|
# ------------------ JWT / TOKENS (lifetimes defined in code) ------------------
|
|
# (No env vars needed; kept placeholder section)
|
|
|
|
# ------------------ MISC ------------------
|
|
# FRONTEND_URL_DEV not used; rely on FRONTEND_URL
|
|
# Add any extra custom vars below
|
|
|
|
# -- ČSOB API --
|
|
|
|
CSOB_MERCHANT_ID=A6680stogb
|
|
CSOB_API_URL=https://iapi.iplatebnibrana.csob.cz/ # PŘI PRODUKCI VYMĚNIT ZA REALNE API!!!! |