From 6171153dc6ac730f5e13ffa00df096aaa5c21819 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 7 Apr 2025 15:09:43 +0200 Subject: [PATCH] testing --- ct/musicassistant.sh | 40 +++++++++++++++++ install/musicassistant-install.sh | 71 +++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 ct/musicassistant.sh create mode 100644 install/musicassistant-install.sh diff --git a/ct/musicassistant.sh b/ct/musicassistant.sh new file mode 100644 index 0000000..62bc4a2 --- /dev/null +++ b/ct/musicassistant.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/music-assistant/server + +APP="MusicAssistant" +var_tags="${var_tags:-music}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-7}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/musicassistant ]]; then + msg_error "No Installation Found!" + exit + fi +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}meilisearch: http://${IP}:8095${CL}" diff --git a/install/musicassistant-install.sh b/install/musicassistant-install.sh new file mode 100644 index 0000000..7351f12 --- /dev/null +++ b/install/musicassistant-install.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# License: MIT +# Source: https://github.com/music-assistant/server + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + ffmpeg \ + build-essential \ + libffi-dev \ + libssl-dev \ + libjpeg-dev \ + zlib1g-dev \ + pkg-config +msg_ok "Installed Dependencies" + +msg_info "Setup Python3" +$STD apt-get install -y \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv +rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED +msg_ok "Setup Python3" + +msg_info "Setup Music Assistant" +fetch_and_deploy_gh_release music-assistant/server +python3 -m venv /opt/musicassistant/venv +source /opt/musicassistant/venv/bin/activate +pip install --upgrade pip setuptools wheel +pip install . +msg_ok "Setup Music Assistant" + +msg_info "Creating systemd service" +cat </etc/systemd/system/musicassistant.service +[Unit] +Description=Music Assistant +After=network-online.target + +[Service] +Type=simple +WorkingDirectory=/opt/musicassistant +Environment="PATH=/opt/musicassistant/venv/bin" +ExecStart=/opt/musicassistant/venv/bin/mass +Restart=always +RestartForceExitStatus=100 + +[Install] +WantedBy=multi-user.target +EOF + +systemctl daemon-reexec +systemctl enable -q --now musicassistant +msg_ok "Started Music Assistant" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"