From 65aa5a3aaaebcbec19e030b213edad936d5b5b21 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Thu, 30 Apr 2020 22:54:43 +0200 Subject: [PATCH] PHRAS-3049 #comment auto-install reorganisation, more environement variable for mail configuration and http api setting --- .env | 19 +++++++++++++++++- docker/phraseanet/auto-install.sh | 33 +++++++++++++++++++------------ 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/.env b/.env index 1f3824846a..5996e11791 100644 --- a/.env +++ b/.env @@ -14,7 +14,7 @@ MYSQL_ROOT_PASSWORD=root SERVER_NAME=phraseanet-docker -# --------------- APPLICATION CONFIGURATION -------------------- +# --------------- PHP CONFIGURATION -------------------- # Max upload size MAX_BODY_SIZE=2G @@ -49,6 +49,23 @@ INSTALL_SERVER_NAME=localhost # Mysql max allowed packet MYSQL_MAX_ALLOWED_PACKET=16M +# --------------- APPLICATION CONFIGURATION -------------------- + +# api +PHRASEANET_API_ENABLED=true +PHRASEANET_API_SSL=true + +# Phraseanet mail configuration +PHRASEANET_EMITTER_EMAIL=phraseanet@example.com +PHRASEANET_MAIL_OBJECT_PREFIX= +PHRASEANET_SMTP_ENABLED=false +PHRASEANET_SMTP_HOST= +PHRASEANET_SMTP_PORT= +PHRASEANET_SMTP_AUTH_ENABLED=false +PHRASEANET_SMTP_SECURE_MODE=tls +PHRASEANET_SMTP_USER= +PHRASEANET_SMTP_PASSWORD= + # --- DEV purpose --- diff --git a/docker/phraseanet/auto-install.sh b/docker/phraseanet/auto-install.sh index c408f4aafa..c68c080036 100755 --- a/docker/phraseanet/auto-install.sh +++ b/docker/phraseanet/auto-install.sh @@ -25,6 +25,17 @@ fi --server-name=$INSTALL_SERVER_NAME \ --data-path=/var/alchemy/Phraseanet/datas -y + # Bus configuration for scheduler & worker +bin/setup system:config set workers.queue.worker-queue.registry alchemy_worker.queue_registry +bin/setup system:config set workers.queue.worker-queue.host rabbitmq +bin/setup system:config set workers.queue.worker-queue.port 5672 +bin/setup system:config set workers.queue.worker-queue.user $INSTALL_RABBITMQ_USER +bin/setup system:config set workers.queue.worker-queue.password $INSTALL_RABBITMQ_PASSWORD +bin/setup system:config set workers.queue.worker-queue.vhost / + +/var/alchemy/Phraseanet/bin/console compile:configuration + + /var/alchemy/Phraseanet/bin/setup system:config set main.search-engine.options.host elasticsearch /var/alchemy/Phraseanet/bin/setup system:config set main.search-engine.options.minScore 2 /var/alchemy/Phraseanet/bin/setup system:config set main.search-engine.options.minScore 2 @@ -38,22 +49,18 @@ fi /var/alchemy/Phraseanet/bin/setup system:config set main.cache.options.namespace $INSTALL_SERVER_NAME /var/alchemy/Phraseanet/bin/setup system:config set main.cache.type redis -# Bus configuration for scheduler & worker -bin/setup system:config set workers.queue.worker-queue.registry alchemy_worker.queue_registry -bin/setup system:config set workers.queue.worker-queue.host rabbitmq -bin/setup system:config set workers.queue.worker-queue.port 5672 -bin/setup system:config set workers.queue.worker-queue.user $INSTALL_RABBITMQ_USER -bin/setup system:config set workers.queue.worker-queue.password $INSTALL_RABBITMQ_PASSWORD -bin/setup system:config set workers.queue.worker-queue.vhost / - -# Create elasticsearch index -/var/alchemy/Phraseanet/bin/console searchengine:index -c - ## enable API and disable ssl on it -/var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api-enabled true -/var/alchemy/Phraseanet/bin/setup system:config set main.api_require_ssl false +/var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api-enabled $PHRASEANET_API_ENABLED +/var/alchemy/Phraseanet/bin/setup system:config set main.api_require_ssl $PHRASEANET_API_SSL # set instance title bin/setup system:config set registry.general.title $PHRASEANET_PROJECT_NAME /var/alchemy/Phraseanet/bin/console compile:configuration + +# Create elasticsearch index +/var/alchemy/Phraseanet/bin/console searchengine:index -c + +# Create _TRASH_ collection on first databox +/var/alchemy/Phraseanet/bin/console collection:create 1 _TRASH_ -d 1 +