Skip to content

Commit

Permalink
[server]: add option to read license from a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Emms authored and roboquat committed Dec 9, 2021
1 parent 8e3eb7e commit c27d245
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export interface ConfigSerialized {
insecureNoDomain: boolean;
logLevel: LogrusLogLevel;

// Use one or other - licenseFile reads from a file and populates license
license?: string;
licenseFile?: string;

workspaceHeartbeat: {
intervalSeconds: number;
Expand Down Expand Up @@ -178,6 +180,11 @@ export namespace ConfigFile {
if (brandingConfig) {
brandingConfig = BrandingParser.normalize(brandingConfig);
}
let license = config.license
const licenseFile = config.licenseFile
if (licenseFile) {
license = fs.readFileSync(licenseFile, "utf-8")
}
return {
...config,
stage: translateLegacyStagename(config.stage),
Expand All @@ -186,6 +193,7 @@ export namespace ConfigFile {
builtinAuthProvidersConfigured,
brandingConfig,
chargebeeProviderOptions,
license,
workspaceGarbageCollection: {
...config.workspaceGarbageCollection,
startDate: config.workspaceGarbageCollection.startDate ? new Date(config.workspaceGarbageCollection.startDate).getTime() : Date.now(),
Expand Down

0 comments on commit c27d245

Please sign in to comment.