In Lucee, I can see how to load extentions dynamic...
# lucee
p
In Lucee, I can see how to load extentions dynamically, example by enviroment variable. However if I open a .lex file there are the jars and there is a file that looks to be the definition of the functions/tag that are part of that extention. What I want to know is how I can "pre-load" that in to the lucee lite jar file. I am using Fuseless on lambda so do not have the ability to download extentions via admin. Enviroment variables works fine but slows down startup time.
b
It should work to put the extensions in the deploy folder of the server context on disk, assuming that is all writable at runtime.
p
Well it's lambda so you don't have access to put files there. I can unzip the lucee.jar and add files into that but all I deploy is a jar
b
that will work, but it's more of a pain
you can put the lex files in the lucee jar, but you'll prolly need to modify the manifest in the lucee jar to require them or they won't load
p
where would I place the lex file?
b
extension
inside the jar
p
I tried that, it didnt work, it was unable to recognise cfimage
But if you think it shoudl work let me re-try that to comfirm I did all the stepos right
b
well, like I said, that's not enough for it to be loaded
it just makes it available
p
OK
b
you have to edit the manifest
p
OK, which file is the manifest?
b
and I was wrong, it's not the manifest from the lucee jar, it's the manifest in the core file
under
/core/core.lco
inside the lucee.jar
And then under
META-INF/MANIFEST.MF
inside the lco file
You'll find something along the lines of
Copy code
Require-Extension: 7E673D15-D87C-41A6-8B5F1956528C605F;name=MySQL;labe
 l=MySQL;version=8.0.33,99A4EF8D-F2FD-40C8-8FB8C2E67A4EEEB6;name=MSSQL
 ;label=MS SQL Server;version=12.2.0.jre8,671B01B8-B3B3-42B9-AC055A356
 BED5281;name=PostgreSQL;label=PostgreSQL;version=42.6.0,2BCD080F-4E1E
 -48F5-BEFE794232A21AF6;name=JDTsSQL;label=jTDS (MSSQL);version=1.3.1,
 CED6227E-0F49-6367-A68D21AACA6B07E8;name=Admin;label=Lucee Administra
 tor;version=1.0.0.5,D46D49C3-EB85-8D97-30BEC2F38561E985;name=Doc;labe
 l=Lucee Documentation;version=1.0.0.4,17AB52DE-B300-A94B-E058BD978511
 E39E;name=S3;label=S3;version=2.0.1.25,87FE44E5-179C-43A3-A87B3D38BEF
 4652E;name=EHCache;label=EHCache;version=2.10.0.36,D46B46A9-A0E3-44E1
 -D972A04AC3A8DC10;name=Chart;label=CFChart;version=1.0.19.25,66E312DD
 -D083-27C0-64189D16753FD6F0;name=PDF;label=PDF;version=1.2.0.10,FAD67
 145-E3AE-30F8-1C11A6CCF544F0B7;name=Form;label=Form tags;version=1.0.
 0.10;since=5.1.0.21,B737ABC4-D43F-4D91-8E8E973E37C40D1B;name=Image;la
 bel=Image;version=2.0.0.26;since=5.3.0.35-ALPHA,37C61C0A-5D7E-4256-85
 72639BE0CF5838;name=Esapi;label=ESAPI;version=2.2.4.15;since=5.3.0.37
 -ALPHA,8D7FB0DF-08BB-1589-FE3975678F07DB17;name=Compress;label=Compre
 ss;version=1.0.0.15;since=5.3.2.31-SNAPSHOT,6E2CB28F-98FB-4B51-B6BE6C
 64ADF35473;name=Ajax;label=Ajax;version=1.0.0.5;since=5.3.2.40-SNAPSH
 OT
that's from a standard lucee core file
All of those extensions will be installed on first start, using the context/extensions/available folder as a local repo to look for them
on start, any lex files in the extensions folder of the jar are dumped into the available folder
It's a rather circuitous process, but I had to do this for CommandBox Lite, which bundles Lucee Lite at one point
We just solved this same problem recently for our BoxLang AWS Lambda runtime. We have a build process, which pre-install the modules you need. Unfortunately, Pete never got around to making a more formal approach in fuseless, which is powered by Lucee
p
OK I think I follow, thanks alot. I'll try see how I go. The lco file I cant open its binary format?
b
lco is an archive, just like a jar
you can rename it to .zip and then unpack and repack the same way just like a jar
p
Ahh ok, thanks. I'll unzip it
b
7-Zip wlll also open it directly
which is what I use for all jar/lco/lex files
p
Oh 7zip is on mac now...
I think I can use this as the env variable: LUCEE_EXTENSIONS: 'B737ABC4-D43F-4D91-8E8E973E37C40D1B;name=cfimage;path=/var/task/app/image-extension-2.0.0.29.lex' where I know that the lex file is at that path on the virtual machine lambda is running on and it loads the lex file locally, it seams to be workign and meant i didnt have to modify the manifest file
z
just drop the lex file in the deploy folder? https://docs.lucee.org/guides/deploying-lucee-server-apps.html
if you want a faster start time, you could try run a build which deploys lucee, then zip up that whole folder to deploy to lamba, the lucee is already warmed up and just needs to run, no installing etc
p
The deploy folder isnt that same on lambda I am using fuseless on AWS Lambda, so you don't have access to drop files where ever you want