-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(env): select a valid DATABASE_URL when deployed on Railway.app
Railway.app provides DATABASE_PRIVATE_URL, DATABASE_URL and/or DATABASE_PUBLIC_URL. DATABASE_PRIVATE_URL is for private networking, while DATABASE_PUBLIC_URL is for public networking. If private networking is disabled, the former still exists but is invalid (i.e., missing host). If public networking is disabled, both host and port are missing in the latter, resulting in an invalid URL too. A legacy Postgres addon may provide only DATABASE_URL (for PUBLIC networking) and DATABASE_PRIVATE_URL, while a modern one may provide only DATABASE_URL (for PRIVATE networking) and DATABASE_PUBLIC_URL. Thus, we need to select a valid one from them. This should solve most database connection issues on Railway.app. Signed-off-by: Rongrong <[email protected]>
- Loading branch information
1 parent
354c6ea
commit 6d6b44a
Showing
4 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters