Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ncharles committed Apr 15, 2019
1 parent bf60916 commit 08005c1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rudder-agent/SOURCES/debug-script/lib/collect
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ collect_files() {
cp ${RUDDER_OPT}/etc/rudder-networks* "${TARGET_DIRECTORY}/rudder/" 2>/dev/null
cp ${RUDDER_VAR}/ncf/local/ncf.conf "${TARGET_DIRECTORY}/rudder/" 2>/dev/null


# Hash the passwords
# This is ad-hoc, as most files differ
perl -MDigest::SHA=sha512_hex -pe 's/^(ldap.authpw=)(.*)$/"$1".sha512_hex$2/e' "${TARGET_DIRECTORY}/rudder/inventory-web.properties" > "${TARGET_DIRECTORY}/rudder/inventory-web.properties"
perl -MDigest::SHA=sha512_hex -pe 's/^(ldap.authpw=)(.*)$/"$1".sha512_hex$2/e' "${TARGET_DIRECTORY}/rudder/rudder-web.properties" > "${TARGET_DIRECTORY}/rudder/rudder-web.properties"
perl -MDigest::SHA=sha512_hex -pe 's/^(rudder.jdbc.password=)(.*)$/"$1".sha512_hex$2/e' "${TARGET_DIRECTORY}/rudder/rudder-web.properties" > "${TARGET_DIRECTORY}/rudder/rudder-web.properties"

perl -MDigest::SHA=sha512_hex -pe 's/^(.*:ompgsql:.*,rudder,rudder,)(.*);RudderReportsFormat$/"$1".sha512_hex$2.";RudderReportsFormat"/e' "${TARGET_DIRECTORY}/syslog/rsyslog.d/rudder.conf" > "${TARGET_DIRECTORY}/syslog/rsyslog.d/rudder.conf"
# add back the rest of line lost by previous line
sed -i '/^.*ompgsql:.*,rudder,rudder/ s/$/;RudderReportsFormat/' ${TARGET_DIRECTORY}/syslog/rsyslog.d/rudder.conf"
# Backup apache logs
mkdir -p "${TARGET_DIRECTORY}/apache/"
cp /var/log/rudder/apache2/*log /var/log/rudder/apache2/*log.1 "${TARGET_DIRECTORY}/apache/" 2>/dev/null
Expand Down

0 comments on commit 08005c1

Please sign in to comment.