-
-
Notifications
You must be signed in to change notification settings - Fork 472
maintainerr: add LXC helper script and installer #1541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| #!/usr/bin/env bash | ||
| source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) | ||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: tumeden | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE | ||
| # Source: https://github.com/Maintainerr/Maintainerr | ||
|
|
||
| APP="Maintainerr" | ||
| var_tags="${var_tags:-media}" | ||
| var_cpu="${var_cpu:-4}" | ||
| var_ram="${var_ram:-4096}" | ||
| var_disk="${var_disk:-18}" | ||
| var_os="${var_os:-debian}" | ||
| var_version="${var_version:-13}" | ||
| 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/maintainerr ]]; then | ||
| msg_error "No ${APP} Installation Found!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if check_for_gh_release "maintainerr" "Maintainerr/Maintainerr"; then | ||
| msg_info "Stopping Service" | ||
| systemctl stop maintainerr | ||
| msg_ok "Stopped Service" | ||
|
|
||
| CLEAN_INSTALL=1 fetch_and_deploy_gh_release "maintainerr" "Maintainerr/Maintainerr" "tarball" | ||
|
|
||
| NODE_VERSION="24" setup_nodejs | ||
| msg_info "Preparing Build Runtime" | ||
| export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 | ||
| $STD corepack enable | ||
| if [[ -f /opt/maintainerr/package.json ]]; then | ||
| if command -v jq >/dev/null 2>&1; then | ||
| yarn_spec=$(jq -r '.packageManager // empty' /opt/maintainerr/package.json 2>/dev/null || true) | ||
| if [[ -n "$yarn_spec" && "$yarn_spec" == yarn@* ]]; then | ||
| yarn_ver="${yarn_spec#yarn@}" | ||
| yarn_ver="${yarn_ver%%+*}" | ||
| $STD corepack prepare "yarn@${yarn_ver}" --activate || true | ||
| fi | ||
| fi | ||
| fi | ||
| msg_ok "Prepared Build Runtime" | ||
|
|
||
| msg_info "Building Maintainerr (Patience)" | ||
| cd /opt/maintainerr || { msg_error "Failed to change to /opt/maintainerr"; exit 1; } | ||
| cat <<EOF >/opt/maintainerr/apps/ui/.env | ||
| VITE_BASE_PATH=/__PATH_PREFIX__ | ||
| EOF | ||
| export NODE_OPTIONS="--max-old-space-size=4096" | ||
| $STD yarn install --immutable --network-timeout 99999999 | ||
| $STD yarn turbo build | ||
| $STD yarn workspaces focus --all --production | ||
| mkdir -p /opt/maintainerr/apps/server/dist/ui | ||
| cp -a /opt/maintainerr/apps/ui/dist/. /opt/maintainerr/apps/server/dist/ui/ | ||
| ln -sfnT /opt/maintainerr /opt/app | ||
| msg_ok "Built Maintainerr" | ||
|
|
||
| msg_info "Starting Service" | ||
| systemctl start maintainerr | ||
| msg_ok "Started Service" | ||
| 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 "${TAB}${GATEWAY}${BGN}http://${IP}:6246${CL}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "name": "Maintainerr", | ||
| "slug": "maintainerr", | ||
| "categories": [ | ||
| 13 | ||
| ], | ||
| "date_created": "2026-03-06", | ||
| "type": "ct", | ||
| "updateable": true, | ||
| "privileged": false, | ||
| "interface_port": 6246, | ||
| "documentation": "https://docs.maintainerr.info/latest/Installation/", | ||
| "website": "https://maintainerr.info/", | ||
| "logo": "https://raw.githubusercontent.com/Maintainerr/Maintainerr/main/apps/ui/public/logo_black.svg", | ||
| "config_path": "/etc/maintainerr/maintainerr.conf", | ||
| "description": "Maintainerr is a tool that automatically cleans up media libraries on servers like Plex or Jellyfin. It analyzes your library and related apps (such as Sonarr, Radarr, Seerr, or Tautulli) to find movies or TV shows that are unwatched, old, or no longer wanted", | ||
| "install_methods": [ | ||
| { | ||
| "type": "default", | ||
| "script": "ct/maintainerr.sh", | ||
| "resources": { | ||
| "cpu": 4, | ||
| "ram": 4096, | ||
| "hdd": 18, | ||
| "os": "Debian", | ||
| "version": "13" | ||
| } | ||
| } | ||
| ], | ||
| "default_credentials": { | ||
| "username": null, | ||
| "password": null | ||
| }, | ||
| "notes": [ | ||
| { | ||
| "text": "Initial install and updates build from source and may take several minutes.", | ||
| "type": "warning" | ||
| }, | ||
| { | ||
| "text": "Data is persisted in /opt/data.", | ||
| "type": "info" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: tumeden | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE | ||
| # Source: https://github.com/Maintainerr/Maintainerr | ||
|
|
||
| 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 \ | ||
| build-essential \ | ||
| python3 | ||
| msg_ok "Installed Dependencies" | ||
|
|
||
| fetch_and_deploy_gh_release "maintainerr" "Maintainerr/Maintainerr" "tarball" | ||
|
|
||
| NODE_VERSION="24" setup_nodejs | ||
| msg_info "Preparing Build Runtime" | ||
| export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 | ||
| $STD corepack enable | ||
| if [[ -f /opt/maintainerr/package.json ]]; then | ||
| if command -v jq >/dev/null 2>&1; then | ||
| yarn_spec=$(jq -r '.packageManager // empty' /opt/maintainerr/package.json 2>/dev/null || true) | ||
| if [[ -n "$yarn_spec" && "$yarn_spec" == yarn@* ]]; then | ||
| yarn_ver="${yarn_spec#yarn@}" | ||
| yarn_ver="${yarn_ver%%+*}" | ||
| $STD corepack prepare "yarn@${yarn_ver}" --activate || true | ||
| fi | ||
| fi | ||
| fi | ||
| mkdir -p /opt/data/logs /etc/maintainerr | ||
| ln -sfnT /opt/maintainerr /opt/app | ||
| msg_ok "Prepared Build Runtime" | ||
|
|
||
| msg_info "Building Maintainerr (Patience)" | ||
| cd /opt/maintainerr | ||
| cat <<EOF >/opt/maintainerr/apps/ui/.env | ||
| VITE_BASE_PATH=/__PATH_PREFIX__ | ||
| EOF | ||
| export NODE_OPTIONS="--max-old-space-size=4096" | ||
| $STD yarn install --immutable --network-timeout 99999999 | ||
| $STD yarn turbo build | ||
| $STD yarn workspaces focus --all --production | ||
| mkdir -p /opt/maintainerr/apps/server/dist/ui | ||
| cp -a /opt/maintainerr/apps/ui/dist/. /opt/maintainerr/apps/server/dist/ui/ | ||
| msg_ok "Built Maintainerr" | ||
|
|
||
| msg_info "Creating Start Script" | ||
| cat <<'EOF' >/opt/maintainerr/start.sh | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| BASE_PATH_REPLACE="${BASE_PATH:-}" | ||
| UI_DIST_DIR="/opt/maintainerr/apps/server/dist/ui" | ||
|
|
||
| if [[ ! -d "$UI_DIST_DIR" ]]; then | ||
| echo "Missing UI build directory: $UI_DIST_DIR" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if grep -R -q -- '/__PATH_PREFIX__' "$UI_DIST_DIR"; then | ||
| ESCAPED_BASE_PATH="${BASE_PATH_REPLACE//\\/\\\\}" | ||
| ESCAPED_BASE_PATH="${ESCAPED_BASE_PATH//&/\\&}" | ||
| if ! find "$UI_DIST_DIR" -type f -not -path '*/node_modules/*' -print0 | xargs -0 sed -i "s,/__PATH_PREFIX__,$ESCAPED_BASE_PATH,g"; then | ||
| echo "Failed to rewrite UI base paths under $UI_DIST_DIR" >&2 | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| exec npm run --prefix /opt/maintainerr/apps/server start | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
| EOF | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| chmod +x /opt/maintainerr/start.sh | ||
| msg_ok "Created Start Script" | ||
|
|
||
| msg_info "Configuring Maintainerr" | ||
| cat <<EOF >/etc/maintainerr/maintainerr.conf | ||
| UI_PORT=6246 | ||
| UI_HOSTNAME=0.0.0.0 | ||
| VERSION_TAG=stable | ||
| DEBUG=false | ||
| BASE_PATH= | ||
| EOF | ||
| msg_ok "Configured Maintainerr" | ||
|
|
||
| msg_info "Creating Service" | ||
| cat <<EOF >/etc/systemd/system/maintainerr.service | ||
| [Unit] | ||
| Description=Maintainerr Service | ||
| Wants=network-online.target | ||
| After=network-online.target | ||
|
|
||
| [Service] | ||
| EnvironmentFile=/etc/maintainerr/maintainerr.conf | ||
| Environment=NODE_ENV=production | ||
| Type=simple | ||
| Restart=on-failure | ||
| RestartSec=5 | ||
| WorkingDirectory=/opt/maintainerr | ||
| ExecStart=/opt/maintainerr/start.sh | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
| systemctl enable -q --now maintainerr | ||
| msg_ok "Created Service" | ||
|
|
||
| motd_ssh | ||
| customize | ||
| cleanup_lxc | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.