Wand Installation script and Docker update (#28)

* Updated Readme.md for ARM support for wand.

* Added Installation script

* Updated for security reasons

* Reverted something since I'm lazy to fix

* Added * removal on backspace

* Added CD to the dir

* Added instructions for the installer

* Changed so it'll take from the official repo
This commit is contained in:
Arnon Hacohen 2024-04-22 08:02:38 +03:00 committed by GitHub
parent 6ff3b437ed
commit f3244b81f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 87 additions and 2 deletions

View File

@ -2,6 +2,21 @@
Wand makes it easy to configure dash, houdini and a media server.
## Install script
**Step 1** run the script
```bash
$ bash <(https://raw.githubusercontent.com/solero/wand/master/install.sh)
```
**Step 2** Answer Questions
the questions are:
* Database password (Leave blank for random password)
* Hostname (example: `clubpenguin.com`) (Leave empty for localhost)
* External IP Address (Leave empty for localhost)
**Step 3** Run and enjoy.
Run this command:
```bash
$ cd wand && sudo docker-compose up
```
## Basic setup
**Step 1** Install git, docker & docker-compose
@ -9,7 +24,7 @@ Wand makes it easy to configure dash, houdini and a media server.
```bash
$ sudo apt update
$ sudo apt install docker.io git curl
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/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
```

70
install.sh Normal file
View File

@ -0,0 +1,70 @@
#!/bin/bash
clear
echo "Setting up the enviroment."
sudo apt update
sudo apt install docker.io git curl
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
echo "Done setting up the enviroment."
echo "Downloading Game Files"
git clone --recurse-submodules https://github.com/solero/wand && cd wand
echo "Done Downloading the game files."
sudo rm -r .env
echo "Please answer this questions for setting up the game:"
echo "Enter password for the database (leave empty for a random password):"
dbpass=""
while IFS= read -r -s -n1 char; do
if [[ -z $char ]]; then
break
elif [[ $char == $'\177' ]]; then # handle backspace
if [ ${#dbpass} -gt 0 ]; then
dbpass="${dbpass%?}" # remove last character
echo -ne '\b \b' # erase last character on the screen
fi
else
echo -n '*'
dbpass+="$char"
fi
done
if [ -z "$dbpass" ]; then
dbpass=$(openssl rand -base64 12)
fi
echo "enter the hostname for the game (example: example.com) (leave empty for localhost)"
read hostname
if [ -z "$hostname" ]; then
hostname=localhost
fi
echo "Enter your external IP address (leave empty for localhost):"
read ipadd
if [ -z "$ipadd" ]; then
ipadd=127.0.0.1
fi
echo "# database
POSTGRES_USER=postgres
POSTGRES_PASSWORD=$dbpass
# Web
WEB_PORT=80
WEB_HOSTNAME=$hostname
WEB_LEGACY_PLAY=http://old.$hostname
WEB_LEGACY_MEDIA=http://legacy.$hostname
WEB_VANILLA_PLAY=http://play.$hostname
WEB_VANILLA_MEDIA=http://media.$hostname
WEB_RECAPTCHA_SITE=
WEB_RECAPTCHA_SECRET=
WEB_SENDGRID_KEY=
# Game
GAME_ADDRESS=$ipadd
GAME_LOGIN_PORT=6112" > .env
echo "Done!"
echo "You can now run the game doing the command"
echo "cd wand && sudo docker-compose up"