feat: enhance setup scripts for multi-domain support and improve configuration handling#301
Conversation
…iguration handling
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Silver Mail system's setup process by introducing robust multi-domain support and improving configuration management. The changes enable the system to seamlessly handle multiple email domains, generate wildcard SSL certificates for each, and correctly configure OpenDKIM for all associated subdomains, streamlining the deployment and maintenance of a flexible email infrastructure. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request enhances the setup scripts to support multiple domains and improves configuration handling. The main setup script now reads all configured domains, the certbot script generates wildcard certificates, and the OpenDKIM script supports subdomains. The changes are well-aligned with the goal. I've left one comment to improve the robustness of the YAML parsing logic in the OpenDKIM script.
| if (line ~ /^[[:space:]]*dkim-selector:/) { | ||
| selector = line | ||
| sub(/^[[:space:]]*dkim-selector:[[:space:]]*/, "", selector) | ||
| sub(/[[:space:]]*$/, "", selector) | ||
| if (selector == "" || selector == "null") selector = "mail" | ||
| } | ||
| if (line ~ /^[[:space:]]*dkim-key-size:/) { | ||
| keysize = line | ||
| sub(/^[[:space:]]*dkim-key-size:[[:space:]]*/, "", keysize) | ||
| sub(/[[:space:]]*$/, "", keysize) | ||
| if (keysize == "" || keysize == "null") keysize = "2048" | ||
| } |
There was a problem hiding this comment.
The logic to trim trailing whitespace from dkim-selector and dkim-key-size was removed. This makes the parsing less robust and inconsistent with how the domain value is parsed. Trailing whitespace in the YAML file could lead to incorrect values being used. It's recommended to restore the whitespace trimming for these fields to ensure consistent and correct behavior.
| if (line ~ /^[[:space:]]*dkim-selector:/) { | |
| selector = line | |
| sub(/^[[:space:]]*dkim-selector:[[:space:]]*/, "", selector) | |
| sub(/[[:space:]]*$/, "", selector) | |
| if (selector == "" || selector == "null") selector = "mail" | |
| } | |
| if (line ~ /^[[:space:]]*dkim-key-size:/) { | |
| keysize = line | |
| sub(/^[[:space:]]*dkim-key-size:[[:space:]]*/, "", keysize) | |
| sub(/[[:space:]]*$/, "", keysize) | |
| if (keysize == "" || keysize == "null") keysize = "2048" | |
| } | |
| if (line ~ /^[[:space:]]*dkim-selector:/) { | |
| selector = line | |
| sub(/^[[:space:]]*dkim-selector:[[:space:]]*/, "", selector) | |
| sub(/[[:space:]]*$/, "", selector) | |
| if (selector == "" || selector == "null") selector = "mail" | |
| } | |
| if (line ~ /^[[:space:]]*dkim-key-size:/) { | |
| keysize = line | |
| sub(/^[[:space:]]*dkim-key-size:[[:space:]]*/, "", keysize) | |
| sub(/[[:space:]]*$/, "", keysize) | |
| if (keysize == "" || keysize == "null") keysize = "2048" | |
| } |
📌 Description
This PR is to change the script to support multiple domains with their subdomains.
🔍 Changes Made
✅ Checklist (Email System)
🧪 Testing Instructions
📷 Screenshots / Logs (if applicable)