Skip to content

Commit a8be309

Browse files
committed
stalwart: add
1 parent 9ec3d98 commit a8be309

5 files changed

Lines changed: 107 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
postgres: ${{ steps.filter.outputs.postgres }}
2222
redis: ${{ steps.filter.outputs.redis }}
2323
registry: ${{ steps.filter.outputs.registry }}
24+
stalwart: ${{ steps.filter.outputs.stalwart }}
2425
traefik: ${{ steps.filter.outputs.traefik }}
2526
steps:
2627
- name: checkout
@@ -50,6 +51,8 @@ jobs:
5051
- 'redis/**'
5152
registry:
5253
- 'registry/**'
54+
stalwart:
55+
- 'stalwart/**'
5356
traefik:
5457
- 'traefik/**'
5558
base:
@@ -132,6 +135,14 @@ jobs:
132135
image: akilli/registry
133136
context: "{{defaultContext}}:registry"
134137
secrets: inherit
138+
stalwart:
139+
needs: [ changes, base ]
140+
if: (success() && needs.base.if == 'true') || (always() && needs.changes.outputs.stalwart == 'true')
141+
uses: akilli/docker/.github/workflows/dockerhub.yml@master
142+
with:
143+
image: akilli/stalwart
144+
context: "{{defaultContext}}:stalwart"
145+
secrets: inherit
135146
traefik:
136147
needs: [changes, base]
137148
if: (success() && needs.base.if == 'true') || (always() && needs.changes.outputs.traefik == 'true')

stalwart/compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
volumes:
2+
data: {}
3+
services:
4+
stalwart:
5+
image: akilli/stalwart
6+
restart: unless-stopped
7+
ports:
8+
- "25:25"
9+
- "443:443"
10+
- "465:465"
11+
- "993:993"
12+
# environment:
13+
# STALWART_HOST: mail.example.com
14+
volumes:
15+
- data:/data
16+
# - /path/to/app.crt:/ssl/app.crt:ro
17+
# - /path/to/app.key:/ssl/app.key:ro

stalwart/config.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
storage.data = "rocksdb"
2+
storage.fts = "rocksdb"
3+
storage.blob = "rocksdb"
4+
storage.lookup = "rocksdb"
5+
storage.directory = "internal"
6+
7+
store.rocksdb.type = "rocksdb"
8+
store.rocksdb.path = "/data"
9+
store.rocksdb.compression = "lz4"
10+
11+
directory.internal.type = "internal"
12+
directory.internal.store = "rocksdb"
13+
14+
authentication.fallback-admin.user = "admin"
15+
authentication.fallback-admin.secret = "%{env:STALWART_PASSWORD}%"
16+
17+
tracer.stdout.enable = true
18+
tracer.stdout.type = "stdout"
19+
tracer.stdout.level = "info"
20+
tracer.stdout.ansi = false
21+
22+
certificate.default.default = true
23+
certificate.default.cert = "%{file:/ssl/app.crt}%"
24+
certificate.default.private-key = "%{file:/ssl/app.key}%"
25+
26+
server.hostname = "%{env:STALWART_HOST}%"
27+
http.hsts = true
28+
http.permissive-cors = false
29+
http.url = "protocol + '://' + config_get('server.hostname') + ':' + local_port"
30+
http.use-x-forwarded = true
31+
32+
server.listener.http.bind = "[::]:8080"
33+
server.listener.http.protocol = "http"
34+
35+
server.listener.https.bind = "[::]:443"
36+
server.listener.https.protocol = "http"
37+
server.listener.https.tls.implicit = true
38+
39+
server.listener.imaptls.bind = "[::]:993"
40+
server.listener.imaptls.protocol = "imap"
41+
server.listener.imaptls.tls.implicit = true
42+
43+
server.listener.smtp.bind = "[::]:25"
44+
server.listener.smtp.protocol = "smtp"
45+
46+
server.listener.submissions.bind = "[::]:465"
47+
server.listener.submissions.protocol = "smtp"
48+
server.listener.submissions.tls.implicit = true

stalwart/dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM akilli/base
2+
LABEL maintainer="Ayhan Akilli"
3+
4+
ENV STALWART_HOST=mail.example.com
5+
ENV STALWART_PASSWORD=admin
6+
7+
# @todo install regular `rocksdb` package once `stalwart-mail` dependencies are updated
8+
RUN echo "@old https://dl-cdn.alpinelinux.org/alpine/v3.23/community" >> /etc/apk/repositories && \
9+
apk add --no-cache \
10+
rocksdb@old \
11+
stalwart-cli \
12+
stalwart-mail && \
13+
app-user && \
14+
app-chown
15+
COPY config.toml /app/config.toml
16+
17+
CMD ["su-exec", "app", "stalwart", "--config", "/app/config.toml"]

stalwart/readme.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# `akilli/stalwart`
2+
3+
[akilli/base](../base) based stalwart image.
4+
5+
The default config
6+
7+
- expects the TLS certificate file at `/ssl/app.crt`
8+
- expects the TLS private key file at `/ssl/app.key`
9+
- uses `STALWART_HOST` environment variable to set server hostname
10+
- uses `STALWART_PASSWORD` environment variable to set `admin` user password
11+
12+
Alternatively, you can mount your own config to `/app/config.toml`.
13+
14+
You can use the example [compose.yml](compose.yml) as a starting point for your configuration.

0 commit comments

Comments
 (0)