Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDEV-4956 setAdminPassword, adminPassword, cleanup #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 48 additions & 39 deletions build-run-cfml.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="all" basedir="." name="run-cfml">
<macrodef name="echots">
<attribute name="message"/>
<attribute name="message" />
<sequential>
<local name="timestamp" />
<tstamp>
Expand All @@ -11,43 +11,46 @@
</sequential>
</macrodef>
<target name="all">
<echots message="Lucee Starting"/>
<echots message="Lucee Starting" />
<script language="CFML">
<![CDATA[
systemOutput( "---------- #DateTimeFormat(now(),'yyyy-mm-dd HH:nn:ss')# - Lucee Started ----------", true);
systemOutput( "#server.lucee.version#", true );

request.adminPassword="admin";
param name="adminPassword" default="admin";
request.adminPassword = adminPassword;
request.errorThrown = false;

try {
param name="setAdminPassword" default="true";
if ( setAdminPassword ) {

// set a password for the admin
try {
admin
action="updatePassword"
type="web"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Web admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
}

// set a password for the admin
try {
admin
action="updatePassword"
type="web"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Web admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
}

try {
admin
action="updatePassword"
type="server"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Server admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
try {
admin
action="updatePassword"
type="server"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Server admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
}
}


admin
action="updateMapping"
type="web"
Expand All @@ -59,18 +62,24 @@
primary="physical"
trusted="no";

admin
action="getMappings"
type="web"
password="#request.adminPassword#"
returnVariable="mappings";

systemOutput( "-------------- Mappings --------------", true );
loop query="mappings" {
systemOutput("#mappings.virtual# #chr( 9 )# #mappings.strPhysical# "
& ( len( mappings.strArchive ) ? "[#mappings.strArchive#] " : "" )
& ( len( mappings.inspect ) ? "(#mappings.inspect#)" : ""), true );
try {
admin
action="getMappings"
type="web"
password="#request.adminPassword#"
returnVariable="mappings";

loop query="mappings" {
systemOutput("#mappings.virtual# #chr( 9 )# #mappings.strPhysical# "
& ( len( mappings.strArchive ) ? "[#mappings.strArchive#] " : "" )
& ( len( mappings.inspect ) ? "(#mappings.inspect#)" : ""), true );
}

} catch( e ){
systemOutput( e.message, true );
}
systemOutput( "ExpandPath( '/' ) #chr(9)# #ExpandPath( '/' )#" , true );

param name="extensionDir" default="";
if ( len( extensionDir) ){
Expand Down Expand Up @@ -195,6 +204,6 @@
}
]]>
</script>
<echots message="Lucee Stopping"/>
<echots message="Lucee Stopping" />
</target>
</project>
</project>
7 changes: 7 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<property name="preCleanup" value="true"/>
<!-- delete the Lucee working dir afterwards -->
<property name="postCleanup" value="true"/>
<property name="setAdminPassword" value="true"/>
<property name="adminPassword" value="admin"/>

<!-- scripts can be run as an include, or via internalRequest (default) which picks up any Application.cfc -->
<property name="executeScriptByInclude" value=""/>
Expand Down Expand Up @@ -89,6 +91,8 @@
<echo message="executeScriptByInclude: ${executeScriptByInclude}" />
<echo message="luceeCFconfig: ${luceeCFconfig}" />
<echo message="javaDebugger: ${debugger}" />
<echo message="setAdminPassword: ${setAdminPassword}" />
<echo message="adminPassword: ${adminPassword}" />

<echo message="" />
<!-- execute CFML testcases -->
Expand Down Expand Up @@ -121,6 +125,9 @@
<jvmarg value="-Dlucee.extensions=${extensions}"/>
<jvmarg value="-Dlucee.mapping.first=true"/>
<jvmarg value="-Dcompile=${compile}"/>
<jvmarg value="-DsetAdminPassword=${setAdminPassword}"/>
<jvmarg value="-DadminPassword=${adminPassword}"/>

<!--
<jvmarg value="-Dlucee.cli.printExceptions=true"/>
-->
Expand Down
Loading