Deploy `Flutter` App to Fly.io
nelsonic opened this issue Β· 22 comments
- Deploy the
Flutter
App to: https://fly.io/dashboard/dwyl-app asdwylapp
- Replace all the instances of
applicationId "com.example.myapp"
withapplicationId "com.dwyl.app"
in theFlutter
App.
See: https://developer.android.com/studio/build/application-id.html - Add
dwyl
logo to theFlutter
App.
see: dwyl/flutter-phoenix-channels-demo#3 - Create subdomain on Cloudflare:
app.dwyl.com
pointing todwylapp.fly.io
(@nelsonic will do this step) - Trouble-shoot
app.dwyl.com
DNS issue: #316
On it π
Cool. Thanks @LuchoTurtle. Going to do my part on CloudFlare
now.
Turns out I need an IPV4
Address in order to configure the subdomain:
So can only do this once the initial deployment to Fly.io
is complete.
@LuchoTurtle ping me on Signal when you've got the basic Flutter
App deployed. π
@nelsonic Already made the changes in #313 . It is already deployed (check https://fly.io/dashboard/dwyl-app) so you can proceed with Cloudflare.
Get IP v4
Address from Fly.io App info: https://fly.io/apps/dwylapp
66.241.125.55
Add to DNS config on Cloudflare:
Wait patiently while the DNS records update ... β³
What part of "patiently" didn't you understand...? π
(come back to this in a few hours once the DNS record has propagated ...)
OR update DNS on Mac to point to 1.1.1.1
...
Still have to be patient ... π§
We should review this together on Standup today.
Just ran:
fly ips allocate-v4 --app dwylapp
as per: https://fly.io/docs/reference/services/
And got the following:
VERSION IP TYPE REGION CREATED AT
v4 149.248.196.139 public global 8s ago
Now instead of having a shared IP v4
address, we have:
https://fly.io/apps/dwylapp
149.248.196.139
(not shared)
Updated the IP address on Cloudflare:
Getting the following (different) error when visiting: https://app.dwyl.com/
Ok. might need to be patient with this again. β³
This error is quite strange:
This page isnβt working app.dwyl.com redirected you too many times.
[Try clearing your cookies](https://support.google.com/chrome?p=rl_error&hl=en-GB).
ERR_TOO_MANY_REDIRECTS
@LuchoTurtle / @SimonLab would you mind researching this π π
or if one of you wants to figure out why the App
isn't working on the subdomain (I can help if needed)
then the other person can look into page load times: #315
Could it be that the Flutter
app doesn't acknowledge the app.dwyl.com
as a possible redirect? π
On @LuchoTurtle's advice:
Changed:
Sadly, we get: "SSL handshake failed":
And it also fails for the auth
instance that was working: https://auth.dwyl.com/
Lots of people have this problem in Cloudflare forums and all the links I could find are usually SSL/TLS-related or HTTP/HTTPS-related.
Cloudflare Docs even has a troubleshooting section for this.
https://developers.cloudflare.com/ssl/troubleshooting/too-many-redirects/
If the Cloudflare configuration is the same as auth
's, there must be something on fly
's side that is not.
Yeah, the first thing I checked was the two apps we have on Fly.io
that have Cloudflare A
records:
https://auth.dwyl.com and https://hits.dwyl.com
Both of these are Phoenix
Apps. So it's possible that the config for the Flutter
app is just not quite right.
Hence me suggesting that we need to ask a question on the https://community.fly.io
with as much context as possible.
If you search on https://community.fly.io for "Flutter"
the only match is: https://community.fly.io/t/postgres-write-broken-pipe/5529
This is not relevant to us. so we need to open a new question. That will be helpful to anyone else
trying to deploy a Flutter
Web App to Fly.io. π
I've created a thread here https://community.fly.io/t/err-too-many-redirects-when-deploying-flutter-web-app-with-a-cloudflare-proxy/10894
You can check if it's good enough @nelsonic
@LuchoTurtle please update your question with screenshots without obfuscating the IP addresses:
None of this is private
or sensitive info. it's all public
by virtue of the fact that DNS
is public
. π
So scrubbing the IP
address just makes you/us look like we have no idea what we're doing. π
e.g: https://www.whatsmydns.net/dns-lookup?query=dwyl.com&server=cloudflare
Done
Not closed. Additional checkboxes / todos added to OP. β³
Closing this issue because #316 has also been addressed.