From f91926c730a561feeb1a97a862e61adfac87e787 Mon Sep 17 00:00:00 2001
From: gjacobjn <52928254+gjacobjn@users.noreply.github.com>
Date: Wed, 13 May 2020 18:00:23 +0200
Subject: [PATCH 1/9] Add GS1 database model
Add GS1 database model
---
lib/conf.d/data_templates/gs1.xml | 235 ++++++++++++++++++++++++++++++
1 file changed, 235 insertions(+)
create mode 100644 lib/conf.d/data_templates/gs1.xml
diff --git a/lib/conf.d/data_templates/gs1.xml b/lib/conf.d/data_templates/gs1.xml
new file mode 100644
index 0000000000..a4ff9a6612
--- /dev/null
+++ b/lib/conf.d/data_templates/gs1.xml
@@ -0,0 +1,235 @@
+
+
+ {{datapathnoweb}}{{basename}}/documents
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 1024
+ resample
+ 72
+ no
+ 75
+ yes
+ screen
+ image
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 240
+ resample
+ 72
+ yes
+ 75
+ no
+ screen
+ image
+
+
+
+
+ 480
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 240
+ screen
+ image
+ no
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 240
+ gif
+ 150
+ screen
+ no
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 748
+ video
+ yes
+ libfaac
+ libx264
+ screen
+ 1000
+ 128
+ 48000
+ 25
+ 25
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 748
+ video
+ screen
+ 1000
+ 128
+ 48000
+ libvorbis
+ 25
+ 25
+ libvpx
+
+
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 240
+ screen
+ no
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ audio
+ yes
+ 128
+ 48000
+ screen
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ audio
+ handheld
+
+
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ resample
+ 72
+ 240
+ no
+ screen
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ flexpaper
+ no
+ screen
+
+
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 240
+ no
+ resample
+ 72
+ screen
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 800
+ no
+ resample
+ 72
+ screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 19d0d1901bfad66567e249989072ca096dfcacd2 Mon Sep 17 00:00:00 2001
From: Nicolas Maillat
Date: Wed, 3 Jun 2020 01:49:46 +0200
Subject: [PATCH 2/9] PHRAS-3120 fix storage file path for subview
fix for audiovideowav and audiovideomp3
---
lib/conf.d/data_templates/DublinCore.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml
index ffd40733f8..83e7e139fc 100644
--- a/lib/conf.d/data_templates/DublinCore.xml
+++ b/lib/conf.d/data_templates/DublinCore.xml
@@ -119,7 +119,7 @@
libvpx
- {{datapathnoweb}}{{basename}}/subview
+ {{datapathnoweb}}{{basename}}/subdefs
no
audio
128
@@ -131,7 +131,7 @@
- {{datapathnoweb}}{{basename}}/subview
+ {{datapathnoweb}}{{basename}}/subdefs
no
audio
180
From a007b8dbb32e79f21771cd21997af272112a74de Mon Sep 17 00:00:00 2001
From: aynsix
Date: Wed, 3 Jun 2020 10:33:22 +0300
Subject: [PATCH 3/9] fix xml content
---
lib/conf.d/data_templates/gs1.xml | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/conf.d/data_templates/gs1.xml b/lib/conf.d/data_templates/gs1.xml
index a4ff9a6612..8c823a8906 100644
--- a/lib/conf.d/data_templates/gs1.xml
+++ b/lib/conf.d/data_templates/gs1.xml
@@ -198,8 +198,7 @@
-
-
+
@@ -225,11 +224,11 @@
-
+
-
\ No newline at end of file
+
From 627bf104a90461fc525554846df1ac6a59698ae3 Mon Sep 17 00:00:00 2001
From: nmaillat
Date: Wed, 3 Jun 2020 00:22:13 +0200
Subject: [PATCH 4/9] change volumes path in docker-compose and in override
---
docker-compose.override.yml | 19 +------------------
docker-compose.yml | 29 +++++++++++++++--------------
2 files changed, 16 insertions(+), 32 deletions(-)
diff --git a/docker-compose.override.yml b/docker-compose.override.yml
index 838e32e64c..1471f077d1 100644
--- a/docker-compose.override.yml
+++ b/docker-compose.override.yml
@@ -13,10 +13,6 @@ services:
- ../:/var/alchemy
- .:/var/alchemy/Phraseanet
- ./docker/nginx/root/entrypoint.sh:/entrypoint.sh
- - ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- - ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- - ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
- - ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
builder:
build:
@@ -50,25 +46,12 @@ services:
volumes:
- ../:/var/alchemy
- .:/var/alchemy/Phraseanet
- - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw
- - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw
- - ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- - ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- - ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
- - ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
- - ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
worker:
volumes:
- ../:/var/alchemy
- .:/var/alchemy/Phraseanet
- - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw
- - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw
- - ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- - ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- - ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
- - ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
- - ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
+
rabbitmq:
ports:
diff --git a/docker-compose.yml b/docker-compose.yml
index d8d716cb4e..699f159482 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -13,6 +13,7 @@ services:
volumes:
- ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
+ - ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
depends_on:
- phraseanet
@@ -64,13 +65,13 @@ services:
- PHRASEANET_SMTP_USER
- PHRASEANET_SMTP_PASSWORD
volumes:
- - config_vol:/var/alchemy/Phraseanet/config:rw
- - data_vol:/var/alchemy/Phraseanet/datas:rw
- - tmp_vol:/var/alchemy/Phraseanet/tmp:rw
- - logs_vol:/var/alchemy/Phraseanet/logs:rw
- - thumbnails_vol:/var/alchemy/Phraseanet/www/thumbnails:rw
- - custom_vol:/var/alchemy/Phraseanet/www/custom:rw
- - cache_vol:/var/alchemy/Phraseanet/cache:rw
+ - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw
+ - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw
+ - ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
+ - ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
+ - ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
+ - ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
+ - ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
worker:
build:
@@ -94,13 +95,13 @@ services:
- SESSION_CACHE_LIMITER
- PHP_LOG_LEVEL
volumes:
- - config_vol:/var/alchemy/Phraseanet/config:rw
- - data_vol:/var/alchemy/Phraseanet/datas:rw
- - tmp_vol:/var/alchemy/Phraseanet/tmp:rw
- - logs_vol:/var/alchemy/Phraseanet/logs:rw
- - thumbnails_vol:/var/alchemy/Phraseanet/www/thumbnails:rw
- - custom_vol:/var/alchemy/Phraseanet/www/custom:rw
- - cache_vol:/var/alchemy/Phraseanet/cache:rw
+ - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw
+ - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw
+ - ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
+ - ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
+ - ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
+ - ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
+ - ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
db:
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-db:$PHRASEANET_DOCKER_TAG
From c1448f7bb2781211f8d3280cc2c028eb74dd1387 Mon Sep 17 00:00:00 2001
From: nmaillat
Date: Wed, 3 Jun 2020 13:56:10 +0200
Subject: [PATCH 5/9] fix email setting in conf,remove tmp volume form gateway
---
docker-compose.yml | 1 -
docker/phraseanet/entrypoint.sh | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/docker-compose.yml b/docker-compose.yml
index 699f159482..6a16aa136a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -13,7 +13,6 @@ services:
volumes:
- ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- - ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
depends_on:
- phraseanet
diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh
index 9d22cef4ff..e4b4451062 100755
--- a/docker/phraseanet/entrypoint.sh
+++ b/docker/phraseanet/entrypoint.sh
@@ -24,8 +24,8 @@ if [ -f "$FILE" ]; 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-host $PHRASEANET_SMTP_HOST
+ bin/setup system:config set registry.email.smtp-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
From da2ce2471a1e3f5a1e3dca257357fbba1e26f734 Mon Sep 17 00:00:00 2001
From: aynsix
Date: Thu, 4 Jun 2020 10:50:26 +0300
Subject: [PATCH 6/9] webhook privacy
---
.../Event/Subscriber/WebhookSubdefEventSubscriber.php | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php
index ca5d88b2ab..04af58cf3c 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php
@@ -30,7 +30,8 @@ class WebhookSubdefEventSubscriber implements EventSubscriberInterface
$this->app['manipulator.webhook-event']->create(
WebhookEvent::RECORD_SUBDEF_CREATED,
WebhookEvent::RECORD_SUBDEF_TYPE,
- $eventData
+ $eventData,
+ [$event->getRecord()->getBaseId()]
);
}
@@ -45,7 +46,8 @@ class WebhookSubdefEventSubscriber implements EventSubscriberInterface
$this->app['manipulator.webhook-event']->create(
WebhookEvent::RECORD_SUBDEF_FAILED,
WebhookEvent::RECORD_SUBDEF_TYPE,
- $eventData
+ $eventData,
+ [$event->getRecord()->getBaseId()]
);
}
@@ -60,7 +62,8 @@ class WebhookSubdefEventSubscriber implements EventSubscriberInterface
$this->app['manipulator.webhook-event']->create(
WebhookEvent::RECORD_SUBDEFS_CREATED,
WebhookEvent::RECORD_SUBDEF_TYPE,
- $eventData
+ $eventData,
+ [$event->getRecord()->getBaseId()]
);
}
From 7ea8e95549f448367fbaf7176104a7bdcfef08b9 Mon Sep 17 00:00:00 2001
From: aynsix
Date: Thu, 4 Jun 2020 12:02:52 +0300
Subject: [PATCH 7/9] remove unused webhook subdef_count
---
.../WebhookSubdefEventSubscriber.php | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php
index 04af58cf3c..dd676f92f3 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookSubdefEventSubscriber.php
@@ -5,7 +5,6 @@ namespace Alchemy\Phrasea\Core\Event\Subscriber;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\SubDefinitionCreatedEvent;
use Alchemy\Phrasea\Core\Event\Record\SubDefinitionCreationFailedEvent;
-use Alchemy\Phrasea\Core\Event\Record\SubDefinitionsCreatedEvent;
use Alchemy\Phrasea\Model\Entities\WebhookEvent;
use Silex\Application;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -51,27 +50,10 @@ class WebhookSubdefEventSubscriber implements EventSubscriberInterface
);
}
- public function onSubdefsCreated(SubDefinitionsCreatedEvent $event)
- {
- $eventData = [
- 'databox_id' => $event->getRecord()->getDataboxId(),
- 'record_id' => $event->getRecord()->getRecordId(),
- 'subdef_count' => count($event->getMedia())
- ];
-
- $this->app['manipulator.webhook-event']->create(
- WebhookEvent::RECORD_SUBDEFS_CREATED,
- WebhookEvent::RECORD_SUBDEF_TYPE,
- $eventData,
- [$event->getRecord()->getBaseId()]
- );
- }
-
public static function getSubscribedEvents()
{
return [
RecordEvents::SUB_DEFINITION_CREATED => 'onSubdefCreated',
- RecordEvents::SUB_DEFINITIONS_CREATED => 'onSubdefsCreated',
RecordEvents::SUB_DEFINITION_CREATION_FAILED => 'onSubdefCreationFailed'
];
}
From 944f78fbf60e7ac7064264d20d096d92247181ea Mon Sep 17 00:00:00 2001
From: nmaillat
Date: Thu, 4 Jun 2020 12:39:19 +0200
Subject: [PATCH 8/9] phraseanet entrypoint move chown
---
docker/phraseanet/entrypoint.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docker/phraseanet/entrypoint.sh b/docker/phraseanet/entrypoint.sh
index e4b4451062..a0dabfc5fc 100755
--- a/docker/phraseanet/entrypoint.sh
+++ b/docker/phraseanet/entrypoint.sh
@@ -44,4 +44,13 @@ fi
./docker/phraseanet/plugins/console init
+chown -R app:app \
+ cache \
+ config \
+ datas \
+ tmp \
+ logs \
+ www/thumbnails \
+ www/custom
+
bash -e docker-php-entrypoint $@
From 733d97b5d57d385e285e6756b769f8b88aefccf9 Mon Sep 17 00:00:00 2001
From: aynsix
Date: Thu, 4 Jun 2020 14:13:11 +0300
Subject: [PATCH 9/9] fix test
---
.../Phrasea/Model/Repositories/WebhookEventRepositoryTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Alchemy/Tests/Phrasea/Model/Repositories/WebhookEventRepositoryTest.php b/tests/Alchemy/Tests/Phrasea/Model/Repositories/WebhookEventRepositoryTest.php
index d27c00738e..b1f25ba585 100644
--- a/tests/Alchemy/Tests/Phrasea/Model/Repositories/WebhookEventRepositoryTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Model/Repositories/WebhookEventRepositoryTest.php
@@ -12,6 +12,6 @@ class WebhookEventRepositoryTest extends \PhraseanetTestCase
{
$events = self::$DI['app']['orm.em']->getRepository('Phraseanet:WebhookEvent')->findUnprocessedEvents();
// I have no clue as to why this magic number is here, probably best to discard test
- $this->assertCount(41, $events);
+ $this->assertCount(34, $events);
}
}