This repository was archived by the owner on May 7, 2024. It is now read-only.
Allow database prepare command to use environment variables.#586
Closed
ghunteranderson wants to merge 1 commit into
Closed
Allow database prepare command to use environment variables.#586ghunteranderson wants to merge 1 commit into
ghunteranderson wants to merge 1 commit into
Conversation
…om start.sh. This allows environment variables to be used in prepare step rather than parsing the mistaken url "true".
Author
|
I believe this PR may address #323. All the @pantsel would need to do is add the standard environment variables For me, I have passwords that may not be url safe. The |
mloskot
added a commit
to Cadcorp/konga
that referenced
this pull request
Dec 4, 2020
mloskot
added a commit
to Cadcorp/konga
that referenced
this pull request
Dec 8, 2020
This pull request was closed.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The files
/makedb/dbs/pg.js,makedb/dbs/mysql.jsand/config/connections.jsallow the user to pass the standard database connection environment variables into the prepare command so long as a connection URL is not set. However, if-u <url>is not passed intostart.sh, then thekong.jsinvocation becomes./bin/kong.js prepare --adapter postgres --uri. The argument parser then interprets this asargv.uri=trueand the process tries to connect with connection URL "true". The changes instart.shattempt to address this.Moving on to
kong.js, we omit settingprocess.env.DB_URIat all ifargv.uriis empty. This preventsprocess.env.DB_URIfrom becoming string "undefined" and causing the same problem as string "true".Finally, this PR removes the validation requiring a connection URL. I believe this is currently ignored if ran via
startup.shasargv.uriwas either true or a nonempty string.