fix: endpoint migration when EXTERNAL_URL is not present (#1232)

For `URI.parse` to work the URI needs to be a FQDN otherwise `nil` is
returned.
This commit is contained in:
Gabi
2022-12-23 21:13:11 -03:00
committed by GitHub
parent 38c41feb67
commit e49d5631a5

View File

@@ -32,7 +32,7 @@ defmodule FzHttp.Repo.Migrations.MoveWireguardOptionalFieldsToSites do
execute("""
UPDATE sites
SET endpoint = '#{URI.parse(System.get_env("EXTERNAL_URL", "localhost")).host}'
SET endpoint = '#{URI.parse(System.get_env("EXTERNAL_URL", "https://localhost/")).host}'
WHERE endpoint IS NULL
""")
end