The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
967 B

  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. # Unlock a new bubble
  6. #
  7. # Usage:
  8. #
  9. # bunlock unlock-key
  10. #
  11. # unlock-key : the unlock key for the new bubble
  12. #
  13. # Environment variables
  14. #
  15. # BUBBLE_API : which API to use. Default is local (http://127.0.0.1:PORT, where PORT is found in .bubble.env)
  16. # BUBBLE_USER : account to use. Default is root@local.local
  17. # BUBBLE_PASS : password for account. Default is password
  18. #
  19. SCRIPT="${0}"
  20. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  21. export REQUIRE_BUBBLE_USER=1
  22. export REQUIRE_BUBBLE_PASS=1
  23. . "${SCRIPT_DIR}"/bubble_common
  24. if [[ -z "${BUBBLE_API}" ]] ; then
  25. die "No BUBBLE_API env var defined"
  26. fi
  27. UNLOCK_KEY="${1:?no unlock-key provided}"
  28. echo "{\"name\":\"${BUBBLE_USER}\",\"password\":\"${BUBBLE_PASS}\"}" | \
  29. "${SCRIPT_DIR}"/bpost 'auth/login?k='"${UNLOCK_KEY}"'' - --no-login