diff --git a/create-semaphore-db.sql b/create-semaphore-db.sql new file mode 100644 index 0000000..aaeeef4 --- /dev/null +++ b/create-semaphore-db.sql @@ -0,0 +1,23 @@ +CREATE DATABASE semaphore; +CREATE USER 'semaphore'@'localhost' IDENTIFIED BY 'semaphore'; +GRANT Usage ON *.* TO 'semaphore'@'localhost'; +GRANT Alter ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create view ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Delete ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Delete history ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Drop ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Index ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Insert ON semaphore.* TO 'semaphore'@'localhost'; +GRANT References ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Select ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Show view ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Trigger ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Update ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Alter routine ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create routine ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create temporary tables ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Execute ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Lock tables ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Show Create Routine ON semaphore.* TO 'semaphore'@'localhost'; + diff --git a/disable-rp-filter.sh b/disable-rp-filter.sh new file mode 100755 index 0000000..270d059 --- /dev/null +++ b/disable-rp-filter.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sysctl -a|grep \.rp_filter|gawk '{print $1}' |xargs -I{} sysctl -w {}=0 diff --git a/init-packages b/init-packages new file mode 100644 index 0000000..36b9480 --- /dev/null +++ b/init-packages @@ -0,0 +1,3 @@ +wget +curl +git diff --git a/init.sh b/init.sh new file mode 100644 index 0000000..44a9677 --- /dev/null +++ b/init.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +dnf install -y $( cat init-packages ) diff --git a/install-ansible.sh b/install-ansible.sh new file mode 100755 index 0000000..8c242f4 --- /dev/null +++ b/install-ansible.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +dnf install -y python3.12 python3.12-devel python3.12-pip + +update-alternatives --set python3 /usr/bin/python3.12 + +python3 -m pip install --upgrade pip + +python3 -m pip install --upgrade ansible diff --git a/install-ngtech-squid.sh b/install-ngtech-squid.sh new file mode 100755 index 0000000..1ff75b9 --- /dev/null +++ b/install-ngtech-squid.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +dnf module disable squid -y + +cat < /etc/yum.repos.d/ngtech-squid.repo +[ngtech-squid] +name=Rocky Linux \$releasever - NgTech Squid Repo +#mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=\$basearch&repo=BaseOS-\$releasever +baseurl=https://www.ngtech.co.il/repo/rocky/\$releasever/\$basearch/ +gpgcheck=0 +enabled=1 +countme=1 +EOF + +dnf check-update + +dnf install -y squid squid-helpers + +dnf install -y epel-release + +crb enable + +dnf install -y epel-release + +dnf install -y iptstate atop htop conntrack-tools curl jq wget iptables-services iptables-utils \ + tcpdump + +systemctl disable firewalld --now + +cp -vf rules.v4 /etc/sysconfig/iptables +cp -vf rules.v6 /etc/sysconfig/ip6tables + + +systemctl start iptables +systemctl start ip6tables + +systemctl enable iptables +systemctl enable ip6tables diff --git a/install-semaphore.sh b/install-semaphore.sh new file mode 100644 index 0000000..57cdbd7 --- /dev/null +++ b/install-semaphore.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +dnf install -y jq + +RPM_URL="https://github.com/semaphoreui/semaphore/releases/download/v2.10.22/semaphore_2.10.22_linux_amd64.rpm" +OUTPUT_FILENAME="semaphore_2.10.22_linux_amd64.rpm" + + +wget "${RPM_URL}" -O "${OUTPUT_FILENAME}" + +dnf localinstall -y ./semaphore*amd64.rpm + +dnf module disable mariadb -y + +wget "https://downloads.mariadb.com/MariaDB/mariadb_repo_setup" -O "mariadb_repo_setup" +# Checksum check +bash "mariadb_repo_setup" + +dnf install mariadb-server -y + +systemctl start mariadb +systemctl enable mariadb + +## Create database and user + +## setup semaphore + +## install config + +mkdir -p /etc/semaphore +cp -vf config.json /etc/semaphore/ + +##Create service + +cat > /etc/systemd/system/semaphore.service <