This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Merged
Conversation
Contributor
Author
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
377680d to
5bcf459
Compare
59548c8 to
8b6f9d3
Compare
Base automatically changed from
bb04-07-Change_Repl_used_for_fetching_DB_token_in_tests
to
master
April 7, 2023 18:27
8b6f9d3 to
5032635
Compare
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.

Why
The JWT used for authenticating into the Replit DB is placed on the Repl as an environment variable on boot and lasts for 30h or so. This is fine for shorter lasting Repls, but if we want to have long-running Repls we need a mechanism to refresh the DB token.
What changed
Let's make it so that we read the DB URL data from a file, which can be refreshed while a program is running. If the file does not exist or we fail to read from it, fall back to the environment variable.
Testing
We need to set the
RIDT_PASSWORDto the token used for authing into database-test-ridt.util.repl.co. You can find it in that Repl's secrets. To store the database URL in a file instead of the env var, set theUSE_FILEenvironment variable to anything.