Skip to content

Commit

Permalink
Merge branch '6.2' into LDEV-4929-6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner authored Aug 19, 2024
2 parents 41dda8d + 0d4ea07 commit 11e1223
Show file tree
Hide file tree
Showing 372 changed files with 9,522 additions and 2,204 deletions.
87 changes: 70 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build 6.1
name: Build 6.1

on:
workflow_call:
Expand All @@ -22,32 +22,63 @@ on:

jobs:
build:

runs-on: ubuntu-latest
env:
DO_DEPLOY: "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/6.1') }}"
DO_DEPLOY: "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/6.2') }}"
LUCEE_BUILD_JAVA_VERSION: 21
LUCEE_TEST_JAVA_VERSION: ''
services:
ldap:
# image: kwart/ldap-server
image: rroemhild/test-openldap
ports:
- 10389:10389
- 10636:10636
sql-server:
# Docker Hub image
image: mcr.microsoft.com/mssql/server:2019-latest
ldap_with_creds:
image: ${{ (github.secret_source != 'none') && 'rroemhild/test-openldap' || '' }}
ports:
- 10389:10389
- 10636:10636
credentials:
username: ${{ secrets.DOCKERHUB_PUBLIC_USERNAME || ' ' }} # empty string to avoid invalid template
password: ${{ secrets.DOCKERHUB_PUBLIC_TOKEN || ' ' }}
ldap_no_creds:
image: ${{ (github.secret_source == 'none') && 'rroemhild/test-openldap' || '' }}
ports:
- 10389:10389
- 10636:10636
sql-server_with_creds:
image: ${{ (github.secret_source != 'none') && 'mcr.microsoft.com/mssql/server:2022-latest' || '' }}
env:
MSSQL_PID: Express
ACCEPT_EULA: Y
SA_PASSWORD: Lucee!1433 # password must be complex or the service won't start
ports:
- 1433:1433
options: --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
credentials:
username: ${{ secrets.DOCKERHUB_PUBLIC_USERNAME || ' ' }}
password: ${{ secrets.DOCKERHUB_PUBLIC_TOKEN || ' ' }}
sql-server_without_creds:
image: ${{ (github.secret_source == 'none') && 'mcr.microsoft.com/mssql/server:2022-latest' || '' }}
env:
MSSQL_PID: Express
ACCEPT_EULA: Y
SA_PASSWORD: Lucee!1433 # password must be complex or the service won't start
ports:
- 1433:1433
options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
redis:
options: --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
redis_with_creds:
image: ${{ (github.secret_source != 'none') && 'redis' || '' }}
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
credentials:
username: ${{ secrets.DOCKERHUB_PUBLIC_USERNAME || ' ' }}
password: ${{ secrets.DOCKERHUB_PUBLIC_TOKEN || ' ' }}
redis_without_creds:
# Docker Hub image
image: redis
image: ${{ (github.secret_source == 'none') && 'redis' || '' }}
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
Expand All @@ -57,8 +88,8 @@ jobs:
ports:
# Maps port 6379 on service container to the host
- 6379:6379
greenmail:
image: greenmail/standalone:1.6.9
greenmail_with_creds:
image: ${{ (github.secret_source != 'none') && 'greenmail/standalone:1.6.9' || '' }}
ports:
- 3025:3025 #SMTP
- 3110:3110 #POP3
Expand All @@ -67,9 +98,31 @@ jobs:
- 3993:3993 #IMAPS
- 3995:3995 #POP3S
- 8080:8080 #API
credentials:
username: ${{ secrets.DOCKERHUB_PUBLIC_USERNAME || ' ' }}
password: ${{ secrets.DOCKERHUB_PUBLIC_TOKEN || ' ' }}
greenmail_no_creds:
image: ${{ (github.secret_source == 'none') && 'greenmail/standalone:1.6.9' || '' }}
ports:
- 3025:3025 #SMTP
- 3110:3110 #POP3
- 3143:3143 #IMAP
- 3465:3465 #SMTPS
- 3993:3993 #IMAPS
- 3995:3995 #POP3S
- 8080:8080 #API

steps:
# when workflow is run via a workflow_call, these vars are found under input, which doesn't exist otherwise
# so lets copy them over to the normal env vars

- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ github.secret_source != 'none' }}
with:
username: ${{ secrets.DOCKERHUB_PUBLIC_USERNAME }}
password: ${{ secrets.DOCKERHUB_PUBLIC_TOKEN }}

- name: Configure Build Java Version
if: ${{ inputs.LUCEE_BUILD_JAVA_VERSION != '' }}
run: echo "LUCEE_BUILD_JAVA_VERSION=${{ inputs.LUCEE_BUILD_JAVA_VERSION }}" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/osv-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
with:
go-version: '>=1.21.6'
- name: Install Google OSV Scanner
run: go install github.com/google/osv-scanner/cmd/osv-scanner@v1
run: go install github.com/google/osv-scanner/cmd/osv-scanner@v1.8.1
- name: Run OSV vulnerabilities Scanner
run: 'PATH="${PATH}:$(go env GOPATH)/bin" osv-scanner -r ${{ github.workspace }}'
45 changes: 3 additions & 42 deletions ant/build-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,6 @@
name="buildLoaderMaven"
depends="_buildLoaderMaven,upload_to_s3"
description="generate the loader jar" >

</target>

<!-- temporary disabled: depends="createCore17,createCore21" -->
Expand Down Expand Up @@ -900,45 +899,7 @@
<echots message="build-jar-ant:${goal}/META-INF/MANIFEST.MF"/>
</target>

<target name="createZeroLoader" if="buildLoaderJar">
<!-- generates the jar containing no extensions -->
<echots message="build zero .jar - ${goal}"/>

<!-- remove all the .lex files -->
<delete dir="${temp}/loader/extensions"/>

<!-- Extract the entire JAR -->
<unzip src="${temp}/loader/core/core.lco" dest="${temp}/loader/core/unzip"/>

<!-- Rename the "Require-Extension" section to "Optional-Extension" in the MANIFEST.MF file -->
<replace file="${temp}/loader/core/unzip/META-INF/MANIFEST.MF"
token="Require-Extension:"
value="Optional-Extension:"/>

<!-- Recreate the JAR file with all original contents and the updated MANIFEST.MF -->
<jar
basedir="${temp}/loader/core/unzip"
destfile="${temp}/loader/core/core.lco"
manifest="${temp}/loader/core/unzip/META-INF/MANIFEST.MF"/>

<!-- Clean up the temporary directory -->
<delete dir="${temp}/loader/core/unzip"/>

<!-- Create the final JAR file -->
<jar
basedir="${temp}/loader"
jarfile="${trgLoader}/lucee-zero-${version}.jar"
manifest="${goal}/META-INF/MANIFEST.MF"/>

<echots message="build-jar-ant:${goal}/META-INF/MANIFEST.MF"/>
</target>






<target name="_buildLoaderMaven" depends="__build,setMvnEnv,addExtensions,addBundles,addFelix,createCore,createLoader,createZeroLoader,test_warmup,test_stable_loader" description="generate the loader jar">
<target name="_buildLoaderMaven" depends="__build,setMvnEnv,addExtensions,addBundles,addFelix,createCore,createLoader,test_warmup,test_stable_loader" description="generate the loader jar">
<!-- version -->
<currentTime property="ct" />
<echo file="${outputDir}/lucee/version" message="${version}:${ct}" encoding="UTF-8"/>
Expand All @@ -954,7 +915,7 @@
<echo level="info">after:${goal}</echo>
</target>

<target name="buildLoaderAnt" depends="__build,setAntEnv,addExtensions,addBundles,addFelix,createCore,createLoader,createZeroLoader,test_warmup,test_stable_loader" description="generate the loader jar" >
<target name="buildLoaderAnt" depends="__build,setAntEnv,addExtensions,addBundles,addFelix,createCore,createLoader,test_warmup,test_stable_loader" description="generate the loader jar" >
<!-- version -->
<currentTime property="ct" />
<echo file="${temp}/loader/lucee/version" message="${version}:${ct}" encoding="UTF-8"/>
Expand All @@ -963,7 +924,7 @@
<echots message="done"/>
</target>

<target name="buildLoaderFast" depends="__build,setAntEnv,addExtensions,addBundles,addFelix,createCore,createLoader,createZeroLoader"
<target name="buildLoaderFast" depends="__build,setAntEnv,addExtensions,addBundles,addFelix,createCore,createLoader"
description="quick/fast generate the loader jar" >
<!-- version -->
<currentTime property="ct" />
Expand Down
68 changes: 48 additions & 20 deletions ant/upload_to_s3.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,31 @@
trg.jar = trg.dir & src.jarName;
trg.core = trg.dir & src.coreName;
if ( fileExists( trg.jar ) && fileExists( trg.core ) ){
SystemOutput( "Build artifacts have already been uploaded for this version, nothing to do", 1, 1 );
return;
}
// copy jar
SystemOutput( "upload #src.jarName# to S3",1,1 );
if ( fileExists( trg.jar ) )
fileDelete( trg.jar );
fileCopy( src.jar, trg.jar );
SystemOutput( "upload #src.jar# to S3",1,1 );
copyIt=true;
if (fileExists( trg.jar ) ) {
try {
fileDelete( trg.jar );
}
catch(e){
copyIt=false;
}
}
if(copyIt) fileCopy( src.jar, trg.jar );
// copy core
SystemOutput( "upload #src.coreName# to S3",1,1 );
if ( fileExists( trg.core ) )
fileDelete( trg.core );
fileCopy( src.core, trg.core );
SystemOutput( "upload #src.core# to S3",1,1 );
copyIt=true;
if ( fileExists( trg.core ) ) {
try {
fileDelete( trg.core );
}
catch(e){
copyIt=false;
}
}
if(copyIt) fileCopy( src.core, trg.core );
}
/*
Expand Down Expand Up @@ -100,30 +109,49 @@
src.lightName = "lucee-light-" & src.version & ".jar";
src.light = src.dir & src.lightName;
if ( DO_DEPLOY )
SystemOutput( "build and upload #src.lightName# to S3",1,1 );
SystemOutput( "build and upload #src.light# to S3",1,1 );
else
SystemOutput( "build #src.light#",1,1 );
createLight( src.jar,src.light,src.version, false );
if ( DO_DEPLOY ){
trg.light = trg.dir & src.lightName;
fileCopy( src.light, trg.light );
copyIt=true;
if ( fileExists( trg.light ) ) {
try {
fileDelete( trg.light );
}
catch(e){
copyIt=false;
}
}
if(copyIt) fileCopy( src.light, trg.light );
}
// Lucee zero build, built from light but also no admin or docs
src.zeroName = "lucee-zero-" & src.version & ".jar";
src.zero = src.dir & src.zeroName;
/*if ( DO_DEPLOY )
SystemOutput( "build and upload #src.zeroName# to S3",1,1 );
if ( DO_DEPLOY )
SystemOutput( "build and upload #src.zero# to S3",1,1 );
else
SystemOutput( "build #src.zero#",1,1 );
createLight( src.light, src.zero,src.version, true );
*/
createLight( src.light, src.zero,src.version, false );
if ( DO_DEPLOY ) {
trg.zero = trg.dir & src.zeroName;
fileCopy( src.zero, trg.zero );
copyIt=true;
if ( fileExists( trg.zero ) ) {
try {
fileDelete( trg.zero );
}
catch(e){
copyIt=false;
}
}
if(copyIt) fileCopy( src.zero, trg.zero );
}
Expand Down
18 changes: 18 additions & 0 deletions core/src/main/cfml/context/templates/error/error.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@
<td>#replace( HTMLEditFormat( trim( catch.detail ) ), chr(10), '<br>', 'all' )#</td>
</tr>
</cfif>

<cfif LuceeAIHas('default:exception')>
<cfLuceeAI default="exception" throwonerror=false
meta="meta"
message="An exception was thrown in Lucee version #server.lucee.version# source code.
Analyze the provided source code provided in JSON format and return the result in markdown format.
Keep the answer short and ensure the structure is flat, the result will be injected into an existing markdown output that show the input you got,
so only gives your conclusion, the input you get will already be presented.
Make some example code how to improve.">
<cfLuceeAIInquiry question="#serializeJSON(catch)#">
<tr>
<td class="label">AI (#meta.label?:""#)</td>
<td>#markdowntohtml(answer)#</td>
</tr>
</cfLuceeAI>
</cfif>


<cfif structkeyexists( catch, 'errorcode' ) && len( catch.errorcode ) && catch.errorcode NEQ 0>
<tr>
<td class="label">Error Code</td>
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,13 @@ Require-Bundle: org.apache.commons.commons-codec;bundle-version=1.15.0,
com.github.f4b6a3.ulid;bundle-version=5.2.3,
org.lucee.janino;bundle-version=3.1.9,
org.lucee.janinocc;bundle-version=3.1.9
Require-Extension: 7E673D15-D87C-41A6-8B5F1956528C605F;name=MySQL;label=MySQL;version=8.4.0,
99A4EF8D-F2FD-40C8-8FB8C2E67A4EEEB6;name=MSSQL;label=MS SQL Server;version=12.4.2.jre8,
Require-Extension: 7E673D15-D87C-41A6-8B5F1956528C605F;name=MySQL;label=MySQL;version=9.0.0,
99A4EF8D-F2FD-40C8-8FB8C2E67A4EEEB6;name=MSSQL;label=MS SQL Server;version=12.6.3.jre11,
671B01B8-B3B3-42B9-AC055A356BED5281;name=PostgreSQL;label=PostgreSQL;version=42.7.3,
2BCD080F-4E1E-48F5-BEFE794232A21AF6;name=JDTsSQL;label=jTDS (MSSQL);version=1.3.1,
CED6227E-0F49-6367-A68D21AACA6B07E8;name=Admin;label=Lucee Administrator;version=1.0.0.5,
D46D49C3-EB85-8D97-30BEC2F38561E985;name=Doc;label=Lucee Documentation;version=1.0.0.4,
17AB52DE-B300-A94B-E058BD978511E39E;name=S3;label=S3;version=2.0.1.25,
17AB52DE-B300-A94B-E058BD978511E39E;name=S3;label=S3;version=2.0.2.19-SNAPSHOT,
87FE44E5-179C-43A3-A87B3D38BEF4652E;name=EHCache;label=EHCache;version=2.10.0.36,
66E312DD-D083-27C0-64189D16753FD6F0;name=PDF;label=PDF;version=1.2.0.10,
B737ABC4-D43F-4D91-8E8E973E37C40D1B;name=Image;label=Image;version=2.0.0.26;since=5.3.0.35-ALPHA,
Expand Down
19 changes: 15 additions & 4 deletions core/src/main/java/lucee/aprint.java
Original file line number Diff line number Diff line change
Expand Up @@ -501,22 +501,33 @@ private static void _eo(PrintStream ps, Map map) {
ps.print(map.getClass().getName() + " {");
while (it.hasNext()) {
Object key = it.next();

_eo(ps, key);
if (key instanceof CharSequence) {
ps.print("\"");
ps.print(key.toString());
ps.print("\" ");
}
else _eo(ps, key);
ps.print(":");
_eo(ps, map.get(key));
}
ps.println("}");
}
else {
ps.println(map.getClass().getName() + " {");
char del = ' ';
while (it.hasNext()) {
Object key = it.next();
ps.print(" ");
_eo(ps, key);
ps.print(del);
if (key instanceof CharSequence) {
ps.print("\"");
ps.print(key.toString());
ps.print("\" ");
}
else _eo(ps, key);
ps.print(":");
_eo(ps, map.get(key));
ps.println(";");
del = ',';
}
ps.println("}");
}
Expand Down
Loading

0 comments on commit 11e1223

Please sign in to comment.