diff --git a/ct/voicestudio.sh b/ct/voicestudio.sh new file mode 100644 index 0000000000..70f2e9dc9c --- /dev/null +++ b/ct/voicestudio.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Estcool9 +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/debpalash/VoiceStudio + +APP="VoiceStudio" +var_tags="${var_tags:-ai;audio;tts;voice-cloning}" +var_cpu="${var_cpu:-6}" +var_ram="${var_ram:-12288}" +var_disk="${var_disk:-50}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified +export var_voicestudio_hf_token="${var_voicestudio_hf_token:-}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/voicestudio || ! -f /opt/voicestudio_data/.env ]]; then + msg_error "No VoiceStudio Installation Found!" + exit 1 + fi + + if ! systemctl is-active --quiet voicestudio; then + msg_warn "VoiceStudio is not running; skipping the automatic update." + exit 0 + fi + + if ! curl -fsS --max-time 5 http://127.0.0.1:3900/jobs | jq -e 'length == 0' >/dev/null; then + msg_warn "VoiceStudio has active jobs or its API is unavailable; skipping the update." + exit 0 + fi + + if ! curl -fsS --max-time 5 http://127.0.0.1:3900/models/install/status | jq -e '.jobs | length == 0' >/dev/null; then + msg_warn "A model download is active or its status cannot be checked; skipping the update." + exit 0 + fi + + if check_for_gh_release "voicestudio" "debpalash/VoiceStudio"; then + msg_info "Stopping VoiceStudio" + systemctl stop voicestudio + msg_ok "Stopped VoiceStudio" + + if ! ( + set -e + mkdir -p /opt/voicestudio_data/uv/python + export UV_PYTHON_INSTALL_DIR=/opt/voicestudio_data/uv/python + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "voicestudio" "debpalash/VoiceStudio" "tarball" + PYTHON_VERSION="3.11" setup_uv + NODE_VERSION="22" NODE_MODULE="$(jq -r '.packageManager' /opt/voicestudio/package.json)" setup_nodejs + cd /opt/voicestudio + $STD bun install --frozen-lockfile + $STD bun run setup:api + $STD bun run --cwd electron build:web + rm -rf /opt/voicestudio/node_modules /opt/voicestudio/electron/node_modules + ); then + msg_error "VoiceStudio update failed; attempting to restart the service." + systemctl start voicestudio || true + exit 1 + fi + + msg_info "Starting VoiceStudio" + systemctl start voicestudio + if ! $STD curl --retry 60 --retry-delay 2 --retry-connrefused -fsS http://127.0.0.1:3900/health; then + msg_error "VoiceStudio failed its health check after the update." + exit 1 + fi + msg_ok "Updated VoiceStudio successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\\n" +echo -e "${CREATING}${GN}VoiceStudio setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Access it using the following URL:${CL}" +echo -e "${GATEWAY}${BGN}http://${IP}:3900${CL}" diff --git a/install/voicestudio-install.sh b/install/voicestudio-install.sh new file mode 100644 index 0000000000..5c46389425 --- /dev/null +++ b/install/voicestudio-install.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Estcool9 +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/debpalash/VoiceStudio + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing VoiceStudio dependencies" +$STD apt install -y build-essential ffmpeg gpg libsndfile1 libopus-dev pkg-config cmake python3-dev +msg_ok "Installed VoiceStudio dependencies" + +mkdir -p /opt/voicestudio_data/uv/python /opt/voicestudio_data/huggingface +export UV_PYTHON_INSTALL_DIR=/opt/voicestudio_data/uv/python +fetch_and_deploy_gh_release "voicestudio" "debpalash/VoiceStudio" "tarball" +PYTHON_VERSION="3.11" setup_uv +NODE_VERSION="22" NODE_MODULE="$(jq -r '.packageManager' /opt/voicestudio/package.json)" setup_nodejs + +msg_info "Building VoiceStudio" +cd /opt/voicestudio +$STD bun install --frozen-lockfile +$STD bun run setup:api +$STD bun run --cwd electron build:web +rm -rf /opt/voicestudio/node_modules /opt/voicestudio/electron/node_modules +msg_ok "Built VoiceStudio" + +msg_info "Configuring VoiceStudio" +API_KEY="$(random_password 64)" +cat </opt/voicestudio_data/.env +OMNIVOICE_DATA_DIR=/opt/voicestudio_data +HF_HOME=/opt/voicestudio_data/huggingface +OMNIVOICE_SERVER_MODE=1 +OMNIVOICE_BIND_HOST=0.0.0.0 +OMNIVOICE_API_KEY=${API_KEY} +EOF +if [[ -n "${var_voicestudio_hf_token:-}" ]]; then + cat <>/opt/voicestudio_data/.env +HF_TOKEN=${var_voicestudio_hf_token} +EOF +fi +chmod 600 /opt/voicestudio_data/.env +msg_ok "Configured VoiceStudio" + +msg_info "Creating VoiceStudio service" +cat </etc/systemd/system/voicestudio.service +[Unit] +Description=VoiceStudio Headless Backend +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/voicestudio +EnvironmentFile=/opt/voicestudio_data/.env +Environment=HOME=/opt/voicestudio_data +Environment=PYTHONPATH=/opt/voicestudio/backend +Environment=PYTHONUNBUFFERED=1 +ExecStart=/opt/voicestudio/.venv/bin/uvicorn backend.main:app --host 0.0.0.0 --port 3900 +Restart=on-failure +RestartSec=5 +TimeoutStartSec=600 +LimitNOFILE=65535 +UMask=0077 +NoNewPrivileges=true +PrivateTmp=true +ProtectSystem=full +ProtectHome=true +ReadWritePaths=/opt/voicestudio /opt/voicestudio_data + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now voicestudio +$STD curl --retry 60 --retry-delay 2 --retry-connrefused -fsS http://127.0.0.1:3900/health +msg_ok "Created VoiceStudio service" + +cat </etc/systemd/system/voicestudio-update.service +[Unit] +Description=VoiceStudio stable release update +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/update +SuccessExitStatus=1 +EOF +cat </etc/systemd/system/voicestudio-update.timer +[Unit] +Description=Daily VoiceStudio stable release update check + +[Timer] +OnCalendar=*-*-* 03:30:00 +RandomizedDelaySec=45m +Persistent=true +Unit=voicestudio-update.service + +[Install] +WantedBy=timers.target +EOF + +motd_ssh +customize +systemctl enable -q --now voicestudio-update.timer +cleanup_lxc diff --git a/json/voicestudio.json b/json/voicestudio.json new file mode 100644 index 0000000000..defe2157b3 --- /dev/null +++ b/json/voicestudio.json @@ -0,0 +1,61 @@ +{ + "name": "VoiceStudio", + "slug": "voicestudio", + "categories": [ + 20 + ], + "date_created": "2026-04-09", + "type": "ct", + "updateable": true, + "privileged": false, + "architectures": [ + "amd64" + ], + "interface_port": 3900, + "documentation": "https://github.com/debpalash/VoiceStudio/blob/v0.5.8/docs/install/docker.md", + "website": "https://github.com/debpalash/VoiceStudio", + "repository": "https://github.com/debpalash/VoiceStudio", + "logo": "https://cdn.jsdelivr.net/gh/debpalash/VoiceStudio@v0.5.8/docs/assets/voicestudio-pro.svg", + "description": "VoiceStudio is a local-first studio for voice synthesis, voice cloning, dubbing, transcription, and audiobook production. It provides a browser-based interface backed by a local API.", + "install_methods": [ + { + "type": "default", + "script": "ct/voicestudio.sh", + "config_path": "/opt/voicestudio_data/.env", + "resources": { + "cpu": 6, + "ram": 12288, + "hdd": 50, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Open http://:3900 and enter the API key stored in /opt/voicestudio_data/.env as OMNIVOICE_API_KEY.", + "type": "info" + }, + { + "text": "Review and accept each model and dependency licence in VoiceStudio before downloading it.", + "type": "warning" + }, + { + "text": "CPU inference is slower; GPU passthrough and accelerator-specific setup are not configured automatically.", + "type": "warning" + } + ], + "app_vars": [ + { + "name": "var_voicestudio_hf_token", + "label": "Hugging Face Token (optional)", + "type": "password", + "secret": true, + "help": "Optional token for gated/private model repositories and higher download limits." + } + ] +}