Skip to content

Commit

Permalink
Merge branch 'master' into PHRAS-4084-workers-cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
jygaulier authored Aug 27, 2024
2 parents 6bc93e9 + 32833ac commit 527d88e
Show file tree
Hide file tree
Showing 25 changed files with 1,815 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ PHRASEANET_DOCKER_REGISTRY=local

# Docker images tag.
# @run
PHRASEANET_DOCKER_TAG=4.1.8
PHRASEANET_DOCKER_TAG=4.1.9

# Stack Name
# An optionnal Name for the stack
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# CHANGELOG

## 4.1.9

### Update instructions

- Migration patch:
- Migration script for configuration file

`bin/setup system:upgrade`, ran by setup container with Docker if env `PHRASEANET_UPGRADE=1 `

### Version summary
- Fix for Verisign PDF
- Expiring right to core
- New Api endpoint admin

### Stack (docker compose and helm)

- No change

## What's Changed
* PHRAS-4083_searchraw-limit-offset-to-result by @jygaulier in https://github.com/alchemy-fr/Phraseanet/pull/4528
* PHRAS-4082: Github action - Check the push image method by @aynsix in https://github.com/alchemy-fr/Phraseanet/pull/4530
* PHRAS-4086_pdftotext-exception by @jygaulier in https://github.com/alchemy-fr/Phraseanet/pull/4532
* PHRAS-4078_ExpiringRight-to-core by @jygaulier in https://github.com/alchemy-fr/Phraseanet/pull/4526
* PHRAS-4085_data-volumes-api by @jygaulier in https://github.com/alchemy-fr/Phraseanet/pull/4529


**Full Changelog**: https://github.com/alchemy-fr/Phraseanet/compare/4.1.8...4.1.9

___
## 4.1.8

### Update instructions
Expand Down
3 changes: 3 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace KonsoleKommander;
use Alchemy\Phrasea\CLI;
use Alchemy\Phrasea\Command\ApplyRightsCommand;
use Alchemy\Phrasea\Command\BuildMissingSubdefs;
use Alchemy\Phrasea\Command\ExpiringRights\AlertExpiringRightsCommand;
use Alchemy\Phrasea\Command\Record\BuildPermalinks;
use Alchemy\Phrasea\Command\Record\BuildSubdefs;
use Alchemy\Phrasea\Command\CheckConfig;
Expand Down Expand Up @@ -194,6 +195,8 @@ $cli->command(new SendValidationRemindersCommand());

$cli->command(new NetworkProxiesTestCommand('network-proxies:test'));

$cli->command(new AlertExpiringRightsCommand());

$cli->loadPlugins();

$cli->run();
3 changes: 3 additions & 0 deletions bin/maintenance
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use Alchemy\Phrasea\Command\Maintenance\CleanRightsCommand;
use Alchemy\Phrasea\Command\Maintenance\CleanWebhookLogsCommand;
use Alchemy\Phrasea\Command\Maintenance\CleanWorkerRunningJobCommand;
use Alchemy\Phrasea\Command\Maintenance\SessionsCommand;
use Alchemy\Phrasea\Command\Maintenance\LazaretFilesSetSizeCommand;

require_once __DIR__ . '/../lib/autoload.php';

Expand Down Expand Up @@ -59,4 +60,6 @@ $cli->command(new CleanLogViewCommand());

$cli->command(new CleanWebhookLogsCommand());

$cli->command(new LazaretFilesSetSizeCommand());

$cli->run();
39 changes: 39 additions & 0 deletions config/configuration.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -489,3 +489,42 @@ translator:
# end of job : change coll status
set_status: 10xxxx
set_collection: online
expiring-rights:
version: 3
jobs:
# "I want to alert owners that records have expired"
- rights-expired-owners:
active: false
target: "owners"
databox: "db_with_rights"
collection: [ "Promo", "Selections" ]
expire_field: ExpireDate
prior_notice: -60
set_status: 01xxxx
alerts:
- method: webhook
recipient: ["bob@a.fr", "joe@b.com"]

# "I want to alert users who have downloaded that a document rights will expire in 60 days"
- rights-60-downloaders:
active: false
target: "downloaders"
databox: "db_with_rights"
collection: [ "Promo", "Selections" ]
downloaded: [ "document", "preview" ]
expire_field: "ExpirationDate"
prior_notice: -60
alerts:
- method: "webhook"

# "I want to alert users who have downloaded that a document rights has expired"
- rights-expired-dowloaders:
active: false
target: "downloaders"
databox: "db_with_rights"
collection: [ "Promo", "Selections" ]
downloaded: [ "document", "preview" ]
expire_field: "ExpirationDate"
prior_notice: 0
alerts:
- method: "webhook"
4 changes: 4 additions & 0 deletions lib/Alchemy/Phrasea/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
use Alchemy\Phrasea\Authorization\AuthorizationServiceProvider;
use Alchemy\Phrasea\Core\Event\Subscriber\BasketSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\BridgeSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\ExpiringRightsSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\ExportSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\FeedEntrySubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\LazaretSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\PhraseaInstallSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\RegistrationSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\ValidationSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\WebhookUserEventSubscriber;
use Alchemy\Phrasea\Core\LazyLocator;
use Alchemy\Phrasea\Core\MetaProvider\DatabaseMetaProvider;
use Alchemy\Phrasea\Core\MetaProvider\HttpStackMetaProvider;
use Alchemy\Phrasea\Core\MetaProvider\MediaUtilitiesMetaServiceProvider;
Expand Down Expand Up @@ -767,6 +769,8 @@ private function setupEventDispatcher()
$dispatcher->addSubscriber(new WebhookUserEventSubscriber($app));
}

$dispatcher->addSubscriber(new ExpiringRightsSubscriber($app, new LazyLocator($app, 'phraseanet.appbox')));

return $dispatcher;
})
);
Expand Down
16 changes: 12 additions & 4 deletions lib/Alchemy/Phrasea/Border/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use Alchemy\Phrasea\Model\Entities\LazaretCheck;
use Alchemy\Phrasea\Model\Entities\LazaretFile;
use Alchemy\Phrasea\Model\Entities\LazaretSession;
use Exception;
use PHPExiftool\Driver\Metadata\Metadata;
use PHPExiftool\Driver\Value\Mono as MonoValue;
use PHPExiftool\Driver\Value\Multi;
Expand Down Expand Up @@ -405,6 +406,8 @@ protected function createLazaret(File $file, Visa $visa, LazaretSession $session

$lazaretFile->setSession($session);

$lazaretFile->setSize($file->getFile()->getSize());

$this->app['orm.em']->persist($lazaretFile);

foreach ($file->getAttributes() as $fileAttribute) {
Expand Down Expand Up @@ -445,11 +448,16 @@ protected function createLazaret(File $file, Visa $visa, LazaretSession $session
*/
protected function addMediaAttributes(File $file)
{
$metadataCollection = $this->app['phraseanet.metadata-reader']->read($file->getMedia());
try {
$metadataCollection = $this->app['phraseanet.metadata-reader']->read($file->getMedia());

array_walk($metadataCollection, function (Metadata $metadata) use ($file) {
$file->addAttribute(new MetadataAttr($metadata));
});
array_walk($metadataCollection, function (Metadata $metadata) use ($file) {
$file->addAttribute(new MetadataAttr($metadata));
});
}
catch (Exception $e) {
// ingore
}

return $this;
}
Expand Down
Loading

0 comments on commit 527d88e

Please sign in to comment.