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

optional ipv6 for repo #1661

Merged
merged 2 commits into from
Feb 17, 2022
Merged

optional ipv6 for repo #1661

merged 2 commits into from
Feb 17, 2022

Conversation

ericsullivan
Copy link
Contributor

Changes

I tried to self-host on fly.io, but it uses IPv6 for DB access:
https://hexdocs.pm/phoenix/fly.html#runtime-configuration

This changes follows the current Phoenix generator setup:
https://github.com/phoenixframework/phoenix/blob/master/installer/lib/phx_new/generator.ex#L355

It had been defaulted to inet6:
phoenixframework/phoenix#4289

but that caused an issue:
phoenixframework/phoenix#4389

Tests

  • This PR does not require tests

Changelog

  • Entry has been added to changelog

Documentation

  • Docs have been updated
  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode
  • This PR does not change the UI

@ukutaht
Copy link
Contributor

ukutaht commented Feb 11, 2022

Thanks! Definitely interested in getting this in.

Did you consider parsing the DATABASE_URL config parameter? So if the hostname is an IPv6 then the [:inet6]config option will automatically be applied. I don't understand why Ecto doesn't work that way to begin with

@ericsullivan
Copy link
Contributor Author

@ukutaht The DATABASE_URL uses a DNS entry like:

DATABASE_URL=postgres://<USERNAME>:<PW>@top2.nearest.of.plausible-db.internal:5432/plausible

So you can't tell it's an IPv6 without doing the lookup. Since it's fly.io they're all IPv6, which is why I used the ENV approach

@ukutaht
Copy link
Contributor

ukutaht commented Feb 17, 2022

Oh, gotcha. That makes sense.

@ukutaht ukutaht merged commit 0ac26cb into plausible:master Feb 17, 2022
@ericsullivan
Copy link
Contributor Author

Thank you

@ericsullivan ericsullivan deleted the feature/inet6_repo branch February 17, 2022 13:50
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 this pull request may close these issues.

2 participants