Skip to content

Commit

Permalink
Merge branch 'release/2.4.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
proura committed May 22, 2023
2 parents 2b39666 + fa18a65 commit bd2f221
Show file tree
Hide file tree
Showing 29 changed files with 455 additions and 55 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ drlmbin = usr/sbin/drlm
drlm_store_svc = usr/sbin/drlm-stord
drlm_api = usr/sbin/drlm-api
drlm_proxy = usr/sbin/drlm-proxy
drlm_send_error = usr/sbin/drlm-send-error
name = drlm
version := $(shell awk 'BEGIN { FS="=" } /VERSION=/ { print $$2 }' $(drlmbin))

Expand Down Expand Up @@ -86,6 +87,7 @@ clean:
rm -f packaging/docker/src/drlm*.deb
rm -f usr/sbin/drlm-api
rm -f usr/sbin/drlm-proxy
rm -f usr/sbin/drlm-send-error

validate:
@echo -e "\033[1m== Validating scripts and configuration ==\033[0;0m"
Expand Down Expand Up @@ -162,6 +164,7 @@ install-bin:
install -Dp -m0755 $(drlm_store_svc) $(DESTDIR)$(sbindir)/drlm-stord
install -Dp -m0755 $(drlm_api) $(DESTDIR)$(sbindir)/drlm-api
install -Dp -m0755 $(drlm_proxy) $(DESTDIR)$(sbindir)/drlm-proxy
install -Dp -m0755 $(drlm_send_error) $(DESTDIR)$(sbindir)/drlm-send-error

install-data:
@echo -e "\033[1m== Installing scripts ==\033[0;0m"
Expand Down Expand Up @@ -215,14 +218,22 @@ else
@echo -e "No Go binaries detected to build DRLM PROXY, will be copied the builded one"
endif

dist: clean validate drlmapi drlmproxy man rewrite $(name)-$(distversion).tar.gz restore
drlmsenderror:
ifneq ($(shell which go),)
@echo -e "\033[1m== Building DRLM SEND ERROR ==\033[0;0m"
go build -o ./usr/sbin/drlm-send-error ./usr/share/drlm/www/drlm-send-error/
else
@echo -e "No Go binaries detected to build DRLM SEND ERROR, will be copied the builded one"
endif

dist: clean validate drlmapi drlmproxy drlmsenderror man rewrite $(name)-$(distversion).tar.gz restore

$(name)-$(distversion).tar.gz:
@echo -e "\033[1m== Building archive $(name)-$(distversion) ==\033[0;0m"
git checkout $(git_branch)
git ls-tree -r --name-only --full-tree $(git_branch) | \
tar -czf $(name)-$(distversion).tar.gz --transform='s,^,$(name)-$(distversion)/,S' \
--files-from=- ./usr/sbin/drlm-api ./usr/share/drlm/www/drlm-api/drlm-api.go ./usr/sbin/drlm-proxy ./usr/share/drlm/www/drlm-proxy/drlm-proxy.go
--files-from=- ./usr/sbin/drlm-api ./usr/sbin/drlm-proxy ./usr/sbin/drlm-send-error

rpm: dist
@echo -e "\033[1m== Building RPM package $(name)-$(distversion) ==\033[0;0m"
Expand All @@ -243,6 +254,7 @@ deb: dist
rm build-stamp
rm usr/sbin/drlm-api
rm usr/sbin/drlm-proxy
rm usr/sbin/drlm-send-error

docker: dist
@echo -e "\033[1m== Building Docker image $(name)-$(distversion) ==\033[0;0m"
Expand Down
17 changes: 17 additions & 0 deletions doc/drlm-release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ DRLM are compatible with previous versions, unless otherwise noted.

The references pointing to fix #nr or issue #nr refer to our issues tracker

DRLM Version 2.4.10 (February 2023) - Release Notes
---------------------------------------------------
* Bugfix in installclient tunnig_rear function

* Bugfix avoid duplicate settings in /etc/drlm/local.conf during update or install process

* Bugfix in user deletion to skip error code 12

* NEW! XML/JSON error reporting supported

* Bugfix in impbackup client configuration

* Bugfix runbackup umounting previous backups

* Bugfix runbackup rsync hidden warning errors


DRLM Version 2.4.9 (December 2022) - Release Notes
--------------------------------------------------
* Bugfix in importbackup Debian nbd detach
Expand Down
2 changes: 1 addition & 1 deletion etc/drlm/rsyncd/rsyncd.motd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DRLM server 2.4.9
DRLM server 2.4.10
3 changes: 2 additions & 1 deletion etc/logrotate.d/drlm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/var/log/drlm/drlm-rsyncd.log
/var/log/drlm/drlm-sched.log
/var/log/drlm/drlm-api.log
/var/log/drlm/drlm-proxy.log {
/var/log/drlm/drlm-proxy.log
/var/log/drlm/drlm-send-error.log {
missingok
weekly
rotate 3
Expand Down
13 changes: 11 additions & 2 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
drlm (2.4.10) stable release; urgency=high
* Bugfix in installclient tunnig_rear function
* Bugfix avoid duplicate settings in /etc/drlm/local.conf during update or install process
* Bugfix in user deletion to skip error code 12
* NEW! XML/JSON error reporting supported
* Bugfix in impbackup client configuration
* Bugfix runbackup umounting previous backups
* Bugfix runbackup rsync hidden warning errors

-- Pau Roura <[email protected]> Fri, 10 Feb 2023 00:00:00 +0100

drlm (2.4.9) stable release; urgency=high
* Bugfix in importbackup Debian nbd detach
* Bugfix getting Client OS version fixed
Expand Down Expand Up @@ -28,8 +39,6 @@ drlm (2.4.6) stable release; urgency=high

-- Pau Roura <[email protected]> Wed, 21 Sep 2022 00:00:00 +0100

-- Pau Roura <[email protected]> Wed, 21 Sep 2022 00:00:00 +0100

drlm (2.4.5) stable release; urgency=high
* NEW! Improved jobs list with status feedback
* NEW! Now is possible to enable and disable Jobs
Expand Down
2 changes: 1 addition & 1 deletion packaging/debian/drlm.dsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Format: 1.0
Source: drlm
Version: 2.4.9
Version: 2.4.10
Binary: drlm
Maintainer: Pau Roura ([email protected])
Architecture: all
Expand Down
9 changes: 6 additions & 3 deletions packaging/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ case "$1" in
# DRLM services #
#################

# Set debian like DHCP an NFS service names
# Set debian like DHCP and NFS service names
/usr/share/drlm/conf/DHCP/config-DHCP.sh install
[ -f /etc/drlm/local.conf ] && echo "NFS_SVC_NAME=\"nfs-kernel-server\"" >> /etc/drlm/local.conf

if [ -f /etc/drlm/local.conf ]; then
if ! grep -v '^\s*$\|^\s*\#' /etc/drlm/local.conf | grep -q 'NFS_SVC_NAME="nfs-kernel-server"' ; then
echo "NFS_SVC_NAME=\"nfs-kernel-server\"" >> /etc/drlm/local.conf
fi
fi
;;

*)
Expand Down
2 changes: 1 addition & 1 deletion packaging/debian/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
case "$1" in
install)
# check host name is not localhost
currhostname="$(/usr/bin/hostname -s)"
currhostname="$(hostname -s)"
if [ "$currhostname" = "localhost" ]; then
echo "Its important that DRLM servers have a valid hostname. Please change \"localhost\" host name. "
exit 1
Expand Down
18 changes: 15 additions & 3 deletions packaging/rpm/drlm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ fi
/usr/share/drlm/conf/DHCP/config-DHCP.sh install

### Enable systemd services
echo "NFS_SVC_NAME=\"nfs-server\"" >> /etc/drlm/local.conf
if ! grep -v '^\s*$\|^\s*\#' /etc/drlm/local.conf | grep -q 'NFS_SVC_NAME="nfs-server"'; then
echo "NFS_SVC_NAME=\"nfs-server\"" >> /etc/drlm/local.conf
fi
systemctl enable rpcbind.service
systemctl enable nfs-server.service
systemctl enable dhcpd.service
Expand All @@ -199,8 +201,8 @@ systemctl is-active --quiet apache2.service && systemctl stop apache2.service
systemctl is-enabled --quiet apache2.service && systemctl disable apache2.service
%endif
%if (0%{?centos} || 0%{?fedora} || 0%{?rhel} || 0%{?rocky} )
systemctl is-active --quiet httpd.service && systemctl stop httpd.service
systemctl is-enabled --quiet httpd.service && systemctl disable httpd.service
systemctl list-units --full -all | grep -Fq httpd.service && systemctl is-active --quiet httpd.service && systemctl stop httpd.service
systemctl list-units --full -all | grep -Fq httpd.service && systemctl is-enabled --quiet httpd.service && systemctl disable httpd.service
%endif
fi

Expand Down Expand Up @@ -263,6 +265,7 @@ systemctl daemon-reload
%{_sbindir}/drlm-stord
%{_sbindir}/drlm-api
%{_sbindir}/drlm-proxy
%{_sbindir}/drlm-send-error

%posttrans
### Rcover certificates post transaction
Expand Down Expand Up @@ -316,6 +319,15 @@ systemctl start drlm-tftpd.service

%changelog

* Fri Feb 10 2023 Pau Roura <[email protected]> 2.4.10
- Bugfix in installclient tunnig_rear function
- Bugfix avoid duplicate settings in /etc/drlm/local.conf during update or install process
- Bugfix in user deletion to skip error code 12
- NEW! XML/JSON error reporting supported
- Bugfix in impbackup client configuration
- Bugfix runbackup umounting previous backups
- Bugfix runbackup rsync hidden warning errors

* Thu Nov 24 2022 Pau Roura <[email protected]> 2.4.9
- Bugfix in importbackup Debian nbd detach
- Bugfix getting Client OS version fixed
Expand Down
2 changes: 1 addition & 1 deletion usr/sbin/drlm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ readonly INITIAL_BASH_FLAGS_AND_OPTIONS_COMMANDS="$( get_bash_flags_and_options_
# Versioning
readonly PRODUCT="Disaster Recovery Linux Manager"
readonly PROGRAM=${0##*/}
readonly VERSION=2.4.9
readonly VERSION=2.4.10
readonly RELEASE_DATE="Git"

readonly STARTTIME=$SECONDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ fi

# At this point is available the content of the DR file
# If exists *.*.drlm.cfg file in the mountpoint it means that is a backup done with a DRLM 2.4.0 or superior
if [ -f "$TMP_MOUNTPOINT/*.*.drlm.cfg" ]; then
IMP_CFG_FILE="$(ls $TMP_MOUNTPOINT/*.*.drlm.cfg)"
if [ -f "$IMP_CFG_FILE" ]; then

IMP_CFG_FILE="$(ls $TMP_MOUNTPOINT/*.*.drlm.cfg)"
IMP_CLI_NAME="$(basename $(ls $TMP_MOUNTPOINT/*.*.drlm.cfg) | awk -F'.' {'print $1'})"
IMP_CLI_CFG="$(basename $(ls $TMP_MOUNTPOINT/*.*.drlm.cfg) | awk -F'.' {'print $2'})"
IMP_CLI_NAME="$(basename "$IMP_CFG_FILE" | awk -F'.' {'print $1'})"
IMP_CLI_CFG="$(basename "$IMP_CFG_FILE" | awk -F'.' {'print $2'})"

IMPORT_CONFIGURATION_CONTENT="$(cat $IMP_CFG_FILE)"

Expand Down
12 changes: 9 additions & 3 deletions usr/share/drlm/conf/DHCP/config-DHCP.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ case $1 in
"install")
case "$SRV_DISTRO" in
debian|ubuntu)
echo "DHCP_SVC_NAME=\"isc-dhcp-server\"" >> /etc/drlm/local.conf
if ! grep -v '^\s*$\|^\s*\#' /etc/drlm/local.conf | grep -q 'DHCP_SVC_NAME="isc-dhcp-server"'; then
echo "DHCP_SVC_NAME=\"isc-dhcp-server\"" >> /etc/drlm/local.conf
fi
;;

centos|rhel|rocky)
;;

opensuse*|sles*)
echo "DHCP_DIR=\"/etc\"" >> /etc/drlm/local.conf
echo "DHCP_FILE=\"\$DHCP_DIR/dhcpd.conf\"" >> /etc/drlm/local.conf
if ! grep -v '^\s*$\|^\s*\#' /etc/drlm/local.conf | grep -q 'DHCP_DIR="/etc"'; then
echo "DHCP_DIR=\"/etc\"" >> /etc/drlm/local.conf
fi
if ! grep -v '^\s*$\|^\s*\#' /etc/drlm/local.conf | grep -q 'DHCP_FILE="$DHCP_DIR/dhcpd.conf"'; then
echo "DHCP_FILE=\"\$DHCP_DIR/dhcpd.conf\"" >> /etc/drlm/local.conf
fi
;;

esac
Expand Down
61 changes: 60 additions & 1 deletion usr/share/drlm/conf/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ BKP_CLI_PER=1
#
# ERR_REPORT=[yes|no]
# default: no
# REPORT_TYPE=[ovo|nsca-ng|nsca|nrdp|zabbix|mail]
# REPORT_TYPE=[ovo|nsca-ng|nsca|nrdp|zabbix|mail|xml|json]
# default: empty
#
########
Expand Down Expand Up @@ -337,6 +337,65 @@ MAIL_TO="root@localhost"
MAIL_CC=""
MAIL_BCC=""

#
# REPORT_TYPE=[xml|json]
#
# XML VARIABLES
# =============
#
# These are default values and can be overwritten in local.conf according to your XML installation and configuration.
# DRLM_SEND_ERROR_BIN="/usr/sbin/drlm-send-error" #Default drlm-send-error command path
# DRLM_SEND_ERROR_URL="http://servertostorexml:9090/" #Desired URL to send the XML to
# DRLM_SEND_ERROR_MSG=
# If DRLM_SEND_ERROR_MSG is set to "" will be send a default error like the next one:
#
# <drlm>
# <version>2.4.10-git</version>
# <type>ERROR</type>
# <server>drlmserver</server>
# <client>drlmclient</client>
# <configuration>default</configuration>
# <os>Debian 11.6</os>
# <rear>2.6/2020-06-17</rear>
# <workflow>runbackup</workflow>
# <message>2023-02-09 09:11:21 drlm:runbackup:drlmclient:ERROR: Client drlmclient SSH Server on 22 port is not available</message>
# </drlm>
#
# But DRLM_SEND_ERROR_MSG can be customized specifying an XML string containing DRLM runtime environment variables.
# For example: DRLM_SEND_ERROR_MSG='<drlm><server>$HOSTNAME</server><client>$CLI_NAME</client><nbd>$NBD_DEVICE</nbd><message>$ERRMSG</message></drlm>'
# In the header of the runbackup scripts (/usr/share/drlm/backup/run/default/*.sh) you can find all the variables available at any time
#
# JSON VARIABLES
# ==============
#
# These are default values and can be overwritten in local.conf according to your JSON installation and configuration.
# DRLM_SEND_ERROR_BIN="/usr/sbin/drlm-send-error" #Default drlm-send-error command path
# DRLM_SEND_ERROR_URL="http://servertostorejson:9090/" #Desired URL to send the JSON to
# DRLM_SEND_ERROR_MSG=
# If DRLM_SEND_ERROR_MSG is set to "" will be send a default error like the next one:
#
# {
# "program":"drlm",
# "version":"2.4.10",
# "type":"ERROR",
# "server":"drlmserver",
# "client":"drlmclient",
# "configuration":"default",
# "os":"Debian 11.6",
# "rear":"2.6/2020-06-17",
# "workflow":"runbackup",
# "message":"2023-02-09 11:40:58 drlm:runbackup:drlmclient:ERROR: Client drlmclient SSH Server on 22 port is not available"
# }
#
# But DRLM_SEND_ERROR_MSG can be customized specifying an JSON string containing DRLM runtime environment variables.
# For example: DRLM_SEND_ERROR_MSG=''{\"name\":\"$HOSTNAME\", \"backup_type\":\"$DRLM_BKP_TYPE\", \"ERROR\":\"$ERRMSG\"}''
# In the header of the runbackup scripts (/usr/share/drlm/backup/run/default/*.sh) you can find all the variables available at any time
#

DRLM_SEND_ERROR_BIN="/usr/sbin/drlm-send-error"
DRLM_SEND_ERROR_URL=""
DRLM_SEND_ERROR_MSG=""

################ ---- DHCP CONFIGURATION
#
########
Expand Down
2 changes: 1 addition & 1 deletion usr/share/drlm/conf/samples/client_PXE.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# for more information. #
###############################################################################

# DRLM v2.4.9
# DRLM v2.4.10
#

# This configuration example does a PXE rescue system and a data backup of all
Expand Down
2 changes: 1 addition & 1 deletion usr/share/drlm/conf/samples/client_data_only.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# for more information. #
###############################################################################

# DRLM v2.4.9
# DRLM v2.4.10
#

# This configuration example does a data backup of /home directory of the
Expand Down
8 changes: 4 additions & 4 deletions usr/share/drlm/conf/samples/client_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# (Configuration examples in /usr/share/drlm/conf/samples/) #
###############################################################################

# DRLM v2.4.9
# DRLM v2.4.10
#

# DRLM automatically generates a ReaR configuration file in function of three
Expand All @@ -21,8 +21,8 @@
# Backup type ISO generates a rescue image in ISO format and backup data is stored
# in a DRLM server directory.
#
# DRLM_BKP_TYPE=ISO (Default)
# |-- DRLM_BKP_PROT=RSYNC (Default)
# DRLM_BKP_TYPE=ISO #(Default)
# |-- DRLM_BKP_PROT=RSYNC #(Default)
# |-- DRLM_BKP_PROT=NETFS
# |-- DRLM_BKP_PROG=TAR
# |-- DRLM_BKP_PROG=RSYNC
Expand Down Expand Up @@ -51,7 +51,7 @@
# may be useful to use it by enabling incremental backups, DRLM_INCREMENTAL, also described below.
#
# DRLM_BKP_TYPE=DATA
# |-- DRLM_BKP_PROT=RSYNC (Default)
# |-- DRLM_BKP_PROT=RSYNC #(Default)
# |-- DRLM_BKP_PROT=NETFS
# |-- DRLM_BKP_PROG=TAR
# |-- DRLM_BKP_PROG=RSYNC
Expand Down
2 changes: 1 addition & 1 deletion usr/share/drlm/conf/samples/client_default.drlm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# for more information. #
###############################################################################

# DRLM v2.4.9
# DRLM v2.4.10
#

# In client.drlm.cfg config file can be set DRLM client specific configurations
Expand Down
2 changes: 1 addition & 1 deletion usr/share/drlm/conf/samples/client_incremental.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# for more information. #
###############################################################################

# DRLM v2.4.9
# DRLM v2.4.10
#

# This configuration example does ISO rescue file and an incremental data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# for more information. #
###############################################################################

# DRLM v2.4.9
# DRLM v2.4.10
#

# This configuration example does a data backup of /home directory of the
Expand Down
Loading

0 comments on commit bd2f221

Please sign in to comment.