Skip to content

Commit 1f7cc9c

Browse files
Add budget-board (ct)
1 parent 19bfe87 commit 1f7cc9c

3 files changed

Lines changed: 219 additions & 0 deletions

File tree

ct/budget-board.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env bash
2+
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main"
3+
# Engine comes from community-scripts/core; this repo only ships the scripts.
4+
# A local core checkout wins (COMMUNITY_SCRIPTS_CORE_DIR, else a sibling ../core),
5+
# so a fork or branch of core can be tested without editing this file.
6+
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
7+
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
8+
# Copyright (c) 2021-2026 community-scripts ORG
9+
# Author: Slaviša Arežina (tremor021)
10+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
11+
# Source: https://github.com/teelur/budget-board
12+
13+
APP="Budget-Board"
14+
var_tags="${var_tags:-finance;budget;money}"
15+
var_cpu="${var_cpu:-2}"
16+
var_ram="${var_ram:-2048}"
17+
var_disk="${var_disk:-8}"
18+
var_os="${var_os:-debian}"
19+
var_version="${var_version:-13}"
20+
var_unprivileged="${var_unprivileged:-1}"
21+
22+
header_info "$APP"
23+
variables
24+
color
25+
catch_errors
26+
27+
function update_script() {
28+
header_info
29+
check_container_storage
30+
check_container_resources
31+
32+
if [[ ! -d /opt/budget-board ]]; then
33+
msg_error "No ${APP} Installation Found!"
34+
exit
35+
fi
36+
37+
if check_for_gh_release "budget-board" "teelur/budget-board"; then
38+
msg_info "Stopping Service"
39+
systemctl stop budget-board
40+
msg_ok "Stopped Service"
41+
42+
msg_info "Backing up Data"
43+
cp -r /opt/budget-board/budget-board.env /opt/budget-board.env.bak
44+
msg_ok "Backed up Data"
45+
46+
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "budget-board" "teelur/budget-board" "tarball"
47+
48+
msg_info "Restoring Configuration"
49+
cp -r /opt/budget-board.env.bak /opt/budget-board/budget-board.env
50+
rm -f /opt/budget-board.env.bak
51+
msg_ok "Restored Configuration"
52+
53+
msg_info "Rebuilding Backend"
54+
cd /opt/budget-board/server
55+
$STD dotnet restore "BudgetBoard.WebAPI/BudgetBoard.WebAPI.csproj"
56+
export configuration=Release
57+
$STD dotnet publish "BudgetBoard.WebAPI/BudgetBoard.WebAPI.csproj" -c $configuration -o /opt/budget-board/publish /p:UseAppHost=false --no-restore
58+
msg_ok "Rebuilt Backend"
59+
60+
msg_info "Rebuilding Frontend"
61+
cd /opt/budget-board/client
62+
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
63+
$STD yarn install
64+
$STD yarn run build
65+
cp -r dist/. /var/www/html/
66+
msg_ok "Rebuilt Frontend"
67+
68+
msg_info "Starting Service"
69+
systemctl start budget-board
70+
systemctl reload nginx
71+
msg_ok "Started Service"
72+
msg_ok "Updated successfully!"
73+
fi
74+
exit
75+
}
76+
77+
start
78+
build_container
79+
description
80+
81+
msg_ok "Completed Successfully!\n"
82+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
83+
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
84+
echo -e "${GATEWAY}${BGN}http://${IP}${CL}"

ct/headers/budget-board

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
____ __ __ ____ __
2+
/ __ )__ ______/ /___ ____ / /_ / __ )____ ____ __________/ /
3+
/ __ / / / / __ / __ `/ _ \/ __/_____/ __ / __ \/ __ `/ ___/ __ /
4+
/ /_/ / /_/ / /_/ / /_/ / __/ /_/_____/ /_/ / /_/ / /_/ / / / /_/ /
5+
/_____/\__,_/\__,_/\__, /\___/\__/ /_____/\____/\__,_/_/ \__,_/
6+
/____/

install/budget-board-install.sh

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/teelur/budget-board
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt install -y nginx
18+
setup_deb822_repo \
19+
"microsoft" \
20+
"https://packages.microsoft.com/keys/microsoft-2025.asc" \
21+
"https://packages.microsoft.com/debian/13/prod/" \
22+
"trixie"
23+
$STD apt install -y dotnet-sdk-10.0
24+
msg_ok "Installed Dependencies"
25+
26+
NODE_VERSION=25 setup_nodejs
27+
PG_VERSION=16 setup_postgresql
28+
PG_DB_NAME=budget_board_db PG_DB_USER=budget_board setup_postgresql_db
29+
30+
fetch_and_deploy_gh_release "budget-board" "teelur/budget-board" "tarball"
31+
32+
msg_info "Configuring Budget Board Backend"
33+
cd /opt/budget-board/server
34+
$STD dotnet restore "BudgetBoard.WebAPI/BudgetBoard.WebAPI.csproj"
35+
export configuration=Release
36+
$STD dotnet publish "BudgetBoard.WebAPI/BudgetBoard.WebAPI.csproj" -c $configuration -o /opt/budget-board/publish /p:UseAppHost=false --no-restore
37+
38+
cat <<EOF >/opt/budget-board/budget-board.env
39+
Logging__LogLevel__Default=Information
40+
CLIENT_ADDRESS=$LOCAL_IP
41+
POSTGRES_HOST=localhost
42+
POSTGRES_PORT=5432
43+
POSTGRES_DATABASE=$PG_DB_NAME
44+
POSTGRES_USER=$PG_DB_USER
45+
POSTGRES_PASSWORD=$PG_DB_PASS
46+
OIDC_ENABLED=false
47+
OIDC_ISSUER=
48+
OIDC_CLIENT_ID=
49+
OIDC_CLIENT_SECRET=
50+
EMAIL_SENDER=
51+
EMAIL_SENDER_USERNAME=
52+
EMAIL_SENDER_PASSWORD=
53+
EMAIL_SMTP_HOST=
54+
EMAIL_SMTP_PORT=587
55+
DISABLE_NEW_USERS=false
56+
DISABLE_LOCAL_AUTH=false
57+
AUTO_UPDATE_DB=true
58+
DISABLE_AUTO_SYNC=false
59+
SYNC_INTERVAL_HOURS=8
60+
TZ=UTC
61+
62+
ASPNETCORE_URLS=http://127.0.0.1:6253
63+
PORT=6253
64+
VITE_SERVER_ADDRESS=${LOCAL_IP}
65+
VITE_OIDC_ENABLED=false
66+
VITE_OIDC_PROVIDER=
67+
VITE_OIDC_CLIENT_ID=
68+
VITE_DISABLE_NEW_USERS=false
69+
VITE_DISABLE_LOCAL_AUTH=false
70+
EOF
71+
msg_ok "Configured Budget Board Backend"
72+
73+
msg_info "Configuring Budget Board Frontend"
74+
cd /opt/budget-board/client
75+
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
76+
$STD yarn config set --home enableTelemetry 0
77+
$STD npm install --global corepack@latest
78+
$STD corepack enable
79+
$STD yarn install
80+
$STD yarn run build
81+
cp -r dist/. /var/www/html/
82+
msg_ok "Configured Budget Board Frontend"
83+
84+
msg_info "Creating services"
85+
cat <<EOF >/etc/systemd/system/budget-board.service
86+
[Unit]
87+
Description=Budget Board Service
88+
After=network.target
89+
90+
[Service]
91+
WorkingDirectory=/opt/budget-board/publish
92+
ExecStart=dotnet BudgetBoard.WebAPI.dll
93+
Restart=always
94+
EnvironmentFile=/opt/budget-board/budget-board.env
95+
96+
[Install]
97+
WantedBy=multi-user.target
98+
EOF
99+
systemctl enable -q --now budget-board
100+
101+
cat <<'EOF' >/etc/nginx/sites-available/budget-board.conf
102+
server {
103+
listen 80 default_server;
104+
server_name _;
105+
root /var/www/html;
106+
index index.html;
107+
108+
location /api/ {
109+
proxy_pass http://127.0.0.1:6253;
110+
proxy_http_version 1.1;
111+
proxy_set_header Host $host;
112+
proxy_set_header X-Real-IP $remote_addr;
113+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
114+
proxy_set_header X-Forwarded-Proto $scheme;
115+
}
116+
117+
location / {
118+
try_files $uri $uri/ /index.html;
119+
}
120+
}
121+
EOF
122+
ln -sf /etc/nginx/sites-available/budget-board.conf /etc/nginx/sites-enabled/budget-board.conf
123+
rm -f /etc/nginx/sites-enabled/default
124+
systemctl reload nginx
125+
msg_ok "Created services"
126+
127+
motd_ssh
128+
customize
129+
cleanup_lxc

0 commit comments

Comments
 (0)