Skip to content

Commit

Permalink
Release v5.21.0
Browse files Browse the repository at this point in the history
New features:
[system] seamless upgrade from Community Edition to Enterprise

Improvements:
[system] automatize grub-pc configuration update

Bugfixes:
[farms] fix debian buster apt sources

Signed-off-by: nevola <[email protected]>
  • Loading branch information
nevola committed Oct 10, 2023
1 parent c02a322 commit 6dc7a65
Show file tree
Hide file tree
Showing 12 changed files with 527 additions and 372 deletions.
9 changes: 9 additions & 0 deletions DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: zevenet
Version: 5.21.0
Maintainer: RELIANOID <[email protected]>
Architecture: amd64
Section: admin
Priority: optional
Description: RELIANOID Load Balancer Community Edition
RELIANOID, formerly ZEVENET, is a Multilayered Aplication Delivery Controller (ADC) and high performance load balancer with an easy configuration, usability and user-friendly web GUI for layer 3, 4 and 7 networking management.
Depends: nftables (>= 0.9.1), linux-headers-amd64 (>= 4.19+105), linux-image-amd64 (>= 4.19+105), rrdtool, libnet-netmask-perl, libproc-daemon-perl, libnetwork-ipv4addr-perl, librrds-perl, libio-interface-perl, libdata-validate-ip-perl, libpcap0.8, ntpdate, libfile-grep-perl, iputils-arping, openssl, unzip, libev4, libjson-perl, libjson-xs-perl, libcgi-session-perl, libauthen-simple-perl, libauthen-simple-passwd-perl, conntrack, liburi-perl, libtimedate-perl, libconfig-tiny-perl, snmpd, libnet-ssleay-perl, libnetaddr-ip-perl, libswitch-perl, libcgi-simple-perl, libunix-syslog-perl, monitoring-plugins, monitoring-plugins-common, net-tools, cherokee, pound, libregexp-ipv6-perl, nftlb, curl, zproxy (>= 0.9.0-5.13.0), libcrypt-openssl-x509-perl, certbot, liblwp-protocol-http-socketunixalt-perl
120 changes: 120 additions & 0 deletions DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/bash
###############################################################################
#
# ZEVENET Software License
# This file is part of the ZEVENET Load Balancer software package.
#
# Copyright (C) 2014-today ZEVENET SL, Sevilla (Spain)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or any later version.
#
# This program 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################

GLOBALCF="/usr/local/zevenet/config/global.conf"
GLOBALCFT="/usr/local/zevenet/share/global.conf.template"

[ ! "$1" == "configure" ] && echo "Installation aborted $1 $2" && exit 1
[ "$1" == "configure" ] && echo "Completing the ZEVENET installation..."

# upgrading global.conf
/usr/local/zevenet/bin/checkglobalconf

# load LB variables
source /usr/local/zevenet/bin/load_global_conf
load_global_conf

# Enable root access through SSH
SSHDCONFIG="/etc/ssh/sshd_config"
if [[ `grep -c "^PermitRootLogin.*yes" $SSHDCONFIG` == '0' ]]; then
sed -i -e 's/^PermitRootLogin.*/PermitRootLogin yes/' $SSHDCONFIG
/etc/init.d/ssh reload 2> /dev/null
fi

# Disable services

# SNMP service
if [[ -f /etc/snmp/snmpd.conf && `grep -c '#zenlb' /etc/snmp/snmpd.conf` == '0' ]]; then
/etc/init.d/snmpd stop
update-rc.d snmpd disable
cp /usr/local/zevenet/share/snmpd.conf.template /etc/snmp/snmpd.conf
fi

# Disable SNMP debugging messages in log
if [[ `grep -c 'LSd' /etc/default/snmpd` == '1' ]]; then
sed -i -e 's/LSd/LS6d/' /etc/default/snmpd
fi

# Start ssh server after zevenet service
sed -i 's/^\# Required-Start:.*/# Required-Start:\t\$remote_fs \$syslog zevenet/g' /etc/init.d/ssh
sed -i 's/^\# Required-Stop:.*/# Required-Stop:\t\$remote_fs \$syslog zevenet/g' /etc/init.d/ssh


## Create configuration files

# Move zlb-stop & zlb-start
if [ ! -f $zlb_start_script ]; then
cp $zlb_start_tpl $zlb_start_script
fi
if [ ! -f $zlb_stop_script ]; then
cp $zlb_stop_tpl $zlb_stop_script
fi

# create Web server
if [ ! -f "$http_server_cert" ]; then
cp -rf $http_server_cert_tpl $http_server_cert
fi
if [ ! -f "$http_server_key" ]; then
cp -rf $http_server_key_tpl $http_server_key
fi

# Install check_uplink
ZBIN_PATH="/usr/local/zevenet/bin"
LIBEXEC_PATH="/usr/lib/nagios/plugins"
if [ ! -L ${LIBEXEC_PATH}/check_uplink ]; then
ln -s ${ZBIN_PATH}/check_uplink ${LIBEXEC_PATH}/check_uplink
fi

# Apply all migrating scripts to ZEVENET
MIG_DIR="/usr/local/zevenet/migrating/"
for SCRIPT in `ls $MIG_DIR`; do ${MIG_DIR}$SCRIPT; done

# Restarting ZEVENET service
echo "ZEVENET will be unavailable while the service is restarting."
/etc/init.d/zevenet stop
/etc/init.d/zevenet start

# Add ZEVENET Load Balancer service to boot process
update-rc.d zevenet defaults

# Setup motd.tail
cp /etc/motd.tail /etc/motd
if [ "`grep Debian /etc/issue`" != "" -o "`grep -i Zevenet /etc/issue`" != "" ]; then
sed -i "s/.*Debian.*/RELIANOID Community Edition \\\n \\\l/g" /etc/issue
fi

# Set the cron service
cp /usr/local/zevenet/share/zevenet.cron /etc/cron.d/zevenet
/etc/init.d/cron reload

# Change prompt color
sed -i "s/1;30m/0;37m/g" /etc/bash.bashrc 2> /dev/null

# Configure apt repository
perl -E " require Zevenet::System::Packages; &setSystemPackagesRepo();"
sed -i 's/ oldstable/ buster/g' /etc/apt/sources.list

## Run checkupdates to update message
$checkupdates_bin > /dev/null

echo "RELIANOID ADC installation completed."
24 changes: 16 additions & 8 deletions usr/local/zevenet/migrating/pound2zproxy.sh → DEBIAN/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@
#
###############################################################################

# Migrate pound config file to l7 proxy config file
for i in $(find /usr/local/zevenet/config/ -name "*pound.cfg");
do
echo "Migrating config file $i from pound to l7 proxy"
# Save zlb-stop and zlb-start to a temporal directory
tmp_start="/tmp/zlb-start"
tmp_stop="/tmp/zlb-stop"
zvn_start="/usr/local/zevenet/config/zlb-start"
zvn_stop="/usr/local/zevenet/config/zlb-stop"

sed -i -e 's/pound.socket/proxy.socket/' $i
sed -i -E 's/^LogLevel\s+0/LogLevel\t5/g' $i
if [ -f $zvn_start ]; then
mv $zvn_start $tmp_start
fi

if [ -f $zvn_stop ]; then
mv $zvn_stop $tmp_stop
fi

# Create the new GUI system group
groupadd -f webgui;
usermod -a -G webgui root;

mv "$i" "$(echo "$i" | sed s/pound.cfg/proxy.cfg/)"
done
2 changes: 2 additions & 0 deletions build-pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/workdir/
/build-context/
33 changes: 15 additions & 18 deletions usr/local/zevenet/migrating/zproxy_marks.pl → build-pkg/dockerfile-base
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/perl

###############################################################################
#
# ZEVENET Software License
Expand All @@ -22,21 +20,20 @@
#
###############################################################################

use strict;
use warnings;
require Zevenet::Farm::Core;
require Zevenet::Farm::HTTP::Backend;
require Zevenet::Farm::HTTP::Config;
FROM zevenet/zvn-builder-base:#{version}

# Base packages
RUN apt-get update && apt-get install -y \
libssl-dev \
libperl-dev

my $ng_cur = &getGlobalConfiguration( 'proxy_ng' );
# Use host user uid/gid, so the new files are owned by the user
# running the container
ARG host_uid
ARG host_gid

if ( $ng_cur eq "true" )
{
print "Setting new proxy directives on existing l7 farms";
my @farmsf = &getFarmsByType( 'http' );
push @farmsf, &getFarmsByType( 'https' );
foreach my $farm_name ( @farmsf )
{
&setHTTPFarmBackendsMarks( $farm_name );
}
}
# The -o option (non-unique) is a hack that avoid problems when
# the image is built as root
RUN groupadd -o -g ${host_uid} host_user && \
useradd -o -u ${host_uid} -g ${host_gid} host_user
USER host_user
Loading

0 comments on commit 6dc7a65

Please sign in to comment.