Skip to content

polaric-newcert: preserve SSID and apply config.xml callsign override - #67

Merged
ohanssen merged 1 commit into
masterfrom
copilot/fix-polaric-newcert-script
Aug 8, 2026
Merged

polaric-newcert: preserve SSID and apply config.xml callsign override#67
ohanssen merged 1 commit into
masterfrom
copilot/fix-polaric-newcert-script

Conversation

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

polaric-newcert was deriving the SAN hostname from a callsign that incorrectly dropped SSID suffixes, and it only read callsign data from server.ini. This change keeps SSIDs intact and allows default.callsign from /var/lib/polaric/config.xml to override the server.ini value when present.

  • Callsign precedence

    • Added /var/lib/polaric/config.xml as a callsign source.
    • If default.callsign is found in XML, it overrides default.mycall from /etc/polaric-aprsd/server.ini.
  • SSID preservation

    • Removed the -N suffix stripping from default.mycall parsing, so callsigns like LA7ECA-5 remain la7eca-5.
  • XML parsing support

    • Added extraction for default.callsign in common XML representations (attribute and element-style forms), then normalized casing/whitespace before SAN construction.
# server.ini (fallback source)
default.mycall = LA7ECA-5

# config.xml (override source, if present)
<param name="default.callsign" value="LA7ECA-10"/>

Co-authored-by: ohanssen <2892992+ohanssen@users.noreply.github.com>
@ohanssen
ohanssen marked this pull request as ready for review August 8, 2026 19:37
Copilot AI lite review requested due to automatic review settings August 8, 2026 19:37
@ohanssen
ohanssen merged commit 4dafc21 into master Aug 8, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mycall from /etc/polaric-aprsd/server.ini (no -N stripping).
  • Add /var/lib/polaric/config.xml as a higher-precedence callsign source via default.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')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants