Add SMTP configuration and environment support#129
Conversation
Updated copyright year from 2023 to 2026.
DavidePrincipi
left a comment
There was a problem hiding this comment.
Since discover-smarthost runs under multiple unit instances, separate temporary files are required to avoid conflicts when smarthost.env is written.
…nd add argument check
…r command argument
Co-authored-by: Davide Principi <davide.principi@nethesis.it>
…ument requirement
There was a problem hiding this comment.
Pull request overview
Adds smarthost/SMTP settings discovery to the webserver module so php-fpm containers can consume centrally-managed SMTP configuration, and updates the container/runtime setup accordingly (issue: NethServer/dev#7859).
Changes:
- Add
discover-smarthostscript to read smarthost settings from Redis and generate an SMTP environment file. - Update
phpfpm@.serviceto load the new env file and attempt to pass SMTP variables into the php-fpm container; add an event handler to restart php-fpm on smarthost changes. - Install
opensslin the PHP images and refactorbuild-images.shto reduce duplication.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| imageroot/systemd/user/phpfpm@.service | Loads optional smarthost env file, runs discovery pre-start, and attempts to forward SMTP env vars into the container. |
| imageroot/events/smarthost-changed/10restart_phpfpm | New handler to restart configured php-fpm instances when smarthost changes. |
| imageroot/bin/discover-smarthost | New script to generate smarthost.env from Redis smarthost settings. |
| container/Containerfile | Adds openssl to runtime packages. |
| build-images.sh | Refactors repeated image builds into a function. |
| README.md | Documents smarthost discovery behavior and environment propagation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DavidePrincipi
left a comment
There was a problem hiding this comment.
Copilot raised a red flag: --env-file is required to fix the .env write-then-read order.
Please consider also other points.
…ent variable handling
…ent handling for service restarts
…esponse fields in README
DavidePrincipi
left a comment
There was a problem hiding this comment.
Check this comment too #129 (comment)
Co-authored-by: Davide Principi <davide.principi@nethesis.it>
Updated the path for the SMTP configuration environment file in the README.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Introduce a script to discover SMTP settings and create an environment file for smarthost configuration. Update the container setup to include OpenSSL and ensure the service can access the new SMTP environment variables.
NethServer/dev#7859