From fc71e3f9304ed51f3fd7ca544f38a30a590c8ba5 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Tue, 13 Apr 2021 09:15:12 +0200 Subject: migrate travis ci to github actions --- .github/prepare_debian.sh | 99 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100755 .github/prepare_debian.sh (limited to '.github/prepare_debian.sh') diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh new file mode 100755 index 00000000..40053206 --- /dev/null +++ b/.github/prepare_debian.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +set -x +set -e + +export DEBIAN_FRONTEND=noninteractive + +apt-get update +apt-get -y install software-properties-common +if [ $(lsb_release -is) = "Debian" ]; then + apt-add-repository non-free + apt-get update +fi +apt-get -y install perl autotools-dev libdbi-dev libldap2-dev libpq-dev libradcli-dev libnet-snmp-perl procps +apt-get -y install libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl snmpd +apt-get -y install fping snmp netcat smbclient vsftpd apache2 ssl-cert postfix libhttp-daemon-ssl-perl +apt-get -y install libdbd-sybase-perl libnet-dns-perl +apt-get -y install slapd ldap-utils +apt-get -y install gcc make autoconf automake gettext +apt-get -y install faketime +apt-get -y install libmonitoring-plugin-perl +apt-get -y install libcurl4-openssl-dev +apt-get -y install liburiparser-dev +apt-get -y install squid +apt-get -y install openssh-server +apt-get -y install mariadb-server mariadb-client libmariadb-dev +apt-get -y install cron iputils-ping +apt-get -y install iproute2 + +# remove ipv6 interface from hosts +if [ $(ip addr show | grep "inet6 ::1" | wc -l) -eq "0" ]; then + sed '/^::1/d' /etc/hosts > /tmp/hosts + cp -f /tmp/hosts /etc/hosts +fi + +ip addr show + +cat /etc/hosts + + +# apache +a2enmod ssl +a2ensite default-ssl +make-ssl-cert generate-default-snakeoil --force-overwrite +service apache2 start + +# squid +cp tools/squid.conf /etc/squid/squid.conf +service squid start + +# mariadb +service mariadb start +mysql -e "create database IF NOT EXISTS test;" -uroot + +# ldap +sed -e 's/cn=admin,dc=nodomain/'$(/usr/sbin/slapcat|grep ^dn:|awk '{print $2}')'/' -i .github/NPTest.cache +service slapd start + +# sshd +ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa +cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys +service ssh start +sleep 1 +ssh-keyscan localhost >> ~/.ssh/known_hosts +touch ~/.ssh/config + +# start one login session, required for check_users +( ssh -n -tt root@localhost "top" < /dev/null >/dev/null 2>&1 & ) +sleep 1 +who +ssh root@localhost "top -b -n 1" + +# snmpd +for DIR in /usr/share/snmp/mibs /usr/share/mibs; do + rm -f $DIR/ietf/SNMPv2-PDU \ + $DIR/ietf/IPSEC-SPD-MIB \ + $DIR/ietf/IPATM-IPMC-MIB \ + $DIR/iana/IANA-IPPM-METRICS-REGISTRY-MIB +done +mkdir -p /var/lib/snmp/mib_indexes +sed -e 's/^agentaddress.*/agentaddress 127.0.0.1/' -i /etc/snmp/snmpd.conf +service snmpd start + +# start cron, will be used by check_nagios +cron + +# start postfix +service postfix start + +# start ftpd +service vsftpd start + +# hostname +sed "/NP_HOST_TLS_CERT/s/.*/'NP_HOST_TLS_CERT' => '$(hostname)',/" -i /src/.github/NPTest.cache + +# create some test files to lower inodes +for i in $(seq 10); do + touch /media/ramdisk2/test.$1 +done -- cgit v1.2.3-74-g34f1 From 40e171b7cdb2262398728aa9b84e747a856d9c1f Mon Sep 17 00:00:00 2001 From: Jacob Hansen Date: Fri, 30 Apr 2021 09:38:19 +0200 Subject: Attempt to fix check_users Signed-off-by: Jacob Hansen --- .github/prepare_debian.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to '.github/prepare_debian.sh') diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh index 40053206..3693accf 100755 --- a/.github/prepare_debian.sh +++ b/.github/prepare_debian.sh @@ -65,10 +65,12 @@ ssh-keyscan localhost >> ~/.ssh/known_hosts touch ~/.ssh/config # start one login session, required for check_users -( ssh -n -tt root@localhost "top" < /dev/null >/dev/null 2>&1 & ) -sleep 1 -who -ssh root@localhost "top -b -n 1" +#( ssh -n -tt root@localhost "top" < /dev/null >/dev/null 2>&1 & ) +ssh -tt localhost /dev/null 2>/dev/null & +disown %1 +#sleep 1 +#who +#ssh root@localhost "top -b -n 1" # snmpd for DIR in /usr/share/snmp/mibs /usr/share/mibs; do -- cgit v1.2.3-74-g34f1 From de9f85c916db4515bd81f2a000d7fb57f8e0f46a Mon Sep 17 00:00:00 2001 From: Jacob Hansen Date: Fri, 30 Apr 2021 12:33:52 +0200 Subject: Use openssl generated cert The SSL certificate generate using make-ssl-cert seems to not work well with a our plugins. Causing a "CN could not be found" error to be shown. Using an OpenSSL generated certifiticate, seems to work better. Signed-off-by: Jacob Hansen --- .github/prepare_debian.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.github/prepare_debian.sh') diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh index 3693accf..a74f3464 100755 --- a/.github/prepare_debian.sh +++ b/.github/prepare_debian.sh @@ -41,8 +41,12 @@ cat /etc/hosts # apache a2enmod ssl a2ensite default-ssl -make-ssl-cert generate-default-snakeoil --force-overwrite -service apache2 start +# replace snakeoil certs with openssl generated ones as the make-ssl-cert ones +# seems to cause problems with our plugins +rm /etc/ssl/certs/ssl-cert-snakeoil.pem +rm /etc/ssl/private/ssl-cert-snakeoil.key +openssl req -nodes -newkey rsa:2048 -x509 -sha256 -days 365 -nodes -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=$(hostname)" +service apache2 restart # squid cp tools/squid.conf /etc/squid/squid.conf -- cgit v1.2.3-74-g34f1 From 6344d29143bfd80d511e6c2d4bd39b9f58e03f14 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Thu, 20 May 2021 17:49:46 +0200 Subject: remove useless comments Signed-off-by: Sven Nierlein --- .github/prepare_debian.sh | 4 ---- .github/workflows/test.yml | 38 +++----------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) (limited to '.github/prepare_debian.sh') diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh index a74f3464..c68b9f5d 100755 --- a/.github/prepare_debian.sh +++ b/.github/prepare_debian.sh @@ -69,12 +69,8 @@ ssh-keyscan localhost >> ~/.ssh/known_hosts touch ~/.ssh/config # start one login session, required for check_users -#( ssh -n -tt root@localhost "top" < /dev/null >/dev/null 2>&1 & ) ssh -tt localhost /dev/null 2>/dev/null & disown %1 -#sleep 1 -#who -#ssh root@localhost "top -b -n 1" # snmpd for DIR in /usr/share/snmp/mibs /usr/share/mibs; do diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e467957..512d28e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,29 +8,7 @@ on: jobs: # macos: -# name: Running tests on ${{ matrix.os }} -# strategy: -# fail-fast: false -# matrix: -# os: -# - macos-10.15 -# runs-on: ${{ matrix.os }} -# steps: -# -# - name: Git clone repository -# uses: actions/checkout@v2 -# #- name: Setup tmate session, see https://github.com/marketplace/actions/debugging-with-tmate -# # uses: mxschmitt/action-tmate@v3 -# - name: Prepare machine -# run: | -# brew install automake -# - name: Run the tests -# run: | -# tools/setup \ -# && ./configure --enable-libtap \ -# && make \ -# && make test - +# ... linux: runs-on: ubuntu-latest name: Running tests on ${{ matrix.distro }} @@ -38,22 +16,12 @@ jobs: fail-fast: false matrix: distro: - #- 'debian:10' - 'debian:testing' - #- 'ubuntu:20.10' - #- 'centos:7' - #- 'centos:8' + #... include: - #- distro: 'debian:10' - # prepare: .github/prepare_debian.sh - distro: 'debian:testing' prepare: .github/prepare_debian.sh - #- distro: 'ubuntu:20.10' - # prepare: .github/prepare_debian.sh - #- distro: 'centos:7' - # prepare: .github/prepare_centos.sh - #- distro: 'centos:8' - # prepare: .github/prepare_centos.sh + #... steps: - name: Git clone repository uses: actions/checkout@v2 -- cgit v1.2.3-74-g34f1 From f29ba217d7521efda868551eab2866067615e49a Mon Sep 17 00:00:00 2001 From: rincewind Date: Wed, 1 Sep 2021 10:48:32 +0200 Subject: Use netcat-openbsd for debian explicitely --- .github/prepare_debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/prepare_debian.sh') diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh index c68b9f5d..4021c104 100755 --- a/.github/prepare_debian.sh +++ b/.github/prepare_debian.sh @@ -13,7 +13,7 @@ if [ $(lsb_release -is) = "Debian" ]; then fi apt-get -y install perl autotools-dev libdbi-dev libldap2-dev libpq-dev libradcli-dev libnet-snmp-perl procps apt-get -y install libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl snmpd -apt-get -y install fping snmp netcat smbclient vsftpd apache2 ssl-cert postfix libhttp-daemon-ssl-perl +apt-get -y install fping snmp netcat-openbsd smbclient vsftpd apache2 ssl-cert postfix libhttp-daemon-ssl-perl apt-get -y install libdbd-sybase-perl libnet-dns-perl apt-get -y install slapd ldap-utils apt-get -y install gcc make autoconf automake gettext -- cgit v1.2.3-74-g34f1 From f7f7309b99f9f0eb4176a4c7cb8e5991d23b5b74 Mon Sep 17 00:00:00 2001 From: Lorenz <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 6 Nov 2022 23:12:41 +0100 Subject: Update GitHub runner (#1810) * Update action/checkout to v3 * Format debian prepare script --- .github/prepare_debian.sh | 61 ++++++++++++++++++++++++++++++++++------------ .github/workflows/test.yml | 2 +- 2 files changed, 46 insertions(+), 17 deletions(-) (limited to '.github/prepare_debian.sh') diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh index 4021c104..d8a76da6 100755 --- a/.github/prepare_debian.sh +++ b/.github/prepare_debian.sh @@ -11,21 +11,51 @@ if [ $(lsb_release -is) = "Debian" ]; then apt-add-repository non-free apt-get update fi -apt-get -y install perl autotools-dev libdbi-dev libldap2-dev libpq-dev libradcli-dev libnet-snmp-perl procps -apt-get -y install libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl snmpd -apt-get -y install fping snmp netcat-openbsd smbclient vsftpd apache2 ssl-cert postfix libhttp-daemon-ssl-perl -apt-get -y install libdbd-sybase-perl libnet-dns-perl -apt-get -y install slapd ldap-utils -apt-get -y install gcc make autoconf automake gettext -apt-get -y install faketime -apt-get -y install libmonitoring-plugin-perl -apt-get -y install libcurl4-openssl-dev -apt-get -y install liburiparser-dev -apt-get -y install squid -apt-get -y install openssh-server -apt-get -y install mariadb-server mariadb-client libmariadb-dev -apt-get -y install cron iputils-ping -apt-get -y install iproute2 +apt-get -y install perl \ + autotools-dev \ + libdbi-dev \ + libldap2-dev \ + libpq-dev \ + libradcli-dev \ + libnet-snmp-perl \ + procps \ + libdbi0-dev \ + libdbd-sqlite3 \ + libssl-dev \ + dnsutils \ + snmp-mibs-downloader \ + libsnmp-perl \ + snmpd \ + fping \ + snmp \ + netcat-openbsd \ + smbclient \ + vsftpd \ + apache2 \ + ssl-cert \ + postfix \ + libhttp-daemon-ssl-perl \ + libdbd-sybase-perl \ + libnet-dns-perl \ + slapd \ + ldap-utils \ + gcc \ + make \ + autoconf \ + automake \ + gettext \ + faketime \ + libmonitoring-plugin-perl \ + libcurl4-openssl-dev \ + liburiparser-dev \ + squid \ + openssh-server \ + mariadb-server \ + mariadb-client \ + libmariadb-dev \ + cron \ + iputils-ping \ + iproute2 # remove ipv6 interface from hosts if [ $(ip addr show | grep "inet6 ::1" | wc -l) -eq "0" ]; then @@ -37,7 +67,6 @@ ip addr show cat /etc/hosts - # apache a2enmod ssl a2ensite default-ssl diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f93930a..d2785a41 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: #... steps: - name: Git clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 #- name: Setup tmate session, see https://github.com/marketplace/actions/debugging-with-tmate # uses: mxschmitt/action-tmate@v3 - name: Run the tests on ${{ matrix.distro }} -- cgit v1.2.3-74-g34f1 From 843f17918886edd5c8d14e5a9967785c654053c8 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Mon, 6 Feb 2023 05:45:36 +0000 Subject: Adding non-free source list (Closes: #1837) (due https://lists.debian.org/debian-devel-announce/2023/02/msg00000.html) --- .github/prepare_debian.sh | 1 + 1 file changed, 1 insertion(+) (limited to '.github/prepare_debian.sh') diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh index d8a76da6..5222659e 100755 --- a/.github/prepare_debian.sh +++ b/.github/prepare_debian.sh @@ -5,6 +5,7 @@ set -e export DEBIAN_FRONTEND=noninteractive +sed "s/main/non-free contrib/g" /etc/apt/sources.list.d/debian.sources > /etc/apt/sources.list.d/debian-nonfree.sources apt-get update apt-get -y install software-properties-common if [ $(lsb_release -is) = "Debian" ]; then -- cgit v1.2.3-74-g34f1