From e109d3c365b1583407d9cd1ed9fcc2bd31b8b994 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Thu, 30 Apr 2020 22:54:43 +0200 Subject: [PATCH 1/7] 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 + From 8619d7d88b161ff7ca7c5425a7307426d99b262e Mon Sep 17 00:00:00 2001 From: nmaillat Date: Fri, 1 May 2020 00:17:49 +0200 Subject: [PATCH 2/7] install change db template to DublinCore model, edit DublinCore databox template --- .env | 2 +- lib/conf.d/data_templates/DublinCore.xml | 45 ++++++++++-------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.env b/.env index 5996e11791..f5d7403856 100644 --- a/.env +++ b/.env @@ -41,7 +41,7 @@ INSTALL_DB_HOST=db INSTALL_DB_PORT=3306 INSTALL_DB_USER=root INSTALL_DB_PASSWORD=root -INSTALL_DB_TEMPLATE=en-simple +INSTALL_DB_TEMPLATE=DublinCore INSTALL_APPBOX=ab_master INSTALL_DATABOX=db_databox1 INSTALL_SERVER_NAME=localhost diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml index db3039df7f..e12b12f480 100644 --- a/lib/conf.d/data_templates/DublinCore.xml +++ b/lib/conf.d/data_templates/DublinCore.xml @@ -90,6 +90,21 @@ + + {{datapathnoweb}}{{basename}}/subdefs + 1 + 1280 + image + yes + screen + 72 + yes + yes + 75 + jpeg + + + {{datapathnoweb}}{{basename}}/subdefs 748 @@ -155,30 +170,6 @@ - - - {{datapathnoweb}}{{basename}}/subdefs - image - 240 - no - resample - 72 - screen - - - - - {{datapathnoweb}}{{basename}}/subdefs - image - 800 - no - resample - 72 - screen - - - - @@ -199,9 +190,9 @@ - - - + + + From 5c67882bdbdab32226a9a318393d743417221c00 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Fri, 1 May 2020 01:17:17 +0200 Subject: [PATCH 3/7] PHRAS-3049 # comment define video poster in embed-bundle conf, add more field in DublinCore template --- lib/conf.d/configuration.yml | 4 ++-- lib/conf.d/data_templates/DublinCore.xml | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/conf.d/configuration.yml b/lib/conf.d/configuration.yml index 8a7a62052d..b6fbb1e6a7 100644 --- a/lib/conf.d/configuration.yml +++ b/lib/conf.d/configuration.yml @@ -47,7 +47,7 @@ main: _doctype: limit: 10 _camera_model: - limit: 0 + limit: 10 _iso: limit: 0 _aperture: @@ -243,7 +243,7 @@ embed_bundle: video: player: videojs autoplay: false - cover_subdef: thumbnail + cover_subdef: videoposter message_start: StartOfMessage available_speeds: - 1 diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml index e12b12f480..0802d67af9 100644 --- a/lib/conf.d/data_templates/DublinCore.xml +++ b/lib/conf.d/data_templates/DublinCore.xml @@ -8,7 +8,7 @@ 1024 resample 72 - no + yes 75 yes screen @@ -90,7 +90,7 @@ - + {{datapathnoweb}}{{basename}}/subdefs 1 1280 @@ -193,6 +193,10 @@ + + + + From d24f3766525d4530edf8d587ac2802b6abc2b1bb Mon Sep 17 00:00:00 2001 From: nmaillat Date: Fri, 1 May 2020 01:56:14 +0200 Subject: [PATCH 4/7] PHRAS-3049 #comment define volume during install #time 3h --- docker/phraseanet/auto-install.sh | 2 ++ lib/conf.d/configuration.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/phraseanet/auto-install.sh b/docker/phraseanet/auto-install.sh index c68c080036..f0e0f6135f 100755 --- a/docker/phraseanet/auto-install.sh +++ b/docker/phraseanet/auto-install.sh @@ -23,6 +23,8 @@ fi --appbox=$INSTALL_APPBOX \ --databox=$INSTALL_DATABOX \ --server-name=$INSTALL_SERVER_NAME \ + --download-path=/var/alchemy/Phraseanet/datas/download \ + --lazaret-path=/var/alchemy/Phraseanet/datas/lazaret \ --data-path=/var/alchemy/Phraseanet/datas -y # Bus configuration for scheduler & worker diff --git a/lib/conf.d/configuration.yml b/lib/conf.d/configuration.yml index b6fbb1e6a7..93faaefdd8 100644 --- a/lib/conf.d/configuration.yml +++ b/lib/conf.d/configuration.yml @@ -243,7 +243,7 @@ embed_bundle: video: player: videojs autoplay: false - cover_subdef: videoposter + cover_subdef: poster message_start: StartOfMessage available_speeds: - 1 From 35cfd07f18424bc86e9bc85d4ff6e9b939995175 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Fri, 1 May 2020 02:27:09 +0200 Subject: [PATCH 5/7] PHRAS-3049 #comment more volumes in auto-install --- docker/phraseanet/auto-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/phraseanet/auto-install.sh b/docker/phraseanet/auto-install.sh index f0e0f6135f..3ef97d520f 100755 --- a/docker/phraseanet/auto-install.sh +++ b/docker/phraseanet/auto-install.sh @@ -25,6 +25,9 @@ fi --server-name=$INSTALL_SERVER_NAME \ --download-path=/var/alchemy/Phraseanet/datas/download \ --lazaret-path=/var/alchemy/Phraseanet/datas/lazaret \ + --caption-path=/var/alchemy/Phraseanet/tmp/caption + --scheduler-locks-path=/var/alchemy/Phraseanet/tmp/locks + --worker-tmp-files=/var/alchemy/Phraseanet/tmp/ --data-path=/var/alchemy/Phraseanet/datas -y # Bus configuration for scheduler & worker From 870d81eaf69dcd694d9ce03c3c008f0fb1e72b78 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Fri, 1 May 2020 02:43:48 +0200 Subject: [PATCH 6/7] PHRAS-3049 #comment roolback on --scheduler-locks-path --- docker/phraseanet/auto-install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/phraseanet/auto-install.sh b/docker/phraseanet/auto-install.sh index 3ef97d520f..ec02d3e697 100755 --- a/docker/phraseanet/auto-install.sh +++ b/docker/phraseanet/auto-install.sh @@ -25,9 +25,8 @@ fi --server-name=$INSTALL_SERVER_NAME \ --download-path=/var/alchemy/Phraseanet/datas/download \ --lazaret-path=/var/alchemy/Phraseanet/datas/lazaret \ - --caption-path=/var/alchemy/Phraseanet/tmp/caption - --scheduler-locks-path=/var/alchemy/Phraseanet/tmp/locks - --worker-tmp-files=/var/alchemy/Phraseanet/tmp/ + --caption-path=/var/alchemy/Phraseanet/tmp/caption \ + --worker-tmp-files=/var/alchemy/Phraseanet/tmp \ --data-path=/var/alchemy/Phraseanet/datas -y # Bus configuration for scheduler & worker From 9bbc36f6229a47ad522a0a057c8265cef7fb54e5 Mon Sep 17 00:00:00 2001 From: nmaillat Date: Wed, 6 May 2020 00:58:25 +0200 Subject: [PATCH 7/7] Email config in entrypoint --- docker-compose.yml | 9 +++++++++ docker/phraseanet/entrypoint.sh | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3eee64c36a..74490e9d35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,6 +54,15 @@ services: - INSTALL_SERVER_NAME - INSTALL_RABBITMQ_USER=$RABBITMQ_DEFAULT_USER - INSTALL_RABBITMQ_PASSWORD=$RABBITMQ_DEFAULT_PASS + - PHRASEANET_EMITTER_EMAIL + - PHRASEANET_MAIL_OBJECT_PREFIX + - PHRASEANET_SMTP_ENABLED + - PHRASEANET_SMTP_HOST + - PHRASEANET_SMTP_PORT + - PHRASEANET_SMTP_AUTH_ENABLED + - PHRASEANET_SMTP_SECURE_MODE + - PHRASEANET_SMTP_USER + - PHRASEANET_SMTP_PASSWORD volumes: - config_vol:/var/alchemy/Phraseanet/config:rw - data_vol:/var/alchemy/Phraseanet/datas:rw diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh index 621d8c2e5f..f98d0f9d24 100755 --- a/docker/phraseanet/entrypoint.sh +++ b/docker/phraseanet/entrypoint.sh @@ -18,8 +18,19 @@ chown -R app:app \ FILE=config/configuration.yml if [ -f "$FILE" ]; then - bin/setup system:config set registry.general.title $PHRASEANET_PROJECT_NAME echo "$FILE exists, skip setup." + bin/setup system:config set registry.general.title $PHRASEANET_PROJECT_NAME + if [[ $PHRASEANET_SMTP_ENABLED=true ]]; then + bin/setup system:config set registry.email.smtp-enabled $PHRASEANET_SMTP_ENABLED + bin/setup system:config set registry.email.smtp-auth-enabled $PHRASEANET_SMTP_AUTH_ENABLED + bin/setup system:config set registry.email.smtp-auth-secure-mode $PHRASEANET_SMTP_SECURE_MODE + bin/setup system:config set registry.email.smtp-auth-host $PHRASEANET_SMTP_HOST + bin/setup system:config set registry.email.smtp-auth-port $PHRASEANET_SMTP_PORT + bin/setup system:config set registry.email.smtp-user $PHRASEANET_SMTP_USER + bin/setup system:config set registry.email.smtp-password $PHRASEANET_SMTP_PASSWORD + bin/setup system:config set registry.email.emitter-email $PHRASEANET_EMITTER_EMAIL + bin/setup system:config set registry.email.prefix $PHRASEANET_MAIL_OBJECT_PREFIX + fi else echo "$FILE doesn't exist, entering setup..." runuser app -c docker/phraseanet/auto-install.sh