forked from hswaw/hscloud
Merge "devtools/issues: add mailing support"
commit
5c08bb9197
|
@ -4,7 +4,7 @@
|
|||
# Bootstrap:
|
||||
#
|
||||
# ns=redmine
|
||||
# kubectl -n $ns create secret generic redmine --from-literal=secret_key=$(pwgen 24 1) --from-literal=oidc_secret=...
|
||||
# kubectl -n $ns create secret generic redmine --from-literal=secret_key=$(pwgen 24 1) --from-literal=postgres_password=$(pwgen 32 1) --from-literal=mailing_password=... --from-literal=oidc_secret=...
|
||||
#
|
||||
# ceph_ns=ceph-waw3; ceph_pool=waw-hdd-redundant-3
|
||||
# kubectl -n $ceph_ns get secrets rook-ceph-object-user-${ceph_pool}-object-issues -o json | jq 'del(.metadata.namespace,.metadata.resourceVersion,.metadata.uid) | .metadata.creationTimestamp=null' | kubectl replace -f - -n $ns
|
||||
|
@ -44,6 +44,13 @@ local redmine = import "./redmine.libsonnet";
|
|||
clientID: "70ee2821-2657-4409-a298-98649d1f689f",
|
||||
clientSecret: { secretKeyRef: { name: "redmine", key: "oidc_secret" } },
|
||||
},
|
||||
|
||||
mailing+: {
|
||||
address: "mail.hackerspace.pl",
|
||||
user_name: "issues",
|
||||
domain: "hackerspace.pl",
|
||||
password: { secretKeyRef: { name: "redmine", key: "mailing_password" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -36,7 +36,22 @@ local postgres = import "../../kube/postgres.libsonnet";
|
|||
clientID: error "oidc.clientID must be set",
|
||||
clientSecret: error "oidc.clientSecret must be set",
|
||||
},
|
||||
|
||||
# Mailing configuration object passed to smtp_settings
|
||||
mailing: {
|
||||
address: error "mailing.address must be set",
|
||||
port: 465,
|
||||
ssl: true,
|
||||
domain: error "mailing.domain must be set",
|
||||
authentication: ":login",
|
||||
user_name: error "mailing.user_name must be set",
|
||||
password: error "mailing.password must be set",
|
||||
},
|
||||
},
|
||||
|
||||
# Generates YAML file while preserving specified ruby-style symbols.
|
||||
# (ie. removes surrounding quotes)
|
||||
rubyYaml(obj, symbols):: std.foldr(function (symbol, str) std.strReplace(str, '"%s"' % symbol, symbol), symbols, std.manifestYamlDoc(obj)),
|
||||
|
||||
ns: kube.Namespace(app.cfg.namespace),
|
||||
|
||||
|
@ -64,6 +79,11 @@ local postgres = import "../../kube/postgres.libsonnet";
|
|||
containers_: {
|
||||
web: kube.Container("redmine") {
|
||||
image: cfg.image,
|
||||
args: ['sh', '-c', |||
|
||||
set -e
|
||||
echo "${X_EXTRA_CONFIGURATION}" > config/configuration.yml
|
||||
exec /docker-entrypoint.sh rails server -b 0.0.0.0
|
||||
|||],
|
||||
ports_: {
|
||||
http: { containerPort: 3000 },
|
||||
},
|
||||
|
@ -86,6 +106,18 @@ local postgres = import "../../kube/postgres.libsonnet";
|
|||
REDMINE_S3_ACCESS_KEY_ID: cfg.storage.accessKey,
|
||||
REDMINE_S3_SECRET_ACCESS_KEY: cfg.storage.secretKey,
|
||||
REDMINE_S3_REGION: cfg.storage.region,
|
||||
|
||||
REDMINE_MAILING_PASSWORD: cfg.mailing.password,
|
||||
X_EXTRA_CONFIGURATION: app.rubyYaml({
|
||||
production: {
|
||||
email_delivery: {
|
||||
delivery_method: ":smtp",
|
||||
smtp_settings: cfg.mailing {
|
||||
password: "$(REDMINE_MAILING_PASSWORD)",
|
||||
},
|
||||
}
|
||||
},
|
||||
}, [":smtp", ":login"]),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue