initial work

This commit is contained in:
David Young
2026-04-09 13:42:42 -06:00
parent e7fb83438c
commit 3aeee58730
6 changed files with 91 additions and 116 deletions

View File

@@ -28,14 +28,14 @@ print_logo
cd ~
sudo -v
echo "Getting the latest version of HamPack..."
echo "Getting the latest version of HamPackServer..."
rm -rf ~/.local/share/HamPack
git clone https://gitea.young.computer/david/HamPack.git ~/.local/share/HamPack > /dev/null
git clone https://gitea.young.computer/david/HamPackServer.git ~/.local/share/HamPackServer > /dev/null
sudo cp ~/.local/share/HamPack/hampackrefresh ~/.local/bin/hampackrefresh
sudo cp ~/.local/share/HamPack/hampackupdate ~/.local/bin/hampackupdate
sudo cp ~/.local/share/HamPack/hampackserverrefresh ~/.local/bin/hampackserverrefresh
sudo cp ~/.local/share/HamPack/hampackserverupdate ~/.local/bin/hampackserverupdate
cd ~/.local/share/HamPack
cd ~/.local/share/HamPackServer
# Source utility functions
source utils.sh
@@ -52,42 +52,87 @@ source packages.conf
cd ~/
# Install yay AUR helper if not present
#if ! command -v yay &> /dev/null; then
# echo "Installing yay AUR helper..."
# sudo pacman -S --needed git base-devel --noconfirm
# if [[ -d "yay" ]]; then
# echo "yay directory already exists, removing it..."
# rm -rf yay
# fi
# echo "Cloning yay repository..."
# git clone https://aur.archlinux.org/yay.git
# cd yay
# echo "Building yay..."
# makepkg -si --noconfirm
# cd ..
# rm -rf yay
#else
# echo "yay is already installed."
#fi
echo "Installing system utilities..."
install_packages "${UTILITIES[@]}"
echo "Installing applications..."
install_packages "${APPLICATIONS[@]}"
echo "Installing servers..."
install_packages "${SERVERS[@]}"
cd ~/.local/share/HamPack
echo "Installing Flatpak applications..."
. install-flatpaks.sh
if [ ! -d "$HOME/.nvm" ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
else
echo "nvm is already installed, skipping."
fi
echo "Installing stand-alone compiled applications..."
if ! command -v node &> /dev/null; then
nvm install --lts
else
echo "Node.js is already installed, skipping."
fi
if ! pacman -Qi apache &> /dev/null; then
echo "Installing Apache..."
sudo pacman -S --noconfirm apache
sudo systemctl enable httpd
sudo systemctl start httpd
else
echo "Apache is already installed, skipping."
fi
if ! pacman -Qi mariadb &> /dev/null; then
echo "Installing MariaDB (MySQL)..."
sudo pacman -S --noconfirm mariadb
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl enable mariadb
sudo systemctl start mariadb
else
echo "MariaDB is already installed, skipping."
fi
if ! pacman -Qi php php-curl php-mbstring php-xml &> /dev/null; then
sudo pacman -S php php-curl php-mbstring php-xml
else
echo "PHP packages are already installed, skipping."
fi
echo "Enabling PHP extensions in /etc/php/php.ini..."
for ext in curl mbstring xml pdo_mysql mysqli; do
sudo sed -i "s/^;extension=${ext}$/extension=${ext}/" /etc/php/php.ini
done
# Install Cloudlog
CLOUDLOG_DIR="/srv/http/cloudlog"
CLOUDLOG_DB="cloudlog"
CLOUDLOG_DB_USER="cloudlog"
CLOUDLOG_DB_PASS="cloudlog"
if [ ! -d "$CLOUDLOG_DIR" ]; then
echo "Installing Cloudlog..."
sudo git clone https://github.com/magicbug/Cloudlog.git "$CLOUDLOG_DIR"
# Set ownership and permissions (Arch Apache runs as 'http')
sudo chown -R http:http "$CLOUDLOG_DIR"
sudo chmod -R g+rw "$CLOUDLOG_DIR"
# Create MariaDB database and user
echo "Creating Cloudlog database..."
sudo mysql -u root <<EOF
CREATE DATABASE IF NOT EXISTS ${CLOUDLOG_DB};
CREATE USER IF NOT EXISTS '${CLOUDLOG_DB_USER}'@'localhost' IDENTIFIED BY '${CLOUDLOG_DB_PASS}';
GRANT ALL PRIVILEGES ON ${CLOUDLOG_DB}.* TO '${CLOUDLOG_DB_USER}'@'localhost';
FLUSH PRIVILEGES;
EOF
sudo systemctl restart httpd
echo "Cloudlog installed. Complete setup by visiting http://localhost/cloudlog/install"
else
echo "Cloudlog is already installed, skipping."
fi
# Install Compiled Servers
echo "Installing compiled servers..."
. install-compiled.sh
curl -LsSf uvx.sh/not1mm/install.sh | sh
if ! ls /usr/lib/modules/$(uname -r) > /dev/null 2>&1; then
echo "HamPack is installed. A newer kernel has been installed, a reboot is recommended."
read -rp "Reboot now? [y/N] " response