4 export APUB_TESTING_SEND_SYNC=1
5 export RUST_BACKTRACE=1
6 export RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_queries=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
8 for INSTANCE in lemmy_alpha lemmy_beta lemmy_gamma lemmy_delta lemmy_epsilon; do
9 psql "${LEMMY_DATABASE_URL}/lemmy" -c "DROP DATABASE IF EXISTS $INSTANCE"
10 psql "${LEMMY_DATABASE_URL}/lemmy" -c "CREATE DATABASE $INSTANCE"
13 if [ -z "$DO_WRITE_HOSTS_FILE" ]; then
14 if ! grep -q lemmy-alpha /etc/hosts; then
15 echo "Please add the following to your /etc/hosts file, then press enter:
21 127.0.0.1 lemmy-epsilon"
25 for INSTANCE in lemmy-alpha lemmy-beta lemmy-gamma lemmy-delta lemmy-epsilon; do
26 echo "127.0.0.1 $INSTANCE" >> /etc/hosts
30 killall lemmy_server || true
35 LEMMY_HOSTNAME=lemmy-alpha:8541 \
36 LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_alpha.hjson \
37 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_alpha" \
38 LEMMY_HOSTNAME="lemmy-alpha:8541" \
39 target/lemmy_server >/tmp/lemmy_alpha.out 2>&1 &
42 LEMMY_HOSTNAME=lemmy-beta:8551 \
43 LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_beta.hjson \
44 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_beta" \
45 target/lemmy_server >/tmp/lemmy_beta.out 2>&1 &
48 LEMMY_HOSTNAME=lemmy-gamma:8561 \
49 LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_gamma.hjson \
50 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_gamma" \
51 target/lemmy_server >/tmp/lemmy_gamma.out 2>&1 &
54 # An instance with only an allowlist for beta
55 LEMMY_HOSTNAME=lemmy-delta:8571 \
56 LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_delta.hjson \
57 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_delta" \
58 target/lemmy_server >/tmp/lemmy_delta.out 2>&1 &
61 # An instance who has a blocklist, with lemmy-alpha blocked
62 LEMMY_HOSTNAME=lemmy-epsilon:8581 \
63 LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_epsilon.hjson \
64 LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_epsilon" \
65 target/lemmy_server >/tmp/lemmy_epsilon.out 2>&1 &
67 echo "wait for all instances to start"
68 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v3/site')" != "200" ]]; do sleep 1; done
69 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8551/api/v3/site')" != "200" ]]; do sleep 1; done
70 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8561/api/v3/site')" != "200" ]]; do sleep 1; done
71 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8571/api/v3/site')" != "200" ]]; do sleep 1; done
72 while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8581/api/v3/site')" != "200" ]]; do sleep 1; done