zgr2575 / SlowGuardian

A lightweight frontend using $UV to vnbl0ck every imaginable website.
https://sg.zadmin.xyz
MIT License
5 stars 5 forks source link

Raspherry Pi support #3

Closed dude363635 closed 4 months ago

dude363635 commented 5 months ago

When I try to deploy to Vercel it give me a function error (code 500).

To reproduce,

  1. Fork this repository
  2. Go to Vercel and hit your projects (sign up if you haven't already)
  3. Click 'Add New...'
  4. Select 'Project'
  5. There will be a box saying 'Import Git Repository'
  6. Find the fork of this repo, and click 'Import'
  7. Name the project whatever you want ( I used the suggested 'slow-guardian'
  8. Scroll down and click 'Deploy' and wait for it to finish deploying
  9. Once it has finished deploying it will redirect you to a picture of the project and a button will appear that says 'Cotinue to Dashboard'. Click this
  10. This will bring you to the dashboard for your project. Click on the white button that says 'Visit'
  11. You will get this error page: image

Expected behaviour is that when you visit the site you will see the Slow-Guardian homepage and you will be able to use it.

Desktop (please complete the following information):

Any help would be highly appreciated and I think this will be very useful as it seems to properly support GeForceNow, unlike some other sites. It also incoperates a properly working Now.gg by the looks of things, and it is the first unblocking site I have ever seen that has Android on it so well done to you! I tested it on Replit but it doesn't work so well and I cant publish it on Replit. Keep up the good work!!

zgr2575 commented 5 months ago

Hello There, I'll try to reproduce this and get back to you then. I apologize for the late response. Until I can release a "fix" try codespaces, it fully functions on codespaces, but I have no clue why Repl isn't working. Please let me know your issues on repl so I can look into it. Thanks, zgr

zgr2575 commented 5 months ago

Back again, I looked into this issue, it seems to be on Vercels' side, the error code: 500 is a generic HTML error when events are fired off before the backend is ready for requests, with SmarterBackend it will instantly be ready for requests after the initiation of the code. But I looked into it, the error code your receiving, FUNCTION_INVOCATION_FAILED[https://vercel.com/docs/errors/INTERNAL_FUNCTION_INVOCATION_FAILED](Error Page on Vercel).

The internal invocation of a function failed. This is Vercel's error. The INTERNAL_FUNCTION_INVOCATION_FAILED error occurs when a function invocation fails. This could be due to an error within the function itself, or an issue with the environment in which the function is running.

So, here are steps for you to troubleshoot this issue, Check application logs: Review the application logs to identify any specific errors related to the internal function invocation. They can be found at the host URL under the /_logs path Review function code: Ensure that the code for the function is correct and does not contain any errors or infinite loops Verify function configuration: Double-check the function configuration to ensure that it's set up correctly, including any environment variables or other settings Check external dependencies: If the function relies on external services or APIs, ensure they are responding in a timely manner

If your issue is still unresolved, reach out to Vercel's support for more assistance on their end. But for now I again am concerned for the Replit issues. Thanks, zgr

dude363635 commented 5 months ago

Hey zgr, Thanks for replying! Codespaces is blocked for me so yeah can't try that route but thanks anyway! I did have an issue with Replit as well it got stuck on 'Now.gg fix is being applied' I waited for 5 minutes (timed it) and it wasn't working so is this an issue with replit? Also, would I be able to build this on a Raspberry Pi, then VPN into my home network and use it? Thanks again, dude365635

zgr2575 commented 5 months ago

Hello Again, Yeah replit got blocked for me to, but the now.gg fix issue, you can try clearing your cache. For Raspberry Pi, I have done it before, but you will need some basic knowledge of debugging, and javascript for code modification so its works on Raspberry, I have the code for version 1 of the site in which now.gg doesn't work on it. But I can work with you to make the proper modifications. Also I have an update on the vercel issue, you might of pulled in V8.1 in which only supports REPLIT, so try reforming on vercel.

Thanks for reaching out, zgr

zgr2575 commented 5 months ago

Vercel is working, https://vercelsg.vercel.app/

dude363635 commented 4 months ago

Hey zgr, I didn't quite manage to figure out how to clear the cache on Replit, how do you do that? Sorry if that's a noob question! So just pull the repo again to Vercel? As in start it over again to see if it works? Thanks for the vercel link and for replying its so helpful!!! dude365635

zgr2575 commented 4 months ago

Hey, Yeah that should fix the issue, and the now.gg fix page provides a link to steps to clear it. Thanks, zgr

dude363635 commented 4 months ago

Hi, Thanks so much really appreciate it!!! Regardng the deployment to Raspberry Pi I have the Pi 5 8GB so I can test anything if you want to try to make it Pi-compatible? I'm not great at coding so I probably can't help much there but I can try to read the error logs and see if the problem would be a Pi-problem or a code-problem. If you don't want to try to add support for Pi I understand you have already helped a lot so thanks again!!! Have a great day, dude365635

zgr2575 commented 4 months ago

Hello, Any time, helping is my job. For the Pi, I will research compatibility and maybe push an update to SmarterBackend to start testing compatibility. I am not fully sure about the Raspberry Pi 5 and its compatibility to node.js. Give me like 5-10 minutes to figure this out and I will get to work on an update Thanks, zgr (Also I am going to de-escalate this to a feature request. )

zgr2575 commented 4 months ago

Hey again, It's possible. You just need to install node.js on the Pi (if it didn't already come pre installed). Are you using the default raspberry os? Thanks, zgr

dude363635 commented 4 months ago

Hi, Ok I'll try that sometime soon-ish and I'll let you know what happens. Would I just run 'npm start' or something along those lines? Will try on Raspberry Pi OS Bookworm (the only version that supports Pi 5) and I'll see how it runs on a local network. Also, how does the license key jamming work? SOunds interesting as GoGuardian is useless without license key. I removed it somehow one time and GG just stopped completely it was awesome so if I can temporarily disable it that's sweet! Thanks, dude365635

zgr2575 commented 4 months ago

Hey, Let me know what happens, after cloning into the repo, you wanna run node index.js and SmarterBackend is optimized so it should work well on internet speeds ranging from 50mbs +. The license jammer may be patched because it used to be a javascript bookmark you would click to void:0 the chrome plugin causing it to need to be re-entered also you are correct, it is useless without the license key, but beware, last year a kid in my school used it and got suspended as the jammer causes the entire district ( depending on the network they are on ) to go out and cause all GoGO features to stop working. So I just stopped supporting it after they figured out how to turn off JS execution on Chromebooks. Thanks, zgr

dude363635 commented 4 months ago

Hey, Alright I'll let you know what happens! Maybe I'll leave the jammer out of this..... Is it disabled by default? Same thing happened to JS bookmarks over at my school :( dude365635

dude363635 commented 4 months ago

Ok, So I cloned in and it seems to work on Pi 5 8GB with Node.js installed running Pi OS Lite 64-bit (Bookworm). I can access it from my home network and it loads the homepage fast enough. I wouldn't run it on anything less powerful than a Pi 5 though, as a 4 might not be powerful enough... I am yet to use it as a proxy as I am waiting for the Now.gg fix to be applied. I cannot click the link to clear the cache for some reason??? Can you please provide instructions for this? Thanks again, dude365635

dude363635 commented 4 months ago

P.S., is there a way to add support for websockets? If there is no support for websockets, most games will not work (Shell Shockers, for example). Is there a way to add these? Thanks, dude365635

zgr2575 commented 4 months ago

Hey there, Yeah, the pi should natively support node.js so there shouldn't be any problems. Additionally, Ultraviolet should already support WebSockets. I have never even considered them and I am not fully sure about implementing them within the proxy. Also, what device are you using when you're launching a game? Also this is the link it follows: https://support.google.com/accounts/answer/32050 Thanks, zgr

dude363635 commented 4 months ago

Hi, Yeah I'll just mess around with my browser and see what happens. If I go to websocketstest.com it says Websockets don't work with this configuration???? Does Dynamic support Websockets? Have a good day, dude365635

zgr2575 commented 4 months ago

Hey there, Alrighty well let me know what happens, I bumped the version of Ultraviolet last night and it caused problems with detection. For WebSockets, UV should have it built in, when its proxying it probably wouldn't show to a checker, but for Dynamic, it does support WebSockets and I know that for a fact, but it has bad leak protection and occasionally blocks the proxy. Dynamic is weird but has come a long way and I have been modifying it for better features slowly, but I cannot do the same for UV, because of their license and they obfuscate their code. Thanks, zgr

zgr2575 commented 4 months ago

Additionally, https://websocketstest.com/ doesn't support checking web proxies. Thanks, zgr

zgr2575 commented 4 months ago

Also, that checks for your device as I look into it more.

dude363635 commented 4 months ago

Huh thats interesting.... Yeah the Pi version isn't updated idk if its gonna auto-update or not so we'll see. It stays on the Now.gg fix page. I had an idea, is it possible to make the Pi's proxy go through my home network so I get faster speeds? Or is there a way to make a selection of different servers for example: Europe, America, and Australia? It might be a bit too complicated but if you know how to add the support for switching proxy servers I can find the servers to host them on. Thanks again, dude365635

zgr2575 commented 4 months ago

Hey again, Well, for UV it just runs off whatever network your hosting on so it wouldn't be possible to change regions. Does my vercel app work for you and the now.gg fix? Also the Pi version is separate from main, Pi-Support branch is just a little more optimized, and I will be testing support for the Pi-4 model soon. Thanks, zgr

dude363635 commented 4 months ago

Hello, OK, so would that mean I would get the same speeds as my home network? The vercel app is a bit slow and in the wrong region for geforcenow but apart from that its really impressive! Ahh ok I think I just cloned into the main branch an my Pi 5..... Oops... Is there a branch you could make that doesn't open everything in about:blank? I have a method of bypassing stuff but it can only work in one tab with no new tabs being opened. Thanks, dude365635

zgr2575 commented 4 months ago

Hello, Yea, in settings there is a toggle bar for it. But About:Blank hides any search history of using the website making the time for your school to block it a lot longer, and even impossible if you don't have any traces on your Chromebook or whatever device your using. Also, a problem for the Now.gg fix could be you using a proxy to proxy into Ultraviolet; is a proxy on its own and its leak protection could be preventing the page from directing. Thanks, zgr

dude363635 commented 4 months ago

Hey, The toggle bar doesn't seem to save when I deselect it but that probably because with the method I have it basically glitches an app (educational graphing calculator) on chrome os into opening a webview/private browsing window so it doesn't save cookies or share cookies so yeah that's the sad part about it, although the upside is gogaian cant see it and the browsing history doesn't save so its pretty much undetecable. It doesn't use a proxy though so I don't know what is going on with the Pi version ill update it to the Pi-branch and see if that fixes it. Is there anything I can do to fork the repo and make it not open in an about:blank page by default? BTW I really like this feature for normal browsers, it just doesn't work for my method without having a risk... Thanks, dude365635

zgr2575 commented 4 months ago

Hello, The deselection issue is on my end there was an error in the code, but it wouldn't work for you either way because you don't have cookies. But to turn this off modify the following lines of code: ON LINE 10 IN h.js


const popup = open("about:blank", "_blank")

change it to:

//const popup = open("about:blank", "_blank")

That will turn off auto ab

dude363635 commented 4 months ago

Hello, Thanks for that! I'll try it out.... This is gonna get fun! Finally, Fortnite at school..... I'll tell you how updating the code to the Pi-branch goes and if it helps the now.gg fix issue. Thanks, dude365635

zgr2575 commented 4 months ago

Hello, Sorry for the late reply. I've been busy with finals. Did it work out for you? Also, have fun! Thanks, zgr2575

dude363635 commented 4 months ago

Hey zgr, I couldn't quiet figure out how to clone the code from the Pi branch so I couldn't do that, then I messed my Pi config up trying to figure it out so ill reflash it and try again, but I don't know what the command is to clone a branch of the repo? Do you know? Thanks I'm having a lot just trying to figure this out! dude365635

zgr2575 commented 4 months ago

Hey dude, First you need to enter your SlowGuardian Dir (if you have one) cd SlowGuardian Then pull from the repo. git clone https://github.com/zgr2575/SlowGuardian.git rasphberry-pi-support

dude363635 commented 4 months ago

Hey zgr, Hope your finals went well! Continue dev work after you've graduated? Also, I'll try that out, thanks!

zgr2575 commented 4 months ago

Hey dude, They went well! Yes, I will be continuing development of all my repos after I graduate. Let me know! Thanks, zgr

zgr2575 commented 4 months ago

Hello Dude, I am not going to be available for up to a month. If you need any help. Use AI such as deepai, or chat gpt to general support. Ive had fun making and implementing some things that you have seen. I will hopefully see you soon. But I am going to close this, but if you have any problems feel free to open another issue. Thanks, and have a great summer. zgr2575