The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

59 satır
1.9 KiB

  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. #
  6. # Create a new user and start a network for that user
  7. #
  8. # Usage: create_user_and_network <json-file>
  9. #
  10. # json-file : a JSON file containing specs for the new user and network
  11. #
  12. # The default values are:
  13. #
  14. # {
  15. # "rootUsername": "root",
  16. # "rootPassword": "password",
  17. # "sageFqdn": "_required",
  18. # "nginxPort": "1443",
  19. # "username": "user-<<rand 5>>",
  20. # "password": "<<rand 10>>",
  21. # "network": "test-net-{{rand 5}}",
  22. # "email": "user-<<rand 5>>@example.com",
  23. # "domain": "bubblev.org",
  24. # "locale": "en_US",
  25. # "lang": "en",
  26. # "timezone": "EST",
  27. # "plan": "bubble pro",
  28. # "footprint": "Worldwide, excluding OFAC",
  29. # "compute": "VultrCompute",
  30. # "region": "New Jersey"
  31. # }
  32. #
  33. # The required fields above have a value of "_required". A minimal example would be:
  34. #
  35. # {
  36. # "sageFqdn": "api-XXXXX.staging.bubblev.org"
  37. # }
  38. #
  39. # This would add a user with a random name user-{{rand 5}} with a random password and random @example.com email address,
  40. # and a randomly named network with the name test-net-{{rand 5}}
  41. #
  42. # Environment variables
  43. #
  44. # BUBBLE_API : which API to use. Default is local (http://127.0.0.1:PORT, where PORT is found in .bubble.env)
  45. # BUBBLE_USER : account to use. Default is root
  46. # BUBBLE_PASS : password for account. Default is root
  47. # BUBBLE_SCRIPTS : location of run.sh script. Default is to assume it is in the same directory containing this script
  48. #
  49. SCRIPT="${0}"
  50. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  51. . ${SCRIPT_DIR}/bubble_common
  52. JSON="${1:?no json provided}"
  53. if [[ ! -f "${JSON}" ]] ; then
  54. die "json file not found: ${JSON}"
  55. fi
  56. cat "${JSON}" | exec ${SCRIPT_DIR}/bscript debug ${SCRIPT_DIR}/../scripts/create_user_and_network.json --no-login --vars -