diff --git a/README.md b/README.md index 7f43d79..c262e09 100644 --- a/README.md +++ b/README.md @@ -9,19 +9,28 @@

NOTE: This only works for a fresh server with nothing on it but a new OS install!

## This Repository -Installer for the [UNIT3D Torrent Tracker Platform](https://github.com/HDInnovations/UNIT3D). +Installer for the [UNIT3D Torrent Tracker Platform](https://github.com/HDInnovations/UNIT3D-Community-Edition). **Officially Supported OS's** +- Ubuntu 20.04 LTS (Recommended) - Ubuntu 18.04 LTS - Ubuntu 16.04 LTS -**For latest release:** +**For Ubuntu 20.04 LTS:** ``` git clone https://github.com/poppabear8883/UNIT3D-INSTALLER.git installer cd installer sudo ./install.sh ``` +**For Ubuntu 16.04 LTS or Ubuntu 18.04 LTS:** +``` +git clone https://github.com/poppabear8883/UNIT3D-INSTALLER.git installer +git checkout Ubuntu-16.04-18.04 +cd installer +sudo ./install.sh +``` + ### General Support You can find us on the [UNIT3D Discord](https://discord.gg/Yk4NBUU) in the `#support` channel. diff --git a/install.sh b/install.sh index 3648bbf..67ab4f4 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,6 @@ source tools/colors.sh # Detect OS case $(head -n1 /etc/issue | cut -f 1 -d ' ') in - Debian) type="debian" ;; Ubuntu) type="ubuntu" ;; *) type='' ;; esac @@ -18,10 +17,15 @@ if [ "$type" = '' ]; then echo -e "\n$Purple This can happen if you are using an OS template from a provider like OVH amongst others. $Color_Off\n" PS3='Please select the # for your OS: ' - options=("Ubuntu 18.04" "Ubuntu 16.04" "Other Ubuntu" "Debian" "Other" "Quit") + options=("Ubuntu 20.04" "Ubuntu 18.04" "Ubuntu 16.04" "Quit") select opt in "${options[@]}" do case $opt in + "Ubuntu 20.04") + echo 'Ubuntu 20.04 LTS \n \l' > /etc/issue + type='ubuntu' + break + ;; "Ubuntu 18.04") echo 'Ubuntu 18.04 LTS \n \l' > /etc/issue type='ubuntu' @@ -32,20 +36,6 @@ if [ "$type" = '' ]; then type='ubuntu' break ;; - "Other Ubuntu") - echo 'Ubuntu UNKNOWN LTS \n \l' > /etc/issue - type='ubuntu' - break - ;; - "Debian") - echo 'Debian GNU/Linux \n \l' > /etc/issue - type='debian' - break - ;; - "Other") - echo -e "$Red Unsupported GNU/Linux distribution $Color_Off" - exit 1 - ;; "Quit") exit 0 ;; diff --git a/src/Configs/app.php b/src/Configs/app.php index 2cf7976..a3c1575 100644 --- a/src/Configs/app.php +++ b/src/Configs/app.php @@ -12,7 +12,6 @@ * Map to the Installer class */ 'MySql' => MySqlSetup::class, - //'MariaDB' => '', //'Postgres' => '', ], @@ -53,6 +52,5 @@ /* API Keys */ 'tmdb-key' => '', - 'omdb-key' => '', 'igdb-key' => '', ]; diff --git a/src/Configs/os.php b/src/Configs/os.php index 91a9d1a..b34d371 100644 --- a/src/Configs/os.php +++ b/src/Configs/os.php @@ -6,7 +6,7 @@ * UBUNTU */ 'ubuntu' => [ - 'pkg_manager' => 'apt-get', + 'pkg_manager' => 'apt', 'web-user' => 'www-data', 'install_dir' => '/var/www/html', 'nginx-sites-available_path' => '/etc/nginx/sites-available', @@ -25,6 +25,7 @@ 'zip' => 'Compress Files', 'unzip' => 'Decompress Files', 'htop' => 'Monitor Server Resources', + 'libpng12-0' => 'PNG Library', ], ] diff --git a/src/Helpers/helpers.php b/src/Helpers/helpers.php index 90fdf8f..8cfa4dc 100644 --- a/src/Helpers/helpers.php +++ b/src/Helpers/helpers.php @@ -133,6 +133,9 @@ function distinfo() $mainver = $matches[0]; switch ($mainver) { + case "20.04": + $relname = "(Focal Fossa)"; + break; case "18.04": $relname = "(Bionic Beaver)"; break; diff --git a/src/Installer/Database/MySqlSetup.php b/src/Installer/Database/MySqlSetup.php index d0c3f16..96326fe 100644 --- a/src/Installer/Database/MySqlSetup.php +++ b/src/Installer/Database/MySqlSetup.php @@ -27,11 +27,11 @@ public function handle() $this->process(['cp -f ' . resource_path(distname() . "/mysql/$mycnf") . ' /etc/mysql/my.cnf']); if (distname() === 'ubuntu') { - if (distmainver() !== '16.04' && distmainver() !== '18.04') { + if (distmainver() !== '16.04' && distmainver() !== '18.04' && distmainver() !== '20.04') { $this->process(['mysql_install_db']); } - if (distmainver() === '18.04' && !is_dir('/var/lib/mysql')) { + if ((distmainver() === '18.04' || distmainver() === '20.04') && !is_dir('/var/lib/mysql')) { $this->process([ 'mkdir /var/lib/mysql', 'chown mysql:mysql /var/lib/mysql', @@ -64,7 +64,7 @@ public function handle() "mysql -e \"CREATE DATABASE $db\"", "mysql -e \"CREATE USER '$dbuser'@'localhost' IDENTIFIED BY '$dbpass';\"", "mysql -e \"GRANT ALL PRIVILEGES ON $db . * TO '$dbuser'@'localhost'\"", - "mysql -e \"UPDATE mysql.user SET authentication_string=PASSWORD('$root_pass') WHERE User='root'\"", + "mysql -e \"ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$root_pass'\"", "mysql -e \"DELETE FROM mysql.user WHERE User=''\"", "mysql -e \"DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')\"", ]); diff --git a/src/Installer/Nginx/NginxSetup.php b/src/Installer/Nginx/NginxSetup.php index d2af7ec..d8f601f 100644 --- a/src/Installer/Nginx/NginxSetup.php +++ b/src/Installer/Nginx/NginxSetup.php @@ -31,7 +31,7 @@ public function handle() "systemctl restart nginx" ]); - $this->install('python-certbot-nginx'); + $this->install('certbot python3-certbot-nginx'); if ($ssl == 'yes') { $this->process([ diff --git a/src/Installer/Server/ServerSetup.php b/src/Installer/Server/ServerSetup.php index a109b41..5e4886e 100644 --- a/src/Installer/Server/ServerSetup.php +++ b/src/Installer/Server/ServerSetup.php @@ -121,15 +121,6 @@ protected function apiKeys() $key = $this->question('TMDB Key', ''); $this->config->app('tmdb-key', $key); - $this->io->writeln('Obtaining an OMDB Key:'); - $this->io->listing([ - 'Visit https://www.omdbapi.com/apikey.aspx', - 'Choose Free or Patreon (Recommended)', - ]); - - $key = $this->question('OMDB Key', ''); - $this->config->app('omdb-key', $key); - $this->io->writeln('Obtaining an IGDB Key:'); $this->io->listing([ 'Visit https://api.igdb.com', diff --git a/src/Installer/UNIT3D/Unit3dSetup.php b/src/Installer/UNIT3D/Unit3dSetup.php index 119d618..131c6c2 100644 --- a/src/Installer/UNIT3D/Unit3dSetup.php +++ b/src/Installer/UNIT3D/Unit3dSetup.php @@ -61,7 +61,6 @@ protected function env() '{{OWNEREMAIL}}' => $this->config->app('owner_email'), '{{OWNERPASSWORD}}' => $this->config->app('password'), '{{TMDBAPIKEY}}' => $this->config->app('tmdb-key'), - '{{OMDBAPIKEY}}' => $this->config->app('omdb-key'), '{{IGDBAPIKEY}}' => $this->config->app('igdb-key'), '{{MAILDRIVER}}' => $this->config->app('mail_driver'), '{{MAILHOST}}' => $this->config->app('mail_host'), @@ -119,10 +118,7 @@ protected function setup() $this->process([ 'supervisorctl reread', 'supervisorctl update', - 'supervisorctl reload', - 'wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb', - 'dpkg -i /tmp/libpng12.deb', - 'rm /tmp/libpng12.deb' + 'supervisorctl reload' ]); $www_cmds = [ @@ -152,7 +148,7 @@ protected function crons() $install_dir = $this->config->os('install_dir'); $this->process([ - "(crontab -l ; echo \"* * * * * www-data php $install_dir/artisan schedule:run >> /dev/null 2>&1\") | crontab -" + "(crontab -l ; echo \"* * * * * php $install_dir/artisan schedule:run >> /dev/null 2>&1\") | crontab -" ]); } diff --git a/src/Resources/.env.stub b/src/Resources/.env.stub index b8d7459..990203f 100644 --- a/src/Resources/.env.stub +++ b/src/Resources/.env.stub @@ -37,5 +37,4 @@ DEFAULT_OWNER_EMAIL={{OWNEREMAIL}} DEFAULT_OWNER_PASSWORD={{OWNERPASSWORD}} TMDB_API_KEY={{TMDBAPIKEY}} -OMDB_API_KEY={{OMDBAPIKEY}} IGDB_TOKEN={{IGDBAPIKEY}} diff --git a/src/Resources/intro.stub b/src/Resources/intro.stub index 48153f7..638a12b 100644 --- a/src/Resources/intro.stub +++ b/src/Resources/intro.stub @@ -16,8 +16,7 @@ *-----------------------------------------------* - | | - | Copyright (c) 2018-2019 | - | Author: Poppabear | - | | + | Copyright: 2018-2020 | + | Author: Poppabear | + | Maintainer: HDVinnie | *-----------------------------------------------* \ No newline at end of file diff --git a/ubuntu.sh b/ubuntu.sh index 4cd6a27..0df2313 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -83,7 +83,7 @@ check() { check_locale -add_ppa ppa:nginx/development ppa:ondrej/php ppa:certbot/certbot +add_ppa ppa:linuxuprising/libpng12 add_pkgs