formatting

This commit is contained in:
fogelito 2026-02-01 08:46:39 +02:00
parent a38b6cc78d
commit 23f08ef144

View file

@ -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;