Skip to content

Commit 8c051b8

Browse files
MickLesktremor021
andauthored
Replace wget with curl -fsSL, normalize downloads, and prep for IPv6 (#3455)
* Initial Call, Switch from curl -s to curl -fsSL and wget to curl -fssL * more switches * switch vms * more curls * More curls * more * more * more changes * more * prepare ipv6 calls * change frontend to ipv6 * Formatting * Fromatting * Update gomft.sh * Update gomft-install.sh * Update ersatztv.sh * Update build.func --------- Co-authored-by: Slaviša Arežina <[email protected]>
1 parent 8bdede1 commit 8c051b8

File tree

585 files changed

+2366
-2260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

585 files changed

+2366
-2260
lines changed

.github/CONTRIBUTOR_AND_GUIDES/ct/AppName.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ source <(curl -s https://raw.githubusercontent.com/[USER]/[REPO]/refs/heads/[BRA
5252
Final script:
5353

5454
```bash
55-
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
55+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
5656
```
5757

5858
> [!CAUTION]

.github/CONTRIBUTOR_AND_GUIDES/ct/AppName.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
33
# Copyright (c) 2021-2025 community-scripts ORG
44
# Author: [YourUserName]
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
@@ -9,7 +9,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m
99
APP="[APP_NAME]"
1010
# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole"
1111
var_tags="[TAGS]"
12-
# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp)
12+
# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp)
1313
var_cpu="[CPU]"
1414
# Number of cores (1-X) (e.g. 4) - default are 2
1515
var_ram="[RAM]"
@@ -83,4 +83,4 @@ description
8383
msg_ok "Completed Successfully!\n"
8484
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
8585
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
86-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:[PORT]${CL}"
86+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:[PORT]${CL}"

.github/CONTRIBUTOR_AND_GUIDES/install/AppName-install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ msg_ok "Set up Database"
4242

4343
# Setup App
4444
msg_info "Setup ${APPLICATION}"
45-
RELEASE=$(curl -s https://api.github.com/repos/[REPO]/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
46-
wget -q "https://github.com/[REPO]/archive/refs/tags/${RELEASE}.zip"
47-
unzip -q ${RELEASE}.zip
48-
mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION}
45+
RELEASE=$(curl -fsSL https://api.github.com/repos/[REPO]/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
46+
curl -fsSL -o "${RELEASE}.zip" "https://github.com/[REPO]/archive/refs/tags/${RELEASE}.zip"
47+
unzip -q "${RELEASE}.zip"
48+
mv "${APPLICATION}-${RELEASE}/" "/opt/${APPLICATION}"
4949
#
5050
#
5151
#
@@ -77,4 +77,4 @@ msg_info "Cleaning up"
7777
rm -f ${RELEASE}.zip
7878
$STD apt-get -y autoremove
7979
$STD apt-get -y autoclean
80-
msg_ok "Cleaned"
80+
msg_ok "Cleaned"

.github/workflows/script-test.yml

Lines changed: 76 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
name: Run Scripts on PVE Node for testing
22
permissions:
3-
pull-requests: write
3+
pull-requests: write
44
on:
55
pull_request_target:
66
branches:
77
- main
88
paths:
9-
- 'install/**.sh'
10-
- 'ct/**.sh'
9+
- "install/**.sh"
10+
- "ct/**.sh"
1111

1212
jobs:
1313
run-install-script:
1414
runs-on: pvenode
15-
steps:
15+
steps:
1616
- name: Checkout PR branch
1717
uses: actions/checkout@v4
1818
with:
1919
ref: ${{ github.event.pull_request.head.ref }}
2020
repository: ${{ github.event.pull_request.head.repo.full_name }}
21-
fetch-depth: 0
22-
21+
fetch-depth: 0
22+
2323
- name: Add Git safe directory
2424
run: |
2525
git config --global --add safe.directory /__w/ProxmoxVE/ProxmoxVE
26-
26+
2727
- name: Set up GH_TOKEN
2828
env:
2929
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -38,7 +38,6 @@ jobs:
3838
echo "SCRIPT=$CHANGED_FILES" >> $GITHUB_ENV
3939
env:
4040
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
4241

4342
- name: Get scripts
4443
id: check-install-script
@@ -57,108 +56,108 @@ jobs:
5756
ALL_FILES=$(echo "${ALL_FILES[@]}" | xargs)
5857
echo "$ALL_FILES"
5958
echo "ALL_FILES=$ALL_FILES" >> $GITHUB_ENV
60-
59+
6160
- name: Run scripts
6261
id: run-install
6362
continue-on-error: true
6463
run: |
65-
set +e
66-
#run for each files in /ct
67-
for FILE in ${{ env.ALL_FILES }}; do
68-
STRIPPED_NAME=$(basename "$FILE" | sed 's/-install//' | sed 's/\.sh$//')
69-
echo "Running Test for: $STRIPPED_NAME"
70-
if grep -E -q 'read\s+-r\s+-p\s+".*"\s+\w+' "$FILE"; then
71-
echo "The script contains an interactive prompt. Skipping execution."
64+
set +e
65+
#run for each files in /ct
66+
for FILE in ${{ env.ALL_FILES }}; do
67+
STRIPPED_NAME=$(basename "$FILE" | sed 's/-install//' | sed 's/\.sh$//')
68+
echo "Running Test for: $STRIPPED_NAME"
69+
if grep -E -q 'read\s+-r\s+-p\s+".*"\s+\w+' "$FILE"; then
70+
echo "The script contains an interactive prompt. Skipping execution."
71+
continue
72+
fi
73+
if [[ $FILE =~ ^install/.*-install\.sh$ ]]; then
74+
CT_SCRIPT="ct/$STRIPPED_NAME.sh"
75+
if [[ ! -f $CT_SCRIPT ]]; then
76+
echo "No CT script found for $STRIPPED_NAME"
77+
ERROR_MSG="No CT script found for $FILE"
78+
echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
7279
continue
7380
fi
74-
if [[ $FILE =~ ^install/.*-install\.sh$ ]]; then
75-
CT_SCRIPT="ct/$STRIPPED_NAME.sh"
76-
if [[ ! -f $CT_SCRIPT ]]; then
77-
echo "No CT script found for $STRIPPED_NAME"
78-
ERROR_MSG="No CT script found for $FILE"
79-
echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
81+
if grep -E -q 'read\s+-r\s+-p\s+".*"\s+\w+' "install/$STRIPPED_NAME-install.sh"; then
82+
echo "The script contains an interactive prompt. Skipping execution."
8083
continue
8184
fi
82-
if grep -E -q 'read\s+-r\s+-p\s+".*"\s+\w+' "install/$STRIPPED_NAME-install.sh"; then
83-
echo "The script contains an interactive prompt. Skipping execution."
84-
continue
85-
fi
86-
echo "Found CT script for $STRIPPED_NAME"
87-
chmod +x "$CT_SCRIPT"
88-
RUNNING_FILE=$CT_SCRIPT
89-
elif [[ $FILE =~ ^ct/.*\.sh$ ]]; then
90-
INSTALL_SCRIPT="install/$STRIPPED_NAME-install.sh"
91-
if [[ ! -f $INSTALL_SCRIPT ]]; then
92-
echo "No install script found for $STRIPPED_NAME"
93-
ERROR_MSG="No install script found for $FILE"
94-
echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
95-
continue
96-
fi
97-
echo "Found install script for $STRIPPED_NAME"
98-
chmod +x "$INSTALL_SCRIPT"
99-
RUNNING_FILE=$FILE
100-
if grep -E -q 'read\s+-r\s+-p\s+".*"\s+\w+' "ct/$STRIPPED_NAME.sh"; then
101-
echo "The script contains an interactive prompt. Skipping execution."
102-
continue
103-
fi
104-
fi
105-
git remote add community-scripts https://github.com/community-scripts/ProxmoxVE.git
106-
git fetch community-scripts
107-
rm -f .github/workflows/scripts/app-test/pr-build.func || true
108-
rm -f .github/workflows/scripts/app-test/pr-install.func || true
109-
rm -f .github/workflows/scripts/app-test/pr-alpine-install.func || true
110-
rm -f .github/workflows/scripts/app-test/pr-create-lxc.sh || true
111-
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-build.func
112-
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-install.func
113-
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-alpine-install.func
114-
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-create-lxc.sh
115-
chmod +x $RUNNING_FILE
116-
chmod +x .github/workflows/scripts/app-test/pr-create-lxc.sh
117-
chmod +x .github/workflows/scripts/app-test/pr-install.func
118-
chmod +x .github/workflows/scripts/app-test/pr-alpine-install.func
119-
chmod +x .github/workflows/scripts/app-test/pr-build.func
120-
sed -i 's|source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)|source .github/workflows/scripts/app-test/pr-build.func|g' "$RUNNING_FILE"
121-
echo "Executing $RUNNING_FILE"
122-
ERROR_MSG=$(./$RUNNING_FILE 2>&1 > /dev/null)
123-
echo "Finished running $FILE"
124-
if [ -n "$ERROR_MSG" ]; then
125-
echo "ERROR in $STRIPPED_NAME: $ERROR_MSG"
85+
echo "Found CT script for $STRIPPED_NAME"
86+
chmod +x "$CT_SCRIPT"
87+
RUNNING_FILE=$CT_SCRIPT
88+
elif [[ $FILE =~ ^ct/.*\.sh$ ]]; then
89+
INSTALL_SCRIPT="install/$STRIPPED_NAME-install.sh"
90+
if [[ ! -f $INSTALL_SCRIPT ]]; then
91+
echo "No install script found for $STRIPPED_NAME"
92+
ERROR_MSG="No install script found for $FILE"
12693
echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
127-
fi
128-
done
129-
set -e # Restore exit-on-error
130-
94+
continue
95+
fi
96+
echo "Found install script for $STRIPPED_NAME"
97+
chmod +x "$INSTALL_SCRIPT"
98+
RUNNING_FILE=$FILE
99+
if grep -E -q 'read\s+-r\s+-p\s+".*"\s+\w+' "ct/$STRIPPED_NAME.sh"; then
100+
echo "The script contains an interactive prompt. Skipping execution."
101+
continue
102+
fi
103+
fi
104+
git remote add community-scripts https://github.com/community-scripts/ProxmoxVE.git
105+
git fetch community-scripts
106+
rm -f .github/workflows/scripts/app-test/pr-build.func || true
107+
rm -f .github/workflows/scripts/app-test/pr-install.func || true
108+
rm -f .github/workflows/scripts/app-test/pr-alpine-install.func || true
109+
rm -f .github/workflows/scripts/app-test/pr-create-lxc.sh || true
110+
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-build.func
111+
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-install.func
112+
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-alpine-install.func
113+
git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-create-lxc.sh
114+
chmod +x $RUNNING_FILE
115+
chmod +x .github/workflows/scripts/app-test/pr-create-lxc.sh
116+
chmod +x .github/workflows/scripts/app-test/pr-install.func
117+
chmod +x .github/workflows/scripts/app-test/pr-alpine-install.func
118+
chmod +x .github/workflows/scripts/app-test/pr-build.func
119+
sed -i 's|source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)|source .github/workflows/scripts/app-test/pr-build.func|g' "$RUNNING_FILE"
120+
echo "Executing $RUNNING_FILE"
121+
ERROR_MSG=$(./$RUNNING_FILE 2>&1 > /dev/null)
122+
echo "Finished running $FILE"
123+
if [ -n "$ERROR_MSG" ]; then
124+
echo "ERROR in $STRIPPED_NAME: $ERROR_MSG"
125+
echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
126+
fi
127+
done
128+
set -e # Restore exit-on-error
129+
131130
- name: Cleanup PVE Node
132131
run: |
133132
containers=$(pct list | tail -n +2 | awk '{print $0 " " $4}' | awk '{print $1}')
134-
133+
135134
for container_id in $containers; do
136135
status=$(pct status $container_id | awk '{print $2}')
137136
if [[ $status == "running" ]]; then
138137
pct stop $container_id
139138
pct destroy $container_id
140139
fi
141140
done
142-
141+
143142
- name: Post error comments
144143
run: |
145144
ERROR="false"
146145
SEARCH_LINE=".github/workflows/scripts/app-test/pr-build.func: line 255:"
147-
146+
148147
# Get all existing comments on the PR
149148
EXISTING_COMMENTS=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json comments --jq '.comments[].body')
150-
149+
151150
for FILE in ${{ env.ALL_FILES }}; do
152151
STRIPPED_NAME=$(basename "$FILE" | sed 's/-install//' | sed 's/\.sh$//')
153152
if [[ ! -f result_$STRIPPED_NAME.log ]]; then
154153
continue
155154
fi
156155
ERROR_MSG=$(cat result_$STRIPPED_NAME.log)
157-
156+
158157
if [ -n "$ERROR_MSG" ]; then
159158
CLEANED_ERROR_MSG=$(echo "$ERROR_MSG" | sed "s|$SEARCH_LINE.*||")
160159
COMMENT_BODY=":warning: The script _**$FILE**_ failed with the following message: <br> <div><strong>${CLEANED_ERROR_MSG}</strong></div>"
161-
160+
162161
# Check if the comment already exists
163162
if echo "$EXISTING_COMMENTS" | grep -qF "$COMMENT_BODY"; then
164163
echo "Skipping duplicate comment for $FILE"
@@ -171,7 +170,5 @@ jobs:
171170
fi
172171
fi
173172
done
174-
173+
175174
echo "ERROR=$ERROR" >> $GITHUB_ENV
176-
177-

.github/workflows/script_format.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
name: Script Format Check
22
permissions:
3-
pull-requests: write
3+
pull-requests: write
44
on:
55
pull_request_target:
66
branches:
77
- main
88
paths:
9-
- 'install/*.sh'
10-
- 'ct/*.sh'
9+
- "install/*.sh"
10+
- "ct/*.sh"
1111

1212
jobs:
1313
run-install-script:
1414
runs-on: pvenode
15-
steps:
15+
steps:
1616
- name: Checkout PR branch (supports forks)
1717
uses: actions/checkout@v4
1818
with:
1919
ref: ${{ github.event.pull_request.head.ref }}
20-
repository: ${{ github.event.pull_request.head.repo.full_name }}
21-
fetch-depth: 0
22-
20+
repository: ${{ github.event.pull_request.head.repo.full_name }}
21+
fetch-depth: 0
22+
2323
- name: Add Git safe directory
2424
run: |
2525
git config --global --add safe.directory /__w/ProxmoxVE/ProxmoxVE
26-
26+
2727
- name: Set up GH_TOKEN
2828
env:
2929
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -38,7 +38,7 @@ jobs:
3838
echo "SCRIPT=$CHANGED_FILES" >> $GITHUB_ENV
3939
env:
4040
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
41+
4242
- name: Check scripts
4343
id: run-install
4444
continue-on-error: true
@@ -54,13 +54,13 @@ jobs:
5454
FIRST_LINE=$(sed -n '1p' "$FILE")
5555
[[ "$FIRST_LINE" != "#!/usr/bin/env bash" ]] && echo "Line 1 was $FIRST_LINE | Should be: #!/usr/bin/env bash" >> "$LOG_FILE"
5656
SECOND_LINE=$(sed -n '2p' "$FILE")
57-
[[ "$SECOND_LINE" != "source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)" ]] &&
58-
echo "Line 2 was $SECOND_LINE | Should be: source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)" >> "$LOG_FILE"
57+
[[ "$SECOND_LINE" != "source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)" ]] &&
58+
echo "Line 2 was $SECOND_LINE | Should be: source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)" >> "$LOG_FILE"
5959
THIRD_LINE=$(sed -n '3p' "$FILE")
6060
if ! [[ "$THIRD_LINE" =~ ^#\ Copyright\ \(c\)\ [0-9]{4}-[0-9]{4}\ community-scripts\ ORG$ || "$THIRD_LINE" =~ ^Copyright\ \(c\)\ [0-9]{4}-[0-9]{4}\ tteck$ ]]; then
6161
echo "Line 3 was $THIRD_LINE | Should be: # Copyright (c) 2021-2025 community-scripts ORG" >> "$LOG_FILE"
6262
fi
63-
63+
6464
EXPECTED_AUTHOR="# Author:"
6565
EXPECTED_LICENSE="# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE"
6666
EXPECTED_SOURCE="# Source:"
@@ -210,7 +210,6 @@ jobs:
210210
211211
done
212212
213-
214213
- name: Post error comments
215214
run: |
216215
ERROR="false"
@@ -222,7 +221,7 @@ jobs:
222221
continue
223222
fi
224223
ERROR_MSG=$(cat $LOG_FILE)
225-
224+
226225
if [ -n "$ERROR_MSG" ]; then
227226
echo "Posting error message for $FILE"
228227
echo ${ERROR_MSG}
@@ -240,4 +239,4 @@ jobs:
240239

241240
- name: Fail if error
242241
if: ${{ env.ERROR == 'true' }}
243-
run: exit 1
242+
run: exit 1

.github/workflows/scripts/app-test/pr-build.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ build_container() {
184184
echo "Container ID: $CTID"
185185

186186
# This executes create_lxc.sh and creates the container and .conf file
187-
bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/.github/workflows/scripts/app-test/pr-create-lxc.sh)"
187+
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/.github/workflows/scripts/app-test/pr-create-lxc.sh)"
188188

189189
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
190190
if [ "$CT_TYPE" == "0" ]; then

.github/workflows/scripts/app-test/pr-create-lxc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,4 @@ if ! pct create "$CTID" "${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE}" "${PCT_OPTIONS[
160160
msg_error "A problem occurred while trying to create container after re-downloading template."
161161
exit 200
162162
fi
163-
fi
163+
fi

.github/workflows/scripts/generate-app-headers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ find ./ct -type f -name "*.sh" | sort | while read -r script; do
3131
fi
3232
done
3333

34-
echo "Completed processing .sh files."
34+
echo "Completed processing .sh files."

0 commit comments

Comments
 (0)