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}/lemmy" -c "DROP DATABASE IF EXISTS $INSTANCE"
16 psql "${LEMMY_DATABASE_URL}/lemmy" -c "CREATE DATABASE $INSTANCE"
19 if [ -z "$DO_WRITE_HOSTS_FILE" ]; then
20 if ! grep -q lemmy-alpha /etc/hosts; then
21 echo "Please add the following to your /etc/hosts file, then press enter:
27 127.0.0.1 lemmy-epsilon"
31 for INSTANCE in lemmy-alpha lemmy-beta lemmy-gamma lemmy-delta lemmy-epsilon; do
32 echo "127.0.0.1 $INSTANCE" >> /etc/hosts
36 killall lemmy_server || true
39 LEMMY_HOSTNAME=lemmy-alpha:8541 \
41 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_alpha" \
42 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta,lemmy-gamma,lemmy-delta,lemmy-epsilon \
43 LEMMY_SETUP__ADMIN_USERNAME=lemmy_alpha \
44 LEMMY_SETUP__SITE_NAME=lemmy-alpha \
45 target/lemmy_server >/dev/null 2>&1 &
48 LEMMY_HOSTNAME=lemmy-beta:8551 \
50 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_beta" \
51 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-gamma,lemmy-delta,lemmy-epsilon \
52 LEMMY_SETUP__ADMIN_USERNAME=lemmy_beta \
53 LEMMY_SETUP__SITE_NAME=lemmy-beta \
54 target/lemmy_server >/dev/null 2>&1 &
57 LEMMY_HOSTNAME=lemmy-gamma:8561 \
59 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_gamma" \
60 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-beta,lemmy-delta,lemmy-epsilon \
61 LEMMY_SETUP__ADMIN_USERNAME=lemmy_gamma \
62 LEMMY_SETUP__SITE_NAME=lemmy-gamma \
63 target/lemmy_server >/dev/null 2>&1 &
66 # An instance with only an allowlist for beta
67 LEMMY_HOSTNAME=lemmy-delta:8571 \
69 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_delta" \
70 LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta \
71 LEMMY_SETUP__ADMIN_USERNAME=lemmy_delta \
72 LEMMY_SETUP__SITE_NAME=lemmy-delta \
73 target/lemmy_server >/dev/null 2>&1 &
76 # An instance who has a blocklist, with lemmy-alpha blocked
77 LEMMY_HOSTNAME=lemmy-epsilon:8581 \
79 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_epsilon" \
80 LEMMY_FEDERATION__BLOCKED_INSTANCES=lemmy-alpha \
81 LEMMY_SETUP__ADMIN_USERNAME=lemmy_epsilon \
82 LEMMY_SETUP__SITE_NAME=lemmy-epsilon \
83 target/lemmy_server >/dev/null 2>&1 &
85 echo "wait for all instances to start"
86 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v1/site')" != "200" ]]; do sleep 1; done
87 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8551/api/v1/site')" != "200" ]]; do sleep 1; done
88 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8561/api/v1/site')" != "200" ]]; do sleep 1; done
89 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8571/api/v1/site')" != "200" ]]; do sleep 1; done
90 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8581/api/v1/site')" != "200" ]]; do sleep 1; done