Currently, the .env file dictates where the backend authentication server launches, and its default value is in port 5000 of the local network.
GMAIL_REDIRECT_URI=https://localhost:5000/auth/gmail/callback
This only works if the OAuth request is done from a desktop browser running a server at localhost:5000, but we aim to be able to launch this on mobile too, with our current setup of Termux with PRoot installed.
Issue
Mobile browsers won't work with localhost unless you're doing a special reverse proxy or tunnel (like with ngrok, or a local VPN setup).
Workarounds
ChatGPT recommended Cloudflared (Cloudflare Tunnel) to me, as a solution that requires no unnecessary external login (unlike its first recommendation, ngrok), which it described as follows.
-
Install:
-
Use:
cloudflared tunnel --url http://localhost:5000
-
Pros: Fast, reliable, no login required for simple tunnels
-
Cons: Requires a free Cloudflare account for advanced config (but not for basic usage)
This meant that after every single time a tunnel was created, the backend server URL in the .env file had to be manually adjusted... which is especially hard to do on command-line interfaces such as Termux.
Suggested fix
Permanent fix
Let's have an option to launch the backend server directly into some public URL, wherein the frontend can just retrieve the data from there.
Last time I experimented with this, I had a headache dealing with Firefox's and Brave's pettiness when it came to their CORS features.
I wonder why I never got any sort of error with mobile Vivaldi when I did the Cloudflared thing on mobile. Perhaps it's just a case of blockage specific to privacy browsers.
Temporary fix for tomorrow (May 13)
For every phone we plan to show our thesis proposal defense panelists, I'll just manually do the env edits I mentioned in the previous section. We only have two phones for use anyway: mine and @YuzuiAiko's.
(@TIMOTHY-SICAD refused to lend his phone out citing concerns about storage space.)
The env file is in our Facebook Messenger group chat, and the instructions on how to get that into the PRoot distro is in my ChatGPT conversation history. As long as we all wake up early and get to campus early enough to prepare this, it'll be ready to go before our timeslot.
(A caveat is that Termux eats up a lot of battery, based on my personal experience. So maybe we shouldn't run the app on our phones too early?)
Currently, the
.envfile dictates where the backend authentication server launches, and its default value is in port5000of the local network.This only works if the OAuth request is done from a desktop browser running a server at
localhost:5000, but we aim to be able to launch this on mobile too, with our current setup of Termux with PRoot installed.Issue
Mobile browsers won't work with
localhostunless you're doing a special reverse proxy or tunnel (like with ngrok, or a local VPN setup).Workarounds
ChatGPT recommended Cloudflared (Cloudflare Tunnel) to me, as a solution that requires no unnecessary external login (unlike its first recommendation, ngrok), which it described as follows.
Install:
Use:
Pros: Fast, reliable, no login required for simple tunnels
Cons: Requires a free Cloudflare account for advanced config (but not for basic usage)
This meant that after every single time a tunnel was created, the backend server URL in the
.envfile had to be manually adjusted... which is especially hard to do on command-line interfaces such as Termux.Suggested fix
Permanent fix
Let's have an option to launch the backend server directly into some public URL, wherein the frontend can just retrieve the data from there.
Last time I experimented with this, I had a headache dealing with Firefox's and Brave's pettiness when it came to their CORS features.
I wonder why I never got any sort of error with mobile Vivaldi when I did the Cloudflared thing on mobile. Perhaps it's just a case of blockage specific to privacy browsers.
Temporary fix for tomorrow (May 13)
For every phone we plan to show our thesis proposal defense panelists, I'll just manually do the env edits I mentioned in the previous section. We only have two phones for use anyway: mine and @YuzuiAiko's.
(@TIMOTHY-SICAD refused to lend his phone out citing concerns about storage space.)
The env file is in our Facebook Messenger group chat, and the instructions on how to get that into the PRoot distro is in my ChatGPT conversation history. As long as we all wake up early and get to campus early enough to prepare this, it'll be ready to go before our timeslot.
(A caveat is that Termux eats up a lot of battery, based on my personal experience. So maybe we shouldn't run the app on our phones too early?)