Compare commits

..

1 Commits

Author SHA1 Message Date
CanbiZ
191d8fb452 Refactor: Mealie
Updated Node.js version and adjusted database setup. Improved installation steps for Python dependencies and NLTK data.
2025-11-20 14:22:46 +01:00
6 changed files with 41 additions and 128 deletions

View File

@@ -20,7 +20,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### ✨ New Features - #### ✨ New Features
- Immich v2.3.1: OpenVINO tuning, OCR fixes, Maintenance mode, workflows/plugin framework [@vhsdream](https://github.com/vhsdream) ([#9310](https://github.com/community-scripts/ProxmoxVE/pull/9310))
- kasm: add: update [@CrazyWolf13](https://github.com/CrazyWolf13) ([#9253](https://github.com/community-scripts/ProxmoxVE/pull/9253)) - kasm: add: update [@CrazyWolf13](https://github.com/CrazyWolf13) ([#9253](https://github.com/community-scripts/ProxmoxVE/pull/9253))
- tools/pve: expand PVE support to 9.09.1 (post-install & netdata) [@MickLesk](https://github.com/MickLesk) ([#9298](https://github.com/community-scripts/ProxmoxVE/pull/9298)) - tools/pve: expand PVE support to 9.09.1 (post-install & netdata) [@MickLesk](https://github.com/MickLesk) ([#9298](https://github.com/community-scripts/ProxmoxVE/pull/9298))

View File

@@ -61,15 +61,6 @@ EOF
msg_ok "Installed libmimalloc3" msg_ok "Installed libmimalloc3"
fi fi
if [[ ! -f /etc/apt/sources.list.d/mise.list ]]; then
msg_info "Installing Mise"
curl -fSs https://mise.jdx.dev/gpg-key.pub | tee /etc/apt/keyrings/mise-archive-keyring.pub 1>/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.pub arch=amd64] https://mise.jdx.dev/deb stable main" | tee /etc/apt/sources.list.d/mise.list
$STD apt update
$STD apt install -y mise
msg_ok "Installed Mise"
fi
STAGING_DIR=/opt/staging STAGING_DIR=/opt/staging
BASE_DIR=${STAGING_DIR}/base-images BASE_DIR=${STAGING_DIR}/base-images
SOURCE_DIR=${STAGING_DIR}/image-source SOURCE_DIR=${STAGING_DIR}/image-source
@@ -102,7 +93,7 @@ EOF
msg_ok "Image-processing libraries up to date" msg_ok "Image-processing libraries up to date"
fi fi
RELEASE="2.3.1" RELEASE="2.2.3"
if check_for_gh_release "immich" "immich-app/immich" "${RELEASE}"; then if check_for_gh_release "immich" "immich-app/immich" "${RELEASE}"; then
msg_info "Stopping Services" msg_info "Stopping Services"
systemctl stop immich-web systemctl stop immich-web
@@ -130,7 +121,6 @@ EOF
UPLOAD_DIR="$(sed -n '/^IMMICH_MEDIA_LOCATION/s/[^=]*=//p' /opt/immich/.env)" UPLOAD_DIR="$(sed -n '/^IMMICH_MEDIA_LOCATION/s/[^=]*=//p' /opt/immich/.env)"
SRC_DIR="${INSTALL_DIR}/source" SRC_DIR="${INSTALL_DIR}/source"
APP_DIR="${INSTALL_DIR}/app" APP_DIR="${INSTALL_DIR}/app"
PLUGIN_DIR="${APP_DIR}/corePlugin"
ML_DIR="${APP_DIR}/machine-learning" ML_DIR="${APP_DIR}/machine-learning"
GEO_DIR="${INSTALL_DIR}/geodata" GEO_DIR="${INSTALL_DIR}/geodata"
@@ -155,7 +145,9 @@ EOF
rm -rf "${APP_DIR:?}"/* rm -rf "${APP_DIR:?}"/*
) )
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v${RELEASE}" "$SRC_DIR" rm -rf "$SRC_DIR"
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v${RELEASE}" "$SRC_DIR"
msg_info "Updating ${APP} web and microservices" msg_info "Updating ${APP} web and microservices"
cd "$SRC_DIR"/server cd "$SRC_DIR"/server
@@ -188,18 +180,7 @@ EOF
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli $STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
cd "$APP_DIR" cd "$APP_DIR"
mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin
msg_ok "Updated ${APP} web and microservices"
# plugins
cd "$SRC_DIR"
$STD mise trust --ignore ./mise.toml
$STD mise trust ./plugins/mise.toml
cd plugins
$STD mise install
$STD mise run build
mkdir -p "$PLUGIN_DIR"
cp -r ./dist "$PLUGIN_DIR"/dist
cp ./manifest.json "$PLUGIN_DIR"
msg_ok "Updated ${APP} server, web, cli and plugins"
cd "$SRC_DIR"/machine-learning cd "$SRC_DIR"/machine-learning
mkdir -p "$ML_DIR" && chown -R immich:immich "$ML_DIR" mkdir -p "$ML_DIR" && chown -R immich:immich "$ML_DIR"

View File

@@ -23,8 +23,7 @@ function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -f /etc/apt/sources.list.d/plexmediaserver.list ]] \ if [ ! -f /etc/apt/sources.list.d/plexmediaserver.list ]] && [[ ! -f /etc/apt/sources.list.d/plexmediaserver.sources ]]; then
&& [[ ! -f /etc/apt/sources.list.d/plexmediaserver.sources ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi

View File

@@ -71,11 +71,7 @@ export TURBO_CACHE=1
export NEXT_TELEMETRY_DISABLED=1 export NEXT_TELEMETRY_DISABLED=1
export CYPRESS_INSTALL_BINARY=0 export CYPRESS_INSTALL_BINARY=0
export NODE_OPTIONS="--max-old-space-size=4096" export NODE_OPTIONS="--max-old-space-size=4096"
$STD turbo prune --scope=@documenso/remix --docker
cd out
cp -r json/* .
$STD npm ci $STD npm ci
cp -r full/* .
$STD turbo run build --filter=@documenso/remix $STD turbo run build --filter=@documenso/remix
$STD npm run prisma:migrate-deploy $STD npm run prisma:migrate-deploy
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"

View File

@@ -84,13 +84,6 @@ if [[ "$CTTYPE" == "0" && -d /dev/dri ]]; then
fi fi
msg_ok "Dependencies Installed" msg_ok "Dependencies Installed"
msg_info "Installing Mise"
curl -fSs https://mise.jdx.dev/gpg-key.pub | tee /etc/apt/keyrings/mise-archive-keyring.pub 1>/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.pub arch=amd64] https://mise.jdx.dev/deb stable main" | tee /etc/apt/sources.list.d/mise.list
$STD apt update
$STD apt install -y mise
msg_ok "Installed Mise"
read -r -p "${TAB3}Install OpenVINO dependencies for Intel HW-accelerated machine-learning? y/N " prompt read -r -p "${TAB3}Install OpenVINO dependencies for Intel HW-accelerated machine-learning? y/N " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing OpenVINO dependencies" msg_info "Installing OpenVINO dependencies"
@@ -284,7 +277,6 @@ INSTALL_DIR="/opt/${APPLICATION}"
UPLOAD_DIR="${INSTALL_DIR}/upload" UPLOAD_DIR="${INSTALL_DIR}/upload"
SRC_DIR="${INSTALL_DIR}/source" SRC_DIR="${INSTALL_DIR}/source"
APP_DIR="${INSTALL_DIR}/app" APP_DIR="${INSTALL_DIR}/app"
PLUGIN_DIR="${APP_DIR}/corePlugin"
ML_DIR="${APP_DIR}/machine-learning" ML_DIR="${APP_DIR}/machine-learning"
GEO_DIR="${INSTALL_DIR}/geodata" GEO_DIR="${INSTALL_DIR}/geodata"
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
@@ -322,18 +314,7 @@ cp LICENSE "$APP_DIR"
$STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install $STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install
$STD pnpm --filter @immich/sdk --filter @immich/cli build $STD pnpm --filter @immich/sdk --filter @immich/cli build
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli $STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
msg_ok "Installed Immich Server and Web Components"
# plugins
cd "$SRC_DIR"
$STD mise trust --ignore ./mise.toml
$STD mise trust ./plugins/mise.toml
cd plugins
$STD mise install
$STD mise run build
mkdir -p "$PLUGIN_DIR"
cp -r ./dist "$PLUGIN_DIR"/dist
cp ./manifest.json "$PLUGIN_DIR"
msg_ok "Installed Immich Server, Web and Plugin Components"
cd "$SRC_DIR"/machine-learning cd "$SRC_DIR"/machine-learning
$STD useradd -U -s /usr/sbin/nologin -r -M -d "$INSTALL_DIR" immich $STD useradd -U -s /usr/sbin/nologin -r -M -d "$INSTALL_DIR" immich
@@ -397,10 +378,6 @@ DB_VECTOR_EXTENSION=vectorchord
REDIS_HOSTNAME=127.0.0.1 REDIS_HOSTNAME=127.0.0.1
IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003 IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003
MACHINE_LEARNING_CACHE_FOLDER=${INSTALL_DIR}/cache MACHINE_LEARNING_CACHE_FOLDER=${INSTALL_DIR}/cache
## - For OpenVINO only - uncomment below to increase
## - inference speed while reducing accuracy
## - Default is FP32
# MACHINE_LEARNING_OPENVINO_PRECISION=FP16
IMMICH_MEDIA_LOCATION=${UPLOAD_DIR} IMMICH_MEDIA_LOCATION=${UPLOAD_DIR}
EOF EOF

View File

@@ -25,27 +25,14 @@ msg_ok "Installed Dependencies"
PYTHON_VERSION="3.12" setup_uv PYTHON_VERSION="3.12" setup_uv
POSTGRES_VERSION="16" setup_postgresql POSTGRES_VERSION="16" setup_postgresql
NODE_MODULE="yarn" NODE_VERSION="20" setup_nodejs NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs
fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball" "latest" "/opt/mealie" fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball" "latest" "/opt/mealie"
PG_DB_NAME="mealie_db" PG_DB_USER="mealie_user" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db
msg_info "Setup Database" msg_info "Installing Python Dependencies with uv"
DB_NAME=mealie_db cd /opt/mealie
DB_USER=mealie__user $STD uv sync --frozen --extra pgsql
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) msg_ok "Installed Python Dependencies"
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
$STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;"
{
echo "Mealie-Credentials"
echo "Mealie Database User: $DB_USER"
echo "Mealie Database Password: $DB_PASS"
echo "Mealie Database Name: $DB_NAME"
} >>~/mealie.creds
msg_ok "Set up Database"
msg_info "Building Frontend" msg_info "Building Frontend"
export NUXT_TELEMETRY_DISABLED=1 export NUXT_TELEMETRY_DISABLED=1
@@ -54,33 +41,35 @@ $STD yarn install --prefer-offline --frozen-lockfile --non-interactive --product
$STD yarn generate $STD yarn generate
msg_ok "Built Frontend" msg_ok "Built Frontend"
msg_info "Copying Built Frontend into Backend Package" msg_info "Copying Built Frontend"
cp -r /opt/mealie/frontend/dist /opt/mealie/mealie/frontend mkdir -p /opt/mealie/mealie/frontend
cp -r /opt/mealie/frontend/dist/* /opt/mealie/mealie/frontend/
msg_ok "Copied Frontend" msg_ok "Copied Frontend"
msg_info "Preparing Backend (Poetry)" msg_info "Downloading NLTK Data"
$STD uv venv /opt/mealie/.venv mkdir -p /nltk_data/
$STD /opt/mealie/.venv/bin/python -m ensurepip --upgrade
$STD /opt/mealie/.venv/bin/python -m pip install --upgrade pip
$STD /opt/mealie/.venv/bin/pip install uv
cd /opt/mealie cd /opt/mealie
$STD /opt/mealie/.venv/bin/uv pip install poetry==2.0.1 $STD uv run python -m nltk.downloader -d /nltk_data averaged_perceptron_tagger_eng
$STD /opt/mealie/.venv/bin/poetry self add "poetry-plugin-export>=1.9" msg_ok "Downloaded NLTK Data"
msg_ok "Prepared Poetry"
msg_info "Writing Environment File" msg_info "Writing Environment File"
SECRET=$(openssl rand -hex 32)
mkdir -p /run/secrets
cat <<EOF >/opt/mealie/mealie.env cat <<EOF >/opt/mealie/mealie.env
HOST=0.0.0.0 MEALIE_HOME=/opt/mealie
PORT=9000 NLTK_DATA=/nltk_data
SECRET=${SECRET}
DB_ENGINE=postgres DB_ENGINE=postgres
POSTGRES_SERVER=localhost POSTGRES_SERVER=localhost
POSTGRES_PORT=5432 POSTGRES_PORT=5432
POSTGRES_USER=${DB_USER} POSTGRES_USER=${PG_DB_USER}
POSTGRES_PASSWORD=${DB_PASS} POSTGRES_PASSWORD=${PG_DB_PASS}
POSTGRES_DB=${DB_NAME} POSTGRES_DB=${PG_DB_NAME}
NLTK_DATA=/nltk_data
PRODUCTION=true PRODUCTION=true
STATIC_FILES=/opt/mealie/frontend/dist HOST=0.0.0.0
PORT=9000
EOF EOF
msg_ok "Wrote Environment File" msg_ok "Wrote Environment File"
@@ -90,60 +79,32 @@ cat <<'EOF' >/opt/mealie/start.sh
set -a set -a
source /opt/mealie/mealie.env source /opt/mealie/mealie.env
set +a set +a
exec /opt/mealie/.venv/bin/mealie exec uv run mealie
EOF EOF
chmod +x /opt/mealie/start.sh chmod +x /opt/mealie/start.sh
msg_ok "Created Start Script" msg_ok "Created Start Script"
msg_info "Building Mealie Backend Wheel"
cd /opt/mealie
$STD /opt/mealie/.venv/bin/poetry build --output dist
MEALIE_VERSION=$(/opt/mealie/.venv/bin/poetry version --short)
$STD /opt/mealie/.venv/bin/poetry export --only=main --extras=pgsql --output=dist/requirements.txt
echo "mealie[pgsql]==$MEALIE_VERSION \\" >>dist/requirements.txt
/opt/mealie/.venv/bin/poetry run pip hash dist/mealie-$MEALIE_VERSION*.whl | tail -n1 | tr -d '\n' >>dist/requirements.txt
echo " \\" >>dist/requirements.txt
/opt/mealie/.venv/bin/poetry run pip hash dist/mealie-$MEALIE_VERSION*.tar.gz | tail -n1 >>dist/requirements.txt
msg_ok "Built Wheel + Requirements"
msg_info "Installing Mealie via uv"
cd /opt/mealie
$STD /opt/mealie/.venv/bin/uv pip install --require-hashes -r /opt/mealie/dist/requirements.txt --find-links dist
msg_ok "Installed Mealie"
msg_info "Downloading NLTK Data"
mkdir -p /nltk_data/
$STD /opt/mealie/.venv/bin/python -m nltk.downloader -d /nltk_data averaged_perceptron_tagger_eng
msg_ok "Downloaded NLTK Data"
msg_info "Set Symbolic Links for Mealie"
ln -sf /opt/mealie/.venv/bin/mealie /usr/local/bin/mealie
ln -sf /opt/mealie/.venv/bin/poetry /usr/local/bin/poetry
msg_ok "Set Symbolic Links"
msg_info "Creating Systemd Service" msg_info "Creating Systemd Service"
cat <<EOF >/etc/systemd/system/mealie.service cat <<'EOF' >/etc/systemd/system/mealie.service
[Unit] [Unit]
Description=Mealie Backend Server Description=Mealie Recipe Manager
After=network.target postgresql.service After=network.target postgresql.service
Wants=postgresql.service
[Service] [Service]
Type=simple
User=root User=root
WorkingDirectory=/opt/mealie WorkingDirectory=/opt/mealie
ExecStart=/opt/mealie/start.sh ExecStart=/opt/mealie/start.sh
Restart=always Restart=on-failure
RestartSec=5
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q --now mealie systemctl enable -q --now mealie
msg_ok "Created Service" msg_ok "Created and Started Service"
motd_ssh motd_ssh
customize customize
cleanup_lxc
msg_info "Cleaning up"
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
msg_ok "Cleaned"