#!/bin/bash #============================================================================== # Copyright and license info is available in the LICENSE file included with # the Server Deployment Package (SDP), and also available online: # https://swarm.workshop.perforce.com/projects/perforce_software-hms/view/main/LICENSE set -u # Generate an SDP instance-specific variant of the generic # P4Broker config file, suitalbe for use with HMS Data Leakage # Protection (DLP) Package. Display to standard output. # Usage: In these examples, replace 'N' with SDP instance name. # cd /p4/common/config # /p4/common/bin/gen_dlp_broker_cfg.sh N > p4_N.broker.cfg.ToBeReviewed # # After reviewing, remove the .ToBeReviewed suffix. export SDP_INSTANCE=${1:-Unset} if [[ "$SDP_INSTANCE" == Unset ]]; then echo "Instance parameter not supplied." echo "You must supply the SDP instance as a parameter to this script." exit 1 fi source /p4/common/bin/p4_vars "$SDP_INSTANCE" declare BrokerLogLevel=1 declare BrokerConfigTemplate=p4_N.broker.cfg.t declare HelixSwarmUser=swarm declare DLPVersionFile=Version declare DLPVersion= if [[ ! -r "$BrokerConfigTemplate" ]]; then echo "Error: Could not find broker config template: [$PWD/$BrokerConfigTemplate]." exit 1 fi if [[ ! -r "$BrokerConfigTemplate" ]]; then echo "Error: Could not find DLP Version file [$PWD/$DLPVersionFile]." exit 1 fi DLPVersion=$(cat $DLPVersionFile) sed -e "s#__P4PORT__#$P4PORT#g" \ -e "s#__P4BROKERPORT__#$P4BROKERPORT#g" \ -e "s#__P4BINDIR__#${P4BIN%/*}#g" \ -e "s#__BROKER_LOG_LEVEL__#$BrokerLogLevel#g" \ -e "s#__LOGS__#$LOGS#g" \ -e "s#__MAILTO__#$MAILTO#g" \ -e "s#__SWARM_USER__#$HelixSwarmUser#g" \ -e "s#__DLP_VERSION__#$DLPVersion#g" \ "$BrokerConfigTemplate"
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 29182 | C. Thomas Tyler |
Moved HMS files from /p4/common/bin -> /p4/common/site/bin. Moved HMS files from /p4/common/lib -> /p4/common/site/lib. Removed dependency on SDP libs so that HMS can be deployed with a wider variety of SDP versions. |
||
#3 | 27695 | C. Thomas Tyler | Simplified usage comments. | ||
#2 | 25977 | C. Thomas Tyler |
Enhanced so 'p4 dlp' version check works for even exempt users like 'perforce'. Added preflight check for missing DLP Version file. |
||
#1 | 25976 | C. Thomas Tyler |
Added Version file for DLP. Added script to generate broker config file for using DLP from a template. Updated template accordingly. |