###
#
# Environment variables are assigned at different times in docker.
# 3 tags make it possible to distinguish them :
#
# - @install
# - @build
# - @run
#
# The "@deprecated" tag targets a deprecated variable.
#
# For better readability, see url below :
# https://docs.phraseanet.com/4.1/en/EnvironnementVariables.html
#

# --- Phraseanet stack composition -------------------------------------------------------------------------------------

# Stack composition use "COMPOSE_FILES" and "COMPOSE_PROFILES" variables. Use it
# to adapt the stack in accordance with your needs.
#
# 1/ "COMPOSE_FILE" value define docker-compose files to include. See available
# files list below :
# - "docker-compose.yml"            : Services Nginx, Phraseanet, workers,
#                                     scheduler
# - "docker-compose.datastores.yml" : All data storage services required by
#                                     Phraseanet except for files storage.
# - "docker-compose.tools.yml"      : Dev and debug tools
# - "docker-compose.override.yml"   : For dev only, use the code from hosts,
#                                     activate ide debugger, ports mapping for
#                                     datastores
#
#
#
# 2/ "COMPOSE_PROFILES" value define which profiles you want to use
# in docker-compose.
# See available services and worker profiles below:
#
# Profiles service list:
# - "app"          : launch Phraseanet and nginx containers.
# - "workers"      : launch one worker container by kind of Jobs, you can also
#                    choose to launch only some workers, see worker list below.
# - "worker"       : launch one container worker with all jobs run on it.
# - "db"           : launch a mariadb container, because this is the primary
#                    datastore for production usage, use your own service.
# - "elastisearch" : launch a elasticsearch container.
# - "rabbitmq"     : launch a rabbitmq container.
# - "redis"        : launch a redis container.
# - "builder"      : launch the builder container, for dev only.
# - "elk"          : launch an elk stack, for dev only.
# - "squid"        : reverse proxy for dev only.
# - "mailhog"      : for catching all email emit by app for dev.
#
# Profiles worker list:
# - "assetsInjest"
# - "createRecord"
# - "deleteRecord"
# - "editRecord"
# - "exportMail"
# - "exposeUpload"
# - "exportFtp"
# - "mainQueue"
# - "populateIndex"
# - "pullAssets"
# - "recordsActions"
# - "subdefCreation"
# - "subtitle"
# - "validationReminder"
# - "webhook"
# - "writeMetadatas"
#
# - "scheduler" : legacy task manager. Warning! Use only if your stack
#                 require using old task.
#
# See [Docker compose profile documentation|https://docs.docker.com/compose/profiles/]
# for more information about docker compose profiles.
#
#
# See below some examples of stack composition:
#
# For development:
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.override.yml
# - COMPOSE_PROFILES=app,db,pma,elasticsearch,redis,rabbitmq,workers,mailhog,builder
#
# For testing with debug:
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
# - COMPOSE_PROFILES=app,db,pma,elasticsearch,rabbitmq,redis,worker,workers,mailhog
#
# For production (require using your own databases services):
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.scheduler.yml
# - COMPOSE_PROFILES=app,workers
#
# Example with all profiles:
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
# - COMPOSE_PROFILES=app,db,elasticsearch,redis,rabbitmq,pma,mailhog,assetsInjest,createRecord,deleteRecord,editRecord,
#                    exportMail,exposeUpload,exportFtp,mainQueue,populateIndex,pullAssets,recordsActions,subdefCreation,
#                    subtitle,validationReminder,webhook,writeMetadatas,scheduler,elk
#


# Define "docker-compose" files to include.
# @run
COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml

# Define which profiles you want to use in "docker-compose".
# @run
COMPOSE_PROFILES=app,db,elasticsearch,rabbitmq,redis,worker,mailhog



# --- Phraseanet container settings ------------------------------------------------------------------------------------

# Registry from which you pull docker images.
# Avalaible values:
# - "local"     : build and use your images.
# - "alchemyfr" : using predbuild images from Alchemy registry.
#
# @run
PHRASEANET_DOCKER_REGISTRY=alchemyfr

# Docker images tag.
# @run
PHRASEANET_DOCKER_TAG=4.1.5

# Application port.
# @run
PHRASEANET_APP_PORT=8082



# --- Phraseanet container entrypoint settings -------------------------------------------------------------------------

# Do an installation if Phraseanet is not installed.
# Avalaible values: "0" | "1"
# @run
PHRASEANET_INSTALL=1

# Apply they env variables values to config/configuration.yml file.
# Avalaible values: "0" | "1"
# @run
PHRASEANET_SETUP=1

# Play an upgrade.
# Avalaible values: "0" | "1"
# @run
PHRASEANET_UPGRADE=0



# --- RabbitMQ settings ------------------------------------------------------------------------------------------------

# RabbitMQ user account : create an account in RabbitMQ container and use it
# in Phraseanet configuration.
# @run
RABBITMQ_DEFAULT_USER=alchemy

# RabbitMQ password account.
# @run
RABBITMQ_DEFAULT_PASS=vdh4dpe5Wy3R

# RabbitMQ Http interface management port.
# @run
RABBITMQ_MANAGEMENT_PORT=10811



# --- Gateway settings (nginx) -----------------------------------------------------------------------------------------

# Value applied to "send_timeout", "keepalive_timeout", "client_header_timeout"
# and "client_body_timeout" nginx settings.
# @run
GATEWAY_SEND_TIMEOUT=120

# Timeout for establishing a connection with a proxied server. See [documentation|
# http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout].
# @run
GATEWAY_PROXY_TIMEOUT=120

# Value applied to "fastcgi_connect_timeout", "fastcgi_read_timeout"
# and "fastcgi_send_timeout" nginx settings.
# @run
GATEWAY_FASTCGI_TIMEOUT=300



# --- PHP settings -----------------------------------------------------------------------------------------------------

# Maximum request body size for Php and Nginx. Example "1G"
# @run
MAX_BODY_SIZE=1G

# Maximum Php input var. See [max-input-vars Php documentation|
# https://www.php.net/manual/en/info.configuration.php#ini.max-input-vars].
# @run
MAX_INPUT_VARS=12000

# Maximum Php execution time in second. See [max-execution-time Php documentation|
# https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time].
# @run
MAX_EXECUTION_TIME=120

# Maximum Php input time in second. See [max-input-time Php documentation|
# https://www.php.net/manual/en/info.configuration.php#ini.max-input-time].
# @run
MAX_INPUT_TIME=60

# Php timeout for serving a single request after which the worker process will
# be killed. This option should be used when the "max_execution_time" ini option
# does not stop script execution for some reason. A value of "0" means "off".
# Available units: s(econds)[default], m(inutes), h(ours), or d(ays).
# @run
REQUEST_TERMINATE_TIMEOUT=300s

# Php Opcache status. See [opcache Php documentation|
# https://www.php.net/manual/en/intro.opcache.php].
# Avalaible values: "0" | "1"
# @run
OPCACHE_ENABLED=1

# Php session cache limiter. See [session-cache-limiter Php documentation|
# https://www.php.net/manual/en/function.session-cache-limiter].
# Avalaible values: "off" | "on"
# @run
SESSION_CACHE_LIMITER=off

# Php logging level. See [error-reporting Php documentation|
# https://www.php.net/manual/en/function.error-reporting.php].
# Available values: "alert" | "error" | "warning" | "notice" | "debug"
# @run
PHP_LOG_LEVEL=warning



# --- MySQL settings ---------------------------------------------------------------------------------------------------

# MySQL root password.
# @build
MYSQL_ROOT_PASSWORD=root

# MySQL server host address.
# @build
SERVER_NAME=phraseanet-docker

# MySQL maximum allowed packet.
# Value applied to "max_allowed_packet" MySQL server setting.
# @run
MYSQL_MAX_ALLOWED_PACKET=16M

# Value applied to "max_connection" MySQL server setting.
# @run
MYSQL_MAX_CONNECTION=100

# Enable the slow query log to see queries with especially long duration.
# Value applied to "slow_query_log" MySQL server setting.
# @run
MYSQL_SLOW_QUERY_LOG=0

# Value applied to "long_query_time" MySQL server setting.
# @run
MYSQL_LONG_QUERY_TIME=10

# Cache only tiny result sets, so we can fit more in the query cache.
# Value applied to "query_cache_limit" MySQL server setting.
# @run
MYSQL_QUERY_CACHE_LIMIT=128k

# Value applied to "query_cache_size" MySQL server setting.
# @run
MYSQL_QUERY_CACHE_SIZE=64M

# Value applied to "key_buffer_size" MySQL server setting.
# @run
MYSQL_KEY_BUFFER_SIZE=128M



# --- Phraseanet general settings --------------------------------------------------------------------------------------

# Variables below are used in the "configuration.yml" file:

# Application title displayed on Phraseanet homepage.
# Available values:
# - "0" : Keep value define configuration.yml
# - "1" : Use PHRASEANET_PROJECT_NAME
#
# @run
ENV_SET_PHRASEANET_PROJET_NAME=1

# Application title displayed on Phraseanet homepage. Depend on
# "ENV_SET_PHRASEANET_PROJET_NAME" variable value.
# @run
PHRASEANET_PROJECT_NAME=Phraseanet

# @run
PHRASEANET_SERVER_NAME=localhost

# Variables below used to define the first user / email couple :

# Phraseanet root account ID. If this variable is filled in,
# "PHRASEANET_ADMIN_ACCOUNT_PASSWORD" variable value will override
# targeted account ID password each time Phraseanet is started.
# @run
PHRASEANET_ADMIN_ACCOUNT_ID=

# @run
PHRASEANET_ADMIN_ACCOUNT_EMAIL=admin@alchemy.fr

# @run
PHRASEANET_ADMIN_ACCOUNT_PASSWORD=iJRqXU0MwbyJewQLBbra6IWHsWly



# --- Phraseanet MySQL settings ----------------------------------------------------------------------------------------

# @install
PHRASEANET_DB_HOST=db

# @install
PHRASEANET_DB_PORT=3306

# @install
PHRASEANET_DB_USER=root

# @install
PHRASEANET_DB_PASSWORD=root



# --- Phraseanet database settings -------------------------------------------------------------------------------------

# @install
INSTALL_DB_TEMPLATE=DublinCore

# @install
INSTALL_APPBOX=ab_master

# @install
INSTALL_DATABOX=db_databox1



# --- Phraseanet languages settings ------------------------------------------------------------------------------------

# Available languages (list of language code separated by comma).
# @run
PHRASEANET_AVAILABLE_LANGUAGE=fr,en,de,du

# Default language code.
# @run
PHRASEANET_DEFAULT_LANGUAGE=en



# --- Phraseanet binaries execution timeouts settings ------------------------------------------------------------------

# @run
PHRASEANET_FFMPEG_TIMEOUT=7200

# @run
PHRASEANET_FFPROBE_TIMEOUT=120

# @run
PHRASEANET_GS_TIMEOUT=120

# @run
PHRASEANET_MP4BOX_TIMEOUT=120

# @run
PHRASEANET_SWFTOOLS_TIMEOUT=120

# @run
PHRASEANET_UNOCON_TIMEOUT=120

# @run
PHRASEANET_EXIFTOOL_TIMEOUT=120


# --- Phraseanet RabbitMQ settings -------------------------------------------------------------------------------------

# @run
PHRASEANET_RABBITMQ_HOST=rabbitmq

# @run
PHRASEANET_RABBITMQ_PORT=5672

# @run
PHRASEANET_RABBITMQ_SSL=false

# @run
PHRASEANET_RABBITMQ_VHOST=/

# @run
PHRASEANET_RABBITMQ_HEARTBEAT=30



# --- Phraseanet network settings --------------------------------------------------------------------------------------

# Enter comma separated list of IP or SUBNETS for variables below:

# @run
PHRASEANET_TRUSTED_PROXIES=

# @run
PHRASEANET_DEBUG_ALLOWED_IP=

# @run
PHRASEANET_SUBNET_IPS=172.32.0.0/16



# --- Phraseanet API settings ------------------------------------------------------------------------------------------

# @run
PHRASEANET_API_ENABLED=true

# @run
PHRASEANET_API_SSL=true

# @run
PHRASEANET_API_AUTH_TOKEN_HEADER_ONLY=false



# --- Phraseanet Mapbox geolocalisation settings -----------------------------------------------------------------------

# @run
PHRASEANET_MAPBOX_ACTIVATE=false

# @run
PHRASEANET_MAPBOX_TOKEN=

# @run
PHRASEANET_MAPBOX_KIND=



# --- Phraseanet mail settings -----------------------------------------------------------------------------------------

# @run
PHRASEANET_EMITTER_EMAIL=phraseanet@example.com

# @run
PHRASEANET_MAIL_OBJECT_PREFIX="phraseanet"

# Phraseanet SMTP settings:

# Available values:
# - "true"  : SMTP parameters are set from .env file.
# - "false" : SMTP parameters should be set in GUI.
#
# @run
PHRASEANET_SMTP_ENABLED=true

# @run
PHRASEANET_SMTP_HOST=mailhog

# @run
PHRASEANET_SMTP_PORT=1025

# @run
PHRASEANET_SMTP_AUTH_ENABLED=false

# @run
PHRASEANET_SMTP_SECURE_MODE=null

# @run
PHRASEANET_SMTP_USER=

# @run
PHRASEANET_SMTP_PASSWORD=



# --- Phraseanet Workers and Scheduler settings ------------------------------------------------------------------------

# Define how many process are launched in the "worker" container:
# - "0" : Only one process is launched inside the container with no specializing,
#         in this case the scaling needs to be made by the orchestation eg K8S.
#         This is the recommended way.
# - "1" : Deploys one phraseanet worker for each kind of job, the parallelime is
#         defined by value of envs started by "PHRASEANET_WORKER_XXX"
#
# Eg: For two subdefinitions builded at the same time, set
#      "PHRASEANET_WORKER_subdefCreation=2"
# @run
PHRASEANET_EXPLODE_WORKER=1

# When PHRASEANET_EXPLODE_WORKER=1, it define the method for launching
# Phraseanet workers process.
# Available values :
# - "supervisor" : Launch it with supervisor.
# - ""           : Launch phraseanet workers with a "bin/console".
#
# Note for old Phraseanet task planner AKA "Phraseanet scheduler": To launch the
# "scheduler" container, add "scheduler" profile to "COMPOSE_PROFILES" env
# var. Launch this container only if you need to use the old Phraseanet tasks.
# @run
PHRASEANET_WORKERS_LAUNCH_METHOD=

# @run
PHRASEANET_WORKER_assetsIngest=1

# @run
PHRASEANET_WORKER_createRecord=2

# @run
PHRASEANET_WORKER_deleteRecord=2

# @run
PHRASEANET_WORKER_editRecord=2

# @run
PHRASEANET_WORKER_exportMail=2

# @run
PHRASEANET_WORKER_exposeUpload=2

# @run
PHRASEANET_WORKER_ftp=1

# @run
PHRASEANET_WORKER_mainQueue=3

# @run
PHRASEANET_WORKER_populateIndex=1

# @run
PHRASEANET_WORKER_pullAssets=1

# @run
PHRASEANET_WORKER_recordsActions=1

# @run
PHRASEANET_WORKER_subdefCreation=1

# @run
PHRASEANET_WORKER_subtitle=1

# @run
PHRASEANET_WORKER_validationReminder=1

# @run
PHRASEANET_WORKER_webhook=1

# @run
PHRASEANET_WORKER_writeMetadatas=1



# --- Phraseanet Locales settings --------------------------------------------------------------------------------------

# @run
LC_MESSAGES=C.UTF-8

# @run
LC_COLLATE=C.UTF-8

# @run
LC_IDENTIFICATION=C.UTF-8

# @run
LANG=C.UTF-8

# @run
LC_MEASUREMENT=C.UTF-8

# @run
LC_CTYPE=C.UTF-8

# @run
LC_TIME=C.UTF-8

# @run
LC_NAME=C.UTF-8



# --- Phraseanet volumes location settings -----------------------------------------------------------------------------

# @run
PHRASEANET_CONFIG_DIR=./config

# @run
PHRASEANET_LOGS_DIR=./logs

# @run
PHRASEANET_DATA_DIR=./datas

# @run
PHRASEANET_DB_DIR=./volumes/db

# @run
PHRASEANET_ELASTICSEARCH_DIR=./volumes/elasticsearch

# @run
PHRASEANET_THUMBNAILS_DIR=./www/thumbnails

# @run
PHRASEANET_CUSTOM_DIR=./www/custom

# @run
PHRASEANET_PLUGINS_DIR=./www/plugins

# @run
PHRASEANET_TMP_DIR=./tmp

# @run
PHRASEANET_CACHE_DIR=./cache

# @run
PHRASEANET_DOWNLOAD_DIR=./datas/download

# @run
PHRASEANET_LAZARET_DIR=./datas/lazaret

# @run
PHRASEANET_CAPTION_DIR=./tmp/caption

# @run
PHRASEANET_WORKER_TMP=./tmp/worker



# --- Phraseanet plugin support settings -------------------------------------------------------------------------------

# @build
PHRASEANET_PLUGINS=
# @build
PHRASEANET_SSH_PRIVATE_KEY=



# --- ImageMagick default policy override setting ----------------------------------------------------------------------

# @run
IMAGEMAGICK_POLICY_VERSION=6

# @run
IMAGEMAGICK_POLICY_WIDTH=16KP

# @run
IMAGEMAGICK_POLICY_HEIGHT=16KP

# @run
IMAGEMAGICK_POLICY_MAP=512MiB

# @run
IMAGEMAGICK_POLICY_MEMORY=256MiB

# @run
IMAGEMAGICK_POLICY_AREA=128MB

# @run
IMAGEMAGICK_POLICY_DISK=1GiB

# @run
IMAGEMAGICK_POLICY_TEMPORARY_PATH=/tmp



# --- New Relic monitoring settings ------------------------------------------------------------------------------------

# Enable (or not) the "New Relic" agent for plateform monitoring.
# @run
NEWRELIC_ENABLED=false

# @run
NEWRELIC_LICENSE_KEY=

# @run
NEWRELIC_APP_NAME=



# --- Blackfire settings -----------------------------------------------------------------------------------------------

# In developpement mode, Enable (or not) the "Blackfire" agent for
# plateform monitoring.
# @run
BLACKFIRE_ENABLED=false

# @run
BLACKFIRE_SERVER_ID=

# @run
BLACKFIRE_SERVER_TOKEN=



# --- Development purpose ----------------------------------------------------------------------------------------------

# See [Phraseanet development-mode documentation|
# https://github.com/alchemy-fr/Phraseanet#development-mode] for more information.

# "PhpMyAdmin" http port mapping.
# @run
PHRASEANET_PHPMYADMIN_PORT=8089

# "Mailhog" http port mapping.
# @run
MAILHOG_GUI_PORT=8025

# "Xdebug" settings:

# @run
XDEBUG_ENABLED=0

# @run
XDEBUG_PROFILER_ENABLED=0

# @run
IDE_KEY=PHPSTORM

# @run
XDEBUG_REMOTE_HOST=172.32.0.1

# @run
PHP_IDE_CONFIG=serverName=docker-server-phraseanet

# For dev or testing export ftp-server
# @run
PHRASEANET_FTP_DIR=./datas/ftp

# For dev proxy squid WIP:
# - PHRASEANET_SQUID_DIR=./volumes/squid
# - PHRASEANET_SQUID_CONF= ./docker/squid/squid.conf
# - PHRASEANET_SQUID_PORT=3128
#

# For dev who don't have SSH_AUTH_SOCK (avoid an empty volume name)
SSH_AUTH_SOCK=/dev/null
