Files
ProxmoxVE/install/wealthfolio-install.sh
T

67 lines
1.8 KiB
Bash
Raw Normal View History

2026-02-03 20:36:33 +01:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
2026-05-23 09:48:03 +02:00
# Source: https://wealthfolio.app/ | Github: https://github.com/wealthfolio/wealthfolio
2026-02-03 20:36:33 +01:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
2026-05-23 09:48:03 +02:00
$STD apt install -y argon2
2026-02-03 20:36:33 +01:00
msg_ok "Installed Dependencies"
2026-05-23 09:48:03 +02:00
fetch_and_deploy_gh_release "wealthfolio" "wealthfolio/wealthfolio" "prebuild" "latest" "/opt/wealthfolio" "wealthfolio-server-*-linux-amd64.tar.gz"
2026-02-03 20:36:33 +01:00
2026-05-23 09:48:03 +02:00
msg_info "Installing Wealthfolio"
install -m 755 /opt/wealthfolio/wealthfolio-server /usr/local/bin/wealthfolio-server
msg_ok "Installed Wealthfolio"
2026-02-03 20:36:33 +01:00
msg_info "Configuring Wealthfolio"
mkdir -p /opt/wealthfolio_data
SECRET_KEY=$(openssl rand -base64 32)
2026-10-03 08:19:10 +02:00
WF_PASSWORD=$(random_password 16)
2026-02-03 20:36:33 +01:00
WF_PASSWORD_HASH=$(echo -n "$WF_PASSWORD" | argon2 "$(openssl rand -base64 16)" -id -e)
cat <<EOF >/opt/wealthfolio/.env
WF_LISTEN_ADDR=0.0.0.0:8080
WF_DB_PATH=/opt/wealthfolio_data/wealthfolio.db
WF_SECRET_KEY=${SECRET_KEY}
WF_AUTH_PASSWORD_HASH=${WF_PASSWORD_HASH}
WF_STATIC_DIR=/opt/wealthfolio/dist
WF_REQUEST_TIMEOUT_MS=30000
2026-03-06 16:17:00 +01:00
WF_CORS_ALLOW_ORIGINS=http://${LOCAL_IP}:8080
2026-02-03 20:36:33 +01:00
EOF
echo "WF_PASSWORD=${WF_PASSWORD}" >~/wealthfolio.creds
msg_ok "Configured Wealthfolio"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/wealthfolio.service
[Unit]
Description=Wealthfolio Investment Tracker
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/wealthfolio
EnvironmentFile=/opt/wealthfolio/.env
ExecStart=/usr/local/bin/wealthfolio-server
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now wealthfolio
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc