mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
formatting
This commit is contained in:
parent
a38b6cc78d
commit
23f08ef144
1 changed files with 8 additions and 10 deletions
|
|
@ -332,16 +332,9 @@ class Migrations extends Action
|
|||
|
||||
$transfer = $source = $destination = null;
|
||||
|
||||
|
||||
/**
|
||||
* Old logic
|
||||
* $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https';
|
||||
* $endpoint = $protocol . '://' . $platform['apiHostname'] . '/v1';
|
||||
*/
|
||||
|
||||
$endpoint = System::getEnv('_APP_MIGRATION_ENDPOINT');
|
||||
if(empty($endpoint)){
|
||||
throw new \Exception('empty _APP_MIGRATION_ENDPOINT');
|
||||
if (empty($endpoint)) {
|
||||
throw new \Exception('_APP_MIGRATION_ENDPOINT env is empty');
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -355,6 +348,10 @@ class Migrations extends Action
|
|||
}
|
||||
}
|
||||
|
||||
if ($migration->getAttribute('destination') === DestinationAppwrite::getName()) {
|
||||
|
||||
}
|
||||
|
||||
if (($credentials['endpoint'] ?? '') === 'http://localhost/v1') {
|
||||
$credentials['endpoint'] = $endpoint;
|
||||
}
|
||||
|
|
@ -581,7 +578,8 @@ class Migrations extends Action
|
|||
]);
|
||||
|
||||
// Generate download URL with JWT
|
||||
$endpoint = System::getEnv('_APP_DOMAIN', '');
|
||||
|
||||
$endpoint = System::getEnv('_APP_DOMAIN', ''); // Can use System::getEnv('_APP_MIGRATION_ENDPOINT'); ?
|
||||
$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled' ? 'https' : 'http';
|
||||
$downloadUrl = "{$protocol}://{$endpoint}/v1/storage/buckets/{$bucketId}/files/{$fileId}/push?project={$project->getId()}&jwt={$jwt}";
|
||||
$options['downloadUrl'] = $downloadUrl;
|
||||
|
|
|
|||
Loading…
Reference in a new issue