start.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. $PARAMS
  28. python -m synapse.app.homeserver \
  29. --config-path "demo/etc/$port.config" \
  30. -vv \
  31. done
  32. echo "Starting webclient on port 8000..."
  33. python "demo/webserver.py" -p 8000 -P "$DIR/webserver.pid" "webclient"
  34. cd "$CWD"