This repository has been archived by the owner on Dec 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
145 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
readonly OS='redhat' | ||
readonly OS_SUPPORTED_VERSION="7.0" | ||
readonly OS_VERSION_FILE="/etc/redhat-release" | ||
readonly FPM_WWW_POOL="/etc/opt/rh/rh-php73/php-fpm.d/www.conf" | ||
readonly FPM_SERVICE="rh-php73-php-fpm" | ||
readonly WWW_USER="nginx" | ||
readonly WWW_USER_HOME="/var/opt/rh/rh-nginx116/lib/nginx" | ||
readonly GNUPG_HOME='/var/lib/nginx/.gnupg' | ||
readonly CRONTAB_DIR='/var/spool/cron/' | ||
readonly PHP_EXT_DIR='/etc/opt/rh/rh-php73/php.d' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
rh-php73-php-intl | ||
rh-php73-php-gd | ||
rh-php73-php-mysqlnd | ||
rh-php73-php-pdo | ||
rh-php73-php-pear | ||
rh-php73-php-devel | ||
rh-php73-php-mbstring | ||
rh-php73-php-fpm | ||
rh-php73-php-ldap | ||
rh-nginx116-nginx | ||
gcc | ||
git | ||
policycoreutils-python | ||
unzip | ||
wget | ||
python2-certbot-nginx | ||
scl-utils | ||
gpgme-devel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
setup_firewall() { | ||
local zone=public | ||
local services=(http https) | ||
banner "Opening ports 80 and 443 on firewall" | ||
|
||
for i in "${services[@]}"; do | ||
firewall-cmd --permanent --zone="$zone" --add-service="$i" | ||
done | ||
|
||
enable_service firewalld | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
activate_scl() { | ||
source /opt/rh/rh-php73/enable | ||
source /opt/rh/rh-nginx116/enable | ||
cat <<EOF > /etc/profile.d/passbolt_scl.sh | ||
#!/bin/bash | ||
source scl_source enable rh-php73 | ||
source scl_source enable rh-nginx116 | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
setup_yum() { | ||
install_packages yum-utils epel-release | ||
if ! yum list installed | grep remi-release; then | ||
yum -y install "$REMI_PHP_URL" | ||
fi | ||
yum-config-manager --enable "$REMI_PHP_VERSION" | ||
local os="${1:-centos}" | ||
case $os in | ||
centos) | ||
install_packages "yum-utils epel-release $REMI_PHP_URL" | ||
yum-config-manager --enable "$REMI_PHP_VERSION" | ||
;; | ||
redhat) | ||
enable_repos | ||
if ! yum list installed | grep epel-release; then | ||
install_packages "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" | ||
fi | ||
esac | ||
} | ||
|
||
|
||
enable_repos() { | ||
local repos=(rhel-server-rhscl-7-rpms rhel-7-server-extras-rpms rhel-7-server-optional-rpms) | ||
local enabled_repos="" | ||
|
||
enabled_repos="$(subscription-manager repos --list-enabled | grep 'Repo ID' | awk '{print $3}')" | ||
for repo in "${repos[@]}"; do | ||
if ! [[ "$enabled_repos" == *"$repo"* ]]; then | ||
subscription-manager repos --enable "$repo" | ||
fi | ||
done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
centos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
main(){ | ||
init_config | ||
get_options "$@" | ||
validate_os 'redhat' | ||
disclaimer | ||
interactive_prompter | ||
banner 'Installing os dependencies...' | ||
setup_yum 'redhat' | ||
install_packages "$(cat "$script_directory/conf/packages.txt")" | ||
activate_scl | ||
mysql_setup | ||
install_gpg_extension | ||
setup_fpm 'rh-php73-php-fpm' | ||
setup_gpg_keyring | ||
passbolt_install | ||
setup_firewall | ||
setup_selinux | ||
setup_nginx 'rh-nginx116-nginx' | ||
setup_entropy | ||
cron_job | ||
installation_complete | ||
} | ||
|
||
main "$@" 2>&1 | tee -a install.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters