start.sh 1001 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. DIR="$( cd "$( dirname "$0" )" && pwd )"
  3. CWD=$(pwd)
  4. cd "$DIR/.."
  5. mkdir -p demo/etc
  6. # Check the --no-rate-limit param
  7. PARAMS=""
  8. if [ $# -eq 1 ]; then
  9. if [ $1 = "--no-rate-limit" ]; then
  10. PARAMS="--rc-messages-per-second 1000 --rc-message-burst-count 1000"
  11. fi
  12. fi
  13. for port in 8080 8081 8082; do
  14. echo "Starting server on port $port... "
  15. https_port=$((port + 400))
  16. python -m synapse.app.homeserver \
  17. --generate-config \
  18. --config-path "demo/etc/$port.config" \
  19. -p "$https_port" \
  20. --unsecure-port "$port" \
  21. -H "localhost:$https_port" \
  22. -f "$DIR/$port.log" \
  23. -d "$DIR/$port.db" \
  24. -D --pid-file "$DIR/$port.pid" \
  25. --manhole $((port + 1000)) \
  26. --tls-dh-params-path "demo/demo.tls.dh" \
  27. --media-store-path "demo/media_store.$port" \
  28. $PARAMS $SYNAPSE_PARAMS \
  29. python -m synapse.app.homeserver \
  30. --config-path "demo/etc/$port.config" \
  31. -vv \
  32. done
  33. cd "$CWD"