|
1 | 1 | component { |
2 | 2 |
|
3 | | - variables.EXTENSION_PROVIDER="https://extension.lucee.org/rest/extension/provider/info?withLogo=true&type=all"; |
4 | | - //variables.EXTENSION_PROVIDER="http://127.0.0.1:8889/rest/extension/provider/info?withLogo=true&type=all"; |
5 | | - |
6 | | - variables.EXTENSION_DOWNLOAD="https://extension.lucee.org/rest/extension/provider/{type}/{id}"; |
7 | | - |
8 | | - variables.UPDATE_PROVIDER = "https://update.lucee.org/rest/update/provider"; |
9 | | - |
10 | | - //variables.UPDATE_PROVIDER = "http://127.0.0.1:8889/rest/update/provider"; |
| 3 | + // provider urls are to communicate between the docker instances, so they need different urls |
11 | 4 |
|
| 5 | + // set EXTENSION_PROVIDER_INT=http://update:8888/rest/extension/provider in .env for local testing |
| 6 | + variables.EXTENSION_PROVIDER = server.system.environment.EXTENSION_PROVIDER_INT ?: "https://extension.lucee.org/rest/extension/provider"; |
| 7 | + |
| 8 | + // set DOWNLOAD_UPDATE_PROVIDER_INT=http://update:8888/rest/update/provider in .env for local testing |
| 9 | + variables.UPDATE_PROVIDER = server.system.environment.UPDATE_PROVIDER_INT ?: "https://update.lucee.org/rest/update/provider"; |
12 | 10 |
|
13 | 11 | function getExtensions(flush=false) localmode=true { |
| 12 | + var extUrl = EXTENSION_PROVIDER &"/info?withLogo=true&type=all"; |
14 | 13 | if ( arguments.flush || isNull( application.extInfo ) ) { |
15 | | - http url=EXTENSION_PROVIDER&"&flush="&arguments.flush result="http"; |
| 14 | + http url=extUrl result="http"; |
16 | 15 |
|
17 | 16 | if ( isNull( http.status_code ) || http.status_code != 200 ) |
18 | | - throw "could not connect to extension provider (#EXTENSION_PROVIDER#)"; |
| 17 | + throw "could not connect to extension provider (#extUrl#)"; |
19 | 18 |
|
20 | 19 | var data = deSerializeJson( http.fileContent, false ); |
21 | | - if (!structKeyExists( data, "meta" ) ) { |
| 20 | + if ( !structKeyExists( data, "meta" ) ) { |
22 | 21 | systemOutput( "error fetching extensions, falling back on cache", true); |
23 | | - http url=EXTENSION_PROVIDER result="http"; |
| 22 | + http url=extUrl result="http"; |
24 | 23 |
|
25 | 24 | if ( isNull( http.status_code ) || http.status_code != 200 ) |
26 | | - throw "could not connect to extension provider (#EXTENSION_PROVIDER#)"; |
| 25 | + throw "could not connect to extension provider (#extUrl#)"; |
27 | 26 |
|
28 | 27 | data = deSerializeJson( http.fileContent, false ); |
29 | 28 | application.extInfo = data.extensions; |
@@ -240,8 +239,12 @@ component { |
240 | 239 | application[ "changelogLastUpdated" ] = lastUpdated; |
241 | 240 | // application.mavenInfo = {}; // not currently used |
242 | 241 | // maven dates are static, only purge if unknown |
243 | | - loop collection="#application.mavenDates#" key="local.version" value="local.date" { |
244 | | - if ( len(date) eq 0 ) structDelete( application.mavenDates, version ); |
| 242 | + if ( structKeyExists( application, "mavenDates" ) ){ |
| 243 | + loop collection="#application.mavenDates#" key="local.version" value="local.date" { |
| 244 | + if ( len(date) eq 0 ) structDelete( application.mavenDates, version ); |
| 245 | + } |
| 246 | + } else { |
| 247 | + application.mavenDates = {}; |
245 | 248 | } |
246 | 249 |
|
247 | 250 | } |
|
0 commit comments