Bubble proxy service
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

README-release.md 4.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. bubble-flexrouter
  61. To see all available options:
  62. bubble-flexrouter --help
  63. ## Register the flex router with your Bubble
  64. This step can be done as a regular user (non-root, non-Administrator).
  65. #### Set Environment
  66. You will need to set the `BUBBLE_FR_PASS` environment variable to register your router.
  67. Unlike `flex_init.sh` (where this environment variable points to the file containing the bcrypted password),
  68. when you run `flex_register.sh` this environment variable should contain the actual plaintext password.
  69. export BUBBLE_FR_PASS=the-password-you-used-when-running-flex_init.sh
  70. On Windows, replace `export` with `set` if you are using the standard Windows `cmd` program.
  71. #### Register the router
  72. Run:
  73. flex_register.sh your-bubble-hostname.example.com
  74. Where `your-bubble-hostname.example.com` is the hostname of your Bubble.
  75. If you're not sure what the hostname is, click on "My Bubble" in the Bubble App and copy the hostname
  76. from your browser's location bar.
  77. On Linux, the hostname is not easily accessible, but you can use the IP address of your Bubble just the same.
  78. To get the IP address of your Bubble on Linux, run:
  79. cat /etc/wireguard/wg0.conf | grep Endpoint | awk -F':' '{print $1}' | awk '{print $NF}'
  80. ## Restarting bubble-flexrouter
  81. Every time you start bubble-flexrouter, you need to run `flex_register.sh` to register the router
  82. with your Bubble.