passing https.cert and https.key options to the webpack dev server

Signed-off-by: Luka Siric <siric.luka@gmail.com>
This commit is contained in:
Luka Siric
2022-08-24 23:02:56 +02:00
parent bf340bcb4a
commit 221e951298
4 changed files with 43 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/cli': patch
'@backstage/core-app-api': patch
---
Added support for custom certificate for webpack dev server.
+6 -1
View File
@@ -2,12 +2,17 @@ app:
title: Backstage Example App
baseUrl: http://localhost:3000
googleAnalyticsTrackingId: # UA-000000-0
# https:
# credentials:
# cert:
# $file '\path\to\the\certificate'
# key:
# $file '\path\to\the\private-key'
#datadogRum:
# clientToken: '123456789'
# applicationId: qwerty
# site: # datadoghq.eu default = datadoghq.com
# env: # optional
support:
url: https://github.com/backstage/backstage/issues # Used by common ErrorPage
items: # Used by common SupportButton component
+11 -1
View File
@@ -60,7 +60,17 @@ export async function serveBundle(options: ServeOptions) {
// See https://github.com/facebookincubator/create-react-app/issues/387.
disableDotRule: true,
},
https: url.protocol === 'https:',
https:
url.protocol === 'https:'
? {
cert: options.frontendConfig.getOptionalString(
'app.https.credentials.cert',
),
key: options.frontendConfig.getOptionalString(
'app.https.credentials.key',
),
}
: false,
host,
port,
proxy: pkg.proxy,
+20
View File
@@ -65,6 +65,26 @@ export interface Config {
}>;
}>;
};
/**
* Running the frontend app with https
*/
https?: {
/**
* Parent object containing certificate and the private key
*/
credentials?: {
/**
* Https Certificate private key. Can be loaded using $file
* @visibility frontend
*/
key?: string;
/**
* Https Certificate. Can be loaded using $file
* @visibility frontend
*/
cert?: string;
};
};
};
/**