@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/tclahr/ProxmoxVED/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
# Author: Thiago Canozzo Lahr (tclahr)
|
# Author: Thiago Canozzo Lahr (tclahr)
|
||||||
# License: MIT | https://github.com/tclahr/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/tclahr/ProxmoxVE/raw/main/LICENSE
|
||||||
@@ -29,46 +29,36 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/immichFrame/ImmichFrame/releases/latest | grep "tag_name" | awk -F'"' '{print $4}')
|
if check_for_gh_release "immichframe" "immichFrame/ImmichFrame"; then
|
||||||
if [[ ! -f /app/version.txt ]] || [[ "${RELEASE}" != "$(cat /app/version.txt)" ]]; then
|
msg_info "Stopping Service"
|
||||||
msg_info "Updating ${APP} to ${RELEASE}"
|
systemctl stop immichframe
|
||||||
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
msg_info "Stopping ${APP} service"
|
msg_info "Updating ImmichFrame"
|
||||||
systemctl stop immichframe 2>/dev/null
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "immichframe" "immichFrame/ImmichFrame" "tarball" "latest" "/app"
|
||||||
|
msg_info "Building Application"
|
||||||
msg_info "Downloading source ${RELEASE}"
|
cd /app
|
||||||
curl -fsSL "https://github.com/immichFrame/ImmichFrame/archive/refs/tags/${RELEASE}.tar.gz" \
|
$STD /opt/dotnet/dotnet publish ImmichFrame.WebApi/ImmichFrame.WebApi.csproj \
|
||||||
-o /tmp/immichframe.tar.gz
|
|
||||||
tar -xzf /tmp/immichframe.tar.gz -C /tmp/
|
|
||||||
SRCDIR=$(ls -d /tmp/ImmichFrame-*)
|
|
||||||
|
|
||||||
msg_info "Building backend"
|
|
||||||
cd "${SRCDIR}"
|
|
||||||
/opt/dotnet/dotnet publish ImmichFrame.WebApi/ImmichFrame.WebApi.csproj \
|
|
||||||
--configuration Release \
|
--configuration Release \
|
||||||
--runtime linux-x64 \
|
--runtime linux-x64 \
|
||||||
--self-contained false \
|
--self-contained false \
|
||||||
--output /app \
|
--output /app
|
||||||
&>/dev/null
|
|
||||||
|
|
||||||
msg_info "Building frontend"
|
cd /app/immichFrame.Web
|
||||||
cd "${SRCDIR}/immichFrame.Web"
|
$STD npm ci
|
||||||
npm ci --silent &>/dev/null
|
$STD npm run build
|
||||||
npm run build &>/dev/null
|
|
||||||
rm -rf /app/wwwroot/*
|
rm -rf /app/wwwroot/*
|
||||||
cp -r build/* /app/wwwroot
|
cp -r build/* /app/wwwroot
|
||||||
|
msg_ok "Application Built"
|
||||||
|
|
||||||
echo "${RELEASE}" > /app/version.txt
|
msg_info "Starting Service"
|
||||||
|
systemctl start immichframe
|
||||||
|
msg_ok "Started Service"
|
||||||
|
msg_ok "Updated Successfully!"
|
||||||
|
|
||||||
msg_info "Starting ${APP} service"
|
|
||||||
service immichframe start &>/dev/null
|
|
||||||
|
|
||||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
build_container
|
build_container
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
# Author: Thiago Canozzo Lahr (tclahr)
|
# Author: Thiago Canozzo Lahr (tclahr)
|
||||||
# License: MIT | https://github.com/tclahr/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://github.com/immichFrame/ImmichFrame
|
# Source: https://github.com/immichFrame/ImmichFrame
|
||||||
|
|
||||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
@@ -13,7 +13,6 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y \
|
$STD apt install -y \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
@@ -22,55 +21,35 @@ $STD apt install -y \
|
|||||||
npm \
|
npm \
|
||||||
gettext-base
|
gettext-base
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
msg_ok "Installed Dependencies"
|
|
||||||
|
|
||||||
msg_info "Installing .NET 8 SDK via dotnet-install.sh"
|
msg_info "Installing .NET 8 SDK"
|
||||||
mkdir -p /opt/dotnet
|
mkdir -p /opt/dotnet
|
||||||
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
|
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
|
||||||
chmod +x /tmp/dotnet-install.sh
|
chmod +x /tmp/dotnet-install.sh
|
||||||
|
|
||||||
$STD /tmp/dotnet-install.sh \
|
$STD /tmp/dotnet-install.sh \
|
||||||
--channel 8.0 \
|
--channel 8.0 \
|
||||||
--install-dir /opt/dotnet \
|
--install-dir /opt/dotnet \
|
||||||
--no-path
|
--no-path
|
||||||
|
|
||||||
ln -sf /opt/dotnet/dotnet /usr/local/bin/dotnet
|
ln -sf /opt/dotnet/dotnet /usr/local/bin/dotnet
|
||||||
|
msg_ok "Installed .NET 8 SDK"
|
||||||
|
|
||||||
ln -sf /opt/dotnet/dotnet /usr/local/bin/dotnet
|
fetch_and_deploy_gh_release "immichframe" "immichFrame/ImmichFrame" "tarball" "latest" "/app"
|
||||||
|
|
||||||
rm /tmp/dotnet-install.sh
|
msg_info "Building Application"
|
||||||
msg_ok ".NET 8 SDK Installed"
|
|
||||||
|
|
||||||
msg_info "Fetching Latest ImmichFrame Release"
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/immichFrame/ImmichFrame/releases/latest \
|
|
||||||
| grep "tag_name" | awk -F'"' '{print $4}')
|
|
||||||
msg_ok "Latest release: ${RELEASE}"
|
|
||||||
|
|
||||||
msg_info "Downloading ImmichFrame Source (${RELEASE})"
|
|
||||||
curl -fsSL "https://github.com/immichFrame/ImmichFrame/archive/refs/tags/${RELEASE}.tar.gz" \
|
|
||||||
-o /tmp/immichframe.tar.gz
|
|
||||||
$STD tar -xzf /tmp/immichframe.tar.gz -C /tmp/
|
|
||||||
SRCDIR=$(ls -d /tmp/ImmichFrame-*)
|
|
||||||
msg_ok "Source Downloaded"
|
|
||||||
|
|
||||||
msg_info "Building ImmichFrame Backend (ASP.NET Core)"
|
|
||||||
mkdir -p /app
|
mkdir -p /app
|
||||||
cd "${SRCDIR}"
|
cd /app
|
||||||
$STD dotnet publish ImmichFrame.WebApi/ImmichFrame.WebApi.csproj \
|
$STD dotnet publish ImmichFrame.WebApi/ImmichFrame.WebApi.csproj \
|
||||||
--configuration Release \
|
--configuration Release \
|
||||||
--runtime linux-x64 \
|
--runtime linux-x64 \
|
||||||
--self-contained false \
|
--self-contained false \
|
||||||
--output /app
|
--output /app
|
||||||
msg_ok "Backend Built"
|
cd /app/immichFrame.Web
|
||||||
|
|
||||||
msg_info "Building ImmichFrame Frontend (SvelteKit)"
|
|
||||||
cd "${SRCDIR}/immichFrame.Web"
|
|
||||||
$STD npm ci
|
$STD npm ci
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
cp -r build/* /app/wwwroot
|
cp -r build/* /app/wwwroot
|
||||||
msg_ok "Frontend Built"
|
msg_ok "Application Built"
|
||||||
|
|
||||||
msg_info "Creating Configuration Directory"
|
msg_info "Configuring ImmichFrame"
|
||||||
mkdir -p /app/Config
|
mkdir -p /app/Config
|
||||||
|
|
||||||
cat <<'EOF' > /app/Config/Settings.yml
|
cat <<'EOF' > /app/Config/Settings.yml
|
||||||
@@ -192,14 +171,14 @@ Accounts:
|
|||||||
# - "Travel/Europe"
|
# - "Travel/Europe"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Configuration File Created"
|
msg_ok "Configured ImmichFrame"
|
||||||
|
|
||||||
msg_info "Creating Dedicated User"
|
msg_info "Creating immichframe User"
|
||||||
useradd -r -s /sbin/nologin -d /app -M immichframe 2>/dev/null
|
useradd -r -s /sbin/nologin -d /app -M immichframe 2>/dev/null
|
||||||
chown -R immichframe:immichframe /app
|
chown -R immichframe:immichframe /app
|
||||||
msg_ok "User 'immichframe' Created"
|
msg_ok "User immichframe Created"
|
||||||
|
|
||||||
msg_info "Creating ImmichFrame systemd Service"
|
msg_info "Creating Service"
|
||||||
cat <<'EOF' > /etc/systemd/system/immichframe.service
|
cat <<'EOF' > /etc/systemd/system/immichframe.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ImmichFrame Digital Photo Frame
|
Description=ImmichFrame Digital Photo Frame
|
||||||
@@ -229,21 +208,8 @@ SyslogIdentifier=immichframe
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
msg_ok "systemd Service Created"
|
|
||||||
|
|
||||||
msg_info "Enabling and Starting ImmichFrame Service"
|
|
||||||
systemctl enable -q --now immichframe
|
systemctl enable -q --now immichframe
|
||||||
msg_ok "ImmichFrame Service Started"
|
msg_ok "Created Service"
|
||||||
msg_ok "ImmichFrame Service Started"
|
|
||||||
|
|
||||||
msg_info "Saving Version Info"
|
|
||||||
echo "${RELEASE}" > /app/version.txt
|
|
||||||
msg_ok "Version ${RELEASE} Saved"
|
|
||||||
|
|
||||||
msg_info "Cleaning Up Build Artifacts"
|
|
||||||
$STD apt clean
|
|
||||||
msg_ok "Cleanup Complete"
|
|
||||||
msg_ok "Cleanup Complete"
|
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|||||||
Reference in New Issue
Block a user