The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

hace 4 años
123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. #
  3. # Request a URL via the reverse proxy
  4. #
  5. # Usage: proxy url outfile
  6. #
  7. # Environment variables
  8. #
  9. # BUBBLE_API : which API to use. Default is local (http://127.0.0.1:PORT, where PORT is found in .bubble.env)
  10. # BUBBLE_USER : account to use. Default is root
  11. # BUBBLE_PASS : password for account. Default is root
  12. # BUBBLE_SCRIPTS : location of run.sh script. Default is to assume it is in the same directory containing this script
  13. #
  14. SCRIPT="${0}"
  15. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  16. . ${SCRIPT_DIR}/bubble_common
  17. URL="${1:?no URL provided}"
  18. OUTFILE="${2:?no outfile provided}"
  19. RAW=${3:-true}
  20. if [[ "${URL}" =~ http:// ]] ; then
  21. URL="http/$(echo -n ${URL} | cut -d/ -f3-)"
  22. elif [[ "${URL}" =~ https:// ]] ; then
  23. URL="https/$(echo -n ${URL} | cut -d/ -f3-)"
  24. else
  25. URL="http/$(echo -n ${URL} | cut -d/ -f3-)"
  26. fi
  27. PROXY_SCRIPT="${SCRIPT_DIR}/../scripts/proxy.json"
  28. if [[ ! -f "${PROXY_SCRIPT}" ]] ; then
  29. die "proxy API script not found: ${PROXY_SCRIPT}"
  30. fi
  31. echo '{"URL": "'"${URL}"'", "OUTFILE": "'"${OUTFILE}"'", "RAW": "'"${RAW}"'"}' \
  32. | ${SCRIPT_DIR}/bscript ${PROXY_SCRIPT} --vars -