Update koel-install.sh
This commit is contained in:
parent
abfa33f935
commit
38d9e4caeb
@ -5,7 +5,7 @@
|
|||||||
# License: MIT
|
# License: MIT
|
||||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
|
||||||
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
color
|
color
|
||||||
verb_ip6
|
verb_ip6
|
||||||
catch_errors
|
catch_errors
|
||||||
@ -15,16 +15,10 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies (Patience)"
|
msg_info "Installing Dependencies (Patience)"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
postgresql \
|
|
||||||
nginx \
|
nginx \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
gnupg2 \
|
|
||||||
lsb-release \
|
lsb-release \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
curl \
|
|
||||||
unzip \
|
|
||||||
sudo \
|
|
||||||
mc \
|
|
||||||
cron \
|
cron \
|
||||||
libapache2-mod-xsendfile \
|
libapache2-mod-xsendfile \
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
@ -33,9 +27,12 @@ $STD apt-get install -y \
|
|||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
libwebp-dev \
|
libwebp-dev \
|
||||||
libapache2-mod-php \
|
|
||||||
composer
|
composer
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
PG_VERSION="16" install_postgresql
|
||||||
|
PHP_VERSION=8.4 PHP_MODULE="bcmath,bz2,cli,exif,common,curl,fpm,gd,imagick,intl,mbstring,pgsql,xml,xmlrpc,zip" PHP_APACHE=YES install_php
|
||||||
|
NODE_VERSION=22 NODE_MODULE="yarn,npm@latest" install_nodejs
|
||||||
|
|
||||||
msg_info "Setting up PSql Database"
|
msg_info "Setting up PSql Database"
|
||||||
DB_NAME=koel_db
|
DB_NAME=koel_db
|
||||||
@ -51,26 +48,9 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
|
|||||||
echo "Koel Database User: $DB_USER"
|
echo "Koel Database User: $DB_USER"
|
||||||
echo "Koel Database Password: $DB_PASS"
|
echo "Koel Database Password: $DB_PASS"
|
||||||
echo "Koel Database Name: $DB_NAME"
|
echo "Koel Database Name: $DB_NAME"
|
||||||
} >> ~/koel.creds
|
} >>~/koel.creds
|
||||||
msg_ok "Set up PostgreSQL database"
|
msg_ok "Set up PostgreSQL database"
|
||||||
|
|
||||||
msg_info "Setting up Node.js/Yarn"
|
|
||||||
mkdir -p /etc/apt/keyrings
|
|
||||||
$STD curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
|
||||||
$STD echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
|
||||||
$STD apt-get update
|
|
||||||
$STD apt-get install -y nodejs
|
|
||||||
$STD npm install -g npm@latest
|
|
||||||
$STD npm install -g yarn
|
|
||||||
msg_ok "Installed Node.js/Yarn"
|
|
||||||
|
|
||||||
msg_info "Setting up PHP"
|
|
||||||
$STD curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
|
|
||||||
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
|
|
||||||
$STD apt update
|
|
||||||
$STD apt install -y php8.3 php8.3-{bcmath,exif,bz2,cli,common,curl,fpm,gd,intl,sqlite3,mbstring,xml,zip,pgsql}
|
|
||||||
msg_ok "PHP successfully setup"
|
|
||||||
|
|
||||||
msg_info "Installing Koel(Patience)"
|
msg_info "Installing Koel(Patience)"
|
||||||
RELEASE=$(wget -q https://github.com/koel/koel/releases/latest -O - | grep "title>Release" | cut -d " " -f 4)
|
RELEASE=$(wget -q https://github.com/koel/koel/releases/latest -O - | grep "title>Release" | cut -d " " -f 4)
|
||||||
cd /opt
|
cd /opt
|
||||||
@ -83,7 +63,7 @@ chmod -R g+rw /opt/*
|
|||||||
chown -R www-data:www-data /opt/*
|
chown -R www-data:www-data /opt/*
|
||||||
chmod -R 755 /opt/*
|
chmod -R 755 /opt/*
|
||||||
cd /opt/koel
|
cd /opt/koel
|
||||||
echo "export COMPOSER_ALLOW_SUPERUSER=1" >> ~/.bashrc
|
echo "export COMPOSER_ALLOW_SUPERUSER=1" >>~/.bashrc
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
$STD composer update --no-interaction
|
$STD composer update --no-interaction
|
||||||
$STD composer install --no-interaction
|
$STD composer install --no-interaction
|
||||||
@ -95,9 +75,9 @@ sudo sed -i -e "s/DB_CONNECTION=.*/DB_CONNECTION=pgsql/" \
|
|||||||
-e "s|DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS|" \
|
-e "s|DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS|" \
|
||||||
-e "s|MEDIA_PATH=.*|MEDIA_PATH=/opt/koel_media|" \
|
-e "s|MEDIA_PATH=.*|MEDIA_PATH=/opt/koel_media|" \
|
||||||
-e "s|FFMPEG_PATH=/usr/local/bin/ffmpeg|FFMPEG_PATH=/usr/bin/ffmpeg|" /opt/koel/.env
|
-e "s|FFMPEG_PATH=/usr/local/bin/ffmpeg|FFMPEG_PATH=/usr/bin/ffmpeg|" /opt/koel/.env
|
||||||
sed -i -e "s/^upload_max_filesize = .*/upload_max_filesize = 200M/" \
|
# sed -i -e "s/^upload_max_filesize = .*/upload_max_filesize = 200M/" \
|
||||||
-e "s/^post_max_size = .*/post_max_size = 200M/" \
|
# -e "s/^post_max_size = .*/post_max_size = 200M/" \
|
||||||
-e "s/^memory_limit = .*/memory_limit = 200M/" /etc/php/8.3/fpm/php.ini
|
# -e "s/^memory_limit = .*/memory_limit = 200M/" /etc/php/8.3/fpm/php.ini
|
||||||
msg_ok "Installed Koel"
|
msg_ok "Installed Koel"
|
||||||
|
|
||||||
msg_info "Set up web services"
|
msg_info "Set up web services"
|
||||||
@ -127,7 +107,7 @@ server {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files \$uri =404;
|
try_files \$uri =404;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
||||||
@ -136,7 +116,7 @@ server {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
ln -s /etc/nginx/sites-available/koel /etc/nginx/sites-enabled/koel
|
ln -s /etc/nginx/sites-available/koel /etc/nginx/sites-enabled/koel
|
||||||
systemctl restart php8.3-fpm
|
systemctl restart php8.4-fpm
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
msg_ok "Created Services"
|
msg_ok "Created Services"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user