From 3413c60c65cad67096eb3001ab3b74774e6e6a2f Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Mon, 5 Apr 2021 19:19:17 +0900 Subject: [PATCH] chg: [installer] Latest installer --- INSTALL/INSTALL.sh | 138 +++++++++++++++++++++++++------------- INSTALL/INSTALL.sh.sfv | 6 +- INSTALL/INSTALL.sh.sha1 | 2 +- INSTALL/INSTALL.sh.sha256 | 2 +- INSTALL/INSTALL.sh.sha384 | 2 +- INSTALL/INSTALL.sh.sha512 | 2 +- 6 files changed, 99 insertions(+), 53 deletions(-) diff --git a/INSTALL/INSTALL.sh b/INSTALL/INSTALL.sh index a59cbc18c..c16a1b997 100755 --- a/INSTALL/INSTALL.sh +++ b/INSTALL/INSTALL.sh @@ -1149,7 +1149,6 @@ theEnd () { sudo su - ${MISP_USER} fi } -## End Function Section Nothing allowed in .md after this line ## aptUpgrade () { debug "Upgrading system" @@ -1201,6 +1200,13 @@ installCoreDeps () { sudo apt-get install python3-dev python3-pip libxml2-dev libxslt1-dev zlib1g-dev python-setuptools -qy } +upgradeToPHP74 () { + sudo apt install software-properties-common -qy + sudo add-apt-repository ppa:ondrej/php -y + sudo apt update + sudo apt dist-upgrade -y +} + # Install Php 7.4 dependencies installDepsPhp74 () { debug "Installing PHP 7.4 dependencies" @@ -1208,13 +1214,13 @@ installDepsPhp74 () { PHP_INI=${PHP_ETC_BASE}/apache2/php.ini checkAptLock sudo apt install -qy \ - libapache2-mod-php \ - php php-cli \ - php-dev \ - php-json php-xml php-mysql php7.4-opcache php-readline php-mbstring php-zip \ - php-redis php-gnupg \ - php-intl php-bcmath \ - php-gd + libapache2-mod-php7.4 \ + php7.4 php7.4-cli \ + php7.4-dev \ + php7.4-json php7.4-xml php7.4-mysql php7.4-opcache php7.4-readline php7.4-mbstring php7.4-zip \ + php7.4-redis php7.4-gnupg \ + php7.4-intl php7.4-bcmath \ + php7.4-gd for key in upload_max_filesize post_max_size max_execution_time max_input_time memory_limit do @@ -1277,6 +1283,7 @@ installDepsPhp72 () { sudo sed -i "s/^\(session.sid_length\).*/\1 = $(eval echo \${session0sid_length})/" $PHP_INI sudo sed -i "s/^\(session.use_strict_mode\).*/\1 = $(eval echo \${session0use_strict_mode})/" $PHP_INI } +## End Function Section Nothing allowed in .md after this line ## # Install Php 7.0 dependencies installDepsPhp70 () { @@ -2179,16 +2186,20 @@ viper () { } -enableOptionalRHEL8 () { - sudo subscription-manager refresh - - # The following is needed for -devel repos and ONLY for misp-modules, ignore if not needed - sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms - # Software Collections is available for Red Hat Enterprise Linux 7 and previous supported releases. Starting with Red Hat Enterprise Linux 8, the content traditionally consumed via Software Collections is now part of Application Streams. Please see the Application Streams Life Cycle documentation for that release. Source: https://access.redhat.com/support/policy/updates/rhscl +## 0_RHEL_SCL.sh ## +enableReposRHEL7 () { + sudo subscription-manager refresh + sudo subscription-manager repos --enable rhel-7-server-optional-rpms + sudo subscription-manager repos --enable rhel-7-server-extras-rpms +} + +enableEPEL () { + sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y + sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y + sudo yum install yum-utils -y + sudo yum-config-manager --enable remi-php74 } -## 0_RHEL7_SCL.sh ## -## 0_RHEL7_EPEL.sh ## centosEPEL () { # We need some packages from the Extra Packages for Enterprise Linux repository sudo yum install epel-release -y @@ -2759,6 +2770,7 @@ generateInstaller () { perl -pe 's/^## 0_apt-upgrade.sh ##/`cat 0_apt-upgrade.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 0_sudoKeeper.sh ##/`cat 0_sudoKeeper.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 0_installCoreDeps.sh ##/`cat 0_installCoreDeps.sh`/ge' -i INSTALL.tpl.sh + perl -pe 's/^## 0_upgradePhp74.sh ##/`cat 0_upgradePhp74.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 0_installDepsPhp74.sh ##/`cat 0_installDepsPhp74.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 0_installDepsPhp73.sh ##/`cat 0_installDepsPhp73.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 0_installDepsPhp72.sh ##/`cat 0_installDepsPhp72.sh`/ge' -i INSTALL.tpl.sh @@ -2782,9 +2794,11 @@ generateInstaller () { perl -pe 's/^## 6_viper.sh ##/`cat 6_viper.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 6_ssdeep.sh ##/`cat 6_ssdeep.sh`/ge' -i INSTALL.tpl.sh - perl -pe 's/^## 0_RHEL_SCL.sh ##/`cat 0_RHEL_SCL.sh`/ge' -i INSTALL.tpl.sh + perl -pe 's/^## 0_RHEL7_SCL.sh ##/`cat 0_RHEL7_SCL.sh`/ge' -i INSTALL.tpl.sh + perl -pe 's/^## 0_RHEL8_SCL.sh ##/`cat 0_RHEL8_SCL.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 0_CentOS_EPEL.sh ##/`cat 0_CentOS_EPEL.sh`/ge' -i INSTALL.tpl.sh - perl -pe 's/^## 0_RHEL_EPEL.sh ##/`cat 0_RHEL_EPEL.sh`/ge' -i INSTALL.tpl.sh + perl -pe 's/^## 0_RHEL7_EPEL.sh ##/`cat 0_RHEL7_EPEL.sh`/ge' -i INSTALL.tpl.sh + perl -pe 's/^## 0_EPEL_REMI.sh ##/`cat 0_EPEL_REMI.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 0_yumInstallCoreDeps.sh ##/`cat 0_yumInstallCoreDeps.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 1_mispCoreInstall_RHEL.sh ##/`cat 1_mispCoreInstall_RHEL.sh`/ge' -i INSTALL.tpl.sh perl -pe 's/^## 1_installCake_RHEL.sh ##/`cat 1_installCake_RHEL.sh`/ge' -i INSTALL.tpl.sh @@ -2934,10 +2948,6 @@ installSupported () { [[ -n $CORE ]] || [[ -n $ALL ]] && coreCAKE progress 4 - # Update Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies - functionLocation('generic/MISP_CAKE_init.md') - [[ -n $CORE ]] || [[ -n $ALL ]] && updateGOWNT - progress 4 - # Disable spinner #(kill $SPIN_PID 2>&1) >/dev/null @@ -2955,6 +2965,10 @@ installSupported () { [[ -n $MODULES ]] || [[ -n $ALL ]] && mispmodules progress 4 + # Update Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies - functionLocation('generic/MISP_CAKE_init.md') + [[ -n $CORE ]] || [[ -n $ALL ]] && updateGOWNT + progress 4 + # Install misp-modules - functionLocation('generic/misp-modules-cake.md') [[ -n $MODULES ]] || [[ -n $ALL ]] && modulesCAKE progress 4 @@ -3252,44 +3266,73 @@ installMISPRHEL () { space echo "Proceeding with MISP core installation on RHEL ${dist_version}" space - + id -u "${MISP_USER}" > /dev/null if [[ $? -eq 1 ]]; then debug "Creating MISP user" sudo useradd -r "${MISP_USER}" fi - - debug "Enabling Extras Repos (SCL)" - if [[ "${DISTRI}" == "rhel7" ]]; then - sudo subscription-manager register --auto-attach - enableReposRHEL - enableEPEL - else # CentOS - centosEPEL + + # Register system if RHEL + if [[ "${DISTRI}" =~ ^[rhel].* ]]; then + registerRHEL fi - debug "Installing System Dependencies" - yumInstallCoreDeps + debug "Enabling Extras Repos (SCL)" + if [[ "${DISTRI}" == "rhel7" ]]; then + enableReposRHEL7 + enableEPEL + debug "Installing System Dependencies" + yumInstallCoreDeps + debug "Installing MISP code" + installCoreRHEL7 + debug "Install Cake PHP" + installCake_RHEL + debug "Preparing Database" + prepareDB_RHEL + fi + + if [[ "${DISTRI}" == "fedora33" ]]; then + enableREMI_f33 + installCoreRHEL8 + installCake_RHEL8 + permissions_RHEL8 + prepareDB_RHEL8 + apacheConfig_RHEL8 + debug "Configuring Apache" + apacheConfig_RHEL + fi + + if [[ "${DIST_VER}" =~ ^[8].* ]]; then + enableEPEL_REMI_8 + installCoreRHEL8 + installCake_RHEL8 + permissions_RHEL8 + prepareDB_RHEL8 + apacheConfig_RHEL8 + fi + + if [[ "${DISTRI}" == "centos7" ]]; then + centosEPEL + debug "Installing MISP code" + debug "Installing System Dependencies" + yumInstallCoreDeps + installCoreRHEL7 + debug "Install Cake PHP" + installCake_RHEL + debug "Preparing Database" + prepareDB_RHEL + debug "Configuring Apache" + apacheConfig_RHEL + fi debug "Enabling Haveged for additional entropy" sudo yum install haveged -y sudo systemctl enable --now haveged.service - debug "Installing MISP code" - installCoreRHEL - - debug "Install Cake PHP" - installCake_RHEL - debug "Setting File permissions" permissions_RHEL - debug "Preparing Database" - prepareDB_RHEL - - debug "Configuring Apache" - apacheConfig_RHEL - debug "Setting up firewall" firewall_RHEL @@ -3317,6 +3360,8 @@ installMISPRHEL () { space mispmodulesRHEL + # Another sleep to avoid RC + sleep 3 modulesCAKE echo "MISP modules installation finished." @@ -3421,7 +3466,8 @@ if [[ "${FLAVOUR}" == "ubuntu" ]]; then if [[ "${RELEASE}" == "18.04" ]]; then echo "Install on Ubuntu 18.04 LTS fully supported." echo "Please report bugs/issues here: https://github.com/MISP/MISP/issues" - installSupported && exit || exit + upgradeToPHP74 + installSupported PHP="7.4" && exit || exit fi if [[ "${RELEASE}" == "20.04" ]]; then echo "Install on Ubuntu 20.04 LTS fully supported." diff --git a/INSTALL/INSTALL.sh.sfv b/INSTALL/INSTALL.sh.sfv index b0741c013..a443afdc2 100644 --- a/INSTALL/INSTALL.sh.sfv +++ b/INSTALL/INSTALL.sh.sfv @@ -1,5 +1,5 @@ -; Generated by RHash v1.3.9 on 2021-04-02 at 19:00.10 +; Generated by RHash v1.3.9 on 2021-04-05 at 19:19.05 ; Written by Kravchenko Aleksey (Akademgorodok) - http://rhash.sf.net/ ; -; 148678 19:00.10 2021-04-02 INSTALL.sh -INSTALL.sh 64BA3BE8A7A57C393B5507218C0331E007713FBF 8DED9ED577D909FC4FBA4B70D1AB66F192CB97054BC0CF933952AC88F3F76BAD E6FE2C2FCB191D72799B93AEA1304AEB90CEDA4FA4FAF499A7EFBC01BA6EDEDD02158CE026BA9DAF4ACD28D0D4DDEED8 206E165A891331CB420126C1AEDA58EF73FA0F1245CFF8B887A1FE8DE9FA47D5A102C3250ED5F1C264113FB6E28382EAC6225099D63693B273FC9122C30C9B63 +; 149799 19:19.05 2021-04-05 INSTALL.sh +INSTALL.sh 319139B1ED1011A030DC243E1D8B3E7DF1E711D8 BF057F288FC56D6E5A1DD23701D21E7A5783AD7CA284113A368234D6E30AB059 CCCA3AD338D3DC00CB84EF2B2CCAD3FD7CA9DE7A308B49AEBCD86D660ED8CCFC02E038DA4AE2EB8F22B3BB0BCBD3B905 1BAC528C4A805FB6774A68BC954C4546AC0DD0A64618DE6947E25ED9F8C94873EA67B9C577F0D42347AFE0A13741C2676099D84FF11071F776FF5CBB476D4B5D diff --git a/INSTALL/INSTALL.sh.sha1 b/INSTALL/INSTALL.sh.sha1 index a57940a12..86fd472ca 100644 --- a/INSTALL/INSTALL.sh.sha1 +++ b/INSTALL/INSTALL.sh.sha1 @@ -1 +1 @@ -64ba3be8a7a57c393b5507218c0331e007713fbf INSTALL.sh +319139b1ed1011a030dc243e1d8b3e7df1e711d8 INSTALL.sh diff --git a/INSTALL/INSTALL.sh.sha256 b/INSTALL/INSTALL.sh.sha256 index 4ad7fc226..fd4e497e0 100644 --- a/INSTALL/INSTALL.sh.sha256 +++ b/INSTALL/INSTALL.sh.sha256 @@ -1 +1 @@ -8ded9ed577d909fc4fba4b70d1ab66f192cb97054bc0cf933952ac88f3f76bad INSTALL.sh +bf057f288fc56d6e5a1dd23701d21e7a5783ad7ca284113a368234d6e30ab059 INSTALL.sh diff --git a/INSTALL/INSTALL.sh.sha384 b/INSTALL/INSTALL.sh.sha384 index b027c9128..2c515a29b 100644 --- a/INSTALL/INSTALL.sh.sha384 +++ b/INSTALL/INSTALL.sh.sha384 @@ -1 +1 @@ -e6fe2c2fcb191d72799b93aea1304aeb90ceda4fa4faf499a7efbc01ba6ededd02158ce026ba9daf4acd28d0d4ddeed8 INSTALL.sh +ccca3ad338d3dc00cb84ef2b2ccad3fd7ca9de7a308b49aebcd86d660ed8ccfc02e038da4ae2eb8f22b3bb0bcbd3b905 INSTALL.sh diff --git a/INSTALL/INSTALL.sh.sha512 b/INSTALL/INSTALL.sh.sha512 index 7d0e5b688..6c7e7d262 100644 --- a/INSTALL/INSTALL.sh.sha512 +++ b/INSTALL/INSTALL.sh.sha512 @@ -1 +1 @@ -206e165a891331cb420126c1aeda58ef73fa0f1245cff8b887a1fe8de9fa47d5a102c3250ed5f1c264113fb6e28382eac6225099d63693b273fc9122c30c9b63 INSTALL.sh +1bac528c4a805fb6774a68bc954c4546ac0dd0a64618de6947e25ed9f8c94873ea67b9c577f0d42347afe0a13741c2676099d84ff11071f776ff5cbb476d4b5d INSTALL.sh