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

Request: Offline/Cached Environment Variables #353

Open
neverabsolute opened this issue Mar 10, 2023 · 2 comments
Open

Request: Offline/Cached Environment Variables #353

neverabsolute opened this issue Mar 10, 2023 · 2 comments
Labels
feature request Proposed feature for the CLI

Comments

@neverabsolute
Copy link

I've been thinking it would be nice for the CLI to be able to cache environment variables.

The use case I'm thinking of here is CLI usage without internet or during a Railway outage. I know this presents a certain security risk but if you're already logged in to the CLI and someone gains physical access to your machine it's already game over. (Could also make offline access/caching opt-in only)

Example:

railway login && railway link -> link to a project

railway run pnpm dev -> runs as expected, pulling context from environment variables set in the project

oh great heavens internet pooped

railway run pnpm dev -> runs as expected, pulling context from last known environment variables set in the project

@alexng353
Copy link
Contributor

oh great heavens!

@coffee-cup coffee-cup added enhancement New feature or request feature request Proposed feature for the CLI and removed enhancement New feature or request labels Apr 26, 2023
@alexng353
Copy link
Contributor

alexng353 commented Apr 29, 2023

I have to wonder, how would caching work? I'm assuming that there would need to be a timestamp saved in the local cache and some kind of extra endpoint for checking if the environment variables on apiv2 have changed since the last time you got them. Or hash cached variables on client side to match against server side hash?

Either way I can't really think of how to do it without checking the backend every time, unless the offline would just act as a fallback, working only if the api call fails.

note: I am working on POC for second idea now that I've had it lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Proposed feature for the CLI
Projects
None yet
Development

No branches or pull requests

3 participants