@redhat-cloud-services/frontend-components-config-utilities 1.4.12 → 1.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/federated-modules.js +1 -0
- package/package.json +1 -1
- package/proxy.js +10 -7
- package/standalone/services/default/chrome.js +2 -2
- package/standalone/services/rbac.js +1 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
- [Disable chrome 2](#disable-chrome-2)
|
|
8
8
|
- [Chunk mapper](#chunk-mapper)
|
|
9
9
|
- [Federated modules](#federated-modules)
|
|
10
|
+
- [Override container ports](#Override container ports)
|
|
10
11
|
- [List of shared deps](#list-of-shared-deps)
|
|
11
12
|
|
|
12
13
|
## Chrome render loader
|
|
@@ -95,6 +96,15 @@ We've aimed for easy plug and play, but feel free to override any fed mods parti
|
|
|
95
96
|
* `useFileHash` - in order to prevent caching we are using file hashes, you might want to turn this off in your dev env
|
|
96
97
|
* `exclude` - if you want to exclude any shared module you can do it trough here (even for general dependencies added by us)
|
|
97
98
|
|
|
99
|
+
### Override container ports
|
|
100
|
+
The default ports for the RBAC server(**4012**) and/or the Keycloak server(**4001**) can be overridden using a corresponding variable in the environment.
|
|
101
|
+
|
|
102
|
+
Bash examples:
|
|
103
|
+
|
|
104
|
+
export KEYCLOAK_PORT=4020
|
|
105
|
+
export RBAC_PORT=5000
|
|
106
|
+
|
|
107
|
+
|
|
98
108
|
#### List of shared deps
|
|
99
109
|
|
|
100
110
|
This packages exposes these federated shared dependencies
|
package/federated-modules.js
CHANGED
|
@@ -8,6 +8,7 @@ const include = {
|
|
|
8
8
|
'@patternfly/react-table': {},
|
|
9
9
|
'@patternfly/react-tokens': {},
|
|
10
10
|
'@patternfly/react-icons': {},
|
|
11
|
+
'@patternfly/quickstarts': { singleton: true },
|
|
11
12
|
'@redhat-cloud-services/frontend-components': {},
|
|
12
13
|
'@redhat-cloud-services/frontend-components-utilities': {},
|
|
13
14
|
'@redhat-cloud-services/frontend-components-notifications': {},
|
package/package.json
CHANGED
package/proxy.js
CHANGED
|
@@ -30,6 +30,7 @@ module.exports = ({
|
|
|
30
30
|
proxyVerbose,
|
|
31
31
|
useCloud = false,
|
|
32
32
|
target = '',
|
|
33
|
+
keycloakUri = '',
|
|
33
34
|
registry = []
|
|
34
35
|
}) => {
|
|
35
36
|
const proxy = [];
|
|
@@ -83,8 +84,7 @@ module.exports = ({
|
|
|
83
84
|
ws: true,
|
|
84
85
|
onProxyReq: cookieTransform,
|
|
85
86
|
...(currTarget === 'PORTAL_BACKEND_MARKER' && { router }),
|
|
86
|
-
...typeof redirect === 'object' ? redirect : {}
|
|
87
|
-
...(agent && { agent })
|
|
87
|
+
...typeof redirect === 'object' ? redirect : {}
|
|
88
88
|
};
|
|
89
89
|
})
|
|
90
90
|
);
|
|
@@ -209,11 +209,14 @@ module.exports = ({
|
|
|
209
209
|
console.log('\u001b[0m');
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
|
-
|
|
212
|
+
onBeforeSetupMiddleware({ app, compiler, options }) {
|
|
213
213
|
app.enable('strict routing'); // trailing slashes are mean
|
|
214
214
|
let chromePath = localChrome;
|
|
215
215
|
if (standaloneConfig) {
|
|
216
|
-
|
|
216
|
+
if (standaloneConfig.chrome) {
|
|
217
|
+
chromePath = resolvePath(reposDir, standaloneConfig.chrome.path);
|
|
218
|
+
keycloakUri = standaloneConfig.chrome.keycloakUri;
|
|
219
|
+
}
|
|
217
220
|
} else if (!localChrome && useProxy) {
|
|
218
221
|
if (typeof defaultServices.chrome === 'function') {
|
|
219
222
|
defaultServices.chrome = defaultServices.chrome({});
|
|
@@ -230,15 +233,15 @@ module.exports = ({
|
|
|
230
233
|
registerChrome({
|
|
231
234
|
app,
|
|
232
235
|
chromePath,
|
|
233
|
-
keycloakUri
|
|
234
|
-
https: Boolean(
|
|
236
|
+
keycloakUri,
|
|
237
|
+
https: Boolean(options.https),
|
|
235
238
|
proxyVerbose
|
|
236
239
|
});
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
registry.forEach(cb => cb({
|
|
240
243
|
app,
|
|
241
|
-
|
|
244
|
+
options,
|
|
242
245
|
compiler,
|
|
243
246
|
config: standaloneConfig
|
|
244
247
|
}));
|
|
@@ -2,7 +2,7 @@ const fs = require('fs');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const glob = require('glob');
|
|
4
4
|
|
|
5
|
-
const keycloakPort = 4001;
|
|
5
|
+
const keycloakPort = process.env['KEYCLOAK_PORT'] ? process.env['KEYCLOAK_PORT'] : 4001;
|
|
6
6
|
|
|
7
7
|
module.exports = ({ port }) => ({
|
|
8
8
|
// Chrome handles its auth through keycloak
|
|
@@ -114,7 +114,7 @@ module.exports.registerChrome = ({ app, chromePath, keycloakUri, https, proxyVer
|
|
|
114
114
|
console.log('inject keycloak', req.url);
|
|
115
115
|
}
|
|
116
116
|
fileString = fileString
|
|
117
|
-
.replace(/
|
|
117
|
+
.replace(/https?:\/\/sso.qa.redhat.com/gm, keycloakUri);
|
|
118
118
|
}
|
|
119
119
|
res.end(fileString);
|
|
120
120
|
} else {
|