diff --git a/deploy/default.properties b/deploy/default.properties index 50854945..e51b41ee 100755 --- a/deploy/default.properties +++ b/deploy/default.properties @@ -1,228 +1,252 @@ -################################################################# -# -# DO NOT EDIT -# -# This file contains default application configuration options. -# Don't mess with this file. Instead, copy what you need to -# build.properties and edit there. -# This process makes upgrading Roxy easier. -################################################################# - -# -# the location of your code to load into ML -# -xquery.dir=${basedir}/src - -# -# MarkLogic application servers exist inside a group. ML Instances start off -# with a group called "Default". -# -group=Default - -# -# The type of application. Choices are: -# bare: a bare Roxy app project -# mvc: a normal, XQuery-based Roxy MVC app -# rest: an app based on the ML6 REST API -# hybrid: an app that uses Roxy rewriting and the ML6 REST API -# -app-type=mvc - -# -# the location of your REST API options -# relevant to app-types rest and hybrid. -# -rest-options.dir=${basedir}/rest-api/config - -# -# the location of your xml data to load into ML -# -data.dir=${basedir}/data - -# -# the location of your marklogic configuration file -# -config.file=${basedir}/deploy/ml-config.xml - +################################################################# +# +# DO NOT EDIT +# +# This file contains default application configuration options. +# Don't mess with this file. Instead, copy what you need to +# build.properties and edit there. +# This process makes upgrading Roxy easier. +################################################################# + +# +# the location of your code to load into ML +# +xquery.dir=${basedir}/src + +# +# MarkLogic application servers exist inside a group. ML Instances start off +# with a group called "Default". +# +group=Default + +# +# The type of application. Choices are: +# bare: a bare Roxy app project +# mvc: a normal, XQuery-based Roxy MVC app +# rest: an app based on the ML6 REST API +# hybrid: an app that uses Roxy rewriting and the ML6 REST API +# +app-type=mvc + +# +# the location of your REST API options +# relevant to app-types rest and hybrid. +# +rest-options.dir=${basedir}/rest-api/config + +# +# the location of your xml data to load into ML +# +data.dir=${basedir}/data + +# +# the location of your marklogic configuration file +# +config.file=${basedir}/deploy/ml-config.xml + # the location of your triggers configuration file # see sample at deploy/sample/triggers-config.sample.xml # triggers.file=${basedir}/deploy/triggers-config.xml -# -# the location of your schemas -# -schemas.dir=${basedir}/schemas -schemas.root=/ - -# -# Admin username/password that will exist on the local/dev/prod servers -# -user=admin -password=admin - -# -# Your Application's name -# -app-name=roxy -modules-root=/ -modules-prefix=/ - -# The role that is given permissions and execute privileges -app-role=${app-name}-role - -# -# The names of your databases. Forests are given the same names -# -app-modules-db=${app-name}-modules -content-db=${app-name}-content -modules-db=${app-name}-modules - -# -# Number of forests to create per host in the group for the content-db -# -content-forests-per-host=1 - -# -# A location on disk to store the forest data. "data directory" in the admin ui -# -# forest-data-dir= - -## Unit Testing -# Leave commented out for no test db -# turn it on if you are using the roxy unit tester -# Note: to activate Unit Testing, you must have test-content-db and test-port defined -# test-content-db=${app-name}-content-test -# test-modules-db=${app-modules-db} -# -# The authentication method used for your test appserver -# application-level, basic, digest, digestbasic -# -# test-authentication-method=digest -# -# Leave commented out for no test appserver -# turn it on if you are using the roxy unit tester -# test-port=8042 -# -# the environments in which we DO NOT want to deploy tests -# typically your production environment. -do-not-deploy-tests=prod -# -# the location of your unit test code -xquery-test.dir=${basedir}/src/test - - -# Leave commented out for default -# schemas-db=${app-name}-schemas - -# Leave commented out for default -# turn it on if you are using triggers or CPF -# triggers-db=${app-name}-triggers - -# -# the port that the Manage appserver is running on -# Manage appserver is required for boostrapping -# -bootstrap-port-five=8002 -bootstrap-port-four=8000 - -# -# The port used to access QConsole (App-Services app server) -# -qconsole-port=8000 - -# -# If true, .html files under the src directory will be loaded as XML. -# If false, they will be loaded using the MarkLogic default behavior, which is -# to treat them as text. -# -load-html-as-xml=false - -# -# If true, .js and .css files under the src directory will be loaded as binary. -# If false, they will be loaded using the MarkLogic default behavior, which is -# to treat them as text. -# -load-js-as-binary=true -load-css-as-binary=true - -# -# The ports used by your application -# -app-port=8040 -xcc-port=8041 - -# -# set this to false if you are using an existing XCC server and -# you don't want Roxy to manage it for you -# -install-xcc=true - -# -# set this to true if you are using https for your app servers -# -use-https=false - -## Security -# -# The authentication used for your appserver -# -authentication-method=digest -default-user=${app-name}-user -# -# Providing a default empty value -ssl-certificate-template= - -# -# The default values point to Roxy file -# -url-rewriter=/roxy/rewrite.xqy -error-handler=/roxy/error.xqy -rewrite-resolves-globally= - -# Environments recognized by Roxy -environments=local,dev,prod - -# -# The Major version of ML server across your environments (6, 7, or 8). You can override -# this value in build.properties if all of your servers are the same version -# or override it in each ${env}.properties file if each server has a different -# version. -# -server-version=8 - -# -# the uris or IP addresses of your servers -# WARNING: if you are running these scripts on windows you may need to change localhost to 127.0.0.1 -# There have been reported issues with dns resolution when localhost wasn't in the hosts file. -# -local-server=localhost -#dev-server= -#cert-server= -#prod-server= - -# -# If you want to use MLCP, make sure mlcp-home is configured correctly. Using a common location as default. -# -mlcp-home=/usr/local/mlcp -mlcp-vmargs=-Xmx512m -mlcp-user=${user} -mlcp-password=${password} - -# -# Temporary fix to support MarkLogic 8 EA2 -# -evaler-port=7998 - -# -# List of MarkLogic system databases, for replication -# -system-dbs=App-Services,Documents,Extensions,Fab,Last-Login,Meters,Modules,Schemas,Security,Triggers - -# -# HTTP connection settings -# -http.retry-count=3 -http.open-timeout=5 -http.read-timeout=300 -http.retry-delay=15 +# +# the location of your schemas +# +schemas.dir=${basedir}/schemas +schemas.root=/ + +# +# Default username/password that will exist on the local/dev/prod servers +# +user=admin +password=admin + +# +# Username/password used for bootstrap, wipe and restart operations if specified +# +# bootstrap-user= +# bootstrap-password= + +# +# Username/password used for deployment operations if specified +# +# deploy-user= +# deploy-password= + +# +# Username/password used for mlcp if specified +# +# mlcp-user= +# mlcp-password= + +# +# Username/password used for corb if specified +# +# corb-user= +# corb-password= + +# +# Your Application's name +# +app-name=roxy +modules-root=/ +modules-prefix=/ + +# The role that is given permissions and execute privileges +app-role=${app-name}-role + +# +# The names of your databases. Forests are given the same names +# +app-modules-db=${app-name}-modules +content-db=${app-name}-content +modules-db=${app-name}-modules + +# +# Number of forests to create per host in the group for the content-db +# +content-forests-per-host=1 + +# +# A location on disk to store the forest data. "data directory" in the admin ui +# +# forest-data-dir= + +## Unit Testing +# Leave commented out for no test db +# turn it on if you are using the roxy unit tester +# Note: to activate Unit Testing, you must have test-content-db and test-port defined +# test-content-db=${app-name}-content-test +# test-modules-db=${app-modules-db} +# +# The authentication method used for your test appserver +# application-level, basic, digest, digestbasic +# +# test-authentication-method=digest +# +# Leave commented out for no test appserver +# turn it on if you are using the roxy unit tester +# test-port=8042 +# +# the environments in which we DO NOT want to deploy tests +# typically your production environment. +do-not-deploy-tests=prod +# +# the location of your unit test code +xquery-test.dir=${basedir}/src/test + + +# Leave commented out for default +# schemas-db=${app-name}-schemas + +# Leave commented out for default +# turn it on if you are using triggers or CPF +# triggers-db=${app-name}-triggers + +# +# the port that the Manage appserver is running on +# Manage appserver is required for boostrapping +# +bootstrap-port-five=8002 +bootstrap-port-four=8000 + +# +# The port used to access QConsole (App-Services app server) +# +qconsole-port=8000 + +# +# If true, .html files under the src directory will be loaded as XML. +# If false, they will be loaded using the MarkLogic default behavior, which is +# to treat them as text. +# +load-html-as-xml=false + +# +# If true, .js and .css files under the src directory will be loaded as binary. +# If false, they will be loaded using the MarkLogic default behavior, which is +# to treat them as text. +# +load-js-as-binary=true +load-css-as-binary=true + +# +# The ports used by your application +# +app-port=8040 +xcc-port=8041 + +# +# set this to false if you are using an existing XCC server and +# you don't want Roxy to manage it for you +# +install-xcc=true + +# +# set this to true if you are using https for your app servers +# +use-https=false + +## Security +# +# The authentication used for your appserver +# +authentication-method=digest +default-user=${app-name}-user +# +# Providing a default empty value +ssl-certificate-template= + +# +# The default values point to Roxy file +# +url-rewriter=/roxy/rewrite.xqy +error-handler=/roxy/error.xqy +rewrite-resolves-globally= + +# Environments recognized by Roxy +environments=local,dev,prod + +# +# The Major version of ML server across your environments (6, 7, or 8). You can override +# this value in build.properties if all of your servers are the same version +# or override it in each ${env}.properties file if each server has a different +# version. +# +server-version=8 + +# +# the uris or IP addresses of your servers +# WARNING: if you are running these scripts on windows you may need to change localhost to 127.0.0.1 +# There have been reported issues with dns resolution when localhost wasn't in the hosts file. +# +local-server=localhost +#dev-server= +#cert-server= +#prod-server= + +# +# If you want to use MLCP, make sure mlcp-home is configured correctly. Using a common location as default. +# +mlcp-home=/usr/local/mlcp +mlcp-vmargs=-Xmx512m +mlcp-user=${user} +mlcp-password=${password} + +# +# Temporary fix to support MarkLogic 8 EA2 +# +evaler-port=7998 + +# +# List of MarkLogic system databases, for replication +# +system-dbs=App-Services,Documents,Extensions,Fab,Last-Login,Meters,Modules,Schemas,Security,Triggers + +# +# HTTP connection settings +# +http.retry-count=3 +http.open-timeout=5 +http.read-timeout=300 +http.retry-delay=15 diff --git a/deploy/lib/server_config.rb b/deploy/lib/server_config.rb index 8aa08b81..2bc6737c 100644 --- a/deploy/lib/server_config.rb +++ b/deploy/lib/server_config.rb @@ -518,6 +518,13 @@ def execute_query(query, properties = {}) end def restart + @ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user'] + if @ml_username == @properties['ml.bootstrap-user'] + @ml_password = @properties['ml.bootstrap-password'] + else + @ml_password = @properties['ml.password'] + end + group = nil ARGV.each do |arg| # Exclude any argument passed from command line. @@ -633,6 +640,13 @@ def config def bootstrap raise ExitException.new("Bootstrap requires the target environment's hostname to be defined") unless @hostname.present? + @ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user'] + if @ml_username == @properties['ml.bootstrap-user'] + @ml_password = @properties['ml.bootstrap-password'] + else + @ml_password = @properties['ml.password'] + end + internals = find_arg(['--replicate-internals']) if internals @@ -730,6 +744,14 @@ def bootstrap end def wipe + + @ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user'] + if @ml_username == @properties['ml.bootstrap-user'] + @ml_password = @properties['ml.bootstrap-password'] + else + @ml_password = @properties['ml.password'] + end + if @environment != "local" expected_response = %Q{I WANT TO WIPE #{@environment.upcase}} print %Q{ @@ -919,6 +941,13 @@ def validate_install alias_method :validate, :validate_install def deploy + @ml_username = @properties['ml.deploy-user'] || @properties['ml.user'] + if @ml_username == @properties['ml.deploy-user'] + @ml_password = @properties['ml.deploy-password'] + else + @ml_password = @properties['ml.password'] + end + what = ARGV.shift raise HelpException.new("deploy", "Missing WHAT") unless what @@ -1139,6 +1168,13 @@ def xqsync end def corb + @ml_username = @properties['ml.corb-user'] || @properties['ml.user'] + if @ml_username == @properties['ml.corb-user'] + @ml_password = @properties['ml.corb-password'] + else + @ml_password = @properties['ml.password'] + end + password_prompt encoded_password = url_encode(@ml_password) connection_string = %Q{xcc://#{@properties['ml.user']}:#{encoded_password}@#{@properties['ml.server']}:#{@properties['ml.xcc-port']}/#{@properties['ml.content-db']}} @@ -1269,7 +1305,12 @@ def mlcp end @ml_username = @properties['ml.mlcp-user'] || @properties['ml.user'] - @ml_password = @properties['ml.mlcp-password'] || @ml_password + if @ml_username == @properties['ml.mlcp-user'] + @ml_password = @properties['ml.mlcp-password'] + else + @ml_password = @properties['ml.password'] + end + if ARGV.length > 0 password_prompt connection_string = %Q{ -username #{@ml_username} -password #{@ml_password} -host #{@properties['ml.server']} -port #{@properties['ml.xcc-port']}} @@ -1442,6 +1483,13 @@ def settings end def deploy_triggers + @ml_username = @properties['ml.deploy-user'] || @properties['ml.user'] + if @ml_username == @properties['ml.deploy-user'] + @ml_password = @properties['ml.deploy-password'] + else + @ml_password = @properties['ml.password'] + end + logger.info "Deploying Triggers" if !@properties["ml.triggers-db"] raise ExitException.new("Deploy triggers requires a triggers database")