Add support for a YAML config file

This commit is contained in:
Anmol Sethi
2020-05-10 01:19:32 -04:00
parent 95ac0ddfb7
commit c5179c2a06
4 changed files with 67 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import { ProxyHttpProvider } from "./app/proxy"
import { StaticHttpProvider } from "./app/static"
import { UpdateHttpProvider } from "./app/update"
import { VscodeHttpProvider } from "./app/vscode"
import { Args, optionDescriptions, parse } from "./cli"
import { Args, optionDescriptions, parse, readConfigFile } from "./cli"
import { AuthType, HttpServer, HttpServerOptions } from "./http"
import { generateCertificate, generatePassword, hash, open } from "./util"
import { ipcMain, wrap } from "./wrapper"
@ -32,6 +32,8 @@ const version = pkg.version || "development"
const commit = pkg.commit || "development"
const main = async (args: Args): Promise<void> => {
args = await readConfigFile(args)
const auth = args.auth || AuthType.Password
const originalPassword = auth === AuthType.Password && (process.env.PASSWORD || (await generatePassword()))