Skip to content

Commit bd5b90d

Browse files
michaeloffnerzspitzer
authored andcommitted
LDEV-5879 switch update provider to use maven
https://luceeserver.atlassian.net/browse/LDEV-5879
1 parent 13f2023 commit bd5b90d

28 files changed

+2424
-1082
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
name: Java build
77
runs-on: ubuntu-latest
88
env:
9-
luceeVersion: 6.2.0.321
9+
luceeVersion: 6.2.2.91
1010
#luceeVersionQuery: 6.0.3/all/jar
1111
steps:
1212
- uses: actions/checkout@v4
@@ -59,6 +59,7 @@ jobs:
5959
testAdditional: ${{ github.workspace }}/tests
6060
testSevices: mysql
6161
LUCEE_ADMIN_ENABLED: false
62+
DEBUG: true
6263
- name: Run Lucee Test Suite (testLabels="data-provider-integration")
6364
uses: lucee/script-runner@main
6465
#continue-on-error: true
@@ -68,11 +69,18 @@ jobs:
6869
luceeVersion: ${{ env.luceeVersion }}
6970
#luceeVersionQuery: ${{ env.luceeVersionQuery }}
7071
extensionDir: ${{ github.workspace }}/
72+
luceeCFConfig: ${{ github.workspace }}/devops/.CFconfig-update.json5
7173
env:
7274
testLabels: data-provider-integration
7375
testAdditional: ${{ github.workspace }}/tests
7476
testSevices: mysql
7577
LUCEE_ADMIN_ENABLED: false
78+
DEBUG: true
79+
- name: debug failure
80+
if: ${{ failure() }}
81+
run: |
82+
pwd
83+
ls -lR ${{ github.workspace }}
7684
7785
build:
7886
name: Docker build & publish

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ update/WEB-INF
2727
update/log-maven-download.log
2828
update/missing-bundles.txt
2929
/tests/artifacts
30+
/apps/updateserver/services/legacy/artifacts

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,31 @@ This repo contains the application code for the following services used by Lucee
77
* https://extension.lucee.org
88

99
https://luceeserver.atlassian.net/issues/?jql=labels%20%3D%20%22updates%22
10+
11+
# Local Development
12+
13+
By default, the data provider is configured to work in production.
14+
15+
Create an `.env file` with the following settings to work locally.
16+
17+
```env
18+
ALLOW_RELOAD=true
19+
S3_CORE_ROOT=/var/local_s3/lucee_downloads/
20+
S3_EXTENSIONS_ROOT=/var/local_s3/lucee_ext/
21+
S3_BUNDLES_ROOT=/var/local_s3/lucee_bundles/
22+
UPDATE_PROVIDER=http://127.0.0.1:8889/rest/update/provider/
23+
UPDATE_PROVIDER_INT=http://update:8888/rest/update/provider/ # internal docker networking
24+
EXTENSION_PROVIDER=http://127.0.0.1:8889/rest/extension/provider/
25+
EXTENSION_PROVIDER_INT=http://update:8888/rest/extension/provider/ # internal docker networking
26+
DOWNLOADS_URL=http://download:8888/
27+
```
28+
29+
Create folders under `local_s3`
30+
31+
- in `lucee_downloads` place a few sample Lucee full jars
32+
- in `lucee_ext` place some sample extension lex files
33+
34+
The run `docker compose up`
35+
36+
Running locally, the downloads page is at http://127.0.0.1:8888/
37+
and the update provider is http://127.0.0.1:8889/rest/update/provider/list?extended=true

apps/download/Application.cfc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ component {
77
disallowDoctypeDecl: true
88
};
99

10-
//this.s3.accessKeyId = server.system.environment.S3_DOWNLOAD_ACCESS_KEY_ID;
11-
//this.s3.awsSecretKey = server.system.environment.S3_DOWNLOAD_SECRET_KEY;
12-
1310
request.s3Root="s3:///extension-downloads/";
1411
request.s3URL="https://s3-eu-west-1.amazonaws.com/extension-downloads/";
1512

apps/download/download.cfc

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
component {
22

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
114

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";
1210

1311
function getExtensions(flush=false) localmode=true {
12+
var extUrl = EXTENSION_PROVIDER &"/info?withLogo=true&type=all";
1413
if ( arguments.flush || isNull( application.extInfo ) ) {
15-
http url=EXTENSION_PROVIDER&"&flush="&arguments.flush result="http";
14+
http url=extUrl result="http";
1615

1716
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#)";
1918

2019
var data = deSerializeJson( http.fileContent, false );
21-
if (!structKeyExists( data, "meta" ) ) {
20+
if ( !structKeyExists( data, "meta" ) ) {
2221
systemOutput( "error fetching extensions, falling back on cache", true);
23-
http url=EXTENSION_PROVIDER result="http";
22+
http url=extUrl result="http";
2423

2524
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#)";
2726

2827
data = deSerializeJson( http.fileContent, false );
2928
application.extInfo = data.extensions;
@@ -240,8 +239,12 @@ component {
240239
application[ "changelogLastUpdated" ] = lastUpdated;
241240
// application.mavenInfo = {}; // not currently used
242241
// 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 = {};
245248
}
246249

247250
}

apps/download/index.cfm

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
lang.installer['linux-x64']="Linux (x64)";
4343
lang.installer['linux-aarch64']="Linux (aarch64)";
4444
45-
cdnURL="https://cdn.lucee.org/";
45+
cdnURL="https://cdn.lucee.org/"; // now comes from the provider
4646
cdnURLExt="https://ext.lucee.org/";
4747
MAX=1000;
4848
@@ -157,11 +157,11 @@
157157
<div class="fontStyle">
158158
<cfif structKeyExists(dw,"express")>
159159
<cfif doS3.express>
160-
<cfset uri="#cdnURL##dw.express#">
160+
<cfset uri="#dw.express#">
161161
<cfelse>
162162
<cfset uri="#baseURL#express/#dw.version#">
163163
</cfif>
164-
<li><a href="#uri#">Express</a>
164+
<li><a href="#uri#" rel="nofollow">Express</a>
165165
<span class="triggerIcon pointer" style="color :##01798A" title="#lang.express#">
166166
<span class="glyphicon glyphicon-info-sign"></span>
167167
</span>
@@ -172,8 +172,8 @@
172172
<cfset str="">
173173
<cfloop list="win64,linux-x64,linux-aarch64" item="kk">
174174
<cfif !structKeyExists(dw,kk)><cfcontinue></cfif>
175-
<cfset uri="#cdnURL##dw[kk]#">
176-
<cfset str&='<li><a href="#uri#">#lang.installer[kk]# Installer</a> <span class="triggerIcon pointer" style="color :##01798A" title="#lang.installer[kk]# Installer">
175+
<cfset uri="#dw[kk]#">
176+
<cfset str&='<li><a href="#uri#" rel="nofollow">#lang.installer[kk]# Installer</a> <span class="triggerIcon pointer" style="color :##01798A" title="#lang.installer[kk]# Installer">
177177
<span class="glyphicon glyphicon-info-sign"></span>
178178
</span></li>'>
179179
</cfloop>
@@ -182,62 +182,62 @@
182182
<!--- jar --->
183183
<cfif structKeyExists(dw,"jar")>
184184
<cfif doS3.jar>
185-
<cfset uri="#cdnURL##dw.jar#">
185+
<cfset uri="#dw.jar#">
186186
<cfelse>
187187
<cfset uri="#baseURL#loader/#dw.version#">
188188
</cfif>
189189

190-
<li><a href="#(uri)#">lucee.jar</a>
190+
<li><a href="#uri#" rel="nofollow">lucee.jar</a>
191191
<span class="triggerIcon pointer" style="color :##01798A" title="#lang.jar#">
192192
<span class="glyphicon glyphicon-info-sign"></span></li>
193193
</span>
194194
</cfif>
195195
<cfif structKeyExists(dw,"light")>
196196
<cfif doS3.light>
197-
<cfset uri="#cdnURL##dw.light#">
197+
<cfset uri="#dw.light#">
198198
<cfelse>
199199
<cfset uri="#baseURL#light/#dw.version#">
200200
</cfif>
201201

202-
<li><a href="#(uri)#">lucee-light.jar</a><span class="triggerIcon pointer" style="color :##01798A" title='Lucee Jar file without any Extensions bundled, "Lucee light"'>
202+
<li><a href="#uri#" rel="nofollow">lucee-light.jar</a><span class="triggerIcon pointer" style="color :##01798A" title='Lucee Jar file without any Extensions bundled, "Lucee light"'>
203203
<span class="glyphicon glyphicon-info-sign"></span>
204204
</span></li>
205205
</cfif>
206206
<cfif structKeyExists(dw,"zero")>
207207
<cfif doS3.zero>
208-
<cfset uri="#cdnURL##dw.zero#">
208+
<cfset uri="#dw.zero#">
209209
<cfelse>
210210
<cfset uri="#baseURL#zero/#dw.version#">
211211
</cfif>
212212

213-
<li><a href="#(uri)#">lucee-zero.jar</a><span class="triggerIcon pointer" style="color :##01798A" title='Lucee Jar file without any Extensions bundled or doc and admin bundles, "Lucee zero"'>
213+
<li><a href="#uri#" rel="nofollow">lucee-zero.jar</a><span class="triggerIcon pointer" style="color :##01798A" title='Lucee Jar file without any Extensions bundled or doc and admin bundles, "Lucee zero"'>
214214
<span class="glyphicon glyphicon-info-sign"></span>
215215
</span></li>
216216
</cfif>
217217

218218
<!--- core --->
219219
<cfif structKeyExists(dw,"lco")>
220220
<cfif doS3.lco>
221-
<cfset uri="#cdnURL##dw.lco#">
221+
<cfset uri="#dw.lco#">
222222
<cfelse>
223223
<cfset uri="#baseURL#core/#dw.version#">
224224
</cfif>
225225

226-
<li><a href="#(uri)#" >Core</a>
226+
<li><a href="#uri#" rel="nofollow">Core</a>
227227
<span class="triggerIcon pointer" style="color :##01798A" title='#lang.core#'>
228228
<span class="glyphicon glyphicon-info-sign"></span>
229229
</span></li>
230230
</cfif>
231231
<!--- WAR --->
232232
<cfif structKeyExists(dw,"war")>
233233
<cfif doS3.war>
234-
<cfset uri="#cdnURL##dw.war#">
234+
<cfset uri="#dw.war#">
235235
<cfelse>
236236
<cfset uri="#baseURL#war/#dw.version#">
237237
</cfif>
238238

239239
<li>
240-
<a href="#(uri)#" title="#lang.war#">WAR</a>
240+
<a href="#uri#" title="#lang.war#" rel="nofollow">WAR</a>
241241
<span class="triggerIcon pointer" style="color :##01798A" title="#lang.war#">
242242
<span class="glyphicon glyphicon-info-sign"></span>
243243
</span>
@@ -359,12 +359,12 @@
359359
<cfif structKeyExists(dw,"express")>
360360
<div class="row_odd divHeight">
361361
<cfif doS3.express>
362-
<cfset uri="#cdnURL##dw.express#">
362+
<cfset uri="#dw.express#">
363363
<cfelse>
364364
<cfset uri="#baseURL#express/#dw.version#">
365365
</cfif>
366366
<div class="fontStyle">
367-
<a href="#uri#">Express</a>
367+
<a href="#uri#" rel="nofollow">Express</a>
368368
<span class="triggerIcon pointer" style="color :##01798A" title="#lang.express#">
369369
<span class="glyphicon glyphicon-info-sign"></span>
370370
</span>
@@ -378,11 +378,12 @@
378378
<cfloop list="win64,linux-x64,linux-aarch64" item="kk">
379379
<cfif !structKeyExists(dw,kk)><cfcontinue></cfif>
380380
<cfset count++>
381-
<cfset uri="#cdnURL##dw[kk]#">
381+
<cfset uri="#dw[kk]#">
382382
<cfif count GT 1>
383383
<cfset str&='<br>'>
384384
</cfif>
385-
<cfset str&='<a href="#uri#">#lang.installer[kk]# Installer</a> <span class="triggerIcon pointer" style="color :##01798A" title="#lang.installer[kk]# Installer">
385+
<cfset str&='<a href="#uri#" rel="nofollow">#lang.installer[kk]# Installer</a> '
386+
&'<span class="triggerIcon pointer" style="color :##01798A" title="#lang.installer[kk]# Installer">
386387
<span class="glyphicon glyphicon-info-sign"></span>
387388
</span>'>
388389
</cfloop>
@@ -401,38 +402,38 @@
401402
<div class="row_odd jarDiv">
402403
<cfif structKeyExists(dw,"jar")>
403404
<cfif doS3.jar>
404-
<cfset uri="#cdnURL##dw.jar#">
405+
<cfset uri="#dw.jar#">
405406
<cfelse>
406407
<cfset uri="#baseURL#loader/#dw.version#">
407408
</cfif>
408409

409-
<div class="fontStyle"><a href="#(uri)#">lucee.jar</a>
410+
<div class="fontStyle"><a href="#uri#" rel="nofollow">lucee.jar</a>
410411
<span class="triggerIcon pointer" style="color :##01798A" title="#lang.jar#">
411412
<span class="glyphicon glyphicon-info-sign"></span>
412413
</span>
413414
</div>
414415
</cfif>
415416
<cfif structKeyExists(dw,"light")>
416417
<cfif doS3.light>
417-
<cfset uri="#cdnURL##dw.light#">
418+
<cfset uri="#dw.light#">
418419
<cfelse>
419420
<cfset uri="#baseURL#light/#dw.version#">
420421
</cfif>
421422

422-
<div class="fontStyle"><a href="#(uri)#">lucee-light.jar</a>
423+
<div class="fontStyle"><a href="#uri#" rel="nofollow">lucee-light.jar</a>
423424
<span class="triggerIcon pointer" style="color :##01798A" title='Lucee Jar file without any Extensions bundled, "Lucee light"'>
424425
<span class="glyphicon glyphicon-info-sign"></span>
425426
</span>
426427
</div>
427428
</cfif>
428429
<cfif structKeyExists(dw,"zero")>
429430
<cfif doS3.zero>
430-
<cfset uri="#cdnURL##dw.zero#">
431+
<cfset uri="#dw.zero#">
431432
<cfelse>
432433
<cfset uri="#baseURL#zero/#dw.version#">
433434
</cfif>
434435

435-
<div class="fontStyle"><a href="#(uri)#">lucee-zero.jar</a>
436+
<div class="fontStyle"><a href="#uri#" rel="nofollow">lucee-zero.jar</a>
436437
<span class="triggerIcon pointer" style="color :##01798A" title='Lucee Jar file without any Extensions bundled or doc and admin bundles, "Lucee zero"'>
437438
<span class="glyphicon glyphicon-info-sign"></span>
438439
</span>
@@ -443,11 +444,11 @@
443444
<cfif structKeyExists(dw,"lco")>
444445
<div class="row_even divHeight">
445446
<cfif doS3.lco>
446-
<cfset uri="#cdnURL##dw.lco#">
447+
<cfset uri="#dw.lco#">
447448
<cfelse>
448449
<cfset uri="#baseURL#core/#dw.version#">
449450
</cfif>
450-
<div class="fontStyle"><a href="#(uri)#" >Core</a>
451+
<div class="fontStyle"><a href="#uri#" rel="nofollow">Core</a>
451452
<span class="triggerIcon pointer" style="color :##01798A" title='#lang.core#'>
452453
<span class="glyphicon glyphicon-info-sign"></span>
453454
</span>
@@ -458,12 +459,12 @@
458459
<cfif structKeyExists(dw,"war")>
459460
<div class="row_odd divHeight">
460461
<cfif doS3.war>
461-
<cfset uri="#cdnURL##dw.war#">
462+
<cfset uri="#dw.war#">
462463
<cfelse>
463464
<cfset uri="#baseURL#war/#dw.version#">
464465
</cfif>
465466

466-
<div class="fontStyle"><a href="#(uri)#" title="#lang.war#">WAR</a>
467+
<div class="fontStyle"><a href="#uri#" title="#lang.war#" rel="nofollow">WAR</a>
467468
<span class="triggerIcon pointer" style="color :##01798A" title="#lang.war#">
468469
<span class="glyphicon glyphicon-info-sign"></span>
469470
</span>
@@ -622,7 +623,7 @@
622623
<div class="clog-detail collapse #uid#_release_id row_alter" style="text-align:center;">
623624
</cfif>
624625
<div <cfif ind MOD 2 eq 0>class="row_alterEven textStyle textWrap"<cfelse>class="row_alterOdd textStyle textWrap"</cfif>>
625-
<a href="#cdnURLExt##el.filename#"
626+
<a href="#cdnURLExt##el.filename#" rel="nofollow"
626627
<cfif !isEmpty(el.meta.mincoreversion)>
627628
title="Requires Lucee #encodeForHTMLAttribute(el.meta.mincoreversion)#"
628629
</cfif>

0 commit comments

Comments
 (0)