Skip to content

Commit

Permalink
[Fleet] Do not provide instruction to setup an http Fleet server
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Apr 4, 2022
1 parent e1c25c9 commit 3a78ba1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import { PlatformSelector } from '../../../../../../components/enrollment_instru
import type { CommandsByPlatform } from './install_command_utils';
import { getInstallCommandForPlatform } from './install_command_utils';

const URL_REGEX = /^(https?):\/\/[^\s$.?#].[^\s]*$/gm;
const URL_REGEX = /^(https):\/\/[^\s$.?#].[^\s]*$/gm;
const REFRESH_INTERVAL = 10000;

type DeploymentMode = 'production' | 'quickstart';
Expand Down Expand Up @@ -379,7 +379,7 @@ export const AddFleetServerHostStepContent = ({
} else {
setError(
i18n.translate('xpack.fleet.fleetServerSetup.addFleetServerHostInvalidUrlError', {
defaultMessage: 'Invalid URL',
defaultMessage: 'Invalid URL (should use https)',
})
);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.linux).toMatchInlineSnapshot(`
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -26,8 +25,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.mac).toMatchInlineSnapshot(`
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -37,8 +35,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.windows).toMatchInlineSnapshot(`
".\\\\elastic-agent.exe install \`
--fleet-server-es=http://elasticsearch:9200 \`
--fleet-server-service-token=service-token-1 \`
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -48,8 +45,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.rpm).toMatchInlineSnapshot(`
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -59,8 +55,7 @@ describe('getInstallCommandForPlatform', () => {
expect(res.deb).toMatchInlineSnapshot(`
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-insecure-http"
--fleet-server-service-token=service-token-1"
`);
});

Expand All @@ -78,8 +73,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-es-ca-trusted-fingerprint=fingerprint123456 \\\\
--fleet-server-insecure-http"
--fleet-server-es-ca-trusted-fingerprint=fingerprint123456"
`);
});
});
Expand All @@ -96,8 +90,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -112,8 +105,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo ./elastic-agent install \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -128,8 +120,7 @@ describe('getInstallCommandForPlatform', () => {
".\\\\elastic-agent.exe install \`
--fleet-server-es=http://elasticsearch:9200 \`
--fleet-server-service-token=service-token-1 \`
--fleet-server-policy=policy-1 \`
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -144,8 +135,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});

Expand All @@ -160,8 +150,7 @@ describe('getInstallCommandForPlatform', () => {
"sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-insecure-http"
--fleet-server-policy=policy-1"
`);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export function getInstallCommandForPlatform(
}
commandArguments.push(['fleet-server-cert', '<PATH_TO_FLEET_SERVER_CERT>']);
commandArguments.push(['fleet-server-cert-key', '<PATH_TO_FLEET_SERVER_CERT_KEY>']);
} else {
commandArguments.push(['fleet-server-insecure-http']);
}

const commandArgumentsStr = (platform?: string) => {
Expand Down

0 comments on commit 3a78ba1

Please sign in to comment.