Code-server: Add environment variable support for existing runtime flags

Created on 7 Mar 2019  路  7Comments  路  Source: cdr/code-server

It was brought up in Discord by @PhilsLab that we should allow environment variables to be more easily configured in things like Docker containers.

This is really simple, and already supported by the library used, we just need to figure out appropriate names.

https://oclif.io/docs/flags is the documentation for the flags library, the key feature being env.

We'd just need to add that to each of the flags in https://github.com/codercom/code-server/blob/master/packages/server/src/cli.ts#L20 like the following:

host: flags.string({ char: "h", default: "0.0.0.0", env: "HOST" }),

Thoughts are appreciated on this :).

enhancement

Most helpful comment

@aslafy-z I have a PR I'm going to submit tonight, I just had other stuff come up. Have to finish my workday first :).

All 7 comments

LGTM. Feel free to throw up a PR for this, would be a great addition!

I'd love to see this land as I'm building a Helm Chart for code-server. It would consistently help setting settings and secrets.

@aslafy-z I have a PR I'm going to submit tonight, I just had other stuff come up. Have to finish my workday first :).

Any update on this?

No updates, sorry. Feel free to open a PR!

As of https://github.com/cdr/code-server/commit/1697cc32a335b0510725621be6023cf2ec7cc497, the flags package is no longer used. That being said should still be relatively simple to allow people to use environment variables instead of options. I'll open a PR shortly to expose a few and we can have the discussion there as to what the others should be called.

This should be filed against VS Code, we just use their parser.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nol166 picture nol166  路  3Comments

sa7mon picture sa7mon  路  3Comments

lshamis picture lshamis  路  3Comments

broady picture broady  路  3Comments

RealSlimMahdi picture RealSlimMahdi  路  3Comments