Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 8ff69e7

Browse files
committed
chore: updates
1 parent f09a67a commit 8ff69e7

3 files changed

Lines changed: 116 additions & 66 deletions

File tree

install/actualbudget-install.sh

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
22

3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck (tteckster)
5-
# License: MIT
6-
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://actualbudget.org/
77

88
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
99
color
@@ -41,18 +41,32 @@ RELEASE=$(curl -s https://api.github.com/repos/actualbudget/actual/releases/late
4141
wget -q https://github.com/actualbudget/actual-server/archive/refs/tags/v${RELEASE}.tar.gz
4242
tar -xzf v${RELEASE}.tar.gz
4343
mv *ctual-server-* /opt/actualbudget
44-
mkdir -p /opt/actualbudget/server-files
45-
mkdir -p /opt/actualbudget-data
46-
chown -R root:root /opt/actualbudget/server-files
47-
chmod 755 /opt/actualbudget/server-files
48-
cat <<EOF > /opt/actualbudget/.env
49-
ACTUAL_UPLOAD_DIR=/opt/actualbudget/server-files
44+
45+
mkdir -p /opt/actualbudget-data/{server-files,upload,migrate,user-files,migrations,config}
46+
chown -R root:root /opt/actualbudget-data
47+
chmod -R 755 /opt/actualbudget-data
48+
49+
cat <<EOF > /opt/actualbudget-data/.env
50+
ACTUAL_UPLOAD_DIR=/opt/actualbudget-data/upload
5051
ACTUAL_DATA_DIR=/opt/actualbudget-data
51-
ACTUAL_SERVER_FILES_DIR=/opt/actualbudget/server-files
52+
ACTUAL_SERVER_FILES_DIR=/opt/actualbudget-data/server-files
53+
ACTUAL_USER_FILES=/opt/actualbudget-data/user-files
5254
PORT=5006
55+
ACTUAL_TRUSTED_PROXIES="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1/32,::1/128,fc00::/7"
56+
ACTUAL_HTTPS_KEY=/opt/actualbudget/selfhost.key
57+
ACTUAL_HTTPS_CERT=/opt/actualbudget/selfhost.crt
5358
EOF
5459
cd /opt/actualbudget
5560
$STD yarn install
61+
$STD openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout selfhost.key -out selfhost.crt <<EOF
62+
US
63+
California
64+
San Francisco
65+
My Organization
66+
My Unit
67+
localhost
68+
myemail@example.com
69+
EOF
5670
echo "${RELEASE}" >"/opt/actualbudget_version.txt"
5771
msg_ok "Installed Actual Budget"
5872

@@ -67,7 +81,7 @@ Type=simple
6781
User=root
6882
Group=root
6983
WorkingDirectory=/opt/actualbudget
70-
EnvironmentFile=/opt/actualbudget/.env
84+
EnvironmentFile=/opt/actualbudget-data/.env
7185
ExecStart=/usr/bin/yarn start
7286
Restart=always
7387
RestartSec=10

install/pihole-install.sh

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,48 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Dependencies"
17-
$STD apt-get install -y curl
18-
$STD apt-get install -y sudo
19-
$STD apt-get install -y mc
20-
$STD apt-get install -y ufw
21-
$STD apt-get install -y ntp
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
ufw
2222
msg_ok "Installed Dependencies"
2323

2424
msg_info "Installing Pi-hole"
25-
mkdir -p /etc/pihole/
26-
cat <<EOF >/etc/pihole/setupVars.conf
27-
PIHOLE_INTERFACE=eth0
28-
PIHOLE_DNS_1=8.8.8.8
29-
PIHOLE_DNS_2=8.8.4.4
30-
QUERY_LOGGING=true
31-
INSTALL_WEB_SERVER=true
32-
INSTALL_WEB_INTERFACE=true
33-
LIGHTTPD_ENABLED=true
34-
CACHE_SIZE=10000
35-
DNS_FQDN_REQUIRED=true
36-
DNS_BOGUS_PRIV=true
37-
DNSMASQ_LISTENING=local
38-
WEBPASSWORD=$(openssl rand -base64 48)
39-
BLOCKING_ENABLED=true
40-
EOF
41-
# View script https://install.pi-hole.net
25+
mkdir -p /etc/pihole
26+
touch /etc/pihole/pihole.toml
4227
$STD bash <(curl -fsSL https://install.pi-hole.net) --unattended
28+
sed -i -E '
29+
/^\s*upstreams =/ s|=.*|= ["8.8.8.8", "8.8.4.4"]|
30+
/^\s*interface =/ s|=.*|= "eth0"|
31+
/^\s*queryLogging =/ s|=.*|= true|
32+
/^\s*size =/ s|=.*|= 10000|
33+
/^\s*active =/ s|=.*|= true|
34+
/^\s*listeningMode =/ s|=.*|= "LOCAL"|
35+
/^\s*port =/ s|=.*|= "80o,443os,[::]:80o,[::]:443os"|
36+
/^\s*pwhash =/ s|=.*|= ""|
37+
38+
# DHCP Disable
39+
/^\s*\[dhcp\]/,/^\s*\[/{s/^\s*active = true/ active = false/}
40+
41+
# NTP Disable
42+
/^\s*\[ntp.ipv4\]/,/^\s*\[/{s/^\s*active = true/ active = false/}
43+
/^\s*\[ntp.ipv6\]/,/^\s*\[/{s/^\s*active = true/ active = false/}
44+
/^\s*\[ntp.sync\]/,/^\s*\[/{s/^\s*active = true/ active = false/}
45+
/^\s*\[ntp.sync\]/,/^\s*\[/{s/^\s*interval = [0-9]+/ interval = 0/}
46+
/^\s*\[ntp.sync.rtc\]/,/^\s*\[/{s/^\s*set = true/ set = false/}
47+
48+
# set domainNeeded und expandHosts
49+
/^\s*domainNeeded =/ s|=.*|= true|
50+
/^\s*expandHosts =/ s|=.*|= true|
51+
' /etc/pihole/pihole.toml
52+
53+
cat <<EOF > /etc/dnsmasq.d/01-pihole.conf
54+
server=8.8.8.8
55+
server=8.8.4.4
56+
EOF
57+
$STD pihole-FTL --config ntp.sync.interval 0
58+
systemctl restart pihole-FTL.service
4359
msg_ok "Installed Pi-hole"
4460

4561
read -r -p "Would you like to add Unbound? <y/N> " prompt
@@ -119,9 +135,13 @@ forward-zone:
119135
#forward-addr: 2620:fe::9@853#dns.quad9.net
120136
EOF
121137
fi
138+
cat <<EOF > /etc/dnsmasq.d/01-pihole.conf
139+
server=127.0.0.1#5335
140+
server=8.8.8.8
141+
server=8.8.4.4
142+
EOF
122143

123-
sed -i -e 's/PIHOLE_DNS_1=8.8.8.8/PIHOLE_DNS_1=127.0.0.1#5335/' -e '/PIHOLE_DNS_2=8.8.4.4/d' /etc/pihole/setupVars.conf
124-
sed -i -e 's/server=8.8.8.8/server=127.0.0.1#5335/' -e '/server=8.8.4.4/d' /etc/dnsmasq.d/01-pihole.conf
144+
sed -i -E "s|^(upstreams =).*|\1 [\"127.0.0.1#5335\", \"8.8.4.4\"]|" /etc/pihole/pihole.toml
125145
systemctl enable -q --now unbound
126146
systemctl restart pihole-FTL.service
127147
msg_ok "Installed Unbound"

install/wikijs-install.sh

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# License: MIT
66
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
77

8-
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
99
color
1010
verb_ip6
1111
catch_errors
@@ -14,12 +14,13 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Dependencies"
17-
$STD apt-get install -y curl
18-
$STD apt-get install -y sudo
19-
$STD apt-get install -y mc
20-
$STD apt-get install -y git
21-
$STD apt-get install -y ca-certificates
22-
$STD apt-get install -y gnupg
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
git \
22+
ca-certificates \
23+
gnupg
2324
msg_ok "Installed Dependencies"
2425

2526
msg_info "Setting up Node.js Repository"
@@ -28,36 +29,49 @@ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dea
2829
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
2930
msg_ok "Set up Node.js Repository"
3031

32+
msg_info "Setting up PostgreSQL Repository"
33+
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
34+
echo "deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" >/etc/apt/sources.list.d/pgdg.list
35+
msg_ok "Set up PostgreSQL Repository"
36+
3137
msg_info "Installing Node.js"
3238
$STD apt-get update
3339
$STD apt-get install -y nodejs
3440
msg_ok "Installed Node.js"
3541

36-
msg_info "Installing Wiki.js"
37-
mkdir -p /opt/wikijs
38-
cd /opt/wikijs
39-
$STD wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz
40-
tar xzf wiki-js.tar.gz
41-
rm wiki-js.tar.gz
42+
msg_info "Set up PostgreSQL"
43+
$STD apt-get install -y postgresql-17
44+
DB_NAME="wikijs_db"
45+
DB_USER="wikijs_user"
46+
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
47+
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
48+
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
49+
$STD sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;" $DB_NAME
50+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
51+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
52+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
53+
{
54+
echo "WikiJS-Credentials"
55+
echo "WikiJS Database User: $DB_USER"
56+
echo "WikiJS Database Password: $DB_PASS"
57+
echo "WikiJS Database Name: $DB_NAME"
58+
} >> ~/wikijs.creds
59+
msg_ok "Set up PostgreSQL"
4260

43-
cat <<EOF >/opt/wikijs/config.yml
44-
bindIP: 0.0.0.0
45-
port: 3000
46-
db:
47-
type: sqlite
48-
storage: /opt/wikijs/db.sqlite
49-
logLevel: info
50-
logFormat: default
51-
dataPath: /opt/wikijs/data
52-
bodyParserLimit: 5mb
53-
EOF
54-
$STD npm rebuild sqlite3
61+
msg_info "Setup Wiki.js"
62+
temp_file=$(mktemp)
63+
RELEASE=$(curl -s https://api.github.com/repos/Requarks/wiki/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
64+
wget -q "https://github.com/Requarks/wiki/archive/refs/tags/v${RELEASE}.tar.gz" -O "$temp_file"
65+
tar -xzf "$temp_file"
66+
mv wiki-${RELEASE} /opt/wikijs
67+
mv /opt/wikijs/config.sample.yml /opt/wikijs/config.yml
68+
sed -i -E "s|(host: ).*|\1localhost|; s|(port: ).*|\15432|; s|(user: ).*|\1$DB_USER|; s|(pass: ).*|\1$DB_PASS|; s|(db: ).*|\1$DB_NAME|; s|(ssl: ).*|\1false|" /opt/wikijs/config.yml
69+
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
5570
msg_ok "Installed Wiki.js"
5671

5772
msg_info "Creating Service"
58-
service_path="/etc/systemd/system/wikijs.service"
59-
60-
echo "[Unit]
73+
cat <<EOF >/etc/systemd/system/wikijs.service
74+
[Unit]
6175
Description=Wiki.js
6276
After=network.target
6377
@@ -70,14 +84,16 @@ Environment=NODE_ENV=production
7084
WorkingDirectory=/opt/wikijs
7185
7286
[Install]
73-
WantedBy=multi-user.target" >$service_path
74-
$STD systemctl enable --now wikijs
87+
WantedBy=multi-user.target
88+
EOF
89+
systemctl enable --now wikijs
7590
msg_ok "Created Service"
7691

7792
motd_ssh
7893
customize
7994

8095
msg_info "Cleaning up"
96+
rm -f "$temp_file"
8197
$STD apt-get -y autoremove
8298
$STD apt-get -y autoclean
8399
msg_ok "Cleaned"

0 commit comments

Comments
 (0)