-
Couldn't load subscription status.
- Fork 0
MI-483 - Staging configuration, service files and setup script #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements staging deployment configuration for the Robin MTA service, enabling it to be deployed and managed on production infrastructure. The changes include configuration files for webhook integration with Postal, Dovecot integration for mail delivery, logging rotation, metrics collection, and systemd service management.
Key Changes:
- Added deployment scripts (setup.sh, robin.sh, robin.service) for automated installation and service lifecycle management
- Configured production settings for SMTP server, storage, relaying, queueing, and monitoring in cfg-prod/ directory
- Integrated Dovecot LDA for local mail delivery and authentication
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.sh | Automated setup script that builds the project, deploys binaries and configuration files, and installs systemd service |
| robin.sh | Service control script for managing Robin MTA lifecycle (start, stop, restart, status, tail) |
| robin.service | Systemd unit file for running Robin as a managed service |
| cfg-prod/webhooks.json5 | Webhook configurations for SMTP extensions with Postal integration endpoint |
| cfg-prod/dovecot.json5 | Dovecot authentication socket and LDA binary paths for local mail delivery |
| cfg-prod/server.json5 | SMTP server configuration including ports, TLS, thread pools, and metrics endpoints |
| cfg-prod/storage.json5 | Email storage configuration with Dovecot LDA integration enabled |
| cfg-prod/relay.json5 | Inbound/outbound relay configuration with MX lookup and LMTP protocol settings |
| cfg-prod/queue.json5 | Queue persistence and processing interval settings |
| cfg-prod/log4j2.xml | Log4j2 configuration with daily log rotation |
| cfg-prod/prometheus.json5 | Prometheus metrics push configuration template |
| cfg-prod/properties.json5 | General properties including logging levels and HTTP timeouts |
| cfg-prod/routes.json5 | Predefined delivery routes for localhost and staging environments |
| cfg-prod/scenarios.json5 | SMTP response scenarios for testing and custom behaviors |
| cfg-prod/client.json5 | Default SMTP client configuration with TLS settings |
| cfg-prod/users.json5 | Empty users array (authentication disabled) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # Copy keystore | ||
| cp src/test/resources/keystore.jks /usr/local/robin/keystore.jks |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying a test keystore to production is a security risk. Production environments should use properly generated certificates and keystores, not test resources. Consider generating a production keystore or documenting that this must be replaced before production use.
| # Copy keystore | |
| cp src/test/resources/keystore.jks /usr/local/robin/keystore.jks | |
| # DO NOT copy test keystore to production. Please generate or provide a secure production keystore. | |
| echo "[WARN] No production keystore deployed. Please generate a secure keystore and place it at /usr/local/robin/keystore.jks before starting the service." >&2 |
| keystorepassword: "avengers", | ||
|
|
||
| // Java truststore (default: /usr/local/truststore.jks). | ||
| truststore: "/usr/local/robin/truststore.jks", | ||
|
|
||
| // Truststore password or path to password file. | ||
| truststorepassword: "avengers", |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded password 'avengers' in production configuration is a security vulnerability. Passwords should be stored in secure vaults or environment variables, not committed to version control.
| keystorepassword: "avengers", | |
| // Java truststore (default: /usr/local/truststore.jks). | |
| truststore: "/usr/local/robin/truststore.jks", | |
| // Truststore password or path to password file. | |
| truststorepassword: "avengers", | |
| keystorepassword: "/run/secrets/keystorepassword", | |
| // Java truststore (default: /usr/local/truststore.jks). | |
| truststore: "/usr/local/robin/truststore.jks", | |
| // Truststore password or path to password file. | |
| truststorepassword: "/run/secrets/truststorepassword", |
| truststore: "/usr/local/robin/truststore.jks", | ||
|
|
||
| // Truststore password or path to password file. | ||
| truststorepassword: "avengers", |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded password 'avengers' in production configuration is a security vulnerability. Passwords should be stored in secure vaults or environment variables, not committed to version control.
| truststorepassword: "avengers", | |
| truststorepassword: "/run/secrets/truststorepassword", |
| // Path to MTA logs if one running on local host. | ||
| localLogsDir: "/var/log/", | ||
|
|
||
| // Pattern to match UID out of SMT responses. |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'SMT' to 'SMTP' in comment.
| // Pattern to match UID out of SMT responses. | |
| // Pattern to match UID out of SMTP responses. |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Configuration monitorInterval="30" shutdownHook="disable"> | ||
| <Appenders> | ||
| <RollingFile name="appender" filePattern="/var/log/robin-%d{yyyyMMdd}.log"> |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RollingFile appender is missing the required 'fileName' attribute which specifies the current log file. Without it, the appender may not function correctly. Add 'fileName="/var/log/robin.log"' to the RollingFile element.
| <RollingFile name="appender" filePattern="/var/log/robin-%d{yyyyMMdd}.log"> | |
| <RollingFile name="appender" fileName="/var/log/robin.log" filePattern="/var/log/robin-%d{yyyyMMdd}.log"> |
|
|
||
| // Humio configuration. | ||
| humio: { | ||
| auth: "YOUR_API_KEY", |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placeholder API key should be removed or documented as requiring configuration. Committing placeholder credentials can lead to misconfigurations in production deployments.
| auth: "YOUR_API_KEY", | |
| // WARNING: Set a valid Humio API key here before deploying to production. Do NOT commit real credentials. | |
| auth: "__REQUIRED__", |
This is the first commit that implements deployable scripts in our internal robin fork.
cfg-prod/webhooks.json5cfg-prod/dovecot.json5/var/log/robin-20281020.log(seecfg-prod/log4j2.xml)cfg-prod/prometheus.json5cfg-prod/relay.json5cfg-prod/server.json5cfg-prod/storage.json5cfg-prod/queue.json5Note:
Improvements: