Skip to content

Commit

Permalink
Merge pull request #19 from afiniel/debian
Browse files Browse the repository at this point in the history
Debian
  • Loading branch information
afiniel authored Jan 27, 2025
2 parents 14cb3f3 + d16e1de commit 5f5d715
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 98 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ This installer provides an automated way to set up a full Yiimp mining pool on U
- Minimum 8GB RAM
- Clean domain or subdomain pointed to your VPS

## Supported OS
## Supported Ubuntu Version
- Ubuntu 16.04 LTS
- Ubuntu 18.04 LTS
- Ubuntu 20.04 LTS
- Ubuntu 22.04 LTS Install Works But system not tested
- Ubuntu 23.04 LTS Install Works But System not tested
- Ubuntu 24.04 LTS Install Works But system not tested

## Supported Debian Version
- Debian 12

## Quick Install

```bash
Expand Down
2 changes: 1 addition & 1 deletion daemon_builder/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
################################################################################

if [ -z "${TAG}" ]; then
TAG=v2.3.2
TAG=v2.3.3
fi

clear
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#########################################################

# Default version tag if not provided as environment variable
TAG=${TAG:-v2.3.2}
TAG=${TAG:-v2.3.3}

# File paths
YIIMPOOL_VERSION_FILE="/etc/yiimpoolversion.conf"
Expand Down
73 changes: 30 additions & 43 deletions install/preflight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,39 @@ source /etc/functions.sh

echo -e "${YELLOW}Running pre-flight checks...${NC}\n"

# Identify Ubuntu version and set permissions accordingly
UBUNTU_DESCRIPTION=$(lsb_release -rs)

if [[ "${UBUNTU_DESCRIPTION}" == "24.04" ]]; then
DISTRO=24
sudo chmod g-w /etc /etc/default /usr
elif [[ "${UBUNTU_DESCRIPTION}" == "23.04" ]]; then
DISTRO=23
sudo chmod g-w /etc /etc/default /usr
elif [[ "${UBUNTU_DESCRIPTION}" == "22.04" ]]; then
DISTRO=22
sudo chmod g-w /etc /etc/default /usr
elif [[ "${UBUNTU_DESCRIPTION}" == "20.04" ]]; then
DISTRO=20
sudo chmod g-w /etc /etc/default /usr
elif [[ "${UBUNTU_DESCRIPTION}" == "18.04" ]]; then
DISTRO=18
sudo chmod g-w /etc /etc/default /usr
elif [[ "${UBUNTU_DESCRIPTION}" == "16.04" ]]; then
DISTRO=16
sudo chmod g-w /etc /etc/default /usr
# Identify OS
if [[ -f /etc/lsb-release ]]; then

UBUNTU_DESCRIPTION=$(lsb_release -rs)
if [[ "${UBUNTU_DESCRIPTION}" == "24.04" ]]; then
DISTRO=24
elif [[ "${UBUNTU_DESCRIPTION}" == "23.04" ]]; then
DISTRO=23
elif [[ "${UBUNTU_DESCRIPTION}" == "22.04" ]]; then
DISTRO=22
elif [[ "${UBUNTU_DESCRIPTION}" == "20.04" ]]; then
DISTRO=20
elif [[ "${UBUNTU_DESCRIPTION}" == "18.04" ]]; then
DISTRO=18
elif [[ "${UBUNTU_DESCRIPTION}" == "16.04" ]]; then
DISTRO=16
else
echo "This script only supports Ubuntu 16.04, 18.04, 20.04, 23.04, and 24.04. Debian 12 is also supported."
exit 1
fi
else
echo "This script only supports Ubuntu 16.04, 18.04, 20.04, 23.04, and 24.04."
exit 1

DEBIAN_DESCRIPTION=$(cat /etc/debian_version | cut -d. -f1)
if [[ "${DEBIAN_DESCRIPTION}" == "12" ]]; then
DISTRO=12
else
echo "This script only supports Ubuntu 16.04, 18.04, 20.04, 23.04, and 24.04. Debian 12 is also supported."
exit 1
fi
fi

# Apply permissions based on the identified LTS version
# case "$DISTRO" in
# 16 | 18 | 20 | 22| 23 | 24)
# echo -e "${YELLOW}Setting permissions for Ubuntu $DISTRO...${NC}"
# sudo chmod g-w /etc /etc/default /usr
# echo -e "${GREEN}Permissions set.${NC}\n"
# ;;
# *)
# echo "Unsupported Ubuntu version: ${UBUNTU_DESCRIPTION}"
# exit 1
# ;;
# esac




# echo -e "${YELLOW}Setting permissions for Ubuntu $DISTRO...${NC}"
# sudo chmod g-w /etc /etc/default /usr
# echo -e "${GREEN}Permissions set.${NC}\n"

# Set permissions
sudo chmod g-w /etc /etc/default /usr

# Check if swap is needed and allocate if necessary
SWAP_MOUNTED=$(cat /proc/swaps | tail -n+2)
Expand Down
2 changes: 1 addition & 1 deletion ver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#########################################################

if [ -z "${TAG}" ]; then
TAG=v2.3.2
TAG=v2.3.3
fi

echo 'VERSION='"${TAG}"'' | sudo -E tee /etc/yiimpoolversion.conf >/dev/null 2>&1
2 changes: 1 addition & 1 deletion yiimp_single/nginx_confs/security.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ location ~ \.sh {

location ~ /\.ht {
deny all;
}
}
23 changes: 1 addition & 22 deletions yiimp_single/nginx_confs/web_default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,6 @@ server {
return 404;
}

# Add phpMyAdmin configuration
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}

location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}

location ~ \.sh {
return 404;
}
Expand All @@ -135,4 +114,4 @@ server {
allow all;
}

}
}
2 changes: 1 addition & 1 deletion yiimp_single/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ source compile_crypto.sh
source server_cleanup.sh
source motd.sh
source server_harden.sh
source phpmyadmin.sh
# source phpmyadmin.sh
source $STORAGE_ROOT/yiimp/.yiimp.conf

clear
Expand Down
6 changes: 3 additions & 3 deletions yiimp_single/stratum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ hide_output sudo make -C iniparser
cd secp256k1 && sudo chmod +x autogen.sh && hide_output sudo ./autogen.sh && hide_output sudo ./configure --enable-experimental --enable-module-ecdh --with-bignum=no --enable-endomorphism && hide_output sudo make -j$((`nproc`+1))

# Update Makefile if AutoExchange is enabled
if [[ "$AutoExchange" =~ ^[Yy][Ee]?[Ss]?$ ]]; then
sudo sed -i 's/CFLAGS += -DNO_EXCHANGE/#CFLAGS += -DNO_EXCHANGE/' Makefile
fi
# if [[ "$AutoExchange" =~ ^[Yy][Ee]?[Ss]?$ ]]; then
# sudo sed -i 's/CFLAGS += -DNO_EXCHANGE/#CFLAGS += -DNO_EXCHANGE/' Makefile
# fi

cd /home/crypto-data/yiimp/yiimp_setup/yiimp/stratum
hide_output sudo make -j$((`nproc`+1))
Expand Down
101 changes: 77 additions & 24 deletions yiimp_single/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,21 @@ elif [[ "$DISTRO" == "20" || "$DISTRO" == "22" || "$DISTRO" == "23" || "$DISTRO"
hide_output sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
echo -e "$GREEN => Complete${NC}"
fi

if [[ "$DISTRO" == "20" || "$DISTRO" == "22" || "$DISTRO" == "23" || "$DISTRO" == "24" ]]; then
echo
echo -e "$MAGENTA Detected$GREEN Distro $DISTRO $RED installing requirements.. ${NC}"
hide_output sudo apt install -y snapd
hide_output sudo snap install bitcoin-core
echo -e "$GREEN Completed${NC}"
elif [[ "$DISTRO" == "12" ]]; then
echo -e "$MAGENTA => Installing CertBot PPA <= ${NC}"
hide_output sudo apt install -y certbot
echo -e "$GREEN => Complete${NC}"
fi

#if [[ "$DISTRO" == "20" || "$DISTRO" == "22" || "$DISTRO" == "23" || "$DISTRO" == "24" ]]; then
# echo
# echo -e "$MAGENTA Detected$GREEN Distro $DISTRO $RED installing requirements.. ${NC}"
# hide_output sudo apt install -y snapd
# hide_output sudo snap install bitcoin-core
# echo -e "$GREEN Completed${NC}"
#fi

echo
echo -e "$MAGENTA Installing MariaDB..${NC}"
hide_output sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
Expand All @@ -87,6 +92,9 @@ case "$DISTRO" in
"24") # Ubuntu 24.04
sudo add-apt-repository -y 'deb [arch=amd64,arm64,ppc64el,s390x] https://mirror.mariadb.org/repo/11.6/ubuntu noble main' >/dev/null 2>&1
;;
"12") # Debian 12
sudo add-apt-repository -y 'deb [arch=amd64,arm64,ppc64el,s390x] https://mirror.mariadb.org/repo/11.6/debian bookworm main' >/dev/null 2>&1
;;
*)
echo "Unsupported Ubuntu version: $DISTRO"
exit 1
Expand Down Expand Up @@ -177,31 +185,65 @@ echo
echo -e "$CYAN => Installing PHP <= ${NC}"
sleep 3

if [ ! -f /etc/apt/sources.list.d/ondrej-php-bionic.list ]; then
hide_output sudo add-apt-repository -y ppa:ondrej/php
if [[ "$DISTRO" == "12" ]]; then
apt_install python3-launchpadlib
fi

if [[ "$DISTRO" == "16" || "$DISTRO" == "18" || "$DISTRO" == "20" || "$DISTRO" == "22" || "$DISTRO" == "23" || "$DISTRO" == "24" ]]; then
if [ ! -f /etc/apt/sources.list.d/ondrej-php-bionic.list ]; then
hide_output sudo add-apt-repository -y ppa:ondrej/php
fi
elif [[ "$DISTRO" == "12" ]]; then
if [ ! -f /etc/apt/sources.list.d/ondrej-php.list ]; then
hide_outputsudo apt-get install -y apt-transport-https lsb-release ca-certificates
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
hide_output sudo apt-get update
fi
fi

hide_output sudo apt-get update

if [[ "$DISTRO" == "16" || "$DISTRO" == "18" || "$DISTRO" == "20" || "$DISTRO" == "22" || "$DISTRO" == "23" || "$DISTRO" == "24" ]]; then
apt_install php7.3-fpm php7.3-opcache php7.3 php7.3-common php7.3-gd
apt_install php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi
apt_install php-pear php-auth-sasl mcrypt imagemagick libruby
apt_install php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3
apt_install php7.3-tidy php7.3-xmlrpc php7.3-xsl memcached php-memcache
apt_install php-imagick php-gettext php7.3-zip php7.3-mbstring
apt_install fail2ban ntpdate python3 python3-dev python3-pip
apt_install curl git sudo coreutils pollinate unzip unattended-upgrades cron
apt_install pwgen libgmp3-dev libmysqlclient-dev libcurl4-gnutls-dev
apt_install libkrb5-dev libldap2-dev libidn11-dev gnutls-dev librtmp-dev
apt_install build-essential libtool autotools-dev automake pkg-config libevent-dev bsdmainutils libssl-dev
apt_install automake cmake gnupg2 ca-certificates lsb-release nginx certbot libsodium-dev
apt_install libnghttp2-dev librtmp-dev libssh2-1 libssh2-1-dev libldap2-dev libidn11-dev libpsl-dev libkrb5-dev php7.3-memcache php7.3-memcached memcached
apt_install php8.1-mysql
apt_install libssh-dev libbrotli-dev php8.2-curl

apt_install php7.3-fpm php7.3-opcache php7.3 php7.3-common php7.3-gd
apt_install php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi
apt_install php-pear php-auth-sasl mcrypt imagemagick libruby
apt_install php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3
apt_install php7.3-tidy php7.3-xmlrpc php7.3-xsl memcached php-memcache
apt_install php-imagick php-gettext php7.3-zip php7.3-mbstring
apt_install fail2ban ntpdate python3 python3-dev python3-pip
apt_install curl git sudo coreutils pollinate unzip unattended-upgrades cron
apt_install pwgen libgmp3-dev libmysqlclient-dev libcurl4-gnutls-dev
apt_install libkrb5-dev libldap2-dev libidn11-dev gnutls-dev librtmp-dev
apt_install build-essential libtool autotools-dev automake pkg-config libevent-dev bsdmainutils libssl-dev
apt_install automake cmake gnupg2 ca-certificates lsb-release nginx certbot libsodium-dev
apt_install libnghttp2-dev librtmp-dev libssh2-1 libssh2-1-dev libldap2-dev libidn11-dev libpsl-dev libkrb5-dev php7.3-memcache php7.3-memcached memcached
apt_install php8.1-mysql
apt_install libssh-dev libbrotli-dev php8.2-curl

elif [[ "$DISTRO" == "12" ]]; then
# Install packages specific to Debian 12
apt_install php7.3-fpm php7.3-opcache php7.3 php7.3-common php7.3-gd
apt_install php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi
apt_install php-pear php-auth-sasl mcrypt imagemagick libruby
apt_install php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3
apt_install php7.3-tidy php7.3-xmlrpc php7.3-xsl memcached php-memcache
apt_install php-imagick php-gettext php7.3-zip php7.3-mbstring
apt_install fail2ban ntpdate python3 python3-dev python3-pip
apt_install curl git sudo coreutils pollinate unzip unattended-upgrades cron
apt_install pwgen libgmp3-dev libmysqlclient-dev libcurl4-gnutls-dev
apt_install libkrb5-dev libldap2-dev libidn11-dev gnutls-dev librtmp-dev
apt_install build-essential libtool autotools-dev automake pkg-config libevent-dev bsdmainutils libssl-dev
apt_install automake cmake gnupg2 ca-certificates lsb-release nginx certbot libsodium-dev
apt_install libnghttp2-dev librtmp-dev libssh2-1 libssh2-1-dev libldap2-dev libidn11-dev libpsl-dev libkrb5-dev php7.3-memcache php7.3-memcached memcached
apt_install php8.1-mysql
apt_install libssh-dev libbrotli-dev php8.2-curl

fi

if [[ ("$DISTRO" == "20" ) || "$DISTRO" == "22" || "$DISTRO" == "23" || "$DISTRO" == "24" ]]; then

apt_install php8.2-fpm php8.2-opcache php8.2 php8.2-common php8.2-gd php8.2-mysql php8.2-imap php8.2-cli
apt_install php8.2-cgi php8.2-curl php8.2-intl php8.2-pspell
apt_install php8.2-sqlite3 php8.2-tidy php8.2-xmlrpc php8.2-xsl php8.2-zip
Expand All @@ -210,6 +252,17 @@ if [[ ("$DISTRO" == "20" ) || "$DISTRO" == "22" || "$DISTRO" == "23" || "$DISTRO
sleep 2
sudo systemctl start php8.2-fpm
sudo systemctl status php8.2-fpm | sed -n "1,3p"

elif [[ "$DISTRO" == "12" ]]; then

apt_install php8.2-fpm php8.2-opcache php8.2 php8.2-common php8.2-gd php8.2-mysql php8.2-imap php8.2-cli
apt_install php8.2-cgi php8.2-curl php8.2-intl php8.2-pspell
apt_install php8.2-sqlite3 php8.2-tidy php8.2-xmlrpc php8.2-xsl php8.2-zip
apt_install php8.2-mbstring php8.2-memcache php8.2-memcached certbot
apt_install libssh-dev libbrotli-dev
sleep 2
sudo systemctl start php8.2-fpm
sudo systemctl status php8.2-fpm | sed -n "1,3p"
fi

echo -e "$CYAN => Fixing DB connection issue... ${NC}"
Expand Down

0 comments on commit 5f5d715

Please sign in to comment.