Unverified Commit 321519e3 authored by torgiren's avatar torgiren
Browse files

add mail support to gitlab - closes #107

Signed-off-by: torgiren's avatarMarcin Fabrykowski <git@fabrykowski.pl>
parent dfe8f878
Pipeline #768 passed with stages
in 38 seconds
Showing with 79 additions and 0 deletions
+79 -0
......@@ -17,3 +17,4 @@ deploy-to-dev:
repo: git@gitlab.exphost.pl:exphost/tenant-exphost-services-home-lab.git
yamlfile: exphost-services.yml
waitapp: tenant-exphost-services-exphost-services
refreshapp: tenant-exphost-services
......@@ -40,6 +40,30 @@ spec:
providers:
- secret: gitlab-providers-dex
key: provider
incomingEmail:
enabled: true
address: gitlab@{{ .Values.domain }}
host: imap.{{ .Values.domain }}
port: 143
ssl: false
startTls: true
user: gitlab@{{ .Values.domain }}
password:
secret: password-password-mail-gitlab-from-tenant-exphost-services
key: password
smtp:
enabled: true
address: smtp.{{ .Values.domain }}
port: 587
user_name: gitlab@{{ .Values.domain }}
password:
secret: password-password-mail-gitlab-from-tenant-exphost-services
key: password
starttls_auto: true
authentication: "login"
email:
from: gitlab@{{ .Values.domain }}
gitlab:
webservice:
......
apiVersion: exphost.pl/v1
kind: Password
metadata:
name: password-mail-gitlab
spec:
name: password-mail-gitlab
types:
- sha512
---
apiVersion: batch/v1
kind: Job
metadata:
name: create-ldap-mail-gitlab
annotations:
argocd.argoproj.io/sync-wave: "4"
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: ldap
image: bitnami/openldap:2.5
command:
- /bin/bash
- -c
- 'echo -e "
dn: maildrop=gitlab@{{ .Values.domain }},ou=mails,{{ include "ldap.dc" . }}\n
changetype: add\n
maildrop: gitlab@{{ .Values.domain }}\n
objectClass: person\n
objectClass: postfixUser\n
objectClass: top\n
cn: gitlab\n
sn: mail\n
mailacceptinggeneralid: gitlab@{{ .Values.domain }}\n
userPassword:: $(echo -n {crypt}$PASSWORD|base64 -w0)
"|sed -e "s/^ //" >/tmp/ldif.ldif
;
echo "qweqwe";
cat /tmp/ldif.ldif;
ldapmodify -a -x -H ldap://openldap -D cn=admin,{{ include "ldap.dc" . }} -w $ADMINPASSWORD -f /tmp/ldif.ldif;
echo $?
'
env:
- name: PASSWORD
valueFrom:
secretKeyRef:
name: password-password-mail-gitlab-from-tenant-exphost-services
key: sha512
- name: ADMINPASSWORD
valueFrom:
secretKeyRef:
name: password-password-ldap-admin-from-tenant-exphost-services
key: password
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment