-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'extension-artifacts-build'
- Loading branch information
Showing
73 changed files
with
1,228 additions
and
2,313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Deploy download.lucee.org | ||
on: | ||
- workflow_dispatch | ||
jobs: | ||
deploy-to-download: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger deployments | ||
run: | | ||
curl -XPOST -u ${{ secrets.DEPLOY_API_TOKEN }}:${{ secrets.DEPLOY_API_TOKEN }} "${{ secrets.DEPLOY_API_ENDPOINT }}/download/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Deploy update.lucee.org | ||
on: | ||
- workflow_dispatch | ||
jobs: | ||
deploy-to-update: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger deployments | ||
run: | | ||
curl -XPOST -u ${{ secrets.DEPLOY_API_TOKEN }}:${{ secrets.DEPLOY_API_TOKEN }} "${{ secrets.DEPLOY_API_ENDPOINT }}/update/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ update/WEB-INF | |
/download/debug.cfm | ||
update/log-maven-download.log | ||
update/missing-bundles.txt | ||
/tests/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# lucee-data-provider | ||
# Lucee "Data provider" | ||
|
||
Home of http://stable.lucee.org/download/ | ||
This repo contains the application code for: | ||
|
||
* https://download.lucee.org | ||
* https://update.lucee.org | ||
* https://extension.lucee.org |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
component { | ||
|
||
this.name = "lucee-provider"; | ||
this.s3.accessKeyId = server.system.environment.S3_EXTENSION_ACCESS_KEY_ID; | ||
this.s3.awsSecretKey = server.system.environment.S3_EXTENSION_SECRET_KEY; | ||
this.allowReload = IsBoolean( server.system.environment.ALLOW_RELOAD ?: "" ) && server.system.environment.ALLOW_RELOAD; | ||
|
||
function onApplicationStart() { | ||
_loadServices(); | ||
} | ||
|
||
function onRequestStart() output=true { | ||
if ( this.allowReload && StructKeyExists( url, "fwreinit" ) ) { | ||
_loadServices(); | ||
} | ||
|
||
var allowedPaths = [ "rest", "healthcheck" ]; | ||
var requestedPath = ListFirst( Trim( cgi.script_name ), "/" ); | ||
|
||
if ( !ArrayFindNoCase( allowedPaths, requestedPath ) ) { | ||
content reset=true; | ||
header statuscode=404; | ||
echo( "not found" ); | ||
abort; | ||
} | ||
} | ||
|
||
function _loadServices() { | ||
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/"; | ||
var bundleCdnUrl = server.system.environment.S3_BUNDLES_CDN_URL ?: "https://bundle.lucee.org/"; | ||
|
||
var extMetaReader = new services.ExtensionMetadataReader( | ||
s3root = extS3Root | ||
); | ||
var bundleDownloadService = new services.BundleDownloadService( | ||
extensionsCdnUrl = extCdnUrl | ||
, bundleS3Root = bundleS3Root | ||
, bundleCdnUrl = bundleCdnUrl | ||
, extensionMetaReader = extMetaReader | ||
, mavenMatcher = new services.legacy.MavenMatcher() | ||
); | ||
|
||
extMetaReader.setBundleDownloadservice( bundleDownloadService ); | ||
extMetaReader.loadMeta(); | ||
|
||
application.extensionsCdnUrl = extCdnUrl; | ||
application.extensionsS3Root = extS3Root; | ||
application.extMetaReader = extMetaReader; | ||
application.bundleDownloadService = bundleDownloadService; | ||
} | ||
|
||
} |
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
/** | ||
* @restpath /extension/provider | ||
* @rest true | ||
*/ | ||
component { | ||
|
||
variables.metaReader = application.extMetaReader; | ||
variables.cdnURL = application.extensionsCdnUrl; | ||
|
||
/** | ||
* @httpmethod GET | ||
* @restPath info | ||
*/ | ||
remote struct function getInfo( | ||
required boolean withLogo = true restargsource="url" | ||
, required string type = 'release' restargsource="url" | ||
, required boolean flush = false restargsource="url" | ||
) { | ||
var hostName = cgi.HTTP_HOST; | ||
var retVal = { meta={ | ||
title = "Lucee Association Switzerland Extension Store (#hostName#)" | ||
, description = "" | ||
, image = "https://#hostName#/extension/extension-provider.png" | ||
, url = "https://#hostName#" | ||
, mode = "production" | ||
} }; | ||
|
||
try { | ||
retVal.extensions = metaReader.list( | ||
type = ReFindNoCase( "^beta\.", hostName ) ? "abc" : arguments.type | ||
, flush = arguments.flush | ||
, withLogo = arguments.withLogo | ||
); | ||
} catch( e ) { | ||
return e; | ||
} | ||
|
||
return retVal; | ||
} | ||
|
||
/** | ||
* @httpmethod GET | ||
* @restPath info/{id} | ||
*/ | ||
remote function getInfoDetail( | ||
required string id restargsource="Path" | ||
, required boolean withLogo = true restargsource="url" | ||
, string version = "" restargsource="url" | ||
, boolean flush = false restargsource="url" | ||
) { | ||
var ext = metaReader.getExtensionDetail( | ||
id = arguments.id | ||
, withLogo = arguments.withLogo | ||
, version = arguments.version | ||
, flush = arguments.flush | ||
); | ||
|
||
return ext; | ||
|
||
// TODO + some logging + ensure 404 when not found (old logic below) | ||
|
||
if ( StructCount( ext ) ) { | ||
return ext; | ||
} | ||
|
||
var msg = "There is no extension at this provider with id [#EncodeForHtml( arguments.id )#]"; | ||
if ( Len( arguments.version ) ) { | ||
msg &= " in version [#EncodeForHtml( arguments.version )#]."; | ||
} else { | ||
msg &= "."; | ||
} | ||
SystemOutput( msg, true, true ); | ||
content type="text/plain"; | ||
header statuscode=404 statustext=msg; | ||
echo(msg); // otherwise this creates a stack trace for forgebox stuff | ||
abort; | ||
} | ||
|
||
|
||
/** | ||
* provides trial versions ??! | ||
* | ||
* @httpmethod GET | ||
* @restPath full/{id} | ||
*/ | ||
remote function getFull( | ||
required string id restargsource="Path" | ||
, string version = "" restargsource="url" | ||
, boolean flush = false restargsource="url" | ||
) { | ||
|
||
var ext = metaReader.getExtensionDetail( | ||
id = arguments.id | ||
, version = arguments.version | ||
, flush = arguments.flush | ||
, withLogo = false | ||
); | ||
|
||
if ( StructCount( ext ) ) { | ||
header statuscode="302" statustext="Found"; | ||
header name="Location" value=variables.cdnURL & ext.filename; | ||
} | ||
|
||
header statuscode="404" statustext="Not Found"; | ||
} | ||
|
||
/** | ||
* provides trial versions (not sure what this is - has same logic as /full/{id}) | ||
* | ||
* @httpmethod GET | ||
* @restPath trial/{id} | ||
*/ | ||
remote function getTrial( | ||
required string id restargsource="Path" | ||
, string version = "" restargsource="url" | ||
, boolean flush = false restargsource="url" | ||
) { | ||
|
||
var ext = metaReader.getExtensionDetail( | ||
id = arguments.id | ||
, version = arguments.version | ||
, flush = arguments.flush | ||
, withLogo = false | ||
); | ||
|
||
if ( StructCount( ext ) ) { | ||
header statuscode="302" statustext="Found"; | ||
header name="Location" value=variables.cdnURL & ext.filename; | ||
} | ||
|
||
header statuscode="404" statustext="Not Found"; | ||
} | ||
|
||
|
||
/** | ||
* Would be good to get rid of this? | ||
* | ||
* @httpmethod GET | ||
* @restPath updateCache | ||
*/ | ||
remote struct function updateCache(){ | ||
try { | ||
return { | ||
meta = {} | ||
, extensions = metaReader.loadMeta() | ||
} | ||
} catch( any e ) { | ||
return e; | ||
} | ||
} | ||
|
||
/** | ||
* Would be good to get rid of this? | ||
* | ||
* @httpmethod GET | ||
* @restPath reset | ||
*/ | ||
remote function reset() { | ||
metaReader.loadMeta(); | ||
} | ||
} |
Oops, something went wrong.