Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zrok implementation not working #678

Open
drsourcat opened this issue Aug 3, 2024 · 5 comments · May be fixed by #705
Open

Zrok implementation not working #678

drsourcat opened this issue Aug 3, 2024 · 5 comments · May be fixed by #705

Comments

@drsourcat
Copy link

I don't know if it is me. but when adding Zrok as a proxy the server address stays locked on the default cloudflare address.
The server then reports the following error:
[ZrokService] Failed to restart Zrok! Error: [ERROR]: unable to create share (unable to create share: [POST /share][401] shareUnauthorized)
I tried the pre-release version and the latest stable, uninstall/reinstall/reboot/reconnect.
Thanks!

@cameronaaron
Copy link
Contributor

cameronaaron commented Aug 4, 2024

Hey I have a fix for this that I might just pr in just do zrok enable plus your key and it will work

@drsourcat
Copy link
Author

drsourcat commented Aug 4, 2024

I have already tried to enter "zrok enable + token" in the CLI. it executes the command but the issue persists.
Also tried to disable and re-enable.

@ydanote
Copy link

ydanote commented Sep 9, 2024

Hey I have a fix for this that I might just pr in just do zrok enable plus your key and it will work

Took a while to figure out, but I actually had to manually run a zrok disable and then again could successfully enable via the BlueBubbles GUI.

@zlshames
Copy link
Member

Hey I have a fix for this that I might just pr in just do zrok enable plus your key and it will work

Took a while to figure out, but I actually had to manually run a zrok disable and then again could successfully enable via the BlueBubbles GUI.

Oh interesting. Good to know. Maybe I check for that error and run disable first? Or if I get that error, run disable then try again. I'll look into it

@cameronaaron
Copy link
Contributor

Hey I have a fix for this that I might just pr in just do zrok enable plus your key and it will work

Took a while to figure out, but I actually had to manually run a zrok disable and then again could successfully enable via the BlueBubbles GUI.

Oh interesting. Good to know. Maybe I check for that error and run disable first? Or if I get that error, run disable then try again. I'll look into it

I think that is what fixed it for me as well

cameronaaron added a commit to cameronaaron/bluebubbles-server that referenced this issue Nov 13, 2024
Fixes BlueBubblesApp#678

Fix the Zrok proxy issue by adding logic to handle errors and restart the proxy.

* **packages/server/src/server/api/http/api/v1/socketRoutes.ts**
  - Import `ZrokService`.
  - Add logic to handle the Zrok proxy issue by disabling and re-enabling the Zrok proxy if an error is detected.
  - Update the `change-proxy-service` event to include the new logic.

* **packages/server/src/server/managers/zrokManager/index.ts**
  - Add logic to handle the error where the server address remains unchanged by attempting to disable and re-enable the Zrok proxy.
  - Update the `connectHandler` method to include the new logic.
  - Implement `handleError` method to handle errors and restart the Zrok proxy.

* **packages/server/src/server/services/proxyServices/zrokService/index.ts**
  - Implement a check for the error and attempt to disable and re-enable the Zrok proxy if the error is detected.
  - Update the `connect` method to include the new logic.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/BlueBubblesApp/bluebubbles-server/issues/678?shareId=XXXX-XXXX-XXXX-XXXX).
@cameronaaron cameronaaron linked a pull request Nov 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants