From 339f9f28fff65e13fc07bd2b2b260697daa143b4 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Tue, 7 Jul 2020 20:46:58 -0400 Subject: [PATCH 1/6] update: installer --- install.sh | 22 ++++++---------------- src/Configs/app.php | 2 -- src/Configs/os.php | 2 +- src/Installer/Nginx/NginxSetup.php | 2 +- src/Installer/Server/ServerSetup.php | 9 --------- src/Installer/UNIT3D/Unit3dSetup.php | 3 +-- src/Resources/.env.stub | 1 - ubuntu.sh | 14 -------------- 8 files changed, 9 insertions(+), 46 deletions(-) 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..a5763ce 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', 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..ae05c7f 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'), @@ -152,7 +151,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/ubuntu.sh b/ubuntu.sh index 4cd6a27..0ec0539 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -22,18 +22,6 @@ check_locale() { echo -e "$IGreen OK $Color_Off" } -# Adds PPA's -add_ppa() { - echo -e "\n$Cyan Adding PPA Repositories ... $Color_Off" - - for ppa in "$@"; do - add-apt-repository -y $ppa > /dev/null 2>&1 - check $? "Adding $ppa Failed!" - done - - echo -e "$IGreen OK $Color_Off" -} - # Installs Environment Prerequisites add_pkgs() { # Update apt @@ -83,8 +71,6 @@ check() { check_locale -add_ppa ppa:nginx/development ppa:ondrej/php ppa:certbot/certbot - add_pkgs install_composer From d1d9db29fcf986c97cc6ddb44e84b8e726385b62 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Tue, 7 Jul 2020 21:14:19 -0400 Subject: [PATCH 2/6] update: mysql setup --- README.md | 1 + src/Helpers/helpers.php | 3 +++ src/Installer/Database/MySqlSetup.php | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f43d79..62efd6d 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Installer for the [UNIT3D Torrent Tracker Platform](https://github.com/HDInnovations/UNIT3D). **Officially Supported OS's** +- Ubuntu 20.04 LTS - Ubuntu 18.04 LTS - Ubuntu 16.04 LTS 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..279e0e2 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', From 358d32a57ef8e9113dc3d430a674af6bdfe84769 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Tue, 7 Jul 2020 21:20:03 -0400 Subject: [PATCH 3/6] update: intro stub --- src/Resources/intro.stub | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 From f2027ab2b2a9db734e4c0415705f157da15a6d95 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Tue, 7 Jul 2020 21:41:48 -0400 Subject: [PATCH 4/6] update: mysql 8 support - 1287 'SET PASSWORD FOR = PASSWORD('')' is deprecated --- src/Installer/Database/MySqlSetup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Installer/Database/MySqlSetup.php b/src/Installer/Database/MySqlSetup.php index 279e0e2..96326fe 100644 --- a/src/Installer/Database/MySqlSetup.php +++ b/src/Installer/Database/MySqlSetup.php @@ -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')\"", ]); From 6c0f5807cbcf8e241c00af2013d92379a0e6c5aa Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Tue, 7 Jul 2020 21:52:22 -0400 Subject: [PATCH 5/6] update: readme --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62efd6d..c262e09 100644 --- a/README.md +++ b/README.md @@ -9,20 +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 +- 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. From 9155b94548120f964cec11991fa212cdc5517c43 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Tue, 7 Jul 2020 22:12:31 -0400 Subject: [PATCH 6/6] fix: libpng12 support --- src/Configs/os.php | 1 + src/Installer/UNIT3D/Unit3dSetup.php | 5 +---- ubuntu.sh | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Configs/os.php b/src/Configs/os.php index a5763ce..b34d371 100644 --- a/src/Configs/os.php +++ b/src/Configs/os.php @@ -25,6 +25,7 @@ 'zip' => 'Compress Files', 'unzip' => 'Decompress Files', 'htop' => 'Monitor Server Resources', + 'libpng12-0' => 'PNG Library', ], ] diff --git a/src/Installer/UNIT3D/Unit3dSetup.php b/src/Installer/UNIT3D/Unit3dSetup.php index ae05c7f..131c6c2 100644 --- a/src/Installer/UNIT3D/Unit3dSetup.php +++ b/src/Installer/UNIT3D/Unit3dSetup.php @@ -118,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 = [ diff --git a/ubuntu.sh b/ubuntu.sh index 0ec0539..0df2313 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -22,6 +22,18 @@ check_locale() { echo -e "$IGreen OK $Color_Off" } +# Adds PPA's +add_ppa() { + echo -e "\n$Cyan Adding PPA Repositories ... $Color_Off" + + for ppa in "$@"; do + add-apt-repository -y $ppa > /dev/null 2>&1 + check $? "Adding $ppa Failed!" + done + + echo -e "$IGreen OK $Color_Off" +} + # Installs Environment Prerequisites add_pkgs() { # Update apt @@ -71,6 +83,8 @@ check() { check_locale +add_ppa ppa:linuxuprising/libpng12 + add_pkgs install_composer