Update install.sh & README.md (#37)

* Update install.sh

Add support for more Linux distros as opposed to only being Debian.
Now supports: Debian/Ubuntu, Fedora, CentOS & Arch Linux.

* Update README.md

* Update install.sh

Added a repository update before installing on all platforms, added output for what the script is doing i.e installing docker, compose, git etc
This commit is contained in:
sina 2024-08-23 07:43:50 +01:00 committed by GitHub
parent a5c8752387
commit 4f02167300
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 128 additions and 17 deletions

View File

@ -1,14 +1,16 @@
# wand # wand
Wand makes it easy to configure dash, houdini and a media server. Wand makes it easy to configure dash, houdini and a media server utilizing docker & docker-compose.
## Install script > [!NOTE]
> This can also be ran on Windows using WSL.
## Installation script
**Step 1** run the script **Step 1** run the script
```bash ```bash
bash <(curl -s https://raw.githubusercontent.com/solero/wand/master/install.sh) bash <(curl -s https://raw.githubusercontent.com/solero/wand/master/install.sh)
``` ```
**Step 2** Answer Questions **Step 2** Answer Questions which are:
the questions are:
* Database password (Leave blank for random password) * Database password (Leave blank for random password)
* Hostname (example: `clubpenguin.com`) (Leave empty for localhost) * Hostname (example: `clubpenguin.com`) (Leave empty for localhost)
* External IP Address (Leave empty for localhost) * External IP Address (Leave empty for localhost)
@ -17,23 +19,57 @@ Run this command:
```bash ```bash
$ cd wand && sudo docker-compose up $ cd wand && sudo docker-compose up
``` ```
## Basic setup ## Manual setup
**Step 1** Install git, docker & docker-compose > [!IMPORTANT]
> This is not recommended for beginners. If you're not sure what you're doing, use the install script.
**Step 1** Choose your Linux Distribution
<details>
<summary>Debian/Ubuntu</summary>
```bash ```bash
$ sudo apt update $ sudo apt update
$ sudo apt install docker.io git curl $ sudo apt install git curl
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sh get-docker.sh
$ sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose $ sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose
``` ```
</details>
<details>
<summary>Fedora/RHEL</summary>
```bash
$ sudo dnf update
$ sudo dnf install git curl
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sh get-docker.sh
$ sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
```
</details>
<details>
<summary>Arch based distros</summary>
```bash
$ sudo pacman -Syu
$ sudo pacman -S docker docker-compose git curl
$ systemctl start docker.service
$ systemctl enable docker.service
```
</details>
**Step 2** Clone the repository & submodules **Step 2** Clone the repository & submodules
```bash ```bash
$ git clone --recurse-submodules https://github.com/solero/wand && cd wand $ git clone --recurse-submodules https://github.com/solero/wand && cd wand
``` ```
**Step 3** Edit the config file **Step 3** Edit the config file (optional, default values are fine for a local setup)
```bash ```bash
$ nano .env $ nano .env
``` ```

View File

@ -1,5 +1,20 @@
#!/bin/bash #!/bin/bash
clear clear
print_banner() {
echo '
__ __ _ _ _____
\ \ / /\ | \ | | __ \
\ \ /\ / / \ | \| | | | |
\ \/ \/ / /\ \ | . ` | | | |
\ /\ / ____ \| |\ | |__| |
\/ \/_/ \_\_| \_|_____/
Wand Installation Script
'
}
print_banner
echo "Please answer these questions to set up the game:" echo "Please answer these questions to set up the game:"
echo "Enter password for the database (leave empty for a random password):" echo "Enter password for the database (leave empty for a random password):"
dbpass="" dbpass=""
@ -36,20 +51,80 @@ fi
read -p "Do you want to run the game when the installation ends? (y/N): " run_game read -p "Do you want to run the game when the installation ends? (y/N): " run_game
install_docker_official() {
echo "Installing Docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo systemctl start docker
sudo systemctl enable docker
}
if [[ $(uname) == "Linux" ]]; then if [[ $(uname) == "Linux" ]]; then
echo "Setting up the environment." echo "Setting up the environment for Linux."
sudo apt update
sudo apt install docker.io git curl -y # Detect the package manager
if command -v apt &> /dev/null || command -v dnf &> /dev/null || command -v yum &> /dev/null; then
if command -v apt &> /dev/null; then
PKG_MANAGER="apt"
INSTALL_CMD="sudo apt"
elif command -v dnf &> /dev/null; then
PKG_MANAGER="dnf"
INSTALL_CMD="sudo dnf"
elif command -v yum &> /dev/null; then
PKG_MANAGER="yum"
INSTALL_CMD="sudo yum"
fi
echo "Detected package manager: $PKG_MANAGER"
# Update the system
echo "Updating system repositories..."
$INSTALL_CMD update
# Install git and curl
echo "Installing Curl and Git..."
$INSTALL_CMD install -y git curl
# Install Docker using the official script supports Debian, Ubuntu, and CentOS
install_docker_official
# Installer for Arch because they do it a little differently over there
elif command -v pacman &> /dev/null; then
PKG_MANAGER="pacman"
INSTALL_CMD="sudo pacman -S --noconfirm"
echo "Detected package manager: $PKG_MANAGER"
# Update the system
echo "Updating system repositories..."
sudo pacman -Syu --noconfirm
# Install Docker, git, and curl
echo "Installing Curl and Git, Docker and Docker Compose..."
$INSTALL_CMD docker docker-compose git curl
sudo systemctl start docker
sudo systemctl enable docker
else
echo "This operating system isn't supported yet. Feel free to join the Discord and ask questions."
exit 1
fi
# Install Docker Compose for non-Arch systems
if [[ $PKG_MANAGER != "pacman" ]]; then
echo "Installing Docker Compose..."
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
elif [[$(uname) == "Darwin" ]]; then fi
echo "Installing homebrew"
sudo curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh elif [[ $(uname) == "Darwin" ]]; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "Installing Docker, git, and Docker Compose..."
brew install docker brew install docker
brew install git brew install git
brew install docker-compose@2.20.3 brew install docker-compose@2.20.3
else else
echo "This operating system isn't supported yet. feel free to join the discord and ask questions." echo "This operating system isn't supported yet. Feel free to join the Discord and ask questions."
exit 1 exit 1
fi fi