Skip to content

Commit

Permalink
clean some config (#4429)
Browse files Browse the repository at this point in the history
PHRAS-3668 : happyscribe setup in configuration.yml
  • Loading branch information
aynsix authored Dec 1, 2023
1 parent 69f3b30 commit 945be4c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
11 changes: 7 additions & 4 deletions config/configuration.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,7 @@ registration-fields:
required: true
download_async:
enabled: true
pusher:
auth_key: 'pusher-auth_key'
secret: 'pusher-secret'
app_id: 'pusher-app_id'

xsendfile:
enabled: false
type: nginx
Expand Down Expand Up @@ -395,6 +392,12 @@ externalservice:
auth_key: 'pusher-auth_key'
secret: 'pusher-secret'
app_id: 'pusher-app_id'
happyscribe:
token: token
organization_id: 123456
transcript_format: vtt
subdef_source: preview


user_account:
deleting_policies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function process(array $payload)
$happyscribeTranscriptFormat = $this->conf->get(['externalservice', 'happyscribe', 'transcript_format'], 'vtt');

if (!$organizationId || !$this->happyscribeToken ) {
$this->logger->error("External service Ginga not set correctly in configuration.yml");
$this->logger->error("External service happyscribe not set correctly in configuration.yml");

return 0;
}
Expand Down
30 changes: 30 additions & 0 deletions lib/classes/patch/418RC8PHRAS3777.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,36 @@ private function patch_appbox(base $appbox, Application $app)
$conf->remove(['main', 'bridge']);
}

// remove old pusher configuration
// copy it under externalservice
if ($conf->has(['pusher'])) {
$p = $conf->get(['pusher']);
$conf->set(['externalservice', 'pusher'], $p);

$conf->remove(['pusher']);
}

// if no pusher configuration
if (!$conf->has(['externalservice', 'pusher'])) {
$pusher = [
'auth_key' => 'pusher-auth_key',
'secret' => 'pusher-secret',
'app_id' => 'pusher-app_id'
];
$conf->set(['externalservice', 'pusher'], $pusher);
}

// if no happyscribe configuration
if (!$conf->has(['externalservice', 'happyscribe'])) {
$h = [
'token' => 'token',
'organization_id' => '123456',
'transcript_format' => 'vtt',
'subdef_source' => 'preview'
];
$conf->set(['externalservice', 'happyscribe'], $h);
}

// remove cooliris
if ($conf->has(['crossdomain', 'allow-access-from'])) {
$tValues = $conf->get(['crossdomain', 'allow-access-from']);
Expand Down
5 changes: 5 additions & 0 deletions lib/conf.d/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ externalservice:
auth_key: 'pusher-auth_key'
secret: 'pusher-secret'
app_id: 'pusher-app_id'
happyscribe:
token: token
organization_id: 123456
transcript_format: vtt
subdef_source: preview


Console_logger_enabled_environments: [test]
Expand Down

0 comments on commit 945be4c

Please sign in to comment.