From b89a671d56ef962de58ada2102ab4898a1d440c6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 12 Oct 2026 12:03:18 +0000 Subject: [PATCH] Delete watchstate (ct) after migration to ProxmoxVE --- ct/watchstate.sh | 81 ---------------------------- install/watchstate-install.sh | 99 ----------------------------------- json/watchstate.json | 61 --------------------- 3 files changed, 241 deletions(-) delete mode 100644 ct/watchstate.sh delete mode 100644 install/watchstate-install.sh delete mode 100644 json/watchstate.json diff --git a/ct/watchstate.sh b/ct/watchstate.sh deleted file mode 100644 index f40b326f07..0000000000 --- a/ct/watchstate.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/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: MickLesk (CanbiZ) -# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE -# Source: https://github.com/arabcoders/watchstate - -APP="WatchState" -var_tags="${var_tags:-media;plex;jellyfin;emby}" -var_cpu="${var_cpu:-2}" -var_ram="${var_ram:-2048}" -var_disk="${var_disk:-6}" -var_os="${var_os:-debian}" -var_version="${var_version:-13}" -var_arm64="${var_arm64:-yes}" -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/watchstate ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - # the old master-YYYYMMDD- releases outrank the v* tags in the version sort - if check_for_gh_release "watchstate" "arabcoders/watchstate" "" "" "v"; then - msg_info "Stopping WatchState" - systemctl stop watchstate-worker php8.5-fpm - msg_ok "Stopped WatchState" - - create_backup /opt/watchstate/.env - setup_composer - NODE_VERSION="24" NODE_MODULE="bun" setup_nodejs - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "watchstate" "arabcoders/watchstate" "tarball" "latest" "/opt/watchstate" "" "v" - restore_backup - - msg_info "Building WatchState" - cd /opt/watchstate - # the Redis cache (routes, event listeners) is namespaced by this version, so a release left at dev-master keeps serving the old one - sed -i "s/'version' => 'dev-master'/'version' => 'v$(cat ~/.watchstate)'/" config/config.php - $STD composer install --no-dev --optimize-autoloader --no-interaction - cd /opt/watchstate/frontend - $STD bun install --frozen-lockfile --production - NODE_ENV=production $STD bun run generate - mv /opt/watchstate/frontend/exported /opt/watchstate/public/exported - rm -rf /opt/watchstate/frontend/node_modules /opt/watchstate/frontend/.nuxt - msg_ok "Built WatchState" - - msg_info "Migrating WatchState Database" - $STD php /opt/watchstate/bin/console db:migrate --execute - $STD php /opt/watchstate/bin/console db:index - chown -R www-data:www-data /opt/watchstate_data - msg_ok "Migrated WatchState Database" - - msg_info "Starting WatchState" - systemctl start php8.5-fpm watchstate-worker - msg_ok "Started WatchState" - msg_ok "Updated successfully!" - fi - exit -} - -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 "${GATEWAY}${BGN}http://${IP}:8080${CL}" -echo -e "${INFO}${YW}The first visitor creates the system user - open the URL right away${CL}" diff --git a/install/watchstate-install.sh b/install/watchstate-install.sh deleted file mode 100644 index 15d57460cc..0000000000 --- a/install/watchstate-install.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2026 community-scripts ORG -# Author: MickLesk (CanbiZ) -# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE -# Source: https://github.com/arabcoders/watchstate - -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 \ - nginx \ - redis-server \ - ripgrep \ - sqlite3 -msg_ok "Installed Dependencies" - -PHP_VERSION="8.5" PHP_FPM="YES" setup_php -setup_composer -setup_ffmpeg -NODE_VERSION="24" NODE_MODULE="bun" setup_nodejs -fetch_and_deploy_gh_release "watchstate" "arabcoders/watchstate" "tarball" "latest" "/opt/watchstate" "" "v" - -msg_info "Building WatchState" -cd /opt/watchstate -sed -i "s/'version' => 'dev-master'/'version' => 'v$(cat ~/.watchstate)'/" config/config.php -$STD composer install --no-dev --optimize-autoloader --no-interaction -cd /opt/watchstate/frontend -$STD bun install --frozen-lockfile --production -NODE_ENV=production $STD bun run generate -mv /opt/watchstate/frontend/exported /opt/watchstate/public/exported -rm -rf /opt/watchstate/frontend/node_modules /opt/watchstate/frontend/.nuxt -msg_ok "Built WatchState" - -msg_info "Configuring WatchState" -# loaded first by CLI, worker and php-fpm alike; the default data dir is /opt/watchstate/var, which every update wipes -cat </opt/watchstate/.env -WS_DATA_PATH=/opt/watchstate_data -EOF -$STD php /opt/watchstate/bin/console db:migrate --execute -$STD php /opt/watchstate/bin/console system:apikey -chown -R www-data:www-data /opt/watchstate_data -msg_ok "Configured WatchState" - -msg_info "Configuring Nginx" -PHP_SOCK=$(get_php_fpm_socket) -cat </etc/nginx/sites-available/watchstate -server { - listen 8080; - server_name _; - root /opt/watchstate/public; - index index.php; - client_max_body_size 100M; - - location / { - try_files \$uri /index.php\$is_args\$args; - } - - location ~ \.php\$ { - fastcgi_pass unix:${PHP_SOCK}; - fastcgi_param SCRIPT_FILENAME \$realpath_root\$fastcgi_script_name; - include fastcgi_params; - fastcgi_read_timeout 600; - } -} -EOF -nginx_enable_site "watchstate" -msg_ok "Configured Nginx" - -msg_info "Creating Service" -cat </etc/systemd/system/watchstate-worker.service -[Unit] -Description=WatchState Worker -After=network.target redis-server.service - -[Service] -Type=simple -User=www-data -Group=www-data -WorkingDirectory=/opt/watchstate -ExecStart=/usr/bin/php /opt/watchstate/bin/console system:worker -v -Restart=always -RestartSec=5 - -[Install] -WantedBy=multi-user.target -EOF -systemctl enable -q --now watchstate-worker -msg_ok "Created Service" - -motd_ssh -customize -cleanup_lxc diff --git a/json/watchstate.json b/json/watchstate.json deleted file mode 100644 index ccc6b21118..0000000000 --- a/json/watchstate.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "WatchState", - "slug": "watchstate", - "categories": [ - 13 - ], - "date_created": "2026-10-03", - "type": "ct", - "updateable": true, - "privileged": false, - "architectures": [ - "amd64", - "arm64" - ], - "interface_port": 8080, - "documentation": "https://github.com/arabcoders/watchstate/blob/master/FAQ.md", - "website": "https://github.com/arabcoders/watchstate", - "repository": "https://github.com/arabcoders/watchstate", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/watchstate.webp", - "description": "WatchState syncs play state (watched/unwatched and resume progress) between Plex, Jellyfin and Emby without relying on third-party services. It pulls changes from the media servers through scheduled imports or webhooks and pushes them to the others one-way or two-way, maps the users of each server, keeps portable backups of the play state and audits mismatched records with Media Health. This script builds the PHP backend and the web UI from source and serves them with nginx, PHP-FPM and Redis.", - "install_methods": [ - { - "type": "default", - "script": "ct/watchstate.sh", - "config_path": "/opt/watchstate_data/config/.env", - "resources": { - "cpu": 2, - "ram": 2048, - "hdd": 6, - "os": "Debian", - "version": "13" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "notes": [ - { - "text": "There is no default account. The first visit to http://:8080 asks for a system user and password, and anyone who reaches the port can set them until then, so do it right after the install. A forgotten login is cleared with: runuser -u www-data -- php /opt/watchstate/bin/console system:resetpassword, after which the next visit asks for a new one.", - "type": "warning" - }, - { - "text": "Add Plex, Jellyfin or Emby under Backends with the server URL and an API token (the help button in the top-right corner walks through one-way and two-way sync), then enable the Import and Export tasks under Tasks: both are off by default. For real-time sync, paste the webhook URL shown on the Backends page into each media server.", - "type": "info" - }, - { - "text": "Settings (WS_* variables from the FAQ) are edited on the Env page of the web UI or in /opt/watchstate_data/config/.env; the database, backups and logs live in /opt/watchstate_data as well and survive updates.", - "type": "info" - }, - { - "text": "Web UI and worker run as www-data. Run console commands from the Console page of the web UI or as www-data (runuser -u www-data -- php /opt/watchstate/bin/console ); run as root, they leave root-owned files in /opt/watchstate_data that WatchState can no longer write.", - "type": "warning" - }, - { - "text": "The built-in player and file checks read media files directly. They only work if the media is mounted into the container under the same paths the media servers use.", - "type": "info" - } - ] -}