4 export LEMMY_JWT_SECRET=changeme
5 export LEMMY_FEDERATION__ENABLED=true
6 export LEMMY_TLS_ENABLED=false
7 export LEMMY_SETUP__ADMIN_PASSWORD=lemmy
8 export LEMMY_RATE_LIMIT__POST=99999
9 export LEMMY_RATE_LIMIT__REGISTER=99999
10 export LEMMY_CAPTCHA__ENABLED=false
11 export LEMMY_TEST_SEND_SYNC=1
12 export RUST_BACKTRACE=1
14 for INSTANCE in lemmy_alpha lemmy_beta lemmy_gamma lemmy_delta lemmy_epsilon; do
15 psql "$LEMMY_DATABASE_URL" -c "CREATE DATABASE $INSTANCE"
18 for INSTANCE in lemmy-alpha lemmy-beta lemmy-gamma lemmy-delta lemmy-epsilon; do
19 echo "127.0.0.1 $INSTANCE" >> /etc/hosts
23 LEMMY_HOSTNAME=lemmy-alpha:8541 \
25 LEMMY_DATABASE_URL=postgres://lemmy:password@database:5432/lemmy_alpha \
26 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta,lemmy-gamma,lemmy-delta,lemmy-epsilon \
27 LEMMY_SETUP__ADMIN_USERNAME=lemmy_alpha \
28 LEMMY_SETUP__SITE_NAME=lemmy-alpha \
29 target/lemmy_server >/dev/null 2>&1 &
32 LEMMY_HOSTNAME=lemmy-beta:8551 \
34 LEMMY_DATABASE_URL=postgres://lemmy:password@database:5432/lemmy_beta \
35 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-gamma,lemmy-delta,lemmy-epsilon \
36 LEMMY_SETUP__ADMIN_USERNAME=lemmy_beta \
37 LEMMY_SETUP__SITE_NAME=lemmy-beta \
38 target/lemmy_server >/dev/null 2>&1 &
41 LEMMY_HOSTNAME=lemmy-gamma:8561 \
43 LEMMY_DATABASE_URL=postgres://lemmy:password@database:5432/lemmy_gamma \
44 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-beta,lemmy-delta,lemmy-epsilon \
45 LEMMY_SETUP__ADMIN_USERNAME=lemmy_gamma \
46 LEMMY_SETUP__SITE_NAME=lemmy-gamma \
47 target/lemmy_server >/dev/null 2>&1 &
50 # An instance with only an allowlist for beta
51 LEMMY_HOSTNAME=lemmy-delta:8571 \
53 LEMMY_DATABASE_URL=postgres://lemmy:password@database:5432/lemmy_delta \
54 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta \
55 LEMMY_SETUP__ADMIN_USERNAME=lemmy_delta \
56 LEMMY_SETUP__SITE_NAME=lemmy-delta \
57 target/lemmy_server >/dev/null 2>&1 &
60 # An instance who has a blocklist, with lemmy-alpha blocked
61 LEMMY_HOSTNAME=lemmy-epsilon:8581 \
63 LEMMY_DATABASE_URL=postgres://lemmy:password@database:5432/lemmy_epsilon \
64 LEMMY_FEDERATION__BLOCKED_INSTANCES=lemmy-alpha \
65 LEMMY_SETUP__ADMIN_USERNAME=lemmy_epsilon \
66 LEMMY_SETUP__SITE_NAME=lemmy-epsilon \
67 target/lemmy_server >/dev/null 2>&1 &
69 echo "wait for all instances to start"
70 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v1/site')" != "200" ]]; do sleep 1; done
71 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8551/api/v1/site')" != "200" ]]; do sleep 1; done
72 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8561/api/v1/site')" != "200" ]]; do sleep 1; done
73 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8571/api/v1/site')" != "200" ]]; do sleep 1; done
74 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8581/api/v1/site')" != "200" ]]; do sleep 1; done