diff --git a/ct/aiometadata.sh b/ct/aiometadata.sh new file mode 100644 index 0000000000..3a35d03687 --- /dev/null +++ b/ct/aiometadata.sh @@ -0,0 +1,65 @@ +#!/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: MrNRod +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/cedya77/aiometadata + +APP="AIOMetadata" +var_tags="${var_tags:-media;streaming;stremio}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified +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/aiometadata ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "aiometadata" "cedya77/aiometadata" "" "" "v"; then + msg_info "Stopping AIOMetadata" + systemctl stop aiometadata + msg_ok "Stopped AIOMetadata" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "aiometadata" "cedya77/aiometadata" "tarball" "latest" "" "" "v" + + msg_info "Building AIOMetadata" + cd /opt/aiometadata + $STD npm ci + $STD npm run build + $STD npm run build:backend + msg_ok "Built AIOMetadata" + + msg_info "Starting AIOMetadata" + systemctl start aiometadata + msg_ok "Started AIOMetadata" + 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} Configure page (add to Stremio from here):${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3232/configure${CL}" +echo -e "${INFO}${YW} Env file (API keys, admin key, Redis/DB config):${CL} ${BGN}/opt/aiometadata_data/.env${CL}" diff --git a/install/aiometadata-install.sh b/install/aiometadata-install.sh new file mode 100644 index 0000000000..b99c100558 --- /dev/null +++ b/install/aiometadata-install.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MrNRod +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/cedya77/aiometadata + +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 redis-server +msg_ok "Installed Dependencies" + +NODE_VERSION="24" setup_nodejs + +fetch_and_deploy_gh_release "aiometadata" "cedya77/aiometadata" "tarball" "latest" "" "" "v" + +msg_info "Configuring Redis" +REDIS_PASS=$(openssl rand -hex 24) +sed -i "s/^# requirepass foobared/requirepass ${REDIS_PASS}/" /etc/redis/redis.conf +systemctl restart redis-server +msg_ok "Configured Redis" + +msg_info "Building AIOMetadata" +cd /opt/aiometadata +$STD npm ci +$STD npm run build +$STD npm run build:backend +msg_ok "Built AIOMetadata" + +msg_info "Configuring AIOMetadata" +mkdir -p /opt/aiometadata_data +cp /opt/aiometadata/.env.example /opt/aiometadata_data/.env +ADMIN_KEY=$(openssl rand -hex 24) +sed -i \ + -e "s|^HOST_NAME=.*|HOST_NAME=http://${LOCAL_IP}:3232|" \ + -e "s|^NODE_ENV=.*|NODE_ENV=production|" \ + -e "s|^DATABASE_URI=sqlite://addon/data/db.sqlite|DATABASE_URI=sqlite:///opt/aiometadata_data/db.sqlite|" \ + -e "s|^REDIS_URL=.*|REDIS_URL=redis://:${REDIS_PASS}@127.0.0.1:6379|" \ + -e "s|^# ADMIN_KEY=.*|ADMIN_KEY=${ADMIN_KEY}|" \ + /opt/aiometadata_data/.env +msg_ok "Configured AIOMetadata" + +msg_info "Creating Service" +cat </etc/systemd/system/aiometadata.service +[Unit] +Description=AIOMetadata +After=network.target redis-server.service +Requires=redis-server.service + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/aiometadata +EnvironmentFile=/opt/aiometadata_data/.env +Environment="UV_THREADPOOL_SIZE=16" +Environment="DOTENV_CONFIG_QUIET=true" +ExecStart=/usr/bin/node dist/server/server.js +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now aiometadata +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc diff --git a/json/aiometadata.json b/json/aiometadata.json new file mode 100644 index 0000000000..855816397a --- /dev/null +++ b/json/aiometadata.json @@ -0,0 +1,49 @@ +{ + "name": "AIOMetadata", + "slug": "aiometadata", + "categories": [ + 13 + ], + "date_created": "2026-09-14", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3232, + "documentation": "https://github.com/cedya77/aiometadata/blob/dev/docs/ENVIRONMENT_VARIABLES.md", + "website": "https://github.com/cedya77/aiometadata", + "repository": "https://github.com/cedya77/aiometadata", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/aiometadata-light.webp", + "description": "AIOMetadata is a Stremio metadata addon that aggregates movie, series and anime data from TMDB, TVDB, Fanart.tv, MyAnimeList, AniList, Trakt and more into one configurable catalog, with per-user API keys, poster proxying and cache warming.", + "install_methods": [ + { + "type": "default", + "script": "ct/aiometadata.sh", + "config_path": "/opt/aiometadata_data/.env", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 8, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "No provider API keys are preset. Add your TMDB/TVDB/Fanart.tv keys on the /configure page, or set the BUILT_IN_* variables in /opt/aiometadata_data/.env to cover every user.", + "type": "warning" + }, + { + "text": "To enable the Trakt, Simkl, AniList and MyAnimeList integrations, add their client ID and secret to /opt/aiometadata_data/.env, then restart the aiometadata service.", + "type": "info" + }, + { + "text": "Use the generated ADMIN_KEY from /opt/aiometadata_data/.env to access the dashboard. Keys set directly (not BUILT_IN_*) are served to any visitor via /api/config.", + "type": "warning" + } + ] +}