polaric-newcert: preserve SSID and apply config.xml callsign override - #67
Merged
Merged
Conversation
Co-authored-by: ohanssen <2892992+ohanssen@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ohanssen
August 8, 2026 19:36
View session
ohanssen
marked this pull request as ready for review
August 8, 2026 19:37
There was a problem hiding this comment.
Pull request overview
Updates polaric-newcert so TLS certificate SAN generation uses a callsign that preserves SSID suffixes and can be overridden by /var/lib/polaric/config.xml when present.
Changes:
- Preserve SSID when reading
default.mycallfrom/etc/polaric-aprsd/server.ini(no-Nstripping). - Add
/var/lib/polaric/config.xmlas a higher-precedence callsign source viadefault.callsign. - Normalize extracted callsign (trim whitespace, lowercase) before SAN construction.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
33
to
+34
| # Look for a line like: mycall = LA7ECA-5 | ||
| # Strip SSID (-N suffix) and convert to lowercase | ||
| # Keep SSID and convert to lowercase |
Comment on lines
+44
to
+52
| XML_CALLSIGN=$(sed -n 's/.*default[.]callsign[^>]*value="\([^"]*\)".*/\1/p' "$POLARIC_XML_CONF" | head -1) | ||
|
|
||
| if [[ -z "$XML_CALLSIGN" ]]; then | ||
| XML_CALLSIGN=$(sed -n "s/.*default[.]callsign[^>]*value='\([^']*\)'.*/\1/p" "$POLARIC_XML_CONF" | head -1) | ||
| fi | ||
|
|
||
| if [[ -z "$XML_CALLSIGN" ]]; then | ||
| XML_CALLSIGN=$(sed -n 's/.*<default[.]callsign>\([^<]*\)<\/default[.]callsign>.*/\1/p' "$POLARIC_XML_CONF" | head -1) | ||
| fi |
| XML_CALLSIGN=$(sed -n 's/.*<default[.]callsign>\([^<]*\)<\/default[.]callsign>.*/\1/p' "$POLARIC_XML_CONF" | head -1) | ||
| fi | ||
|
|
||
| XML_CALLSIGN=$(echo "$XML_CALLSIGN" | tr -d '[:space:]' | tr 'A-Z' 'a-z') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
polaric-newcertwas deriving the SAN hostname from a callsign that incorrectly dropped SSID suffixes, and it only read callsign data fromserver.ini. This change keeps SSIDs intact and allowsdefault.callsignfrom/var/lib/polaric/config.xmlto override theserver.inivalue when present.Callsign precedence
/var/lib/polaric/config.xmlas a callsign source.default.callsignis found in XML, it overridesdefault.mycallfrom/etc/polaric-aprsd/server.ini.SSID preservation
-Nsuffix stripping fromdefault.mycallparsing, so callsigns likeLA7ECA-5remainla7eca-5.XML parsing support
default.callsignin common XML representations (attribute and element-style forms), then normalized casing/whitespace before SAN construction.