#!/usr/bin/env bash # Copyright (c) 2021-2026 community-scripts ORG # Author: MickLesk (Canbiz) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/ampache/ampache source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 catch_errors setting_up_container network_check update_os msg_info "Installing Dependencies" $STD apt install -y \ flac \ vorbis-tools \ lame \ ffmpeg \ inotify-tools \ libavcodec-extra \ libmp3lame-dev \ libtheora-dev \ libvorbis-dev \ libvpx-dev msg_ok "Installed Dependencies" PHP_VERSION=8.4 PHP_MODULE=bcmath,bz2,curl,gd,imagick,intl,mbstring,mysql,sqlite3,xml,xmlrpc,zip PHP_APACHE=YES setup_php setup_mariadb MARIADB_DB_USER=ampache MARIADB_DB_NAME=ampache setup_mariadb_db fetch_and_deploy_gh_release "ampache" "ampache/ampache" "prebuild" "latest" "/opt/ampache" "ampache-*_all_php8.4.zip" msg_info "Setup Ampache" rm -rf /var/www/html ln -s /opt/ampache/public /var/www/html mv /opt/ampache/public/rest/.htaccess.dist /opt/ampache/public/rest/.htaccess mv /opt/ampache/public/play/.htaccess.dist /opt/ampache/public/play/.htaccess cp /opt/ampache/config/ampache.cfg.php.dist /opt/ampache/config/ampache.cfg.php chmod 664 /opt/ampache/public/rest/.htaccess /opt/ampache/public/play/.htaccess msg_ok "Set up Ampache" msg_info "Configuring Database Connection" sed -i 's|^database_hostname = .*|database_hostname = "localhost"|' /opt/ampache/config/ampache.cfg.php sed -i 's|^database_name = .*|database_name = "ampache"|' /opt/ampache/config/ampache.cfg.php sed -i 's|^database_username = .*|database_username = "ampache"|' /opt/ampache/config/ampache.cfg.php sed -i "s|^database_password = .*|database_password = \"${MARIADB_DB_PASS}\"|" /opt/ampache/config/ampache.cfg.php chown -R www-data:www-data /opt/ampache msg_ok "Configured Database Connection" msg_info "Importing Database Schema" mariadb -u ampache -p"${MARIADB_DB_PASS}" ampache