diff --git a/build.gradle b/build.gradle index 4bfa5d92..66073965 100644 --- a/build.gradle +++ b/build.gradle @@ -82,12 +82,12 @@ task fatJar(type: Jar) { build.dependsOn fatJar def PROJECT_TAG = project.name + '-' + version - def root = '.' def build = root + '/build' def libXtremWeb = root + '/libXtremWeb' def src = root + '/src' def resources = src + '/main/resources' +def conf = resources + '/conf' def benchmark = resources + '/benchmark' def templates = resources + '/templates' def doc = resources + '/doc' @@ -103,7 +103,6 @@ def distBin = dist + '/bin' def distMacInstallers = dist + "/installers/macosx" def privateEtc = '/private/etc' - task copyMiscToDist(type: Copy) { into dist @@ -197,37 +196,57 @@ task copyXwsetversion(type: Copy) { into(distBin + '/db-maintenance') } +// Define custom properties that can be used everywhere +ext.getCustomProperties = { + + def props = new Properties() + // add all properties from conf file + file(conf + "/xwconfigure.values").withInputStream { props.load(it) } + for (String key : props.stringPropertyNames()) { + props.setProperty(key, props.getProperty(key).replace('\'', '')) + } + + // add other custom properties + props.setProperty("ADMINUID", 'uuidgen | tr \"A-Z\" \"a-z\"'.execute().text.trim()) + props.setProperty("WORKERUID", 'uuidgen | tr \"A-Z\" \"a-z\"'.execute().text.trim()) + props.setProperty("VWORKERUID", 'uuidgen | tr \"A-Z\" \"a-z\"'.execute().text.trim()) + props.setProperty("ADMINGROUPUID", 'uuidgen | tr \"A-Z\" \"a-z\"'.execute().text.trim()) + props.setProperty("PUBLICWORKERSGROUPUID", 'uuidgen | tr \"A-Z\" \"a-z\"'.execute().text.trim()) + props.setProperty("XWVERSION", version) + + def path = 'pwd'.execute().text.trim() + def keystore = path + "/build/dist/" + PROJECT_TAG + "/keystore/" + def keystorePrefix = keystore.replace('/', '\\/').replace('.', '\\.') + props.setProperty("SSLKEYSTOREWORKER", keystorePrefix + "xwhepworker\\.keys") + props.setProperty("SSLKEYSTOREVWORKER", keystorePrefix + "xwhepworker\\.keys") + props.setProperty("SSLKEYSTORECLIENT", keystorePrefix + "xwhepclient\\.keys") + + def certname = "cn=" + props.CERTCN + ",o=" + props.CERTO + ",c=" + props.CERTC + if (props.CERTOU != "") { + certname += ",ou=" + props.CERTOU + } + if (props.CERTL != "") { + certname += ",l=" + props.CERTL + } + props.setProperty("CERTNAME", certname) + + return props +} + + task copyKeystoreGenerationScripts(type: Copy) { - into(dist+"/bin") + into(dist + "/bin") into(".") { from(scripts) include('xwhepgenkeys.template') - rename('xwhepgenkeys.template', 'xwhepgenkeys') - include('xwhepupdateopenidcerts.template') - rename('xwhepupdateopenidcerts.template', 'xwhepupdateopenidcerts') - - def props = new Properties() - file(resources+"/conf"+'/xwconfigure.values').withInputStream { - props.load(it) - } + rename { fileName -> fileName.replace('.template', '') } - Set keys = props.stringPropertyNames(); - for (String key : keys) { - props.setProperty(key, props.getProperty(key).replace('\'','')); - } - - def certname = "cn=" + props.CERTCN + ",o=" + props.CERTO + ",c=" + props.CERTC - if (props.CERTOU != "") { - certname += ",ou=" + props.CERTOU - } - if (props.CERTL != "") { - certname += ",l=" + props.CERTL - } - props.setProperty("CERTNAME", certname) + include('xwhepupdateopenidcerts.template') + rename { fileName -> fileName.replace('.template', '') } - filter(ReplaceTokens, tokens: props) + filter(ReplaceTokens, tokens: getCustomProperties()) } } @@ -239,10 +258,10 @@ task cleanKeystoreDir(type: Delete) { task generateKeys(type: Exec) { dependsOn(copyKeystoreGenerationScripts, cleanKeystoreDir) commandLine("sh", "-c", - distBin + '/xwhepgenkeys'+ " && " + - "if [ \$? -eq 0 ] ; then echo \"Keystores generated\" ; else echo \"ERROR: keystores generation error\"; exit 1 ; fi" + " && " + - distBin + '/xwhepupdateopenidcerts'+ " && " + - "if [ \$? -eq 0 ] ; then echo \"OpenID server certificates inserted in XWHEP server keystore\" ; else echo \"ERROR: can't insert OpenID server certificates into XWHEP server keystore\" ; fi" + distBin + '/xwhepgenkeys' + " && " + + "if [ \$? -eq 0 ] ; then echo \"Keystores generated\" ; else echo \"ERROR: keystores generation error\"; exit 1 ; fi" + " && " + + distBin + '/xwhepupdateopenidcerts' + " && " + + "if [ \$? -eq 0 ] ; then echo \"OpenID server certificates inserted in XWHEP server keystore\" ; else echo \"ERROR: can't insert OpenID server certificates into XWHEP server keystore\" ; fi" ) } @@ -258,11 +277,43 @@ task chmodBin(type: Exec) { ) } +task copySQLCreateTables(type: Copy) { + from templates + "/xwhep-core-tables-create-tables.sql.in" + into(dist + "/bin/db-maintenance/") + rename { fileName -> fileName.replace('.in', '') } + filter(ReplaceTokens, tokens: getCustomProperties()) +} + +task copyConfFiles(type: Copy) { + into dist + + // copy values to use in the conf + into("/conf") { + from conf + "/xwconfigure.values" + } + + // copy server conf + into("/conf") { + from templates + "/xtremweb.server.conf.in" + rename { fileName -> fileName.replace('.in', '') } + + from templates + '/xtremweb.worker.conf.in' + rename { fileName -> fileName.replace('.in', '') } + + from templates + '/xtremweb.vworker.conf.in' + rename { fileName -> fileName.replace('.in', '') } + + from(templates + '/xtremweb.client.conf.in') + rename { fileName -> fileName.replace('.in', '') } + + filter(ReplaceTokens, tokens: getCustomProperties()) + } +} task copyWindowsClient(type: Copy) { into dist + "/installers/win32/xwhep.client" - into("/conf"){ + into("/conf") { from templates + '/xtremweb.client.conf.in' rename { fileName -> fileName.replace('.in', '') } filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', @@ -270,11 +321,11 @@ task copyWindowsClient(type: Copy) { PASSWORD : '']) } - into("/lib"){ + into("/lib") { from libXtremWeb + "/bcprov-jdk15on-151.jar" } - into("/lib"){ + into("/lib") { from libXtremWeb + "/bcpkix-jdk15on-151.jar" } } @@ -282,11 +333,11 @@ task copyWindowsClient(type: Copy) { task copyWindowsWorker(type: Copy) { into dist + '/installers/win32/xwhep.worker' - into("."){ + into(".") { from resources + "/installers/win32/innoSetup" } - into("/conf"){ + into("/conf") { from templates + 'xtremweb.worker.conf.in' rename { fileName -> fileName.replace('.in', '') } filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', @@ -298,7 +349,7 @@ task copyWindowsWorker(type: Copy) { from resources + "/wrapper/conf/wrapper-worker.conf" } - into("/misc"){ + into("/misc") { from resources + "/misc/xwwrk.ico" } @@ -310,11 +361,11 @@ task copyWindowsWorker(type: Copy) { from resources + "/wrapper/bin" } - into("/lib"){ + into("/lib") { from installers + "/win32/cygwin1.dll" } - into("/lib"){ + into("/lib") { from resources + "/wrapper/lib/" } } @@ -322,11 +373,11 @@ task copyWindowsWorker(type: Copy) { task copyWindowsVWorker(type: Copy) { into dist + '/installers/win32/xwhep.vworker' - into("."){ + into(".") { from resources + "/installers/win32/innoSetup" } - into("/conf"){ + into("/conf") { from templates + 'xtremweb.worker.conf.in' rename { fileName -> fileName.replace('.in', '') } filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', @@ -338,15 +389,15 @@ task copyWindowsVWorker(type: Copy) { from resources + "/wrapper/conf/wrapper-worker.conf" } - into("/lib"){ + into("/lib") { from installers + "/win32/cygwin1.dll" } - into("/lib"){ + into("/lib") { from resources + "/wrapper/lib/" } - into("/misc"){ + into("/misc") { from resources + "/misc/xwwrk.ico" } @@ -368,7 +419,7 @@ task makeMacDir(type: Exec) { task copyMac(type: Copy) { dependsOn(makeMacDir) into(distMacInstallers) - into("."){ + into(".") { from macInstallers filter(ReplaceTokens, tokens: [XWVERSION : "${version}".toString(), SYSTEMUSER: 'xwhep']) @@ -380,13 +431,13 @@ task copyMacClient(type: Copy) { into(distMacInstallers + '/xwhep.client/installer/PckRoot') - into("/Applications/xwhep.client/conf"){ + into("/Applications/xwhep.client/conf") { from templates + '/xtremweb.client.conf.in' rename { fileName -> fileName.replace('xtremweb.client.conf.in', 'xtremweb.client.conf') } - filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', - KEYDIR : '.', - DEFAULTUSER : '', - DEFAULTPASSWORD : '']) + filter(ReplaceTokens, tokens: [LAUNCHERURL : 'http://nohost/', + KEYDIR : '.', + DEFAULTUSER : '', + DEFAULTPASSWORD: '']) } into("/Applications/xwhep.client/lib") { @@ -401,23 +452,23 @@ task copyMacWorker(type: Copy) { into(distMacInstallers + '/xwhep.worker/installer/PckRoot') - into(privateEtc + "/xwhep.worker/conf"){ + into(privateEtc + "/xwhep.worker/conf") { from templates + '/xtremweb.worker.conf.in' rename { fileName -> fileName.replace('xtremweb.worker.conf.in', 'xtremweb.worker.conf') } - filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', - DATASERVERS : '${data.servers}', - KEYDIR : privateEtc + '/xwhep.worker', - DEFAULTUSER : '${xtremweb.worker.login}', - DEFAULTPASSWORD : '${xtremweb.worker.password}']) + filter(ReplaceTokens, tokens: [LAUNCHERURL : 'http://nohost/', + DATASERVERS : '${data.servers}', + KEYDIR : privateEtc + '/xwhep.worker', + DEFAULTUSER : '${xtremweb.worker.login}', + DEFAULTPASSWORD: '${xtremweb.worker.password}']) } - into(privateEtc + "/xwhep.worker"){ + into(privateEtc + "/xwhep.worker") { from misc include('worker-start.html') rename('worker-start.html', 'index.html') } - into(privateEtc + "/xwhep.worker/conf"){ + into(privateEtc + "/xwhep.worker/conf") { from misc include('xwhep.sb') @@ -428,23 +479,23 @@ task copyMacVworker(type: Copy) { dependsOn(copyMac) into(distMacInstallers + '/xwhep.vworker/installer/PckRoot') - into(privateEtc + "/xwhep.worker/conf"){ + into(privateEtc + "/xwhep.worker/conf") { from templates + '/xtremweb.worker.conf.in' rename { fileName -> fileName.replace('xtremweb.worker.conf.in', 'xtremweb.worker.conf') } - filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', - DATASERVERS : '${data.servers}', - KEYDIR : privateEtc + '/xwhep.worker', - DEFAULTUSER : '${xtremweb.vworker.login}', - DEFAULTPASSWORD : '${xtremweb.vworker.password}']) + filter(ReplaceTokens, tokens: [LAUNCHERURL : 'http://nohost/', + DATASERVERS : '${data.servers}', + KEYDIR : privateEtc + '/xwhep.worker', + DEFAULTUSER : '${xtremweb.vworker.login}', + DEFAULTPASSWORD: '${xtremweb.vworker.password}']) } - into(privateEtc + "/xwhep.worker"){ + into(privateEtc + "/xwhep.worker") { from misc include('worker-start.html') rename('worker-start.html', 'index.html') } - into(privateEtc + "/xwhep.worker/conf"){ + into(privateEtc + "/xwhep.worker/conf") { from misc include('xwhep.sb') } @@ -454,13 +505,13 @@ task copyMacServer(type: Copy) { dependsOn(copyMac) into(distMacInstallers + '/xwhep.server/installer/PckRoot') - into("/Applications/xwhep.server/conf"){ + into("/Applications/xwhep.server/conf") { from templates + '/xtremweb.server.conf.in' rename { fileName -> fileName.replace('xtremweb.server.conf.in', 'xtremweb.server.conf') } - filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', - KEYDIR : privateEtc + '/xwhep.server', - DEFAULTUSER : '', - DEFAULTPASSWORD : '']) + filter(ReplaceTokens, tokens: [LAUNCHERURL : 'http://nohost/', + KEYDIR : privateEtc + '/xwhep.server', + DEFAULTUSER : '', + DEFAULTPASSWORD: '']) } into('/Applications/xwhep.server/doc') { @@ -483,53 +534,9 @@ task copyLinuxInstallers(type: Copy) { SYSTEMUSER: 'xwhep']) } -task copyLinux(type: Copy) { - dependsOn(copyLinuxInstallers) - - into dist - - into("/conf") { - from misc + "/xwconfigure.values" - } - - - into("/conf") { - from templates + '/xtremweb.server.conf.in' - rename { fileName -> fileName.replace('.in', '') } - } - - into("/conf") { - from templates + '/xtremweb.client.conf.in' - rename { fileName -> fileName.replace('.in', '.template') } - } - - into("/conf") { - from(templates + '/xtremweb.client.conf.in') - rename { fileName -> fileName.replace('.in', '') } - filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/']) - } - - into("/conf") { - from templates + '/xtremweb.worker.conf.in' - rename { fileName -> fileName.replace('.in', '') } - filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', - LOGIN : '${xtremweb.worker.login}', - PASSWORD : '${xtremweb.worker.password}']) - } - - into("/conf"){ - from templates + '/xtremweb.worker.conf.in' - rename { fileName -> fileName.replace('xtremweb.worker.conf.in', 'xtremweb.vworker.conf') } - filter(ReplaceTokens, tokens: [LAUNCHERURL: 'http://nohost/', - LOGIN : '${xtremweb.vworker.login}', - PASSWORD : '${xtremweb.vworker.password}']) - } -} - - - task buildAll { - dependsOn(chmodBin, copyWindowsClient, copyWindowsWorker, copyWindowsVWorker, copyMacClient, copyMacWorker, copyMacVworker, copyMacServer, copyLinux) + dependsOn(chmodBin, copyWindowsClient, copyWindowsWorker, copyWindowsVWorker, copyMacClient, copyMacWorker, + copyMacVworker, copyMacServer, copyLinuxInstallers, copySQLCreateTables, copyConfFiles) } buildAll.dependsOn getTasksByName('build', true) diff --git a/src/main/resources/conf/xwconfigure.values b/src/main/resources/conf/xwconfigure.values index fec20a62..8aa9ebfc 100644 --- a/src/main/resources/conf/xwconfigure.values +++ b/src/main/resources/conf/xwconfigure.values @@ -4,6 +4,10 @@ DBENGINE='InnoDB' DBHOST='localhost' DBADMINLOGIN='root' DBADMINPASSWORD='root' +DBWORKERLOGIN='worker' +DBWORKERPASSWORD='workerp' +DBVWORKERLOGIN='vworker' +DBVWORKERPASSWORD='vworkerp' DBNAME='xtremweb11' DBUSERLOGIN='xwuser' DBUSERPASSWORD='xwuserp' diff --git a/src/main/resources/scripts/xwconfigure b/src/main/resources/scripts/xwconfigure index 71321349..d2ef9777 100755 --- a/src/main/resources/scripts/xwconfigure +++ b/src/main/resources/scripts/xwconfigure @@ -1123,74 +1123,6 @@ TMPFILE2=`date "+%Y%m%d_%H%M%S"`".xwtmp2" # # Preparing the SQL script to install MySQL database, with lowercase UUIDs # -XWADMINGROUPUID=` uuidgen | tr "A-Z" "a-z"` -XWWORKERGROUPUID=`uuidgen | tr "A-Z" "a-z"` -XWADMINUID=` uuidgen | tr "A-Z" "a-z"` -XWWORKERUID=` uuidgen | tr "A-Z" "a-z"` -XWVWORKERUID=` uuidgen | tr "A-Z" "a-z"` - -rm -f $TMPFILE1 -rm -f $TMPFILE2 -rm -f $XWSETUPDBSQL -printf "Preparing database script" -cat $XWSETUPDBSQLIN | sed "s/@DBNAME@/$DBNAME/g" > $TMPFILE1 -cat $TMPFILE1 | sed "s/@DBUSER@/$DBUSERLOGIN/g" > $TMPFILE2 -rm -f $TMPFILE1 -printf "." -cat $TMPFILE2 | sed "s/@DBUSERPASSWORD@/$DBUSERPASSWORD/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." -cat $TMPFILE1 | sed "s/@ADMINGROUPUID@/$XWADMINGROUPUID/g" > $TMPFILE2 -rm -f $TMPFILE1 -printf "." -cat $TMPFILE2 | sed "s/@PUBLICWORKERSGROUPUID@/$XWWORKERGROUPUID/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." -cat $TMPFILE1 | sed "s/@ADMINUID@/$XWADMINUID/g" > $TMPFILE2 -rm -f $TMPFILE1 -printf "." -cat $TMPFILE2 | sed "s/@WORKERUID@/$XWWORKERUID/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." -cat $TMPFILE1 | sed "s/@DBADMIN@/$XWADMINLOGIN/g" > $TMPFILE2 -rm -f $TMPFILE1 -printf "." -cat $TMPFILE2 | sed "s/@DBADMINPASSWORD@/$XWADMINPASSWORD/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." -cat $TMPFILE1 | sed "s/@DBWORKER@/$XWWORKERLOGIN/g" > $TMPFILE2 -rm -f $TMPFILE1 -printf "." -cat $TMPFILE2 | sed "s/@DBWORKERPASSWORD@/$XWWORKERPASSWORD/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." -SEDVAR=`echo "$DBHOST" | sed -f $SEDCMDS` -cat $TMPFILE1 | sed 's/@XWHOST@/$SEDVAR/g' > $TMPFILE2 -rm -f $TMPFILE1 -printf "." -cat $TMPFILE2 | sed "s/@DBENGINE@/$DBENGINE/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." - -if [ -z "$DBADMINLOGIN" ] ; then - cat $TMPFILE1 | sed -e "s/^GRANT.*//g" | sed -e "s/^set password for.*//g" > $TMPFILE2 - rm -f $TMPFILE1 -else - mv $TMPFILE1 $TMPFILE2 -fi - -cat $TMPFILE2 | sed "s/@VWORKERUID@/$XWVWORKERUID/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." -cat $TMPFILE1 | sed "s/@DBVWORKER@/$XWVWORKERLOGIN/g" > $TMPFILE2 -rm -f $TMPFILE1 -printf "." -cat $TMPFILE2 | sed "s/@DBVWORKERPASSWORD@/$XWVWORKERPASSWORD/g" > $TMPFILE1 -rm -f $TMPFILE2 -printf "." - -mv $TMPFILE1 $XWSETUPDBSQL -echo "Done" if [ "$DBVENDOR" = "mysql" ] ; then @@ -1437,268 +1369,9 @@ echo "Done" # Preparing the server configuration file # rm -f $TMPFILE1 -rm -f $TMPFILE2 +rm -f $TMPFILE printf "Preparing server configuration file '$XWSERVERCONFFILE'" -SEDVAR=`echo "$DBHOST" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DBHOST[[:space:]]*=.*" $XWSERVERCONFFILE > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $XWSERVERCONFFILE | sed "s/^[[:space:]]*DBHOST[[:space:]]*=.*/DBHOST=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*DBHOST[[:space:]]*=.*" $XWSERVERCONFFILE > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $XWSERVERCONFFILE | sed "s/^[[:space:]]*#.*DBHOST[[:space:]]*=.*/DBHOST=$SEDVAR/g" > $TMPFILE2 - else - cp -f $XWSERVERCONFFILE $TMPFILE2 - echo "DBHOST=$SEDVAR" >> $TMPFILE2 - fi -fi -printf "." - -SEDVAR=`echo "$XWUPGRADEURL" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*LAUNCHERURL[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*LAUNCHERURL[[:space:]]*=.*/LAUNCHERURL=$SEDVAR/g" > $TMPFILE1 -else - cp -f $TMPFILE2 $TMPFILE1 - echo "LAUNCHERURL=$SEDVAR" >> $TMPFILE1 -fi -printf "." - - -SEDVAR=`echo "$DBVENDOR" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DBVENDOR[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*DBVENDOR[[:space:]]*=.*/DBVENDOR=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*DBVENDOR[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*DBVENDOR[[:space:]]*=.*/DBVENDOR=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "DBVENDOR=$SEDVAR" >> $TMPFILE2 - fi -fi -printf "." -SEDVAR=`echo "$DBENGINE" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DBENGINE[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*DBENGINE[[:space:]]*=.*/DBENGINE=$SEDVAR/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*DBENGINE[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*DBENGINE[[:space:]]*=.*/DBENGINE=$SEDVAR/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "DBENGINE=$SEDVAR" >> $TMPFILE1 - fi -fi -printf "." -SEDVAR=`echo "$DBNAME" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DBNAME[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*DBNAME[[:space:]]*=.*/DBNAME=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*DBNAME[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*DBNAME[[:space:]]*=.*/DBNAME=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "DBNAME=$SEDVAR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -printf "." -SEDVAR=`echo "$DBUSERLOGIN" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DBUSER[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*DBUSER[[:space:]]*=.*/DBUSER=$SEDVAR/g" > $TMPFILE1 -else - grep -E "^^[[:space:]]*#.*DBUSER[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*DBUSER[[:space:]]*=.*/DBUSER=$SEDVAR/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "DBUSER=$SEDVAR" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 -printf "." -SEDVAR=`echo "$DBUSERPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DBPASS[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*DBPASS[[:space:]]*=.*/DBPASS=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*DBPASS[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*DBPASS[[:space:]]*=.*/DBPASS=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "DBPASS=$SEDVAR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -printf "." -SEDVAR=`echo "$XWADMINLOGIN" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*ADMINLOGIN[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*ADMINLOGIN[[:space:]]*=.*/ADMINLOGIN=$SEDVAR/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*ADMINLOGIN[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*ADMINLOGIN[[:space:]]*=.*/ADMINLOGIN=$SEDVAR/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "ADMINLOGIN=$SEDVAR" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 -printf "." -SEDVAR=`echo "$XWADMINPASSWORD" | sed -f $SEDCMDS` -grep -e "^[[:space:]]*ADMINPASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*ADMINPASSWORD[[:space:]]*=.*/ADMINPASSWORD=$SEDVAR/g" > $TMPFILE2 -else - grep -e "^[[:space:]]*#.*ADMINPASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*ADMINPASSWORD[[:space:]]*=.*/ADMINPASSWORD=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "ADMINPASSWORD=$SEDVAR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -printf "." -SEDVAR=`echo "$XWWORKERLOGIN" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*WORKERLOGIN[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*WORKERLOGIN[[:space:]]*=.*/WORKERLOGIN=$SEDVAR/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*WORKERLOGIN[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*WORKERLOGIN[[:space:]]*=.*/WORKERLOGIN=$SEDVAR/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "WORKERLOGIN=$SEDVAR" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 -printf "." -SEDVAR=`echo "$XWWORKERPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*WORKERPASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*WORKERPASSWORD[[:space:]]*=.*/WORKERPASSWORD=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*WORKERPASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*WORKERPASSWORD[[:space:]]*=.*/WORKERPASSWORD=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "WORKERPASSWORD=$SEDVAR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -printf "." -if [ "$DBVENDOR" = "mysql" ] ; then - XWWORKERUID=`mysql $MYSQLOPTS "$DBNAME" -e "select uid from users where login='$XWWORKERLOGIN'" | tail -1` -fi -SEDVAR=`echo "$XWWORKERUID" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*WORKERUID[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*WORKERUID[[:space:]]*=.*/WORKERUID=$SEDVAR/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*WORKERUID[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*WORKERUID[[:space:]]*=.*/WORKERUID=$SEDVAR/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "WORKERUID=$SEDVAR" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 -printf "." - -if [ "$DBVENDOR" = "mysql" ] ; then - XWADMINUID=`mysql $MYSQLOPTS "$DBNAME" -e "select uid from users where login='$XWADMINLOGIN'" | tail -1` -fi -SEDVAR=`echo "$XWADMINUID" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*ADMINUID[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*ADMINUID[[:space:]]*=.*/ADMINUID=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*ADMINUID[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*ADMINUID[[:space:]]*=.*/ADMINUID=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "ADMINUID=$SEDVAR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -printf "." -#mv $TMPFILE1 $TMPFILE2 -SAFE_SSLKEYPASSPHRASE=`echo "$SSLKEYPASSPHRASE" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKEYPASSPHRASE[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*SSLKEYPASSPHRASE[[:space:]]*=.*/SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*SSLKEYPASSPHRASE[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*SSLKEYPASSPHRASE[[:space:]]*=.*/SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 - -printf "." -SAFE_X509CERTDIR=`echo "$X509CERTDIR" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*X509CERTDIR[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*X509CERTDIR[[:space:]]*=.*/X509CERTDIR=$SAFE_X509CERTDIR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*X509CERTDIR[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*X509CERTDIR[[:space:]]*=.*/X509CERTDIR=$SAFE_X509CERTDIR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "X509CERTDIR=$SAFE_X509CERTDIR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 - -printf "." -SAFE_USERCERTDIR=`echo "$USERCERTDIR" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*USERCERTDIR[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*USERCERTDIR[[:space:]]*=.*/USERCERTDIR=$SAFE_USERCERTDIR/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*USERCERTDIR[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*USERCERTDIR[[:space:]]*=.*/USERCERTDIR=$SAFE_USERCERTDIR/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "USERCERTDIR=$SAFE_USERCERTDIR" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 - -printf "." -SAFE_SSLKEYPASSWORD=`echo "$SSLKEYSERVERPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKEYPASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*SSLKEYPASSWORD[[:space:]]*=.*/SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD/g" > $XWSERVERCONFFILE -else - grep -E "^[[:space:]]*#.*SSLKEYPASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*SSLKEYPASSWORD[[:space:]]*=.*/SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD/g" > $XWSERVERCONFFILE - else - cp -f $TMPFILE1 $XWSERVERCONFFILE - echo "SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSWORD" >> $XWSERVERCONFFILE - fi -fi -rm -f $TMPFILE1 printf "." : ' cptodir="$INSTALLERSDIR/macosx/xwhep.server/installer/PckRoot/Applications/xwhep.server" @@ -1770,87 +1443,7 @@ echo "Done" rm -f $TMPFILE1 rm -f $TMPFILE2 printf "Preparing worker configuration file '$XWWORKERCONFFILE'" -SEDVAR=`echo "$XWUPGRADEURL" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*LAUNCHERURL[[:space:]]*=.*" $XWWORKERCONFFILE > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $XWWORKERCONFFILE | sed "s/^[[:space:]]*LAUNCHERURL[[:space:]]*=.*/LAUNCHERURL=$SEDVAR/g" > $TMPFILE1 -else - cp -f $XWWORKERCONFFILE $TMPFILE1 - echo "LAUNCHERURL=$SEDVAR" >> $TMPFILE1 -fi -printf "." -# -# The worker has a single pass for both key passphrase and keystore password -# -SAFE_SSLKEYPASSPHRASE=`echo "$SSLKEYWORKERPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKEYPASSPHRASE[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*SSLKEYPASSPHRASE[[:space:]]*=.*/SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*SSLKEYPASSPHRASE[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*SSLKEYPASSPHRASE[[:space:]]*=.*/SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -SAFE_SSLKEYPASSWORD=`echo "$SSLKEYWORKERPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKEYPASSWORD[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*SSLKEYPASSWORD[[:space:]]*=.*/SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*SSLKEYPASSWORD[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*SSLKEYPASSWORD[[:space:]]*=.*/SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 - -SEDVAR=`echo "$XWSERVER" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DISPATCHERS[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*DISPATCHERS[[:space:]]*=.*/DISPATCHERS=$SEDVAR/g" > $TMPFILE2 -else - cp -f $TMPFILE1 $TMPFILE2 - echo "DISPATCHERS=$SEDVAR" >> $TMPFILE2 -fi -rm -f $TMPFILE1 -printf "." -SEDVAR=`echo "$XWWORKERLOGIN" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*LOGIN[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*LOGIN[[:space:]]*=.*/LOGIN=$SEDVAR/g" > $TMPFILE1 -else - cp -f $TMPFILE2 $TMPFILE1 - echo "LOGIN=$SEDVAR" >> $TMPFILE1 -fi -rm -f $TMPFILE2 -printf "." -SEDVAR=`echo "$XWWORKERPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*PASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*PASSWORD[[:space:]]*=.*/PASSWORD=$SEDVAR/g" > $TMPFILE2 -else - cp -f $TMPFILE1 $TMPFILE2 - echo "PASSWORD=$SEDVAR" >> $TMPFILE2 -fi -rm -f $TMPFILE1 -printf "." -SEDVAR=`echo "$XWWORKERKEYSTOREFILE" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKeyStore[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*SSLKeyStore[[:space:]]*=.*/SSLKeyStore=$SEDVAR/g" > $XWWORKERCONFFILE -else - cp -f $TMPFILE2 $XWWORKERCONFFILE - echo "SSLKeyStore=$SEDVAR" >> $XWWORKERCONFFILE -fi -rm -f $TMPFILE2 echo " Done" # @@ -1859,35 +1452,9 @@ echo " Done" rm -f $TMPFILE1 rm -f $TMPFILE2 printf "Preparing vworker configuration file '$XWVWORKERCONFFILE'" -cp -f $XWWORKERCONFFILE $XWVWORKERCONFFILE -if [ $? -ne 0 ] ; then - echo "Can't cp -f $XWWORKERCONFFILE $XWVWORKERCONFFILE" - exit 1 -fi -printf "." -SEDVAR=`echo "$XWVWORKERLOGIN" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*LOGIN[[:space:]]*=.*" $XWVWORKERCONFFILE > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $XWVWORKERCONFFILE | sed "s/^[[:space:]]*LOGIN[[:space:]]*=.*/LOGIN=$SEDVAR/g" > $TMPFILE1 -else - cp -f $XWVWORKERCONFFILE $TMPFILE1 - echo "LOGIN=$SEDVAR" >> $TMPFILE1 -fi -rm -f $TMPFILE2 -printf "." -SEDVAR=`echo "$XWVWORKERPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*PASSWORD[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*PASSWORD[[:space:]]*=.*/PASSWORD=$SEDVAR/g" > $XWVWORKERCONFFILE -else - cp -f $TMPFILE1 $XWVWORKERCONFFILE - echo "PASSWORD=$SEDVAR" >> $XWVWORKERCONFFILE -fi echo "Done" - - # # Preparing worker conf file for macosx packages # @@ -2035,115 +1602,6 @@ END printf "Preparing client configuration file '$XWCLIENTCONFFILE'" rm -f $TMPFILE1 rm -f $TMPFILE2 -SEDVAR=`echo "$XWUPGRADEURL" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*LAUNCHERURL[[:space:]]*=.*" $XWCLIENTCONFTEMPLATEFILE > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $XWCLIENTCONFTEMPLATEFILE | sed "s/^[[:space:]]*LAUNCHERURL[[:space:]]*=.*/LAUNCHERURL=$SEDVAR/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*LAUNCHERURL[[:space:]]*=.*" $XWCLIENTCONFTEMPLATEFILE > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $XWCLIENTCONFTEMPLATEFILE | sed "s/^[[:space:]]*#.*LAUNCHERURL[[:space:]]*=.*/LAUNCHERURL=$SEDVAR/g" > $TMPFILE1 - else - cp -f $XWCLIENTCONFTEMPLATEFILE $TMPFILE1 - echo "LAUNCHERURL=$SEDVAR" >> $TMPFILE1 - fi -fi -printf "." -SEDVAR=`echo "$XWSERVER" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*DISPATCHERS[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*DISPATCHERS[[:space:]]*=.*/DISPATCHERS=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*DISPATCHERS[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*DISPATCHERS[[:space:]]*=.*/DISPATCHERS=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "DISPATCHERS=$SEDVAR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -printf "." -SEDVAR=`echo "$XWCLIENTKEYSTOREFILE" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKeyStore[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*SSLKeyStore[[:space:]]*=.*/SSLKeyStore=$SEDVAR/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*SSLKeyStore[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*SSLKeyStore[[:space:]]*=.*/SSLKeyStore=$SEDVAR/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "SSLKeyStore=$SEDVAR" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 - -# -# The client has a single pass for both key passphrase and keystore password -# -SAFE_SSLKEYPASSPHRASE=`echo "$SSLKEYCLIENTPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKEYPASSPHRASE[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*SSLKEYPASSPHRASE[[:space:]]*=.*/SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*SSLKEYPASSPHRASE[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*SSLKEYPASSPHRASE[[:space:]]*=.*/SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "SSLKEYPASSPHRASE=$SAFE_SSLKEYPASSPHRASE" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 -SAFE_SSLKEYPASSWORD=`echo "$SSLKEYCLIENTPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*SSLKEYPASSWORD[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*SSLKEYPASSWORD[[:space:]]*=.*/SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD/g" > $TMPFILE1 -else - grep -E "^[[:space:]]*#.*SSLKEYPASSWORD[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*SSLKEYPASSWORD[[:space:]]*=.*/SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD/g" > $TMPFILE1 - else - cp -f $TMPFILE2 $TMPFILE1 - echo "SSLKEYPASSWORD=$SAFE_SSLKEYPASSWORD" >> $TMPFILE1 - fi -fi -rm -f $TMPFILE2 - -cp $TMPFILE1 $XWCLIENTCONFTEMPLATEFILE - -SEDVAR=`echo "$XWADMINLOGIN" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*LOGIN[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*LOGIN[[:space:]]*=.*/LOGIN=$SEDVAR/g" > $TMPFILE2 -else - grep -E "^[[:space:]]*#.*LOGIN[[:space:]]*=.*" $TMPFILE1 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE1 | sed "s/^[[:space:]]*#.*LOGIN[[:space:]]*=.*/LOGIN=$SEDVAR/g" > $TMPFILE2 - else - cp -f $TMPFILE1 $TMPFILE2 - echo "LOGIN=$SEDVAR" >> $TMPFILE2 - fi -fi -rm -f $TMPFILE1 - -printf "." - -SEDVAR=`echo "$XWADMINPASSWORD" | sed -f $SEDCMDS` -grep -E "^[[:space:]]*PASSWORD[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 -if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*PASSWORD[[:space:]]*=.*/PASSWORD=$SEDVAR/g" > $XWCLIENTCONFFILE -else - grep -E "^[[:space:]]*#.*PASSWORD[[:space:]]*=.*" $TMPFILE2 > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - cat $TMPFILE2 | sed "s/^[[:space:]]*#.*PASSWORD[[:space:]]*=.*/PASSWORD=$SEDVAR/g" > $XWCLIENTCONFFILE - else - cp -f $TMPFILE2 $XWCLIENTCONFFILE - echo "PASSWORD=$SEDVAR" >> $XWCLIENTCONFFILE - fi -fi -rm -f $TMPFILE2 echo "Done" diff --git a/src/main/resources/templates/xtremweb.client.conf.in b/src/main/resources/templates/xtremweb.client.conf.in index 452cf923..55cccab1 100644 --- a/src/main/resources/templates/xtremweb.client.conf.in +++ b/src/main/resources/templates/xtremweb.client.conf.in @@ -43,11 +43,11 @@ ROLE=client # Next defines URL where launcher can find XtremWeb binary -LAUNCHERURL=@LAUNCHERURL@ +LAUNCHERURL=@XWUPGRADEURL@ ####### XtremWeb dispatcher # There put the location of the root XtremWeb server -DISPATCHERS=@DISPATCHERS@ +DISPATCHERS=@XWSERVER@ # Next line shows how to set several servers (names must be delimited by space or tabulation) #DISPATCHERS=host1 host2 host 3 @@ -115,8 +115,8 @@ DISPATCHERS=@DISPATCHERS@ #MANDATINGLOGIN= # Login and password to connect to the server (required) -LOGIN=@DEFAULTUSER@ -PASSWORD=@DEFAULTPASSWORD@ +LOGIN=@XWADMINLOGIN@ +PASSWORD=@XWADMINPASSWORD@ # next defines whether to use NIO # default value : true @@ -323,6 +323,10 @@ SSLKEYSTORE=../keystore/xwhepclient.keys # ERROR LOGGERLEVEL=INFO +SSLKEYPASSPHRASE=@SSLKEYCLIENTPASSWORD@ +SSLKEYPASSWORD=@SSLKEYCLIENTPASSWORD@ +SSLKeyStore=@SSLKEYSTORECLIENT@ + ##### ##### End of File ##### diff --git a/src/main/resources/templates/xtremweb.server.conf.in b/src/main/resources/templates/xtremweb.server.conf.in index 03c978fe..78f884eb 100644 --- a/src/main/resources/templates/xtremweb.server.conf.in +++ b/src/main/resources/templates/xtremweb.server.conf.in @@ -54,12 +54,12 @@ ROLE=server # ENGINE=mem is not to be used in production... # -DBVENDOR= @DBVENDOR@ -DBENGINE= @DBENGINE@ -DBHOST= @DBHOST@ -DBNAME= @DBNAME@ -DBUSER= @DBUSER@ -DBPASS= @DBPASSWORD@ +DBVENDOR=@DBVENDOR@ +DBENGINE=@DBENGINE@ +DBHOST=@DBHOST@ +DBNAME=@DBNAME@ +DBUSER=@DBUSERLOGIN@ +DBPASS=@DBUSERPASSWORD@ # # XWdbRequestLimit defines the max rows amount a single SQL request may return @@ -280,16 +280,16 @@ GOOGLEAUTHURI="https://www.googleapis.com/oauth2/v3/userinfo" # Next define admin login # This is used to insert services at run time # This is also used to create hdsldb:mem database, if applicable -ADMINLOGIN=@DEFAULTUSER@ -ADMINPASSWORD=@DEFAULTPASSWORD@ -ADMINUID= +ADMINLOGIN=@XWADMINLOGIN@ +ADMINPASSWORD=@XWADMINPASSWORD@ +ADMINUID=@ADMINUID@ # # Next define worker login # This is used to create hdsldb:mem DB database, if applicable -WORKERLOGIN=@DEFAULTUSER@ -WORKERPASSWORD=@DEFAULTPASSWORD@ -WORKERUID= +WORKERLOGIN=@XWWORKERLOGIN@ +WORKERPASSWORD=@XWWORKERPASSWORD@ +WORKERUID=@WORKERUID@ # Next line shows how to set several servers (names must be delimited by space or tabulation # This is needed for replication @@ -392,9 +392,9 @@ HOMEDIR= /var/xwhep/server SSLKEYSTORE= ../keystore/xwhepserver.keys #If you change the following remember to regenerate the keys -SSLKEYPASSPHRASE= @KEYPASSPHRASE@ +SSLKEYPASSPHRASE=@SSLKEYPASSPHRASE@ #If you change the following remember to regenerate the keys -SSLKEYPASSWORD= @KEYSERVERPASSWORD@ +SSLKEYPASSWORD=@SSLKEYSERVERPASSWORD@ # Server : the directory containing user public keys
# Property name : USERCERTDIR @@ -404,7 +404,7 @@ SSLKEYPASSWORD= @KEYSERVERPASSWORD@ # they are not correctly interpreted # Deprecated : we don't allow self signed certificates # -#USERCERTDIR=/opt/blabla +USERCERTDIR= # Next contains the directory where CA certificates (public keys) key are stored. # These CA certificates are used to create certificate paths @@ -414,7 +414,7 @@ SSLKEYPASSWORD= @KEYSERVERPASSWORD@ # You may want to check jLite by Oleg Sukhoroslov : http://code.google.com/p/jlite/ # Note : please use full path; don't use ~ or any variable (e.g. $HOME) # they are not correctly interpreted -#X509CERTDIR=/opt/jlite/etc/certs/ca +X509CERTDIR=@X509CERTDIR@ # Next defines server keystore URI # When to use : before your server keys exprire @@ -578,7 +578,7 @@ SSLKEYPASSWORD= @KEYSERVERPASSWORD@ # To force server start, comment or remove this variable # Default : n/a # Since : 8.2.0 -LAUNCHERURL=@LAUNCHERURL@ +LAUNCHERURL=@XWUPGRADEURL@ # diff --git a/src/main/resources/templates/xtremweb.vworker.conf.in b/src/main/resources/templates/xtremweb.vworker.conf.in new file mode 100644 index 00000000..3c132108 --- /dev/null +++ b/src/main/resources/templates/xtremweb.vworker.conf.in @@ -0,0 +1,663 @@ +# +# Copyrights : CNRS +# Author : Oleg Lodygensky +# Acknowledgment : XtremWeb-HEP is based on XtremWeb 1.8.0 by inria : http://www.xtremweb.net/ +# Web : http://www.xtremweb-hep.org +# +# This file is part of XtremWeb-HEP. +# +# XtremWeb-HEP is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# XtremWeb-HEP is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with XtremWeb-HEP. If not, see . +# +# + + +# +# Sept 16th, 2014 +# Variable names must be in uppercase (it works in lowercase, but may introduce +# some missbehaviour under certain circumstances) +# The script "xtremwebconf.sh" uses perl to force upper cases; +# but it may happen that perl is not installed... +# + +# Simple Host Configuration File + +# Next defines the role as worker +# This is used by the launcher +ROLE=worker + +# Next is used for group worker only +# A group worker is worker connecting with WORKER_USER user rights +# which identity is defined in a user group +# Such a worker can then not only compute public applications, but also +# its own group ones +# Next variable may contains the worker group label (and its group only) +# this tells that the worker does not accept public jobs, but its own group ones only +# (if this is empty or not defined, group worker accept public jobs too) +#PROJECT= + +# Next defines URL where launcher can find XtremWeb binary +# Default : n/a +LAUNCHERURL=@XWUPGRADEURL@ + +####### XtremWeb dispatcher +# There put the location of the root XtremWeb server +DISPATCHERS=@XWSERVER@ +# Next line shows how to set several servers (names must be delimited by space or tabulation) +#DISPATCHERS=host1 host2 host 3 + +####### Data servers +# There put the location of the data sever +# Default is XtremWeb dispatchers +#DATASERVERS=@DATASERVERS@ +# Next line shows how to set several servers (names must be delimited by space or tabulation) +#DATASERVERS=host1 host2 host 3 + +# next is TCP port +# default value : 4321 +## TCPPORT=4321 + +# next is ssl TCP port +# default value : 4322 +## TCPSPORT=4322 + +# next is UDP port +# DEFAULT VALUE = 4323 +## UDPPORT=4323 + +# next is the worker HTTP port +# the worker may listen (See server.http property) to display its status +# default value : 4324 +## HTTPWORKERPORT=4324 + +# next is the server HTTP port +# default value : 80 +## HTTPPORT=80 + +# next is server HTTPS port +# default value : 443 +## HTTPSPORT=443 + +# next is XML RPC port listened by the client shell +# default value : 4327 +## XMLRPCPORT=4327 + +# next is Sun RPC port +# default value : 4328 +## SUNRPCPORT=4328 + +# next is proxy port +# default value : -1 (means don't used) +## PROXYPORT=-1 + +# +# This is the proxy resolved name +# default : null +# Since 7.3.0 +#PROXYSERVER= + + +# +# Internode communications needs a running SmartSockets hub; this may also denote a hub network
+# Property name : "smartsocketshubaddr"
+# Property type : string
+# Default value : null +# @since 8.3.2 +# +#SMARTSOCKETSHUBADDR= + +# +# This tells if this host accepts to run job that listen for incoming connections +# Property name : "incomingconnections" +# Property type : boolean +# Default value : false +# @since 8.0.0 +# +INCOMINGCONNECTIONS=true + +# +# This contains the max amount of entries in local cache +# Default : 10000 +#cachesize + +# Login and password to connect to the server (required) +LOGIN=@XWVWORKERLOGIN@ +PASSWORD=@XWVWORKERPASSWORD@ + +# +# Following are two ACL variables +# They must contains regular expression (regexp) +# +# Regexp examples +# - accept all incoming connection : .* +# - accept incoming connection from '168.192.*.*' : 168\.192\..* +# - accept incoming connection from '*.in2P3.fr' : .*\.in2p3\.fr +# - reject incoming connection from '168.192.*.*' : -168\.192\..* +# - reject incoming connection from '*.in2P3.fr' : -.*\.in2p3\.fr +# +# Communication Access Control List (ACL) +# By default you can only access the server from localhost. +# This may contains several comma separated regexp +# Example +# SERVERCOMMACL=.* + +# +# ACL to server status and administration +# XWHEP parts accept incoming connection to display their status and allow +# some configuration modification +# By default you can only access the server from localhost. +# This may contains several comma separated regexp +# Example +# SERVERSTATACL=168\.192\..* + + +# next defines whether to use NIO +# default value : true +# this is forced to false, if using HTTPClient +## JAVANIO=true + + +##### +# How many jobs a worker may compute simultaneously +# default is the number of detected CPUs, automatically set at runtime +# minimum is 1 +# WORKPOOLSIZE=-1 +##### + + +# +# This starts or not the http server +# This HTTP server is intended to configure the worker on the fly +# So that any volunteer PC owner can interact with its worker +# Default is true +# +#STARTSERVERHTTP=false + +##### Name of the class to use as an activator (default is AlwaysActive) +# The activator controls which ressources can be used at a given time +# currently, only the CPU is handled +# + +# This activator turns the worker always on (the worker always computes) +## ACTIVATORCLASS=xtremweb.worker.AlwaysActive + +# use this activator if you want XtremWeb to monitor +# mouse and keyboard activity to know if it can start a computation +# (currently only supperted under Linux) +## ACTIVATORDELAY=20 + +# Duration in minutes before launching a computation when no +# keyboard or mouse activity was detected +## ACTIVATORCLASS=xtremweb.worker.TCPActivator + +# simple shell to set the activity mask. The activity +# mask determine which activity are allowed, see source code +# of xtremweb.worker.activator for more details. +# For example, TCPActivator can be used with netcat to easily control +# the worker from a shell script. +# something like +# % echo 0 | nc -q 0 localhost 10000 +# will stop computation, while +# % echo 1 | nc -q localhost 10000 +# will start the computaion if some jobs are available + + +# +# NOTE -- * Decembre 2005 * +# NOTE -- ********************************** +# NOTE -- * * +# NOTE -- * CPUACTIVATOR * +# NOTE -- * * +# NOTE -- * has been disabled * +# NOTE -- * due to bugs :( * +# NOTE -- ********************************** +# +# OS : linux this is automatically replaced by xtremweb.worker.AlwaysActive +# (under Linux, the provided startup scripts nice processes to 10) +# OS : win32 this is automatically replaced by xtremweb.worker.WinSaverActivator +# OS : Mac OS X this is automatically replaced by xtremweb.worker.DateActivator +# +#ACTIVATORCLASS=xtremweb.worker.CpuActivator + +# +# cpuLoad aims to determine computation time accordingly to the machine CPU loads. +# It is only used with the CpuActivator activator +# +# Here's how it works : +# If more than cpuLoad is requiered by the host for any job but the XW xorker, +# the worker stops computing. +# This test must be true for up to 1.5s so that the worker stops computing +# only if the CPU seems "seriously" required by its owner +# +# Default is 50 +# +#CPULOAD=50 + +# +# computing.jobs tells how many jobs a worker should computing and die +# +# Default is -1 : the worker will never dy +# +#COMPUTINGJOBS=-1 + +# +# This timeout value has a different meaning for worker and for client +# +# Worker +# ------ +# This is the timeout to wait between to work requests in milliseconds +# This timeout is multiplicated by 2 between two unsuccessfull requests (work +# request returned no job) up to 4 times so that the maximum delay between +# to requests is (4 * timeout) +# Setting less than 10 is a very special case: the worker then does not +# write all files to disk. Hence if it crashes, it will not be able to +# recover all informations +# +# Client +# ------ +# This is the time to wait for a each job to complete +# +# ----------------------- +# This is in milliseconds +# Default is 15000 +# +#TIMEOUT=15000 + +# +# This is the socket timeout +# This is in milliseconds +# Default is 60000 +# Setting it to zero means wait for ever; it is at your own risk, keep in mind that Zero may block the worker for ever +# +#SOTIMEOUT=0 + +# +# This defines how many times we keep trying on socket timeout +# Default is 50 +# This is forced to default value, if < 1 +# +#SORETRIES=1 + +# +# This is the max timeout to wait for a job; after this timeout the worker dies. +# This is expecially usefull to deploy workers over Grids, so that we don't use +# a machine for nothing. +# A VALUE <= 0 means wait forever +# +# This is in seconds +# Default is -1 +# +#NOOPTIMEOUT=-1 + +# +# This contains class names to get time stamps for +# Note : substrings are allowed +# (*) "SimpleScheduler" matches "SimpleScheduler" only +# but "Scheduler" matches "SimpleScheduler", "MatchingScheduler" etc. +# (*) "CommHandler" matches "CommHandler" only +# but "Handler" matches "TCPHandler", "UDPHandler", "CommHandler" etc. +# (*) "xtremweb" matches all classes +# (*) etc. +# +# Default is "" (turned off) +# +#MILESTONES=xtremweb + +# +# commLayer is a String determining the communication layer to use +# Possible values : +# - xtremweb.communications.TCPClient (this is the default) +# - xtremweb.communications.HTTPClient +# - xtremweb.communications.UDPFTClient (UDP is a very special case and should only be used with care) +# - xtremweb.communications.XMLRPCClient (this does not work yet) +# +# Octobre 2005 : +# UDP **ONLY** support minimalistic transfers (size < 16KB) +# This is still a prototype :) +# (conterpoint : if you are sure transfers are < 16KB, everything works just fine) +# (transfers include app binary, job params etc.) +# +# Default is xtremweb.communications.TCPClient +# +#COMMLAYER=xtremweb.communications.HTTPClient + +# +# commHandlers is a String determining the communication handlers +# This contains a comma separated list of colon separated tuples +# +# Example : +# xw:xtremweb.communications.TCPClient,http:xtremweb.communications.HTTPClient +# +# Default is xw:,http:xtremweb.communications.HTTPClient +# This automatically always includes default values +# Values provided here are then added to handlers +# +# See commLayer +# +# Since June 2009, XWHEP also accepts ADICS P2P data platform by Cardiff University +# See http://www.p2p-adics.org/ +# +COMMHANDLERS=attic:xtremweb.communications.HTTPClient + +# +# sharedapps is a String determining the local applications the worker wants to share. +# This contains a comma separated list of application types. +# See xtremweb.common.ApplicationType +# +# Example : +# SHAREDAPPS=virtualbox,vmware,vlc +# +# Default is null +# +#SHAREDAPPS=VirtualBox + +# +# sharedpackages is a String determining local packages +# This contains a comma separated list of packages +# The name here must be the name of the needed packages for the registered application +# +# Example : +# SHAREDPACKAGES=root,geant4 +# +# Default is null +# +#SHAREDPACKAGES= + +# +# shareddatas is a String determining local data +# This contains a comma separated list of data names +# +# Example : +# SHAREDDATAS=dataset1,dataset2 +# +# Default is null +# +#SHAREDDATAS= + +# +# shareddataspath is a String determining local paths where the worker can find data +# It must be in the same order as SHAREDDATAS +# If set, the worker uses these paths as current working directory of works processing these data +# If set, the worker does not send result to the XWHEP server. +# If set, the worker does delete data processing result; it is the responsibility of the data owner. +# +# Example : +# SHAREDDATASPATH=/path/one,/path/two +# +# If SHAREDDATAS=dataset1,dataset2 +# Then the worker find dataset1 content in /path/one +# and dataset2 content in /path/two +# +# Since 10.0.0 +# +# Default is null +# +#SHAREDDATASPATH= + + +# +# connectionLess tells to communicate in connectionless mode +# (i.e. connect, send message, disconnect) +# If set to false, we use connected communication mode +# (i.e. connect once forever at warm up, and disconnect only at shut down) +# +# This has only a sense for TCP communications +# +# Default is true +# +#CONNECTIONLESS=true + +# +# multipleInstances tells whether multiple workers may run on a single host +# Allowing may overbook CPU +# +# Default is false +# +#MULTIPLEINSTANCES=false + +# +# optimizeZip tells to optimze zipping process or not +# Zip optimization is quite brutal : we just don't zip if there is only +# one tiny file to zip since zipping has a huge CPU cost +# Otherwise, if there is more than one file, or if this one but huge file +# we do zip +# +# Default is true +# +#OPTIMIZEZIP=true + +# +# optimizeNetwork to try to optimize network traffic +# +# Default is true +# +#OPTIMIZENETWORK=true + +# +# This contains the maximum disk space a job can use +# This is in megabytes +# Here 30 kilobytes of megabytes is 30 gigabytes +# Since 9.1.0 +# Default is 30 Gb +# +#MAXDISKSPACE=30720 + +# +# This contains the maximum RAM space a job can use +# This is in kilobytes +# Here one megabytes of kilobytes is one gigabytes +# Since 9.1.0 +# Default is 1Gb +# +#MAXRAMSPACE=1048576 + +# +# javaExec tells how to launch native applications; either with xtremweb.exec.Executor +# which is the default, or with standard java Runtime.exec() +# Be aware that if you use java Runtime, stdin, stdout and stderr are not managed! +# Default is false +# +#JAVARUNTIME=false + +# Use DateActivator if you want to define gaps usage for XtremWeb +# This works 'a la' crontab. +# +# OS : all +# +# This uses activator.date to define gaps. +# Several comma separated gaps may be provided. +# Be aware that defining days with no hours, defines full days (e.g. 24 hours) +# Field grammar: +# - '*' : every possible values +# - : a unic value +# - : a couple of values separated by an hyphen ('-') defining a gap from x to y +# +# Two fields are allowed : +# - 1st field defines days of week +# - '*' for every day +# - '1', 'Sun' or 'Sunday' +# - '2', 'Mon' or 'Monday' +# - ... +# - '7', 'Sat' or 'Saturday' +# - a couple (of integers or Strings) defining days from N to M +# - 2nd field defines hours +# - '*' every hour +# - AN INTEGER DEFINING A COMPLETE HOUR (0 <= N <= 23) +# - A COUPLE OF INTEGERS DEFINING HOURS FROM N:00 TO M:59 (0,0 <= N,M <= 23,23) +# +# Examples: +# - * * : every days, full day +# - * 1 : every days, from 1:00AM to 1:59AM +# - * 11-17 : every days, from 11:00AM to 5:59PM +# - 1 * : every sunday +# - Thu * : every thursday +# - 2-Thu * : from tuesday to thursday +# - 4-2 * : from thursday to tuesday +# - Thu-Tue 18-3 : from thursday to tuesday, from 6:00PM to 3:59AM +# - Thu-Tue 18-3, Sat-Sun * : from thursday to tuesday, from 6:00PM to 3:59AM +# **AND** every week ends, full day +# +#ACTIVATORCLASS=xtremweb.worker.DateActivator +# +# Next is the DateActivator parameter which tells when to compute as described above +# Default is to compute nightly +ACTIVATIONDATE=* 20-7 + + +# activator that wait for the screensaver to start before allowing +# the worker to compute. +# OS : win32 +## ACTIVATORCLASS=xtremweb.worker.WinSaverActivator + + +# activator that wait for the screensaver to start before allowing +# the worker to compute. +# OS : Mac OS X +## ACTIVATORCLASS=xtremweb.worker.MacSaverActivator + + +#### Location of temporary directories +# XtremWeb needs to use some disk space to store temporary files. +# If you need to use an other directory uncomment this line and specify your own +# +# Default is /tmp +# Note : please use full path; don't use ~ or any variable (e.g. $HOME) +# they are not correctly interpreted +# +# TMPDIR=/tmp +#### + + +#### +# This tells whether worker accepts binary and Java (.JAR) applications +# If this is set to false, worker accepts xtremweb.services.* method calls only +# as well as jobs for localapps +# Default is true +# ACCEPTBIN=true + +#### Configuration of the Sandbox tools. +# The Sandbox is a security program that permits a better security +# level of XtremWeb. It permits your computer to be protected from the +# application ran on your host. +# If you wish to use a sand box tool set sandbox.enable to "true" else set +# it to "false" or comment it. +# If true, you must set sandbox.path and sandbox.start.args below +# Example with docker: +# docker run -t -i --mount type=bind,src=`pwd`,dst=/tmp/xwhep -w /tmp/xwhep ubuntu /bin/bash +# SANDBOXENABLED=true +# SANDBOXPATH=docker +# SANDBOXSTARTARGS=-t -i --mount type=bind,src=`pwd`,dst=/tmp/xwhep -w /tmp/xwhep ubuntu /tmp/xwhep/ +# Default is false +# SANDBOXENABLED=true + +# give here the full path and name of the sandbox system and the +# command line arguments without quotes +# +# UNDER MAC OS >= 10.5 you can use +# SANDBOXPATH=/usr/bin/sandbox-exec +# SANDBOXSTARTARGS=-f /usr/share/sandbox/xgridagentd_task_nobody.sb +# +# SANDBOXPATH=/path_to_sandbox/bin +# SANDBOXSTARTARGS= +#### + +#### worker keystore +# SSL requires a file to store the certificate provided by the XtremWeb Server +# by default it uses the certificate bundled with the software +SSLKEYSTORE=../keystore/xwhepworker.keys +#### +#If you change the following remember to regenerate the keys +#SSLKEYpassphrase: @KEYPASSPHRASE@ +#If you change the following remember to regenerate the keys +#SSLKEYpassword: @KEYWORKERPASSWORD@ + + +# +# This tells if XWHEP worker is a Pilot Job running on an SG ressource (e.g. EGEE) +# This is set by the bridge +# This is deprecated; SGID is better : it is automatically set at runtime +# Property name : "pilotjob" +# Property type : boolean +# Default : false +# +#PILOTJOB=false + +# +# This is the pilot job SG identifier +# This can not be set by hand; this is automatically set by the worker from its environment +# Property name : sgid +# Property type : string +# Default : System.getenv("GLITE_WMS_JOBID") +# +#SGID= + + +# +# This is the expected job URI +# This is for SpeQuLoS (EDGI/JRA2) +# This is a one shot attribute : the worker will ask this job first. +# Whatever is the result of the job request using this attribute, +# this is automatically set to null so that the worker tries only once +# and then acts as usual. +# +# Property name : jobid +# Property type : URI +# +#JOBID= + +# +# This is the expected group job URI +# This is for SpeQuLoS (EDGI/JRA2) +# If this attributes is set, the worker will compute jobs submitted within +# this group only +# This attribute should never be set, except in the very specific context of +# quality of service as defined by SpeQuLoS +# +# Property name : batchid +# Property type : URI +# +#BATCHID= + + +#### Trace collector +# Comment this to disable the Traces Collector. This system records +# some activity of your computer and send it to the server. This is +# only usefull for research work. +#TRACES=false +##### + +# +# this inserts a system tray icon +SYSTEMTRAY=true + +##### Logging + +# +# 15 avril 2008 : we don't use log4j any more since we suspect memory leaks +# we have developped our own little logger +# Available logging levels : +# FINEST +# DEBUG +# CONFIG +# INFO +# WARN +# ERROR +LOGGERLEVEL=INFO + +SSLKEYPASSPHRASE=@SSLKEYWORKERPASSWORD@ +SSLKEYPASSWORD=@SSLKEYWORKERPASSWORD@ +SSLKeyStore=@SSLKEYSTOREVWORKER@ + +##### +##### End of File +##### diff --git a/src/main/resources/templates/xtremweb.worker.conf.in b/src/main/resources/templates/xtremweb.worker.conf.in index ba3f463f..d2a10d1a 100644 --- a/src/main/resources/templates/xtremweb.worker.conf.in +++ b/src/main/resources/templates/xtremweb.worker.conf.in @@ -48,11 +48,11 @@ ROLE=worker # Next defines URL where launcher can find XtremWeb binary # Default : n/a -LAUNCHERURL=@LAUNCHERURL@ +LAUNCHERURL=@XWUPGRADEURL@ ####### XtremWeb dispatcher # There put the location of the root XtremWeb server -DISPATCHERS=@DISPATCHERS@ +DISPATCHERS=@XWSERVER@ # Next line shows how to set several servers (names must be delimited by space or tabulation) #DISPATCHERS=host1 host2 host 3 @@ -131,8 +131,8 @@ INCOMINGCONNECTIONS=true #cachesize # Login and password to connect to the server (required) -LOGIN=@DEFAULTUSER@ -PASSWORD=@DEFAULTPASSWORD@ +LOGIN=@XWWORKERLOGIN@ +PASSWORD=@XWWORKERPASSWORD@ # # Following are two ACL variables @@ -654,6 +654,9 @@ SYSTEMTRAY=true # ERROR LOGGERLEVEL=INFO +SSLKEYPASSPHRASE=@SSLKEYWORKERPASSWORD@ +SSLKEYPASSWORD=@SSLKEYWORKERPASSWORD@ +SSLKeyStore=@SSLKEYSTOREWORKER@ ##### ##### End of File diff --git a/src/main/resources/scripts/db-maintenance/xwhep-core-tables-create-tables.sql.in b/src/main/resources/templates/xwhep-core-tables-create-tables.sql.in similarity index 97% rename from src/main/resources/scripts/db-maintenance/xwhep-core-tables-create-tables.sql.in rename to src/main/resources/templates/xwhep-core-tables-create-tables.sql.in index 7d119266..c8db9c27 100644 --- a/src/main/resources/scripts/db-maintenance/xwhep-core-tables-create-tables.sql.in +++ b/src/main/resources/templates/xwhep-core-tables-create-tables.sql.in @@ -937,17 +937,17 @@ show warnings; -- accessrights = 1792 = 0x700 -- --------------------------------------------------------------------------- insert into users (uid,login,password,fname,lname,email,rights,owneruid,accessrights,userRightId) - values ("@ADMINUID@","@DBADMIN@","@DBADMINPASSWORD@", "@DBADMINFNAME@", "@DBADMINLNAME@", + values ("@ADMINUID@","@DBADMINLOGIN@","@DBADMINPASSWORD@", "@DBADMINFNAME@", "@DBADMINLNAME@", "@DBADMINEMAIL@","SUPER_USER","@ADMINUID@","1792", (select userRightId from userRights where userRightName = 'SUPER_USER')); insert into users (uid,login,password,fname,lname,email,rights,owneruid,accessrights,userRightId) - values ("@WORKERUID@","@DBWORKER@","@DBWORKERPASSWORD@", "@DBADMINFNAME@", "@DBADMINLNAME@", + values ("@WORKERUID@","@DBWORKERLOGIN@","@DBWORKERPASSWORD@", "@DBADMINFNAME@", "@DBADMINLNAME@", "@DBADMINEMAIL@","WORKER_USER","@ADMINUID@","1792", (select userRightId from userRights where userRightName = 'WORKER_USER')); insert into users (uid,login,password,fname,lname,email,rights,owneruid,accessrights,userRightId) - values ("@VWORKERUID@","@DBVWORKER@","@DBVWORKERPASSWORD@", "@DBADMINFNAME@", "@DBADMINLNAME@", + values ("@VWORKERUID@","@DBVWORKERLOGIN@","@DBVWORKERPASSWORD@", "@DBADMINFNAME@", "@DBADMINLNAME@", "@DBADMINEMAIL@","VWORKER_USER","@ADMINUID@","1792", (select userRightId from userRights where userRightName = 'VWORKER_USER')); @@ -960,13 +960,13 @@ insert into users (uid,login,password,fname,lname,email,rights,owneruid,accessri -- There may be error messages if you don't have enough privileges -- If so, contact you DB amdinistrator -- --------------------------------------------------------------------------- -grant all privileges on * to @DBUSER@@localhost identified by '@DBUSERPASSWORD@' with grant option; +grant all privileges on * to @DBUSERLOGIN@@localhost identified by '@DBUSERPASSWORD@' with grant option; -grant all privileges on * to @DBUSER@@localhost.localdomain identified by '@DBUSERPASSWORD@' with grant option; +grant all privileges on * to @DBUSERLOGIN@@localhost.localdomain identified by '@DBUSERPASSWORD@' with grant option; -grant all privileges on * to @DBUSER@@'@XWHOST@' identified by '@DBUSERPASSWORD@' with grant option; +grant all privileges on * to @DBUSERLOGIN@@'@XWHOST@' identified by '@DBUSERPASSWORD@' with grant option; --- set password for @DBUSER@@localhost = old_password ('@DBUSERPASSWORD@'); +-- set password for @DBUSERLOGIN@@localhost = old_password ('@DBUSERPASSWORD@'); -- ===========================================================================