Skip to content

Commit

Permalink
feat: add SMTP mock email server (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgarciaLKS authored Mar 6, 2025
1 parent c81f6f2 commit 3badb4d
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/umbrella/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sources:
- https://github.com/eclipse-tractusx/tractus-x-umbrella

type: application
version: 2.7.0
version: 2.8.0

# when adding or updating versions of dependencies, also update list under /docs/user/installation/README.md
dependencies:
Expand Down
57 changes: 57 additions & 0 deletions charts/umbrella/templates/smtp-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{{- /*
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/}}

{{ if index .Values "smtp4dev" "enabled" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: smtp4dev
namespace: {{ .Release.Namespace }}
labels:
app: smtp4dev
spec:
replicas: 1
selector:
matchLabels:
app: smtp4dev
template:
metadata:
labels:
app: smtp4dev
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
containers:
- name: smtp4dev
image: rnwood/smtp4dev:3.6.1
resources:
limits:
memory: "512Mi"
cpu: "500m"
ports:
- containerPort: {{ .Values.smtp4dev.ports.http }}
- containerPort: {{ .Values.smtp4dev.ports.smtp }}
{{ end }}
39 changes: 39 additions & 0 deletions charts/umbrella/templates/smtp-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- /*
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/}}

{{ if index .Values "smtp4dev" "enabled" }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: smtp4dev-ingress
labels:
name: smtp4dev-ingress
spec:
rules:
- host: {{ .Values.smtp4dev.ingress.url }}
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: smtp4dev
port:
number: {{ .Values.smtp4dev.ports.http }}
{{ end }}
37 changes: 37 additions & 0 deletions charts/umbrella/templates/smtp-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- /*
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/}}

{{ if index .Values "smtp4dev" "enabled" }}
apiVersion: v1
kind: Service
metadata:
name: smtp4dev
spec:
selector:
app: smtp4dev
ports:
- name: smtp
protocol: TCP
port: {{ .Values.smtp4dev.ports.smtp }}
targetPort: 25
- name: http
protocol: TCP
port: {{ .Values.smtp4dev.ports.http }}
targetPort: 80
{{ end }}
9 changes: 9 additions & 0 deletions charts/umbrella/values-adopter-portal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

portal:
enabled: true
# -- uncomment the following for SMTP mail mock
# backend:
# mailing:
# host: "smtp4dev"
# port: "25"
# user: "portal-user"
# senderEmail: "[email protected]"
# password: "portal-password"

# -- uncomment the following for persistance
# postgresql:
# primary:
Expand Down
8 changes: 8 additions & 0 deletions charts/umbrella/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1490,3 +1490,11 @@ ssi-dim-wallet-stub:
port: 8080
keycloak:
enabled: false

smtp4dev:
enabled: false
ingress:
url: smtp.tx.test
ports:
smtp: 25
http: 80
1 change: 1 addition & 0 deletions docs/user/guides/portal-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Use the following credentials to log in to the admin consoles:
The Portal allows onboarding participants by inviting them to join the network. To send invitations:
1. Log in to the Portal at `http://portal.tx.test`.
2. Navigate to the participant management section.
3. When a new request is sent to a new participant, it will be received an email which can be viewed at `http://smtp.tx.test`.

> **Note**
> Since the onboarding process requires the [Clearinghouse](https://github.com/eclipse-tractusx/portal-assets/blob/v2.1.0/docs/developer/Technical%20Documentation/Interface%20Contracts/Clearinghouse.md) to work properly, but ClearingHouse currently isn't available as a FOSS application you can skip the step with the following SQL Script which must be executed against the portal database.
Expand Down
1 change: 1 addition & 0 deletions docs/user/network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The following values need to be added in each case:
<MINIKUBE_IP> business-partners.tx.test
<MINIKUBE_IP> pgadmin4.tx.test
<MINIKUBE_IP> ssi-dim-wallet-stub.tx.test
<MINIKUBE_IP> smtp.tx.test
```

#### Linux using minikube
Expand Down

0 comments on commit 3badb4d

Please sign in to comment.