Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions installscripts/UbuntuInstall.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
# "apt-get update && apt-get install curl -y && curl -s https://raw.githubusercontent.com/SkinsRestorer/SkinSystem/master/installscripts/UbuntuInstall.sh | bash -s"
# This script for Ubuntu 18.04+ installs apache, php, git, curl, overrides the default apache webpage, and creates mysql databases+user.
echo "Installing SkinSystem (mysql, apache2, php, git)"
echo "Installing SkinSystem (mysql, apache2, php, git and all needed php extensions.)"
apt-get update
apt-get install mysql-server apache2 libapache2-mod-php php-curl php-mysql php-gd git -y
cd /var/www
apt install software-properties-common
add-apt-repository ppa:ondrej/php -y
apt-get install apache2 mysql-server
apt-get install php8.2 libapache2-mod-php8.2 php-curl8.2 php-mysql8.2 php-gd8.2 git -y
cd /var/www/html
git clone https://github.com/SkinsRestorer/SkinSystem
cd SkinSystem
mv SkinSystem skins
cd skins
git checkout `git tag | sort -V | grep -v "\-rc" | tail -1`
rm -rf .git
rm -rf .gitignore
rm -rf *.md
cd ..
mv html html.backup$(date -I)
mv SkinSystem html
chmod 775 -R /var/www/html && chown -R www-data:www-data /var/www/html
pw=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')
echo "Creating MySQL user skinsystem:$pw"
echo "CREATE USER 'skinsystem'@'localhost' IDENTIFIED BY '$pw'; \
CREATE DATABASE skinsrestorer; \
GRANT ALL PRIVILEGES ON skinsrestorer . * TO 'skinsystem'@'localhost'; \

echo "Choose an username for the database (or leave empty for the default one): "
read username
if [[ -n "${username/[ ]*\n/}" ]] && username = "skinsystem"

echo "Choose a name for the database (or leave empty for the default one): "
read database
if [[ -n "${database/[ ]*\n/}" ]] && database = "skinrestorer"

echo "Choose a database password (or leave empty to get a randomly generated one): "
read pw
if [[ -n "${[pw]/[ ]*\n/}" ]] && pw = $(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')

echo "Creating MySQL user $username:$pw"
echo "CREATE USER '$username'@'localhost' IDENTIFIED BY '$pw'; \
CREATE DATABASE $database; \
GRANT ALL PRIVILEGES ON $database . * TO '$username'@'localhost'; \
CREATE DATABASE authme; \
GRANT ALL PRIVILEGES ON authme . * TO 'skinsystem'@'localhost';" | mysql && echo "MySQL user skinsystem:$pw was created"
GRANT ALL PRIVILEGES ON authme . * TO '$username'@'localhost';" | mysql && echo "MySQL user $username:$pw was created!"
echo "Have a nice day, remember to save your credentials!"
echo "Your skin system is now accessible at http://yourip/skins!"
read -n 1 -s -r -p "Press any key to continue"
echo ""
clear
clear
1 change: 0 additions & 1 deletion resources/server/authenCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,4 @@ function isValidPassword($password, $hash)
printErrorAndDie(['title' => L::amcr_cd429_title, 'text' => L::amcr_cd429_text]);
}
}
printErrorAndDie(L::amcr_invrq);
?>