resolved @Rugvip comments

Signed-off-by: Luka Siric <siric.luka@gmail.com>
This commit is contained in:
Luka Siric
2022-08-30 16:33:47 +02:00
parent 08eb42afdc
commit eef0522644
6 changed files with 43 additions and 37 deletions
-6
View File
@@ -2,12 +2,6 @@ app:
title: Backstage Example App
baseUrl: http://localhost:3000
googleAnalyticsTrackingId: # UA-000000-0
# https:
# certificate:
# cert:
# $file: '\path\to\the\certificate'
# key:
# $file: '\path\to\the\private-key'
#datadogRum:
# clientToken: '123456789'
# applicationId: qwerty
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright 2022 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Config {
app: {
/**
* Running the frontend app with https
*/
https?: {
/**
* Parent object containing certificate and the private key
*/
certificate?: {
/**
* Https Certificate private key. Use $file to load in a file
* @visibility secret
*/
key: string;
/**
* Https Certificate. Use $file to load in a file
* @visibility secret
*/
cert: string;
};
};
};
}
+2 -4
View File
@@ -64,12 +64,10 @@ export async function serveBundle(options: ServeOptions) {
https:
url.protocol === 'https:'
? {
cert: options.frontendConfig.getOptionalString(
cert: options.backendConfig.getString(
'app.https.certificate.cert',
),
key: options.backendConfig.getOptionalString(
'app.https.certificate.key',
),
key: options.backendConfig.getString('app.https.certificate.key'),
}
: false,
host,
-1
View File
@@ -32,7 +32,6 @@ export type ServeOptions = BundlingPathsOptions & {
frontendConfig: Config;
frontendAppConfigs: AppConfig[];
backendConfig: Config;
backendAppConfigs: AppConfig[];
};
export type BuildOptions = BundlingPathsOptions & {
+1 -6
View File
@@ -96,11 +96,7 @@ export async function loadCliConfig(options: Options) {
});
const frontendConfig = ConfigReader.fromConfigs(frontendAppConfigs);
const backendAppConfigs = schema.process(appConfigs, {
visibility: ['frontend', 'backend', 'secret'],
withFilteredKeys: options.withFilteredKeys,
withDeprecatedKeys: options.withDeprecatedKeys,
});
const backendAppConfigs = schema.process(appConfigs);
const backendConfig = ConfigReader.fromConfigs(backendAppConfigs);
return {
@@ -108,7 +104,6 @@ export async function loadCliConfig(options: Options) {
appConfigs,
frontendConfig,
frontendAppConfigs,
backendAppConfigs,
backendConfig,
};
} catch (error) {
-20
View File
@@ -65,26 +65,6 @@ export interface Config {
}>;
}>;
};
/**
* Running the frontend app with https
*/
https?: {
/**
* Parent object containing certificate and the private key
*/
certificate?: {
/**
* Https Certificate private key. Use $file to load in a file
* @visibility secret
*/
key?: string;
/**
* Https Certificate. Use $file to load in a file
* @visibility frontend
*/
cert?: string;
};
};
};
/**