2026-03-02 09:36:16 +01:00
#!/usr/bin/env bash
2026-09-02 13:18:14 +02:00
_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" )
2026-03-02 09:36:16 +01:00
# Copyright (c) 2021-2026 community-scripts ORG
# Author: michelroegl-brunner
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Dictionarry-Hub/profilarr
APP = "Profilarr"
var_tags = " ${ var_tags :- arr ;radarr;sonarr;config } "
var_cpu = " ${ var_cpu :- 2 } "
var_ram = " ${ var_ram :- 2048 } "
2026-05-20 19:19:08 +02:00
var_disk = " ${ var_disk :- 7 } "
2026-03-02 09:36:16 +01:00
var_os = " ${ var_os :- debian } "
var_version = " ${ var_version :- 13 } "
2026-06-22 04:44:06 +10:00
var_arm64 = " ${ var_arm64 :- yes } "
2026-03-02 09:36:16 +01: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/profilarr ]] ; then
msg_error "No ${ APP } Installation Found!"
exit
fi
2026-05-20 19:19:08 +02:00
if [[ -d /opt/profilarr/backend ]] ; then
msg_error "Profilarr v1 detected!"
echo -e "\nProfilarr v2 is a complete rewrite and is NOT compatible with v1."
echo -e "There is no migration path. Please create a new LXC container for v2.\n"
exit
fi
2026-05-26 03:20:21 -04:00
ARCH = $( uname -m)
2026-05-22 08:51:43 +02:00
if check_for_gh_release "deno" "denoland/deno" "v2.7.5" "Deno is pinned to 2.7.5 because the known WouldBlock: Resource temporarily unavailable (os error 11) Issue" ; then
fetch_and_deploy_gh_release "deno" "denoland/deno" "v2.7.5" "latest" "/usr/local/bin" "deno- ${ ARCH } -unknown-linux-gnu.zip"
2026-05-20 19:19:08 +02:00
fi
2026-03-02 09:36:16 +01:00
if check_for_gh_release "profilarr" "Dictionarry-Hub/profilarr" ; then
msg_info "Stopping Service"
systemctl stop profilarr
msg_ok "Stopped Service"
CLEAN_INSTALL = 1 fetch_and_deploy_gh_release "profilarr" "Dictionarry-Hub/profilarr" "tarball"
2026-05-20 19:19:08 +02:00
PROFILARR_VERSION = $( cat ~/.profilarr)
2026-03-02 09:36:16 +01:00
2026-05-20 19:19:08 +02:00
msg_info "Building Profilarr v ${ PROFILARR_VERSION } (Patience)"
cd /opt/profilarr
cat >src/lib/shared/build.ts <<EOF
// Generated at update time. Do not hand-edit.
export type Channel = 'stable' | 'develop' | 'dev';
export interface BuildInfo {
readonly version: string;
readonly channel: Channel;
readonly commit: string | null;
readonly builtAt: string | null;
}
2026-03-02 09:36:16 +01:00
2026-05-20 19:19:08 +02:00
export const build: BuildInfo = {
version: '${PROFILARR_VERSION}',
channel: 'stable',
commit: null,
builtAt: '$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
};
EOF
$STD deno install --node-modules-dir
export APP_BASE_PATH = /opt/profilarr/dist/build
export VITE_CHANNEL = stable
$STD deno run -A npm:vite build
DENO_TARGET = " ${ ARCH } -unknown-linux-gnu"
$STD deno compile \
--no-check \
--allow-net \
--allow-read \
--allow-write \
--allow-env \
--allow-ffi \
--allow-run \
--allow-sys \
--target " $DENO_TARGET " \
--output dist/build/profilarr \
dist/build/mod.ts
msg_ok "Built Profilarr"
2026-03-02 09:36:16 +01:00
2026-05-20 19:19:08 +02:00
msg_info "Updating Profilarr"
2026-05-26 11:58:45 -07:00
mkdir -p /opt/profilarr/app
2026-05-20 19:19:08 +02:00
cp dist/build/profilarr /opt/profilarr/app/profilarr
cp dist/build/server.js /opt/profilarr/app/server.js
cp -r dist/build/static /opt/profilarr/app/static
chmod +x /opt/profilarr/app/profilarr
msg_ok "Updated Profilarr"
2026-03-02 09:36:16 +01:00
msg_info "Starting Service"
systemctl start profilarr
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 } "
2026-06-03 11:03:13 +02:00
echo -e " ${ INFO }${ YW } Access it using the following URL: ${ CL } "
echo -e " ${ GATEWAY }${ BGN } http:// ${ IP } :6868 ${ CL } "