[PR #6356] [MERGED] Strip SD and NS prefixes before writing to config file #6590

Open
opened 2025-11-20 07:11:18 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/6356
Author: @mattv8
Created: 7/29/2025
Status: Merged
Merged: 7/30/2025
Merged by: @MickLesk

Base: mainHead: fix-config-file


📝 Commits (1)

  • 5a98827 Strip SD and NS prefixes before writing to config file

📊 Changes

2 files changed (+74 additions, -22 deletions)

View changed files

📝 misc/build.func (+48 -8)
📝 misc/config-file.func (+26 -14)

📄 Description

✍️ Description

During testing of PR #6354 I encountered an issue with how the vars to the config files are written. The NS and SD write a prefix to the variables that causes the following error:
🔍 DNS Search Domain: -searchdomain=home.mydomain.com
✖️ Invalid IP Address format for DNS Server. Needs to be 0.0.0.0, was -nameserver=192.168.50.200

If I cat the config with grep -E '(NS|SD)' /opt/community-scripts/homeassistant-core.conf it looks like:

SD="-searchdomain=home.mydomain.com"
NS="-nameserver=192.168.50.200"

when it should be:

SD="home.mydomain.com"
NS="192.168.50.200"

Didn't seem to be behaving properly, so creating this PR to address. Presumably same issue for MAC and VLAN as well.

Link: #6354

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
    WAY too many changes between ProxmoxVED files in this PR, so I tested on my fork directly (e.g. bash -c "$(curl -fsSL https://raw.githubusercontent.com/mattv8/ProxmoxVE/main/ct/homeassistant-core.sh)")...
  • 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/6356 **Author:** [@mattv8](https://github.com/mattv8) **Created:** 7/29/2025 **Status:** ✅ Merged **Merged:** 7/30/2025 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `fix-config-file` --- ### 📝 Commits (1) - [`5a98827`](https://github.com/community-scripts/ProxmoxVE/commit/5a98827d62b71e26831c7971639c7d8ad6fd1513) Strip SD and NS prefixes before writing to config file ### 📊 Changes **2 files changed** (+74 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `misc/build.func` (+48 -8) 📝 `misc/config-file.func` (+26 -14) </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 During testing of PR #6354 I encountered an issue with how the vars to the config files are written. The NS and SD write a prefix to the variables that causes the following error: 🔍 DNS Search Domain: -searchdomain=home.mydomain.com ✖️ Invalid IP Address format for DNS Server. Needs to be 0.0.0.0, was -nameserver=192.168.50.200 If I cat the config with `grep -E '(NS|SD)' /opt/community-scripts/homeassistant-core.conf` it looks like: ```bash SD="-searchdomain=home.mydomain.com" NS="-nameserver=192.168.50.200" ``` when it should be: ```bash SD="home.mydomain.com" NS="192.168.50.200" ``` Didn't seem to be behaving properly, so creating this PR to address. Presumably same issue for MAC and VLAN as well. ## 🔗 Related PR / Issue Link: #6354 ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. WAY too many changes between ProxmoxVED files in this PR, so I tested on my fork directly (e.g. bash -c "$(curl -fsSL https://raw.githubusercontent.com/mattv8/ProxmoxVE/main/ct/homeassistant-core.sh)")... - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🐞 **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. --- <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:11:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#6590