2025-07-14 11:46:19 +02:00
#!/usr/bin/env bash
source <( curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://mealie.io
APP = "Mealie"
var_tags = " ${ var_tags :- recipes } "
var_cpu = " ${ var_cpu :- 2 } "
2025-12-01 18:29:51 +01:00
var_ram = " ${ var_ram :- 3072 } "
2025-07-14 11:46:19 +02:00
var_disk = " ${ var_disk :- 10 } "
var_os = " ${ var_os :- debian } "
2025-10-15 22:29:48 +02:00
var_version = " ${ var_version :- 13 } "
2025-07-14 11:46:19 +02:00
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/mealie ] ] ; then
msg_error " No ${ APP } Installation Found! "
exit
fi
2025-08-29 12:27:24 +02:00
if check_for_gh_release "mealie" "mealie-recipes/mealie" ; then
2025-07-14 11:46:19 +02:00
PYTHON_VERSION = "3.12" setup_uv
2025-12-01 18:29:51 +01:00
NODE_MODULE = "yarn" NODE_VERSION = "24" setup_nodejs
2025-07-14 11:46:19 +02:00
2025-10-30 09:24:16 -07:00
msg_info "Stopping Service"
2025-07-14 11:46:19 +02:00
systemctl stop mealie
2025-12-01 18:29:51 +01:00
msg_ok "Stopped Service"
2025-07-14 11:46:19 +02:00
2025-12-01 18:29:51 +01:00
msg_info "Backing up Configuration"
2025-12-01 19:31:16 +01:00
cp -f /opt/mealie/mealie.env /opt/mealie.env
2025-07-14 11:46:19 +02:00
msg_ok "Backup completed"
2025-12-01 18:29:51 +01:00
CLEAN_INSTALL = 1 fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball" "latest" "/opt/mealie"
2025-07-14 11:46:19 +02:00
2025-12-01 18:29:51 +01:00
msg_info "Installing Python Dependencies with uv"
cd /opt/mealie
$STD uv sync --frozen --extra pgsql
msg_ok "Installed Python Dependencies"
msg_info "Building Frontend"
MEALIE_VERSION = $( <$HOME /.mealie)
$STD sed -i "s|https://github.com/mealie-recipes/mealie/commit/|https://github.com/mealie-recipes/mealie/releases/tag/|g" /opt/mealie/frontend/pages/admin/site-settings.vue
$STD sed -i " s|value: data.buildId,|value: \"v ${ MEALIE_VERSION } \",|g " /opt/mealie/frontend/pages/admin/site-settings.vue
$STD sed -i "s|value: data.production ? i18n.t(\"about.production\") : i18n.t(\"about.development\"),|value: \"bare-metal\",|g" /opt/mealie/frontend/pages/admin/site-settings.vue
2025-07-14 11:46:19 +02:00
export NUXT_TELEMETRY_DISABLED = 1
cd /opt/mealie/frontend
$STD yarn install --prefer-offline --frozen-lockfile --non-interactive --production= false --network-timeout 1000000
$STD yarn generate
2025-12-01 18:29:51 +01:00
msg_ok "Built Frontend"
2025-07-14 11:46:19 +02:00
2025-12-01 18:29:51 +01:00
msg_info "Copying Built Frontend"
mkdir -p /opt/mealie/mealie/frontend
cp -r /opt/mealie/frontend/dist/* /opt/mealie/mealie/frontend/
msg_ok "Copied Frontend"
msg_info "Updating NLTK Data"
mkdir -p /nltk_data/
2025-07-14 11:46:19 +02:00
cd /opt/mealie
2025-12-01 18:29:51 +01:00
$STD uv run python -m nltk.downloader -d /nltk_data averaged_perceptron_tagger_eng
msg_ok "Updated NLTK Data"
2025-07-14 11:46:19 +02:00
msg_info "Restoring Configuration"
2025-12-01 19:31:16 +01:00
mv -f /opt/mealie.env /opt/mealie/mealie.env
2025-12-01 18:29:51 +01:00
cat <<'STARTEOF' >/opt/mealie/start.sh
#!/bin/bash
set -a
source /opt/mealie/mealie.env
set +a
exec uv run mealie
STARTEOF
2025-07-14 11:46:19 +02:00
chmod +x /opt/mealie/start.sh
msg_ok "Configuration restored"
2025-10-30 09:24:16 -07:00
msg_info "Starting Service"
2025-07-14 11:46:19 +02:00
systemctl start mealie
2025-10-30 09:24:16 -07:00
msg_ok "Started Service"
2025-12-01 18:29:51 +01:00
msg_ok "Updated successfully"
2025-07-14 11:46:19 +02:00
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 } :9000 ${ CL } "
2025-12-01 18:29:51 +01:00