pull/24/head
Rawane Boubrima 2023-05-30 08:44:38 +02:00
parent e3cc666e9f
commit e561d13a9a
6 changed files with 33 additions and 55 deletions

View File

@ -15,3 +15,4 @@ for VERSION in `echo ${VERSIONS}`; do
fi
find . -maxdepth 1 -type d -name MISP_v${VERSION}\* -exec rm -rv {} \;
done

View File

@ -13,58 +13,22 @@ fi
SHA_SUMS="1 256 384 512"
checkInstaller () {
if [[ "${FLAVOUR}" == "rhel" ]] || [[ "${FLAVOUR}" == "centos" ]] || [[ "${FLAVOUR}" == "fedora" ]]; then
INSTsum=$(sha512sum ${0} | cut -f1 -d\ )
/usr/bin/wget --no-cache -q -O /tmp/INSTALL.sh.sha512 https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha512
chsum=$(cat /tmp/INSTALL.sh.sha512)
if [[ "${chsum}" == "${INSTsum}" ]]; then
echo "SHA512 matches"
else
echo "SHA512: ${chsum} does not match the installer sum of: ${INSTsum}"
# exit 1 # uncomment when/if PR is merged
fi
else
# TODO: Implement $FLAVOUR checks and install depending on the platform we are on
if [[ $(which shasum > /dev/null 2>&1 ; echo $?) -ne 0 ]]; then
checkAptLock
sudo apt install libdigest-sha-perl -qyy
for sum in $(echo ${SHA_SUMS}); do
/usr/bin/wget -q -O scripts/INSTALL.sh.sha${sum} https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha${sum}
INSTsum=$(shasum -a ${sum} scripts/INSTALL.sh | cut -f1 -d\ )
chsum=$(cat scripts/INSTALL.sh.sha${sum} | cut -f1 -d\ )
if [[ "$chsum" == "$INSTsum" ]]; then
echo "sha${sum} matches"
else
echo "sha${sum}: ${chsum} does not match the installer sum of: ${INSTsum}"
echo "Deleting installer, please run again."
rm scripts/INSTALL.sh
exit 1
fi
# SHAsums to be computed, not the -- notatiation is for ease of use with rhash
SHA_SUMS="--sha1 --sha256 --sha384 --sha512"
for sum in $(echo ${SHA_SUMS} |sed 's/--sha//g'); do
/usr/bin/wget --no-cache -q -O /tmp/INSTALL.sh.sha${sum} https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha${sum}
INSTsum=$(shasum -a ${sum} ${0} | cut -f1 -d\ )
chsum=$(cat /tmp/INSTALL.sh.sha${sum} | cut -f1 -d\ )
if [[ "${chsum}" == "${INSTsum}" ]]; then
echo "sha${sum} matches"
else
echo "sha${sum}: ${chsum} does not match the installer sum of: ${INSTsum}"
echo "Delete installer, re-download and please run again."
exit 1
fi
done
fi
done
}
#checkInstaller () {
# for sum in $(echo ${SHA_SUMS}); do
# /usr/bin/wget -q -O scripts/INSTALL.sh.sha${sum} https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha${sum}
# INSTsum=$(shasum -a ${sum} scripts/INSTALL.sh | cut -f1 -d\ )
# chsum=$(cat scripts/INSTALL.sh.sha${sum} | cut -f1 -d\ )
# if [[ "$chsum" == "$INSTsum" ]]; then
# echo "sha${sum} matches"
# else
# echo "sha${sum}: ${chsum} does not match the installer sum of: ${INSTsum}"
# echo "Deleting installer, please run again."
# rm scripts/INSTALL.sh
# exit 1
# fi
# done
#}
# Fetch and check installer
if [[ -f "scripts/INSTALL.sh" ]]; then
echo "Checking checksums"

View File

@ -39,6 +39,8 @@ PATH_TO_INSTALLER="scripts/${NAME_OF_INSTALLER}"
URL_TO_INSTALLER="https://raw.githubusercontent.com/${REPO}/${BRANCH}/INSTALL/${NAME_OF_INSTALLER}"
URL_TO_LICENSE="https://raw.githubusercontent.com/${REPO}/${BRANCH}/LICENSE"
UBUNTU_VERSION="20.04" # Update to Ubuntu 20.04
if [[ ! -z $DEBUG ]]; then
echo "Debug mode enabled."
echo "-------------------"

View File

@ -248,7 +248,7 @@
"iso_checksum_type": "sha512",
"iso_name": "ubuntu-20.04.6-server-amd64.iso",
"iso_path": "iso",
"iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-20.04.6-server-amd64.iso",
"iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/focal/release/ubuntu-20.04.6-server-amd64.iso",
"memory": "3072",
"no_proxy": "{{env `no_proxy`}}",
"ovftool_path": "ovftool",

View File

@ -70,3 +70,4 @@ d-i pkgsel/upgrade select safe-upgrade
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note

View File

@ -4,12 +4,22 @@
##useradd -U -G sudo -m -s /bin/bash thehive
##echo -e "thehive1234\nthehive1234" | passwd thehive
echo "--- Configuring sudo "
#echo "--- Configuring sudo "
##echo %thehive ALL=NOPASSWD:ALL > /etc/sudoers.d/thehive
echo "%misp ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/misp
#echo "%misp ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/misp
##chmod 0440 /etc/sudoers.d/thehive
chmod 0440 /etc/sudoers.d/misp
#chmod 0440 /etc/sudoers.d/misp
# Disable fancy progressbar
echo 'Dpkg::Progress-Fancy "0";' > /etc/apt/apt.conf.d/99progressbar
echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99progressbar
#echo 'Dpkg::Progress-Fancy "0";' > /etc/apt/apt.conf.d/99progressbar
#echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99progressbar
echo "--- Configuring sudo"
echo "misp ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/misp
chmod 0440 /etc/sudoers.d/misp
echo 'APT::ProgressBar::Fancy "0";' > /etc/apt/apt.conf.d/99progressbar
echo 'APT::Use-Pty "0";' >> /etc/apt/apt.conf.d/99progressbar