Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dev/examples/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
# Note: This file is in git, but services/docker-compose.override.yml is gitignored

services:
smtp-server:
postfix:
build:
context: .
dockerfile: ./smtp/Dockerfile
image: silver-smtp:local

# Uncomment if you're also developing the DKIM server
# opendkim-server:
# opendkim:
# build:
# context: .
# dockerfile: ./dkim/Dockerfile
# image: silver-dkim:local

# Uncomment if you're also developing the Certbot server
# certbot-server:
# certbot:
# build:
# context: ./certbot
# dockerfile: ./Dockerfile
Expand Down
8 changes: 4 additions & 4 deletions scripts/user/create_test_users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ get_domain_from_config() {
check_services() {
echo -e "${YELLOW}Checking Docker Compose services...${NC}"

if ! (cd "${SERVICES_DIR}" && docker compose ps smtp-server) | grep -q "Up\|running"; then
if ! (cd "${SERVICES_DIR}" && docker compose ps postfix) | grep -q "Up\|running"; then
echo -e "${RED}✗ SMTP server container is not running${NC}"
echo -e "${YELLOW}Starting services with: docker compose up -d${NC}"
(cd "${SERVICES_DIR}" && docker compose up -d)
Expand Down Expand Up @@ -199,7 +199,7 @@ fi
check_services

# Find the smtp container
SMTP_CONTAINER=$(cd "${SERVICES_DIR}" && docker compose ps -q smtp-server 2>/dev/null)
SMTP_CONTAINER=$(cd "${SERVICES_DIR}" && docker compose ps -q postfix 2>/dev/null)
if [ -z "$SMTP_CONTAINER" ]; then
echo -e "${RED}✗ SMTP container not found. Is Docker Compose running?${NC}"
echo -e "${YELLOW}Try running: docker compose up -d${NC}"
Expand All @@ -210,13 +210,13 @@ fi
docker exec "$SMTP_CONTAINER" bash -c "
if [ ! -f /app/data/databases/shared.db ]; then
echo 'Error: Database does not exist at /app/data/databases/shared.db'
echo 'Please ensure raven-server is running and has created the database'
echo 'Please ensure raven is running and has created the database'
exit 1
fi
"

if [ $? -ne 0 ]; then
echo -e "${RED}✗ SQLite database not found. Please start raven-server first.${NC}"
echo -e "${RED}✗ SQLite database not found. Please start raven first.${NC}"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/user/manage_roles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ show_usage() {

# Get SMTP container
get_smtp_container() {
SMTP_CONTAINER=$(cd "${SERVICES_DIR}" && docker compose ps -q smtp-server 2>/dev/null)
SMTP_CONTAINER=$(cd "${SERVICES_DIR}" && docker compose ps -q postfix 2>/dev/null)
if [ -z "$SMTP_CONTAINER" ]; then
echo -e "${RED}✗ SMTP container not found. Is Docker Compose running?${NC}"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions scripts/user/remove_test_users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ get_domain_from_config() {
check_services() {
echo -e "${YELLOW}Checking Docker Compose services...${NC}"

if ! (cd "${SERVICES_DIR}" && docker compose ps smtp-server) | grep -q "Up\|running"; then
if ! (cd "${SERVICES_DIR}" && docker compose ps postfix) | grep -q "Up\|running"; then
echo -e "${RED}✗ SMTP server container is not running${NC}"
echo -e "${YELLOW}Please start the services first: docker compose up -d${NC}"
exit 1
Expand Down Expand Up @@ -124,7 +124,7 @@ fi
check_services

# Find the smtp container
SMTP_CONTAINER=$(cd "${SERVICES_DIR}" && docker compose ps -q smtp-server 2>/dev/null)
SMTP_CONTAINER=$(cd "${SERVICES_DIR}" && docker compose ps -q postfix 2>/dev/null)
if [ -z "$SMTP_CONTAINER" ]; then
echo -e "${RED}✗ SMTP container not found. Is Docker Compose running?${NC}"
exit 1
Expand Down
6 changes: 3 additions & 3 deletions scripts/utils/generate-rspamd-worker-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ fi

# Generate hashed password
echo "Generating Rspamd password hash..."
HASH=$(docker exec rspamd-server rspamadm pw --password "$RSPAMD_PASSWORD" 2>/dev/null)
HASH=$(docker exec rspamd rspamadm pw --password "$RSPAMD_PASSWORD" 2>/dev/null)

if [ -z "$HASH" ]; then
echo "Error: Could not generate password hash. Is rspamd-server running?"
echo "Error: Could not generate password hash. Is rspamd running?"
exit 1
fi

Expand Down Expand Up @@ -66,7 +66,7 @@ echo " - Password: (see .env file for RSPAMD_PASSWORD)"
# Restart Rspamd container
echo ""
echo "Restarting Rspamd..."
(cd "$SERVICES_DIR" && docker compose restart rspamd-server)
(cd "$SERVICES_DIR" && docker compose restart rspamd)

echo ""
echo "✓ Done! You can now access the Rspamd web UI with your password."
2 changes: 1 addition & 1 deletion scripts/utils/get-dkim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONF_DIR="$(cd "${SCRIPT_DIR}/../../conf" && pwd)"
CONFIG_FILE="${CONF_DIR}/silver.yaml"

CONTAINER_NAME="opendkim-server"
CONTAINER_NAME="opendkim"

# Check if container is running
if ! docker ps | grep -q "$CONTAINER_NAME"; then
Expand Down
4 changes: 2 additions & 2 deletions services/config-scripts/gen-postfix-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ virtual_mailbox_base = /var/mail/virtual
virtual_transport = lmtp:raven:24
milter_protocol = 6
milter_default_action = accept
smtpd_milters = inet:rspamd-server:11332,inet:opendkim-server:8891
non_smtpd_milters = inet:rspamd-server:11332,inet:opendkim-server:8891
smtpd_milters = inet:rspamd:11332,inet:opendkim:8891
non_smtpd_milters = inet:rspamd:11332,inet:opendkim:8891
smtpd_client_connection_rate_limit = 10
smtpd_client_message_rate_limit = 100
smtpd_client_recipient_rate_limit = 200
Expand Down
2 changes: 1 addition & 1 deletion services/config-scripts/gen-raven-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mkdir -p "$(dirname "$OUTPUT_FILE")" "$(dirname "$MAILS_DB_PATH")" "$RAVEN_CERT_
# --- Generate raven.yaml ---
cat >"$OUTPUT_FILE" <<EOF
domain: ${MAIL_DOMAIN}
auth_server_url: https://thunder-server:8090/auth/credentials/authenticate
auth_server_url: https://thunder:8090/auth/credentials/authenticate

# OAUTHBEARER Token Validation (RFC 7628)
# Required when enabling AUTH=OAUTHBEARER for IMAP/SASL.
Expand Down
52 changes: 26 additions & 26 deletions services/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
smtp-server:
postfix:
image: ghcr.io/lsflk/silver-smtp:main
container_name: smtp-server-container
container_name: postfix
ports:
- "25:25"
- "587:587"
Expand All @@ -16,16 +16,16 @@ services:
networks:
- mail-network
depends_on:
opendkim-server:
opendkim:
condition: service_started
rspamd-server:
rspamd:
condition: service_started
certbot-server:
certbot:
condition: service_started
raven-server:
raven:
condition: service_started

raven-server:
raven:
image: ghcr.io/lsflk/raven:latest
container_name: raven
ports:
Expand All @@ -43,7 +43,7 @@ services:
- DB_FILE=/app/data/databases/shared.db
- SOCKETMAP_HOST=0.0.0.0
- SOCKETMAP_PORT=9100
- THUNDER_HOST=thunder-server
- THUNDER_HOST=thunder
- THUNDER_PORT=8090
- CACHE_TTL_SECONDS=300
- TOKEN_REFRESH_SECONDS=3300
Expand All @@ -57,9 +57,9 @@ services:
restart: unless-stopped
user: "0:0"

opendkim-server:
opendkim:
image: ghcr.io/lsflk/silver-dkim:main
container_name: opendkim-server
container_name: opendkim
volumes:
- ../conf/silver.yaml:/etc/opendkim/silver.yaml
- ./silver-config/opendkim/opendkim.conf:/etc/opendkim/opendkim.conf:ro
Expand All @@ -74,9 +74,9 @@ services:
security_opt:
- no-new-privileges:true

rspamd-server:
rspamd:
image: rspamd/rspamd:latest
container_name: rspamd-server
container_name: rspamd
hostname: rspamd
expose:
- "11332"
Expand All @@ -91,7 +91,7 @@ services:

redis:
image: redis:alpine
container_name: rspamd-redis
container_name: redis
volumes:
- redis-data:/data
restart: unless-stopped
Expand All @@ -102,7 +102,7 @@ services:
# Note: you can use any unbound image; this is an example. Ensure it is configured for recursion
unbound:
image: mvance/unbound:latest
container_name: rspamd-unbound
container_name: unbound
restart: unless-stopped
networks:
- mail-network
Expand All @@ -111,17 +111,17 @@ services:
# volumes:
# - ./unbound:/opt/unbound/etc/unbound

clamav-server:
clamav:
image: clamav/clamav:latest
container_name: clamav-server
container_name: clamav
volumes:
- clamav_db:/var/lib/clamav
- clamav_logs:/var/log/clamav
networks:
- mail-network
restart: always
depends_on:
- rspamd-server
- rspamd
environment:
- CLAMAV_NO_FRESHCLAMD=false
deploy:
Expand All @@ -144,7 +144,7 @@ services:
- mail-network
restart: unless-stopped
depends_on:
- clamav-server
- clamav

# Initialize database from the image
thunder-db-init:
Expand Down Expand Up @@ -178,7 +178,7 @@ services:
# Run Thunder server with the shared database
thunder:
image: ghcr.io/asgardeo/thunder:0.32.0
container_name: thunder-server
container_name: thunder
depends_on:
thunder-setup:
condition: service_completed_successfully
Expand All @@ -196,9 +196,9 @@ services:
- mail-network
restart: unless-stopped

certbot-server:
certbot:
image: ghcr.io/lsflk/silver-certbot:main
container_name: certbot-server
container_name: certbot
volumes:
- ./silver-config/certbot/keys/etc:/etc/letsencrypt
- ./silver-config/certbot/keys/log:/var/log/letsencrypt
Expand All @@ -209,9 +209,9 @@ services:
networks:
- mail-network

metadata-service:
silver-metadata:
image: ghcr.io/lsflk/silver-metadata-service:main
container_name: metadata-service
container_name: silver-metadata
ports:
- "8888:8888"
volumes:
Expand All @@ -228,7 +228,7 @@ services:
- observability
restart: unless-stopped
depends_on:
- clamav-server
- clamav

postfix-exporter:
image: chatwork/kumina-postfix-exporter:latest
Expand All @@ -245,7 +245,7 @@ services:
- mail-network
restart: unless-stopped
depends_on:
- smtp-server
- postfix

node-exporter:
image: prom/node-exporter:latest
Expand Down Expand Up @@ -331,7 +331,7 @@ services:

grafana:
image: grafana/grafana:latest
container_name: grafana-local
container_name: grafana
env_file: ".env"
ports:
- 3000:3000
Expand Down
8 changes: 4 additions & 4 deletions services/metadata-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ PUSH_INTERVAL_SECONDS=60
### 2. Deploy

```bash
docker-compose up -d metadata-service
docker-compose up -d silver-metadata
```

### 3. Check Logs

```bash
docker-compose logs -f metadata-service
docker-compose logs -f silver-metadata
```

You should see:
Expand Down Expand Up @@ -108,7 +108,7 @@ curl -X POST http://localhost:8888/api/results \

### Using Docker
```bash
docker-compose up -d metadata-service
docker-compose up -d silver-metadata
```

### Using Makefile
Expand All @@ -129,7 +129,7 @@ go build -o metadata-service main.go
**No heartbeats being sent?**
1. Check `EXTERNAL_API_URL` is set correctly
2. Verify `ENABLE_PUSH_SERVICE=true`
3. Check logs: `docker-compose logs metadata-service`
3. Check logs: `docker-compose logs silver-metadata`

**Instance ID showing "unknown"?**
- Network connectivity issue
Expand Down
2 changes: 1 addition & 1 deletion services/smtp/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if [ -f "$DB_PATH" ]; then
chmod 644 "$DB_PATH"
else
echo "⚠ Warning: SQLite database not found at $DB_PATH"
echo " Database should be created by raven-server"
echo " Database should be created by raven"
echo " Postfix will start but mail delivery may fail until database is available"
fi

Expand Down
Loading