Skip to content

Commit 99556bd

Browse files
authored
[Standardization]: Same Setup for GoLang on all LXC's & Clear Tarball (#1977)
1 parent ec3b70e commit 99556bd

File tree

7 files changed

+48
-34
lines changed

7 files changed

+48
-34
lines changed

install/authentik-install.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ $STD apt-get install -y nodejs
8181
msg_ok "Installed Node.js"
8282

8383
msg_info "Installing Golang"
84-
cd /tmp
8584
set +o pipefail
86-
GO_RELEASE=$(curl -s https://go.dev/dl/ | grep -o -m 1 "go.*\linux-amd64.tar.gz")
87-
wget -q https://golang.org/dl/${GO_RELEASE}
88-
tar -xzf ${GO_RELEASE} -C /usr/local
89-
ln -s /usr/local/go/bin/go /usr/bin/go
85+
temp_file=$(mktemp)
86+
golang_tarball=$(curl -s https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1)
87+
wget -q https://golang.org/dl/"$golang_tarball" -O "$temp_file"
88+
tar -C /usr/local -xzf "$temp_file"
89+
ln -sf /usr/local/go/bin/go /usr/local/bin/go
90+
rm -f "$temp_file"
9091
set -o pipefail
9192
msg_ok "Installed Golang"
9293

install/caddy-install.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Author: tteck (tteckster) | Co-Author: MickLesk (CanbiZ)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66

7-
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
7+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
88
color
99
verb_ip6
1010
catch_errors
@@ -33,16 +33,16 @@ msg_ok "Installed Caddy"
3333
read -r -p "Would you like to install xCaddy Addon? <y/N> " prompt
3434
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
3535
msg_info "Installing Golang"
36-
cd /opt
3736
set +o pipefail
38-
GOLANG=$(curl -s https://go.dev/dl/ | grep -o "go.*\linux-amd64.tar.gz" | head -n 1)
39-
wget -q https://golang.org/dl/$GOLANG
40-
tar -xzf $GOLANG -C /usr/local
41-
ln -s /usr/local/go/bin/go /usr/local/bin/go
37+
temp_file=$(mktemp)
38+
golang_tarball=$(curl -s https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1)
39+
wget -q https://golang.org/dl/"$golang_tarball" -O "$temp_file"
40+
tar -C /usr/local -xzf "$temp_file"
41+
ln -sf /usr/local/go/bin/go /usr/local/bin/go
42+
rm -f "$temp_file"
4243
set -o pipefail
43-
rm -rf /opt/go*
4444
msg_ok "Installed Golang"
45-
45+
4646
msg_info "Setup xCaddy"
4747
cd /opt
4848
RELEASE=$(curl -s https://api.github.com/repos/caddyserver/xcaddy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')

install/memos-install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ msg_ok "Installed pnpm"
4242

4343
msg_info "Installing Golang"
4444
set +o pipefail
45-
GOLANG=$(curl -s https://go.dev/dl/ | grep -o "go.*\linux-amd64.tar.gz" | head -n 1)
46-
wget -q https://golang.org/dl/$GOLANG
47-
tar -xzf $GOLANG -C /usr/local
48-
ln -s /usr/local/go/bin/go /usr/local/bin/go
45+
temp_file=$(mktemp)
46+
golang_tarball=$(curl -s https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1)
47+
wget -q https://golang.org/dl/"$golang_tarball" -O "$temp_file"
48+
tar -C /usr/local -xzf "$temp_file"
49+
ln -sf /usr/local/go/bin/go /usr/local/bin/go
50+
rm -f "$temp_file"
4951
set -o pipefail
5052
msg_ok "Installed Golang"
5153

install/ollama-install.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ $STD apt-get install -y cmake
2626
msg_ok "Installed Dependencies"
2727

2828
msg_info "Installing Golang"
29-
$STD wget https://golang.org/dl/go1.23.2.linux-amd64.tar.gz
30-
$STD tar -xzf go1.23.2.linux-amd64.tar.gz -C /usr/local
31-
$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
32-
rm -rf go1.23.2.linux-amd64.tar.gz
29+
set +o pipefail
30+
temp_file=$(mktemp)
31+
golang_tarball=$(curl -s https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1)
32+
wget -q https://golang.org/dl/"$golang_tarball" -O "$temp_file"
33+
tar -C /usr/local -xzf "$temp_file"
34+
ln -sf /usr/local/go/bin/go /usr/local/bin/go
35+
rm -f "$temp_file"
36+
set -o pipefail
3337
msg_ok "Installed Golang"
3438

3539
msg_info "Setting up Intel® Repositories"

install/pocketid-install.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ $STD apt-get install -y nodejs
3535
msg_ok "Installed Node.js"
3636

3737
msg_info "Installing Golang"
38-
cd /tmp
3938
set +o pipefail
40-
GO_RELEASE=$(curl -s https://go.dev/dl/ | grep -o -m 1 "go.*\linux-amd64.tar.gz")
41-
wget -q https://golang.org/dl/${GO_RELEASE}
42-
tar -xzf ${GO_RELEASE} -C /usr/local
43-
ln -s /usr/local/go/bin/go /usr/bin/go
39+
temp_file=$(mktemp)
40+
golang_tarball=$(curl -s https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1)
41+
wget -q https://golang.org/dl/"$golang_tarball" -O "$temp_file"
42+
tar -C /usr/local -xzf "$temp_file"
43+
ln -sf /usr/local/go/bin/go /usr/local/bin/go
44+
rm -f "$temp_file"
4445
set -o pipefail
4546
msg_ok "Installed Golang"
4647

install/rtsptoweb-install.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ $STD apt-get install -y mc
2121
msg_ok "Installed Dependencies"
2222

2323
msg_info "Installing Golang"
24-
$STD wget https://golang.org/dl/go1.20.1.linux-amd64.tar.gz
25-
$STD tar -xzf go1.20.1.linux-amd64.tar.gz -C /usr/local
26-
$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
27-
rm -rf go1.20.1.linux-amd64.tar.gz
24+
set +o pipefail
25+
temp_file=$(mktemp)
26+
golang_tarball=$(curl -s https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1)
27+
wget -q https://golang.org/dl/"$golang_tarball" -O "$temp_file"
28+
tar -C /usr/local -xzf "$temp_file"
29+
ln -sf /usr/local/go/bin/go /usr/local/bin/go
30+
rm -f "$temp_file"
31+
set -o pipefail
2832
msg_ok "Installed Golang"
2933

3034
msg_info "Installing RTSPtoWeb"

install/sftpgo-install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ msg_ok "Installed Dependencies"
2323

2424
msg_info "Installing Golang"
2525
set +o pipefail
26-
RELEASE=$(curl -s https://go.dev/dl/ | grep -o "go.*\linux-amd64.tar.gz" | head -n 1)
27-
wget -q https://golang.org/dl/$RELEASE
28-
tar -xzf $RELEASE -C /usr/local
29-
$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
26+
temp_file=$(mktemp)
27+
golang_tarball=$(curl -s https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1)
28+
wget -q https://golang.org/dl/"$golang_tarball" -O "$temp_file"
29+
tar -C /usr/local -xzf "$temp_file"
30+
ln -sf /usr/local/go/bin/go /usr/local/bin/go
31+
rm -f "$temp_file"
3032
set -o pipefail
3133
msg_ok "Installed Golang"
3234

0 commit comments

Comments
 (0)