Skip to content

Commit

Permalink
Fix core downloads and other non-bundle/extension downloads from the …
Browse files Browse the repository at this point in the history
…update server.

Also fix issue with 'latest' downloads when pulling from bundle s3 bucket
  • Loading branch information
DominicWatson committed Jun 19, 2024
1 parent de409a1 commit 6fd3472
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions apps/updateserver/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ component {
}

function _loadServices() {
var coreS3Root = server.system.environment.S3_CORE_ROOT ?: "s3:///lucee-downloads/";
var coreCdnUrl = server.system.environment.S3_CORE_CDN_URL ?: "https://cdn.lucee.org/";
var extS3Root = server.system.environment.S3_EXTENSIONS_ROOT ?: "s3:///extension-downloads/";
var extCdnUrl = server.system.environment.S3_EXTENSIONS_CDN_URL ?: "https://ext.lucee.org/";
var bundleS3Root = server.system.environment.S3_BUNDLES_ROOT ?: "s3:///bundle-download/";
Expand All @@ -45,6 +47,8 @@ component {
extMetaReader.setBundleDownloadservice( bundleDownloadService );
extMetaReader.loadMeta();

application.coreS3Root = coreS3Root;
application.coreCdnUrl = coreCdnUrl;
application.extensionsCdnUrl = extCdnUrl;
application.extensionsS3Root = extS3Root;
application.extMetaReader = extMetaReader;
Expand Down
3 changes: 2 additions & 1 deletion apps/updateserver/rest/UpdateProvider.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
component {

variables.bundleDownloadService = application.bundleDownloadService;
variables.s3Root=application.extensionsS3Root
variables.s3Root = application.coreS3Root;
variables.cdnUrl = application.coreCdnUrl;

variables.providerLog = "update-provider";

Expand Down
2 changes: 1 addition & 1 deletion apps/updateserver/services/BundleDownloadService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ component accessors=true {
if ( ArrayLen( matchedFiles ) ) {
ArraySort( matchedFiles, function( a, b ){
if ( a.version == b.version ) return 0;
return a.version > b.version ? 1 : -1;
return a.version < b.version ? 1 : -1;
} );

return _getS3BundleUrl( matchedFiles[ 1 ].name );
Expand Down

0 comments on commit 6fd3472

Please sign in to comment.