Skip to content

Commit c99cdfc

Browse files
authored
Merge pull request #824 from wireapp/standardize-deployment-features
Standardize deployment features
2 parents 6184746 + b04bbc8 commit c99cdfc

File tree

11 files changed

+187
-38
lines changed

11 files changed

+187
-38
lines changed

ansible/roles/rabbitmq-cluster/tasks/config.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
group: root
88
mode: 0644
99
with_items:
10-
- { src: etc/default/rabbitmq-server.j2 , dest: /etc/default/rabbitmq-server }
10+
- { src: etc/default/rabbitmq-server.j2, dest: /etc/default/rabbitmq-server }
1111
- { src: etc/rabbitmq/rabbitmq.config.j2, dest: /etc/rabbitmq/rabbitmq.config }
1212
# - { src: etc/rabbitmq/rabbitmq-env.conf.j2, dest: /etc/rabbitmq/rabbitmq-env.conf }
1313
notify:
@@ -18,15 +18,12 @@
1818
name: rabbitmq-server
1919
state: restarted
2020

21-
# - name: Enable the plugins is installed
22-
# rabbitmq_plugin:
23-
# names: "{{ item }}"
24-
# prefix: /usr/lib/rabbitmq
25-
# state: enabled
26-
# new_only: yes
27-
# with_items: "{{ rabbitmq_plugins }}"
28-
# notify:
29-
# restart rabbitmq-server
21+
- name: Enable the plugins is installed
22+
command: rabbitmq-plugins enable --offline {{ item }}
23+
with_items: "{{ rabbitmq_plugins }}"
24+
register: plugin_result
25+
changed_when: "'already enabled' not in plugin_result.stdout"
26+
notify: restart rabbitmq-server
3027

3128
- name: restart rabbitmq-server
3229
service:

bin/offline-helm.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,26 @@
33
set -euo pipefail
44
set -x
55

6+
sync_pg_secrets() {
7+
# Sync postgresql secret
8+
./bin/sync-k8s-secret-to-wire-secrets.sh \
9+
wire-postgresql-external-secret \
10+
password \
11+
values/wire-server/secrets.yaml \
12+
.brig.secrets.pgPassword \
13+
.galley.secrets.pgPassword \
14+
.spar.secrets.pgPassword \
15+
.gundeck.secrets.pgPassword
16+
}
17+
618
helm upgrade --install --wait cassandra-external ./charts/cassandra-external --values ./values/cassandra-external/values.yaml
719
helm upgrade --install --wait postgresql-external ./charts/postgresql-external --values ./values/postgresql-external/values.yaml
820
helm upgrade --install --wait elasticsearch-external ./charts/elasticsearch-external --values ./values/elasticsearch-external/values.yaml
921
helm upgrade --install --wait minio-external ./charts/minio-external --values ./values/minio-external/values.yaml
1022
helm upgrade --install --wait fake-aws ./charts/fake-aws --values ./values/fake-aws/prod-values.example.yaml
1123

24+
sync_pg_secrets
25+
1226
# ensure that the RELAY_NETWORKS value is set to the podCIDR
1327
SMTP_VALUES_FILE="./values/smtp/prod-values.example.yaml"
1428
podCIDR=$(kubectl get configmap -n kube-system kubeadm-config -o yaml | grep -i 'podSubnet' | awk '{print $2}' 2>/dev/null)
@@ -20,12 +34,11 @@ else
2034
fi
2135
helm upgrade --install --wait smtp ./charts/smtp --values $SMTP_VALUES_FILE
2236

23-
# remove postgresql chart as postgresql is now external
24-
# helm upgrade --install --wait postgresql ./charts/postgresql --values ./values/postgresql/prod-values.example.yaml --values ./values/postgresql/prod-secrets.example.yaml
2537
helm upgrade --install --wait rabbitmq ./charts/rabbitmq --values ./values/rabbitmq/prod-values.example.yaml --values ./values/rabbitmq/prod-secrets.example.yaml
2638
# it will only deploy the redis cluster
2739
helm upgrade --install --wait databases-ephemeral ./charts/databases-ephemeral --values ./values/databases-ephemeral/prod-values.example.yaml
2840
helm upgrade --install --wait reaper ./charts/reaper --values ./values/reaper/prod-values.example.yaml
41+
2942
helm upgrade --install --wait --timeout=30m0s wire-server ./charts/wire-server --values ./values/wire-server/prod-values.example.yaml --values ./values/wire-server/secrets.yaml
3043

3144
# if charts/webapp directory exists

bin/offline-secrets.sh

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ zauth_private=$(echo "$zauth" | awk 'NR==2{ print $2}')
2222

2323
prometheus_pass="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 16)"
2424

25+
# Generate MLS private keys using openssl
26+
# Keys need 10 spaces indent (5 levels deep: galley > secrets > mlsPrivateKeys > removal > keyname)
27+
readonly MLS_KEY_INDENT=" "
28+
generate_mls_key() {
29+
openssl genpkey "$@" 2>/dev/null | awk -v indent="$MLS_KEY_INDENT" '{printf "%s%s\n", indent, $0}'
30+
}
31+
32+
mls_ed25519_key="$(generate_mls_key -algorithm ed25519)"
33+
mls_ecdsa_p256_key="$(generate_mls_key -algorithm ec -pkeyopt ec_paramgen_curve:P-256)"
34+
mls_ecdsa_p384_key="$(generate_mls_key -algorithm ec -pkeyopt ec_paramgen_curve:P-384)"
35+
mls_ecdsa_p521_key="$(generate_mls_key -algorithm ec -pkeyopt ec_paramgen_curve:P-521)"
36+
2537
if [[ ! -f $VALUES_DIR/wire-server/secrets.yaml ]]; then
2638
echo "Writing $VALUES_DIR/wire-server/secrets.yaml"
2739
cat <<EOF > $VALUES_DIR/wire-server/secrets.yaml
@@ -37,8 +49,8 @@ brig:
3749
awsKeyId: dummykey
3850
awsSecretKey: dummysecret
3951
rabbitmq:
40-
username: wire-server
41-
password: verysecurepassword
52+
username: guest
53+
password: guest
4254
# These are only necessary if you wish to support sign up via SMS/calls
4355
# And require accounts at twilio.com / nexmo.com
4456
setTwilio: |-
@@ -52,25 +64,38 @@ cargohold:
5264
awsKeyId: "$minio_cargohold_access_key"
5365
awsSecretKey: "$minio_cargohold_secret_key"
5466
rabbitmq:
55-
username: wire-server
56-
password: verysecurepassword
67+
username: guest
68+
password: guest
5769
cannon:
5870
secrets:
5971
rabbitmq:
60-
username: wire-server
61-
password: verysecurepassword
72+
username: guest
73+
password: guest
6274
galley:
6375
secrets:
76+
rabbitmq:
77+
username: guest
78+
password: guest
6479
pgPassword: verysecurepassword
6580
awsKeyId: dummykey
6681
awsSecretKey: dummysecret
82+
mlsPrivateKeys:
83+
removal:
84+
ed25519: |
85+
$mls_ed25519_key
86+
ecdsa_secp256r1_sha256: |
87+
$mls_ecdsa_p256_key
88+
ecdsa_secp384r1_sha384: |
89+
$mls_ecdsa_p384_key
90+
ecdsa_secp521r1_sha512: |
91+
$mls_ecdsa_p521_key
6792
gundeck:
6893
secrets:
6994
awsKeyId: dummykey
7095
awsSecretKey: dummysecret
7196
rabbitmq:
72-
username: wire-server
73-
password: verysecurepassword
97+
username: guest
98+
password: guest
7499
nginz:
75100
secrets:
76101
zAuth:
@@ -86,8 +111,8 @@ team-settings:
86111
background-worker:
87112
secrets:
88113
rabbitmq:
89-
username: wire-server
90-
password: verysecurepassword
114+
username: guest
115+
password: guest
91116
EOF
92117

93118
fi
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Added: missing webapp feature flags to webapp example values
2+
Added: config for MLS deployment into example files
3+
Added: config for Federation deployment into example files
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
# using upstream values for coturn helm
1+
# using upstream values for coturn helm
2+
replicaCount: 3
3+
# image:
4+
# tag: some-tag # (only override if you want a newer/different version than what is in the chart)
5+
config:
6+
verboseLogging: false
7+
# rateLimit:
8+
# allowlist: # List of IPs to be excluded from rate limiting
9+
# -
10+
coturnTurnExternalIP: "__COTURN_EXT_IP__"
11+
coturnTurnListenIP: "__COTURN_HOST_IP__"
12+
coturnTurnRelayIP: "__COTURN_HOST_IP__"
13+
coturnFederationListeningIP: "__COTURN_HOST_IP__"
14+
# Uncomment to enable federation
15+
# federate:
16+
# enabled: true
17+
# port: 9191
18+
# dtls:
19+
# enabled: true
20+
# tls:
21+
# issuerRef: letsencrypt-http01
22+
# kind: ClusterIssuer
23+
# certificate:
24+
# dnsNames:
25+
# - coturn.example.com
26+
# - coturn-0.example.com
27+
# - coturn-1.example.com
28+
# - coturn-2.example.com

values/nginx-ingress-services/prod-secrets.example.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# as the ingress seems to simply "swallow" errors if any (and serve the Fake default certificate
44
# which is highly confusing)
55
secrets:
6+
tlsClientCA: | # for federating backends root CA certificates
7+
-----BEGIN CERTIFICATE-----
8+
.... THEIR CERTIFICATE ....
9+
-----END CERTIFICATE-----
610
tlsWildcardCert: |
711
-----BEGIN CERTIFICATE-----
812
.... OWN CERTIFICATE ......
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
rabbitmq:
22
auth:
3-
username: wire-server
4-
password: verysecurepassword
3+
username: guest
4+
password: guest
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
replicaCount: 3
2+
# image:
3+
# tag: some-tag # (only override if you want a newer/different version than what is in the chart)
14
allowOrigin: https://webapp.example.com
25
host: sftd.example.com
3-
replicaCount: 3
46
tls:
57
issuerRef:
68
name: letsencrypt-http01
79
kind: ClusterIssuer
10+
# Uncomment to enable SFT to SFT communication for federated calls
11+
# multiSFT:
12+
# enabled: true
13+
# discoveryRequired: false
14+
# turnServerURI: "turn:coturn.public.ip.address:3478?transport=udp"
15+
# secret: "coturn_zrest_secret"
16+
# Turn on secondary IP listener (for internal IP) when using federation
17+
# internalIpListener: false

values/webapp/prod-values.example.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ envVars:
1919
FEATURE_ENABLE_DEBUG: "false"
2020
FEATURE_ENABLE_PHONE_LOGIN: "false"
2121
FEATURE_ENABLE_SSO: "false"
22+
FEATURE_ENABLE_IN_CALL_REACTIONS: "true"
23+
FEATURE_ENABLE_IN_CALL_HAND_RAISE: "true"
24+
FEATURE_ENABLE_DETACHED_CALLING_WINDOW: "true"
25+
FEATURE_ENABLE_MESSAGE_FORMAT_BUTTONS: "true"
2226
FEATURE_SHOW_LOADING_INFORMATION: "false"
27+
FEATURE_ENABLE_CHANNELS: "false"
28+
FEATURE_ENABLE_CHANNELS_HISTORY_SHARING: "false"
29+
FEATURE_ENABLE_PUBLIC_CHANNELS: "false"
2330
URL_ACCOUNT_BASE: "https://account.example.com"
2431
#URL_MOBILE_BASE: "https://wire-pwa-staging.zinfra.io" # TODO: is this needed?
2532
URL_PRIVACY_POLICY: "https://www.example.com/terms-conditions"

values/wire-server/prod-secrets.example.yaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ brig:
3232
cannon:
3333
secrets:
3434
rabbitmq:
35-
username: wire-server
36-
password: verysecurepassword
35+
username: guest
36+
password: guest
3737

3838
cargohold:
3939
secrets:
@@ -42,8 +42,8 @@ cargohold:
4242
awsKeyId: dummykey # replace with minio_cargohold_access_key
4343
awsSecretKey: dummysecret # replace with minio_cargohold_secret_key
4444
rabbitmq:
45-
username: wire-server
46-
password: verysecurepassword
45+
username: guest
46+
password: guest
4747

4848
galley:
4949
secrets:
@@ -55,15 +55,29 @@ galley:
5555
rabbitmq:
5656
username: guest
5757
password: guest
58+
mlsPrivateKeys:
59+
removal:
60+
ed25519: |
61+
-----BEGIN PRIVATE KEY-----
62+
-----END PRIVATE KEY-----
63+
ecdsa_secp256r1_sha256: |
64+
-----BEGIN PRIVATE KEY-----
65+
-----END PRIVATE KEY-----
66+
ecdsa_secp384r1_sha384: |
67+
-----BEGIN PRIVATE KEY-----
68+
-----END PRIVATE KEY-----
69+
ecdsa_secp521r1_sha512: |
70+
-----BEGIN PRIVATE KEY-----
71+
-----END PRIVATE KEY-----
5872
5973
gundeck:
6074
secrets:
6175
# these only need to be changed if using real AWS services
6276
awsKeyId: dummykey
6377
awsSecretKey: dummysecret
6478
rabbitmq:
65-
username: wire-server
66-
password: verysecurepassword
79+
username: guest
80+
password: guest
6781

6882
proxy:
6983
secrets:
@@ -92,8 +106,8 @@ nginz:
92106
background-worker:
93107
secrets:
94108
rabbitmq:
95-
username: wire-server
96-
password: verysecurepassword
109+
username: guest
110+
password: guest
97111

98112
# Uncomment for legalhold. Set values accordingly
99113

0 commit comments

Comments
 (0)