forked from emqx/pulsar-client-erl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
97 lines (92 loc) · 4.01 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
version: '3'
services:
erlang:
container_name: erlang
image: erlang:26.2.5.2
volumes:
- ./:/pulsar_client_erl
working_dir: /pulsar_client_erl
depends_on:
- pulsar
- toxiproxy
tty: true
toxiproxy:
container_name: toxiproxy
image: ghcr.io/shopify/toxiproxy
ports:
- 8474:8474
- 7650:6650
expose:
- 8474
volumes:
- "./.ci/toxiproxy.json:/config/toxiproxy.json"
restart: always
command:
- "-host=0.0.0.0"
- "-config=/config/toxiproxy.json"
pulsar:
container_name: pulsar
image: apachepulsar/pulsar:${PULSAR_TAG}
ports:
- 6650:6650
- 8080:8080
restart: always
command:
- bash
- "-c"
- |
sed -i '/^advertisedAddress=/advertisedAddress=toxiproxy' conf/standalone.conf
bin/pulsar standalone -nfw -nss
pulsar-basic-auth:
container_name: pulsar-basic-auth
image: apachepulsar/pulsar:${PULSAR_TAG}
volumes:
- ./test/test_SUITE_data/basic_auth:/pulsar/conf/basic_auth:ro
ports:
- 6651:6650
- 8081:8080
restart: always
environment:
- PULSAR_EXTRA_OPTS=-Dpulsar.auth.basic.conf=/pulsar/conf/basic_auth
# Apparently, function worker seems to interact badly with the
# authentication config, so we disable it for the tests.
# https://github.com/apache/pulsar/issues/6309#issuecomment-585498354
command:
- bash
- "-c"
- |
sed -i 's#^authenticationEnabled=.*#authenticationEnabled=true#' conf/standalone.conf
sed -i 's#^authenticationProviders=.*#authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderBasic#' conf/standalone.conf
sed -i 's#^superUserRoles=.*#superUserRoles=super#' conf/standalone.conf
sed -i 's#^brokerClientAuthenticationPlugin=.*#brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationBasic#' conf/standalone.conf
sed -i 's#^brokerClientAuthenticationParameters=.*#brokerClientAuthenticationParameters={"userId":"super","password":"secretpass"}#' conf/standalone.conf
sed -i '/^basicAuthConf=.*/d' conf/standalone.conf
echo 'basicAuthConf=file:///pulsar/conf/basic_auth' >> conf/standalone.conf
bin/pulsar standalone -nfw -nss
pulsar-token-auth:
container_name: pulsar-token-auth
image: apachepulsar/pulsar:${PULSAR_TAG}
volumes:
- ./test/test_SUITE_data/hs256_secret.key:/pulsar/conf/hs256_secret.key:ro
ports:
- 6652:6650
- 8082:8080
restart: always
environment:
- tokenSecretKey=/pulsar/conf/hs256_secret.key
# Apparently, function worker seems to interact badly with the
# authentication config, so we disable it for the tests.
# https://github.com/apache/pulsar/issues/6309#issuecomment-585498354
command:
- bash
- "-c"
- |
sed -i 's#^authenticationEnabled=.*#authenticationEnabled=true#' conf/standalone.conf
sed -i 's#^authenticationProviders=.*#authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderToken#' conf/standalone.conf
sed -i 's#^superUserRoles=.*#superUserRoles=admin#' conf/standalone.conf
sed -i '/^tokenSecretKey=.*/d' conf/standalone.conf
echo 'tokenSecretKey=/pulsar/conf/hs256_secret.key' >> conf/standalone.conf
sed -i 's#^brokerClientAuthenticationPlugin=.*#brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationToken#' conf/standalone.conf
# sed -i 's#^brokerClientAuthenticationParameters=.*#brokerClientAuthenticationParameters={"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiJ9.UlVtumfA7z2dSwrtk8Vvt8T_GUiqnfPoHgZWaGcPv051oiR13v-2_oTdYGVwMYbQ56-pM4DocSbc-mSwhh8mhw"}#' conf/standalone.conf
sed -i 's#^brokerClientAuthenticationParameters=.*#brokerClientAuthenticationParameters=token:eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiJ9.UlVtumfA7z2dSwrtk8Vvt8T_GUiqnfPoHgZWaGcPv051oiR13v-2_oTdYGVwMYbQ56-pM4DocSbc-mSwhh8mhw#' conf/standalone.conf
bin/pulsar standalone -nfw -nss