[PR #6546] [MERGED] Increase: Core Network check (pre-LXC Creation) #6755

Closed
opened 2025-11-20 07:12:13 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/6546
Author: @MickLesk
Created: 8/4/2025
Status: Merged
Merged: 8/4/2025
Merged by: @CrazyWolf13

Base: mainHead: network_check


📝 Commits (3)

📊 Changes

1 file changed (+31 additions, -25 deletions)

View changed files

📝 misc/build.func (+31 -25)

📄 Description

✍️ Description

  • First, up to 10 tries with ICMP ping to deb.debian.org (fastest method if ICMP is allowed).
  • If all pings fail, fallback to an HTTP(S) check using wget --spider to test real outbound connectivity.
  • If both methods fail, user is prompted to set fallback DNS (Cloudflare & Google). After setting, the HTTP check is retried one last time.
  • If all methods still fail, the script exits cleanly via the centralized exit_script handler.

Note - Usage of wget
On fresh Debian/Ubuntu LXC containers, wget is installed by default, while curl is usually not included in the minimal system image. This means wget is always available for basic connectivity checks before any package installation.
Using wget --spider allows us to reliably test HTTP(S) connectivity without extra dependencies, making the check robust and portable across all default LXC environments.

Example-Flow:

  1. 🔄 Try ping (ICMP) to deb.debian.org (max 10 tries)
    → If success: proceed
    → If fail: try HTTP connectivity check

  2. 🌐 Try HTTP connectivity: wget --spider http://deb.debian.org
    → If success: proceed
    → If fail: prompt user for fallback DNS

  3. ⚠️ User prompt: "Set fallback DNS (1.1.1.1/8.8.8.8)? [y/N]"
    → If user agrees: set DNS and retry HTTP check once
    → If user aborts: exit_script

  4. 🌐 Retry HTTP connectivity after DNS fallback
    → If success: proceed
    → If fail: exit_script

Link: #

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/6546 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 8/4/2025 **Status:** ✅ Merged **Merged:** 8/4/2025 **Merged by:** [@CrazyWolf13](https://github.com/CrazyWolf13) **Base:** `main` ← **Head:** `network_check` --- ### 📝 Commits (3) - [`1b08893`](https://github.com/community-scripts/ProxmoxVE/commit/1b08893f4b1c88d7f31477f2294c0b1f2d4652de) Update build.func - [`2e397e3`](https://github.com/community-scripts/ProxmoxVE/commit/2e397e3a41af1ed028d269bb1384921a317dbeba) Update build.func - [`0e20d1a`](https://github.com/community-scripts/ProxmoxVE/commit/0e20d1a741968f789ff0d0d9594f13472e390336) Update build.func ### 📊 Changes **1 file changed** (+31 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `misc/build.func` (+31 -25) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description - First, up to 10 tries with ICMP ping to deb.debian.org (fastest method if ICMP is allowed). - If all pings fail, fallback to an HTTP(S) check using wget --spider to test real outbound connectivity. - If both methods fail, user is prompted to set fallback DNS (Cloudflare & Google). After setting, the HTTP check is retried one last time. - If all methods still fail, the script exits cleanly via the centralized exit_script handler. **Note - Usage of wget** On fresh Debian/Ubuntu LXC containers, wget is installed by default, while curl is usually not included in the minimal system image. This means wget is always available for basic connectivity checks before any package installation. Using wget --spider allows us to reliably test HTTP(S) connectivity without extra dependencies, making the check robust and portable across all default LXC environments. **Example-Flow:** 1. 🔄 Try ping (ICMP) to deb.debian.org (max 10 tries) → If success: proceed → If fail: try HTTP connectivity check 2. 🌐 Try HTTP connectivity: wget --spider http://deb.debian.org → If success: proceed → If fail: prompt user for fallback DNS 3. ⚠️ User prompt: "Set fallback DNS (1.1.1.1/8.8.8.8)? [y/N]" → If user agrees: set DNS and retry HTTP check once → If user aborts: exit_script 4. 🌐 Retry HTTP connectivity after DNS fallback → If success: proceed → If fail: exit_script ## 🔗 Related PR / Issue Link: # ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [ ] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [x] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 07:12:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#6755