Bubble proxy service
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

README-release.md 5.5 KiB

há 4 anos
há 4 anos
há 4 anos
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # Bubble Flex Router
  2. bubble-flexrouter provides HTTP/HTTPS proxy services for Bubble.
  3. Some websites and apps refuse to respond to requests originating from a cloud IP address.
  4. Thus, when a user is connected to their Bubble, some sites and apps will not work.
  5. With flex routing, Bubble can route these requests through a device connected to the Bubble that is running bubble-flexrouter.
  6. Now, from the perspective of the website or app, these requests will originate from a "clean" IP, and so a valid response
  7. will be sent.
  8. Note that using flex routing does remove some privacy protection - sites and apps that are flex-routed will see
  9. one of your device's real IP addresses.
  10. ## Required software
  11. To use the `flex_init.sh` and `flex_register.sh` tools, you'll need to have some software installed:
  12. * bash
  13. * curl
  14. * jq
  15. * htpassword
  16. On Windows, use [Cygwin](https://cygwin.com) to install these.
  17. `htpasswd` is not available from Cygwin. See below for a workaround.
  18. ## Overview
  19. In order to use bubble-flexrouter, you must:
  20. * Initialize the flex router
  21. * Connect to your Bubble
  22. * Run bubble-flexrouter
  23. * Register the flex router with your Bubble
  24. We'll walk through each of these steps next.
  25. ## Initialize the flex router
  26. This step only needs to be done once. After that, bubble-flexrouter will re-use the initialization settings.
  27. On Mac OS and Linux, start by opening a Terminal window.
  28. If you're using Windows, start by opening a Cygwin bash shell. That's what you'll use to run these commands.
  29. ### If you have htpasswd installed
  30. To initialize your bubble-flexrouter, run the init script:
  31. flex_init.sh
  32. You will be prompted to enter a master password for the flex router. Remember this password.
  33. You can also set this password using an environment variable
  34. export BUBBLE_FR_PASS=some-plaintext-password
  35. flex_init.sh
  36. The above command will read the password from the `BUBBLE_FR_PASS` environment variable and will not
  37. prompt for a password.
  38. ### If you don't have htpasswd installed
  39. If you don't have `htpasswd` on your system, then you will need to manually bcrypt the password.
  40. You can do this online at https://bcrypt-generator.com/ -- ensure that "Rounds" is set to 12.
  41. Then set the `BUBBLE_FR_PASS` environment variable to the bcrypted password and
  42. run `flex_init.sh` with the `--bcrypt` flag:
  43. export BUBBLE_FR_PASS=some-bcrypted-password
  44. flex_init.sh --bcrypt
  45. ## Connect to your Bubble
  46. Start the Bubble app and login. On Linux, run `wg-quick up wg0` to connect.
  47. ## Running Flex Router
  48. You'll need to run `bubble-flexrouter` as root (on Linux/MacOS) or Administrator (on Windows).
  49. #### Set Environment
  50. Set environment variables required to run the flex router.
  51. These defaults should work, where `${HOME}` is the home directory of the user who ran `flex_init.sh`:
  52. export BUBBLE_FR_SSH_KEY=${HOME}/.ssh/flex
  53. export BUBBLE_FR_PASS=${HOME}/.bfr_pass
  54. export BUBBLE_FR_TOKEN=${HOME}/.bfr_token
  55. On Windows, if you are using the standard Windows `cmd` program,
  56. replace `export` with `set` and `${HOME}` with `C:\cygwin64\home\<username>`
  57. where `<username>` is the name of the user who ran `flex_init.sh`
  58. #### Run the router
  59. Now that you have your environment variable set, you can run the router.
  60. On Linux and Mac OS:
  61. sudo bubble-flexrouter
  62. On Windows, use `runas` to run `bubble-flexrouter` as Administrator:
  63. runas /user:domainname\username bubble-flexrouter
  64. To see all available options:
  65. bubble-flexrouter --help
  66. ## Register the flex router with your Bubble
  67. This step can be done as a regular user (non-root, non-Administrator).
  68. #### Register the router
  69. Run:
  70. flex_register.sh your-bubble-hostname.example.com
  71. Where `your-bubble-hostname.example.com` is the hostname of your Bubble.
  72. If you're not sure what the hostname is, click on "My Bubble" in the Bubble App and copy the hostname
  73. from your browser's location bar.
  74. On Linux, the hostname is not easily accessible, but you can use the IP address of your Bubble just the same.
  75. To get the IP address of your Bubble on Linux, run:
  76. cat /etc/wireguard/wg0.conf | grep Endpoint | awk -F':' '{print $1}' | awk '{print $NF}'
  77. #### Using Environment Variable to Register
  78. When you run `flex_register.sh`, you'll be prompted for your flex router password, your Bubble account email,
  79. and your Bubble account password.
  80. If you don't want to enter these every time, you can set environment variables instead.
  81. Set the `BUBBLE_FR_PASS` environment variable to the actual plaintext password for your flex router.
  82. This is what you used when running `flex_init.sh` to set up the router.
  83. Set the `BUBBLE_USER` and `BUBBLE_PASS` environment variables to your Bubble account email and password.
  84. For example:
  85. export BUBBLE_FR_PASS=the-password-you-used-when-running-flex_init.sh
  86. export BUBBLE_USER=your-bubble-email@example.com
  87. export BUBBLE_PASS=your-bubble-password
  88. On Windows, replace `export` with `set` if you are using the standard Windows `cmd` program.
  89. ## Running the router
  90. You can sit back and let the router do its work. It will periodically check to make sure that its
  91. secure tunnel to the Bubble is OK. If it finds and problems, it will re-establish the tunnel.
  92. On the other side, your Bubble will be monitoring the router to ensure it is available and properly functioning.
  93. ## Re-register every time your start bubble-flexrouter
  94. **Every time** you start the `bubble-flexrouter`, you need to register it with your Bubble using `flex_register.sh`
  95. If you start `bubble-flexrouter` and never run `flex_register.sh`, then your Bubble will not know the router is
  96. available and it will not be used for flex routing.