Skip to content

Commit 83a79dc

Browse files
authored
Update wastebin-install.sh
1 parent c98e92b commit 83a79dc

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

install/wastebin-install.sh

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

3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck
5-
# Co-Author: MickLesk (Canbiz)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
65
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
76
# Source: https://github.com/matze/wastebin
87

9-
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
109
color
1110
verb_ip6
1211
catch_errors
@@ -15,19 +14,31 @@ network_check
1514
update_os
1615

1716
msg_info "Installing Dependencies"
18-
$STD apt-get install -y curl
19-
$STD apt-get install -y sudo
20-
$STD apt-get install -y mc
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc
2121
msg_ok "Installed Dependencies"
2222

2323
msg_info "Installing Wastebin"
24+
temp_file=$(mktemp)
2425
RELEASE=$(curl -s https://api.github.com/repos/matze/wastebin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
25-
wget -q https://github.com/matze/wastebin/releases/download/${RELEASE}/wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
26-
tar -xf wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
27-
rm -rf wastebin_${RELEASE}_x86_64-unknown-linux-musl.tar.zst
26+
wget -q https://github.com/matze/wastebin/releases/download/${RELEASE}/wastebin_${RELEASE}_x86_64-unknown-linux-musl.zip -O $temp_file
27+
unzip -q $temp_file
2828
mkdir -p /opt/wastebin
2929
mv wastebin /opt/wastebin/
3030
chmod +x /opt/wastebin/wastebin
31+
32+
mkdir -p /opt/wastebin-data
33+
cat <<EOF >/opt/wastebin-data/.env
34+
WASTEBIN_DATABASE_PATH=/opt/wastebin-data/wastebin.db
35+
WASTEBIN_CACHE_SIZE=1024
36+
WASTEBIN_HTTP_TIMEOUT=30
37+
WASTEBIN_SIGNING_KEY=$(openssl rand -hex 32)
38+
WASTEBIN_PASTE_EXPIRATIONS=0,600,3600=d,86400,604800,2419200,29030400
39+
EOF
40+
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
41+
3142
msg_ok "Installed Wastebin"
3243

3344
msg_info "Creating Service"
@@ -39,17 +50,19 @@ After=network.target
3950
[Service]
4051
WorkingDirectory=/opt/wastebin
4152
ExecStart=/opt/wastebin/wastebin
53+
EnvironmentFile=/opt/wastebin-data/.env
4254
4355
[Install]
4456
WantedBy=multi-user.target
4557
EOF
46-
systemctl enable -q --now wastebin.service
58+
systemctl enable -q --now wastebin
4759
msg_ok "Created Service"
4860

4961
motd_ssh
5062
customize
5163

5264
msg_info "Cleaning up"
65+
rm -f $temp_file
5366
$STD apt-get -y autoremove
5467
$STD apt-get -y autoclean
5568
msg_ok "Cleaned"

0 commit comments

Comments
 (0)