wealthfolio: add: prebuild (#14658)

This commit is contained in:
Tobias
2026-05-23 09:48:03 +02:00
committed by GitHub
parent a28fec825b
commit de2806ca54
2 changed files with 13 additions and 57 deletions
+7 -28
View File
@@ -3,13 +3,13 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
# Copyright (c) 2021-2026 community-scripts ORG
# Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://wealthfolio.app/ | Github: https://github.com/afadil/wealthfolio
# Source: https://wealthfolio.app/ | Github: https://github.com/wealthfolio/wealthfolio
APP="Wealthfolio"
var_tags="${var_tags:-finance;portfolio}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-10}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-no}"
@@ -30,13 +30,11 @@ function update_script() {
exit
fi
NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs
if grep -q '^WF_CORS_ALLOW_ORIGINS=\*$' /opt/wealthfolio/.env; then
sed -i "s|^WF_CORS_ALLOW_ORIGINS=\*$|WF_CORS_ALLOW_ORIGINS=http://${LOCAL_IP}:8080|" /opt/wealthfolio/.env
fi
if check_for_gh_release "wealthfolio" "afadil/wealthfolio"; then
if check_for_gh_release "wealthfolio" "wealthfolio/wealthfolio"; then
msg_info "Stopping Service"
systemctl stop wealthfolio
msg_ok "Stopped Service"
@@ -46,21 +44,8 @@ function update_script() {
cp /opt/wealthfolio/.env /opt/wealthfolio_env_backup
msg_ok "Backed up Data"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wealthfolio" "afadil/wealthfolio" "tarball"
msg_info "Building Frontend (patience)"
cd /opt/wealthfolio
export BUILD_TARGET=web
$STD pnpm install --frozen-lockfile
$STD pnpm --filter frontend... build
msg_ok "Built Frontend"
msg_info "Building Backend (patience)"
source ~/.cargo/env
$STD cargo build --release --manifest-path apps/server/Cargo.toml
cp /opt/wealthfolio/target/release/wealthfolio-server /usr/local/bin/wealthfolio-server
chmod +x /usr/local/bin/wealthfolio-server
msg_ok "Built Backend"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wealthfolio" "wealthfolio/wealthfolio" "prebuild" "latest" "/opt/wealthfolio" "wealthfolio-server-*-linux-amd64.tar.gz"
install -m 755 /opt/wealthfolio/wealthfolio-server /usr/local/bin/wealthfolio-server
msg_info "Restoring Data"
cp -r /opt/wealthfolio_data_backup/. /opt/wealthfolio_data
@@ -68,12 +53,6 @@ function update_script() {
rm -rf /opt/wealthfolio_data_backup /opt/wealthfolio_env_backup
msg_ok "Restored Data"
msg_info "Cleaning Up"
rm -rf /opt/wealthfolio/target
rm -rf /root/.cargo/registry
rm -rf /opt/wealthfolio/node_modules
msg_ok "Cleaned Up"
msg_info "Starting Service"
systemctl start wealthfolio
msg_ok "Started Service"
+6 -29
View File
@@ -3,7 +3,7 @@
# Copyright (c) 2021-2026 community-scripts ORG
# Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://wealthfolio.app/ | Github: https://github.com/afadil/wealthfolio
# Source: https://wealthfolio.app/ | Github: https://github.com/wealthfolio/wealthfolio
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
@@ -14,31 +14,14 @@ network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
pkg-config \
libssl-dev \
build-essential \
libsqlite3-dev \
argon2
$STD apt install -y argon2
msg_ok "Installed Dependencies"
setup_rust
NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs
fetch_and_deploy_gh_release "wealthfolio" "afadil/wealthfolio" "tarball"
fetch_and_deploy_gh_release "wealthfolio" "wealthfolio/wealthfolio" "prebuild" "latest" "/opt/wealthfolio" "wealthfolio-server-*-linux-amd64.tar.gz"
msg_info "Building Frontend (patience)"
cd /opt/wealthfolio
export BUILD_TARGET=web
$STD pnpm install --frozen-lockfile
$STD pnpm --filter frontend... build
msg_ok "Built Frontend"
msg_info "Building Backend (patience)"
source ~/.cargo/env
$STD cargo build --release --manifest-path apps/server/Cargo.toml
cp /opt/wealthfolio/target/release/wealthfolio-server /usr/local/bin/wealthfolio-server
chmod +x /usr/local/bin/wealthfolio-server
msg_ok "Built Backend"
msg_info "Installing Wealthfolio"
install -m 755 /opt/wealthfolio/wealthfolio-server /usr/local/bin/wealthfolio-server
msg_ok "Installed Wealthfolio"
msg_info "Configuring Wealthfolio"
mkdir -p /opt/wealthfolio_data
@@ -57,12 +40,6 @@ EOF
echo "WF_PASSWORD=${WF_PASSWORD}" >~/wealthfolio.creds
msg_ok "Configured Wealthfolio"
msg_info "Cleaning Up"
rm -rf /opt/wealthfolio/target
rm -rf /root/.cargo/registry
rm -rf /opt/wealthfolio/node_modules
msg_ok "Cleaned Up"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/wealthfolio.service
[Unit]