Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

If internal links are not specified, the external one should be used #1161

Merged
merged 3 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export class ChePluginServiceImpl implements ChePluginService {

try {
const workspaceSettings: WorkspaceSettings = await this.workspaceService.getWorkspaceSettings();
if (workspaceSettings && workspaceSettings[PLUGIN_REGISTRY_INTERNAL_URL]) {
const uri = workspaceSettings[PLUGIN_REGISTRY_INTERNAL_URL];
const publicUri = workspaceSettings[PLUGIN_REGISTRY_URL] || uri;
if (workspaceSettings) {
const publicUri = workspaceSettings[PLUGIN_REGISTRY_URL];
AndrienkoAleksandr marked this conversation as resolved.
Show resolved Hide resolved
const uri = workspaceSettings[PLUGIN_REGISTRY_INTERNAL_URL] || publicUri;

this.defaultRegistry = {
name: 'Eclipse Che plugins',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class CheServerHttpServiceImpl implements HttpService {
const certificateAuthority = await this.certificateService.getCertificateAuthority();

const proxyUrl = process.env.http_proxy;
const baseUrl = process.env.CHE_API;
const baseUrl = process.env.CHE_API_EXTERNAL;
console.log('proxyUrl && proxyUrl !== && baseUrl', proxyUrl && proxyUrl !== '' && baseUrl);
if (proxyUrl && proxyUrl !== '' && baseUrl) {
const parsedBaseUrl = url.parse(baseUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ export class CheServerRemoteApiImpl {
* baseAPIUrl - responsible for storing base url to API service, taken from environment variable
* machineToken - machine token taken from environment variable, always the same at workspace lifecycle
*/
private readonly baseAPIUrl: string;
private readonly baseAPIUrl: string | undefined;
private readonly machineToken: string;

constructor() {
if (process.env.CHE_API_INTERNAL === undefined) {
console.error('Unable to create Che API REST Client: "CHE_API_INTERNAL" is not set.');
} else {
this.baseAPIUrl = process.env.CHE_API_INTERNAL;
this.baseAPIUrl = process.env.CHE_API_INTERNAL || process.env.CHE_API_EXTERNAL;
if (!this.baseAPIUrl) {
console.error('Unable to create Che API REST client: "CHE_API" is not set');
}

if (process.env.CHE_MACHINE_TOKEN === undefined) {
Expand All @@ -52,6 +51,6 @@ export class CheServerRemoteApiImpl {
}

getCheApiURI(): string {
return this.baseAPIUrl;
return this.baseAPIUrl!;
AndrienkoAleksandr marked this conversation as resolved.
Show resolved Hide resolved
}
}