Skip to content

feat(ci, email): configurable SMTP SSL and Docker image build/push workflow#11

Merged
VargaJoe merged 3 commits into
developfrom
feature/configurable-ssl
Jun 1, 2026
Merged

feat(ci, email): configurable SMTP SSL and Docker image build/push workflow#11
VargaJoe merged 3 commits into
developfrom
feature/configurable-ssl

Conversation

@VargaJoe
Copy link
Copy Markdown
Contributor

@VargaJoe VargaJoe commented Jun 1, 2026

Summary

This PR introduces two independent changes:

  1. Configurable SMTP SSL — the EnableSsl flag on SmtpClient is now driven by configuration instead of being hard-coded, so deployments that target SMTP servers without TLS (e.g. internal relays) can opt out.
  2. Docker image CI workflow — adds a GitHub Actions workflow that builds and publishes the application's Docker image to Docker Hub (sensenetcsp/sn-auth) on pushes to the main branches, validates the build on pull requests, and exposes a manual trigger for ad-hoc builds from any branch.

Changes

Email / SMTP

  • EmailSettings.EnableSsl (bool, default true) added.
  • EmailService now reads EnableSsl from EmailSettings instead of hard-coding true.
  • appsettings.json extended with the new EnableSsl key (default true, preserves existing behavior).

CI / Docker

  • New workflow: .github/workflows/docker-image.yml.
  • Triggers:
    • push to develop, main, master → build and push image.
    • pull_request (non-draft) targeting develop, main, master → build only (validation, no push).
    • workflow_dispatch → manual run from any branch, with optional push_image and custom_tag inputs.
  • Tagging strategy (via docker/metadata-action):
    • :<branch-name> for any push or PR build.
    • :latest only when pushing to main or master (independent of which branch is set as default in GitHub).
    • :preview only when pushing to develop.
    • :pr-<number> for pull request builds.
    • :<custom_tag> when supplied via manual dispatch.
  • Build context is the repository root; Dockerfile path is src/sn-auth/Dockerfile.
  • DockerHub login uses the existing organization secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN, and only runs when an actual push is going to happen.

Behavior notes

  • EnableSsl defaults to true, so existing deployments are unaffected unless they explicitly opt out.
  • The Run workflow button (manual dispatch) only becomes visible in the GitHub Actions UI after this workflow lands on the default branch.

Testing

  • PR build will execute the workflow against this branch via the pull_request trigger, validating that the Docker image builds end-to-end without pushing to the registry.
  • SMTP change is config-only and preserves the previous default behavior.

VargaJoe added 2 commits June 1, 2026 14:37
- Add EnableSsl property to EmailSettings (default: true)
- Use EnableSsl config in EmailService instead of hard-coded true
- Add EnableSsl to appsettings.json
- Allows disabling SSL for non-secure SMTP servers (e.g., Mailpit on port 1025)
- Environment variable override: Email__EnableSsl=false for docker/test environments
@VargaJoe VargaJoe changed the title Feature/configurable ssl feat(ci, email): configurable SMTP SSL and Docker image build/push workflow Jun 1, 2026
@VargaJoe VargaJoe merged commit 756e47a into develop Jun 1, 2026
1 check passed
@VargaJoe VargaJoe deleted the feature/configurable-ssl branch June 1, 2026 13:07
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.

1 participant