Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
dbf7b1c
init implementation
Oct 13, 2022
59cb9f9
fix tests
Oct 14, 2022
1b7dddc
certs initial
Oct 16, 2022
235dbb8
#RI-3682 create database module initial
Oct 18, 2022
f759b20
#RI-3682 fixes for ITests
Oct 19, 2022
316b2fe
Merge branch 'feature/RI-3238/prepare_for_docker' into be/feature/RI-…
Oct 19, 2022
7e07960
Merge branch 'be/feature/RI-3651/create_settings_module' into be/feat…
Oct 19, 2022
95e1cff
Merge branch 'be/feature/RI-3652_ca_cert_module' into be/feature/RI-3…
Oct 19, 2022
ea71afe
#RI-3682 fixes for ITests
Oct 20, 2022
6d787a3
#RI-3682 moving functionality to redis sentinel module
Oct 24, 2022
e0a710e
fix ITests
Oct 26, 2022
f1109d9
run all ITests
Oct 26, 2022
a2f28b8
Merge pull request #1283 from RedisInsight/be/feature/RI-3651/create_…
Oct 26, 2022
f75e2fd
Merge pull request #1284 from RedisInsight/be/feature/RI-3652_ca_cert…
Oct 26, 2022
4c09404
add sent tls auth RTE + fix tests
Oct 27, 2022
1bea4d9
run all tests
Oct 27, 2022
0e6a736
fix sentinel tls client creation
Oct 27, 2022
0d31597
fix tlsAuth tests
Oct 27, 2022
f6c4c9d
Merge pull request #1294 from RedisInsight/be/feature/RI-3682_databas…
Oct 27, 2022
3f8db39
fix all ITests errors
Oct 27, 2022
b05739d
fix db index issue in ITests
Oct 27, 2022
b148855
fix cluster tests
Oct 27, 2022
00fd56a
increase redis version for oss-clu rte
Oct 27, 2022
7a950e5
Merge pull request #1338 from RedisInsight/be/feature/RI-3238/prepare…
Oct 27, 2022
dedca3f
Merge branch 'main' into feature/RI-3238/prepare_for_docker
Oct 27, 2022
287a0f6
fix new ITests added after merge last updates from main
Oct 27, 2022
ded02ab
encryption and analytics modules
Oct 28, 2022
72d8770
remove instance module
Oct 31, 2022
2e35434
redis module + autodiscovery module
Oct 31, 2022
d730939
create StackDatabaseRepository. Finally remove SharedModule + CoreMod…
Oct 31, 2022
42c45c8
add possibility to configure Certificate + Database modules
Oct 31, 2022
9daead9
add database entity migrations + expose db field in the list endpoint
Nov 3, 2022
b393a60
#RI-3711 - Prepare UI for docker
egor-zalenski Nov 3, 2022
2330355
#RI-3711 - Prepare UI for docker
egor-zalenski Nov 4, 2022
e5c9779
#RI-3711 - fix tests
egor-zalenski Nov 4, 2022
3006443
#RI-3711 - fix tests
egor-zalenski Nov 4, 2022
ebeba23
Merge pull request #1362 from RedisInsight/fe/feature/RI-3711_UI_prep…
egor-zalenski Nov 4, 2022
a1fa3c4
Merge branch 'main' into feature/RI-3238/prepare_for_docker
Nov 7, 2022
2b9001c
enable UI tests by default + fit ITests after merge
Nov 7, 2022
b858282
add test for virtualized browser page table
vlad-dargel Nov 7, 2022
5df813a
last checks for test
vlad-dargel Nov 7, 2022
864f098
merge main
vlad-dargel Nov 7, 2022
84f1781
Merge branch 'main' into e2e/feature/names-of-part-of-keys-are-invisi…
vlad-dargel Nov 7, 2022
8b23b03
Merge branch 'main' into feature/RI-3238/prepare_for_docker
Nov 8, 2022
56576b0
Merge branch 'main' into feature/RI-3238/prepare_for_docker
Nov 8, 2022
cbbe395
#RI-3706 fix 408 error and additional attempts to call endpoint by ch…
Nov 8, 2022
bab0e99
Merge branch 'main' into feature/RI-3238/prepare_for_docker
Nov 8, 2022
7be748f
Fix workbench models to expose required fields
Nov 8, 2022
9621020
Fix status code when adding sentinel databases
Nov 8, 2022
86ff1a5
Merge remote-tracking branch 'origin/feature/RI-3238/prepare_for_docker'
egor-zalenski Nov 8, 2022
2a31530
Merge pull request #1380 from RedisInsight/merg/main_to_docker_prepare
egor-zalenski Nov 8, 2022
1c76769
* #RI-3736 - Normalize commands in CLI and Workbench
egor-zalenski Nov 9, 2022
090c647
Fix ui unit test for prepare_docker branch
egor-zalenski Nov 9, 2022
f12e15b
Merge pull request #1384 from RedisInsight/fe/fixtests
egor-zalenski Nov 9, 2022
9e02853
#RI-3738 - Module name is Redijson for telemetry events
egor-zalenski Nov 10, 2022
ef0bf92
fix api tests
Nov 10, 2022
95cd4b5
#RI-3797 - set lastConnection time when create database
Nov 10, 2022
6ac9dee
Fix ITests
Nov 10, 2022
c5e906d
fix port data type sending in API endpoint
Nov 10, 2022
6ead300
Merge branch 'feature/RI-3238/prepare_for_docker' into e2e/bugfix/RI-…
Nov 10, 2022
1f14b6f
create Sentinel endpoint
Nov 10, 2022
68d357e
change getClusterNodesApi endpoint
Nov 10, 2022
f961ad5
Merge pull request #1390 from RedisInsight/e2e/bugfix/RI-3778_docker
AlenaSY Nov 14, 2022
7f1eb62
Merge pull request #1373 from RedisInsight/e2e/feature/names-of-part-…
vlad-dargel Nov 14, 2022
e25d3f3
*RI-3809 - BE bugfix. Command executionTime was not shown in the work…
Nov 14, 2022
a667d22
add UTests
Nov 14, 2022
b114147
* #RI-3606 - [FE][Docker] User cannot rename database
egor-zalenski Nov 14, 2022
f73da2e
Merge pull request #1395 from RedisInsight/feature/bugfix
egor-zalenski Nov 15, 2022
b592e4f
#RI-3808 - No Redis Stack icon on Edit screen
egor-zalenski Nov 15, 2022
20e02c2
Merge pull request #1397 from RedisInsight/feature/bugfix
egor-zalenski Nov 15, 2022
1e70a33
fix unit tests. some of tests/files were disabled
Nov 15, 2022
fb2219d
Merge pull request #1400 from RedisInsight/be/feature/RI-3238-UTests
Nov 15, 2022
315ea06
Merge pull request #1383 from RedisInsight/be/feature/RI-3736_Normali…
AlenaSY Nov 15, 2022
dea67ac
#RI-3798 - Last connected DB is highlighted after turning back to Lis…
egor-zalenski Nov 15, 2022
ab61a48
Merge pull request #1401 from RedisInsight/feature/bugfix
egor-zalenski Nov 16, 2022
b10cf13
#RI-3828 - Connection page in Redis Stack has no DB info
egor-zalenski Nov 16, 2022
d702ced
Merge pull request #1404 from RedisInsight/fe/bugfix/RI-3828_RediStac…
egor-zalenski Nov 16, 2022
9433f14
Utests final
Nov 16, 2022
1100f46
add cloneDeep for redis.connectToInstance method to not mutate object…
Nov 16, 2022
9a648db
rollback circle config for tests
Nov 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ aliases:
- oss-clu # OSS Cluster
- oss-clu-tls # OSS Cluster with TLS enabled
- oss-sent # OSS Sentinel
- oss-sent-tls-auth # OSS Sentinel with TLS auth
- re-st # Redis Enterprise with Standalone inside
- re-clu # Redis Enterprise with Cluster inside
- re-crdt # Redis Enterprise with active-active database inside
Expand All @@ -99,6 +100,7 @@ aliases:
- oss-st-6-tls-auth # OSS Standalone v6 with TLS auth required
- oss-clu-tls # OSS Cluster with TLS enabled
- re-crdt # Redis Enterprise with active-active database inside
- oss-sent-tls-auth # OSS Sentinel with TLS auth
guides-filter: &guidesFilter
filters:
branches:
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/api/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default {
|| 'https://raw.githubusercontent.com/RediSearch/RediSearch/master/commands.json',
},
{
name: 'redijson',
name: 'redisjson',
url: process.env.COMMANDS_REDIJSON_URL
|| 'https://raw.githubusercontent.com/RedisJSON/RedisJSON/master/commands.json',
},
Expand Down
14 changes: 7 additions & 7 deletions redisinsight/api/config/ormconfig.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { AgreementsEntity } from 'src/modules/core/models/agreements.entity';
import { CaCertificateEntity } from 'src/modules/core/models/ca-certificate.entity';
import { ClientCertificateEntity } from 'src/modules/core/models/client-certificate.entity';
import { DatabaseInstanceEntity } from 'src/modules/core/models/database-instance.entity';
import { ServerEntity } from 'src/modules/core/models/server.entity';
import { SettingsEntity } from 'src/modules/core/models/settings.entity';
import { ServerEntity } from 'src/modules/server/entities/server.entity';
import { CommandExecutionEntity } from 'src/modules/workbench/entities/command-execution.entity';
import { PluginStateEntity } from 'src/modules/workbench/entities/plugin-state.entity';
import { NotificationEntity } from 'src/modules/notification/entities/notification.entity';
import { DatabaseAnalysisEntity } from 'src/modules/database-analysis/entities/database-analysis.entity';
import { DataSource } from 'typeorm';
import { AgreementsEntity } from 'src/modules/settings/entities/agreements.entity';
import { SettingsEntity } from 'src/modules/settings/entities/settings.entity';
import { CaCertificateEntity } from 'src/modules/certificate/entities/ca-certificate.entity';
import { ClientCertificateEntity } from 'src/modules/certificate/entities/client-certificate.entity';
import { DatabaseEntity } from 'src/modules/database/entities/database.entity';
import migrations from '../migration';
import * as config from '../src/utils/config';

Expand All @@ -24,7 +24,7 @@ const ormConfig = {
AgreementsEntity,
CaCertificateEntity,
ClientCertificateEntity,
DatabaseInstanceEntity,
DatabaseEntity,
ServerEntity,
SettingsEntity,
CommandExecutionEntity,
Expand Down
10 changes: 4 additions & 6 deletions redisinsight/api/config/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ export default {
server: {
excludeRoutes: [
'redis-enterprise/*',
'instance/redis-enterprise-dbs',
'instance/redis-cloud-dbs',
'instance/sentinel-masters',
{ path: 'instance', method: RequestMethod.POST },
{ path: 'instance', method: RequestMethod.DELETE },
{ path: 'instance/:id', method: RequestMethod.DELETE },
'redis-sentinel/*',
{ path: 'databases', method: RequestMethod.POST },
{ path: 'databases', method: RequestMethod.DELETE },
{ path: 'databases/:id', method: RequestMethod.DELETE },
],
},
};
20 changes: 20 additions & 0 deletions redisinsight/api/migration/1667477693934-database.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class database1667477693934 implements MigrationInterface {
name = 'database1667477693934'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "temporary_database_instance" ("id" varchar PRIMARY KEY NOT NULL, "host" varchar NOT NULL, "port" integer NOT NULL, "name" varchar NOT NULL, "username" varchar, "password" varchar, "tls" boolean, "verifyServerCert" boolean, "lastConnection" datetime, "caCertId" varchar, "clientCertId" varchar, "connectionType" varchar NOT NULL DEFAULT ('STANDALONE'), "nodes" varchar DEFAULT ('[]'), "nameFromProvider" varchar, "sentinelMasterName" varchar, "sentinelMasterUsername" varchar, "sentinelMasterPassword" varchar, "provider" varchar DEFAULT ('UNKNOWN'), "modules" varchar NOT NULL DEFAULT ('[]'), "db" integer, "encryption" varchar, "tlsServername" varchar, CONSTRAINT "FK_d1bc747b5938e22b4b708d8e9a5" FOREIGN KEY ("caCertId") REFERENCES "ca_certificate" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_3b9b625266c00feb2d66a9f36e4" FOREIGN KEY ("clientCertId") REFERENCES "client_certificate" ("id") ON DELETE SET NULL ON UPDATE NO ACTION)`);
await queryRunner.query(`INSERT INTO "temporary_database_instance"("id", "host", "port", "name", "username", "password", "tls", "verifyServerCert", "lastConnection", "caCertId", "clientCertId", "connectionType", "nodes", "nameFromProvider", "sentinelMasterName", "sentinelMasterUsername", "sentinelMasterPassword", "provider", "modules", "db", "encryption", "tlsServername") SELECT "id", "host", "port", "name", "username", "password", "tls", "verifyServerCert", "lastConnection", "caCertId", "clientCertId", "connectionType", "nodes", "nameFromProvider", "sentinelMasterName", "sentinelMasterUsername", "sentinelMasterPassword", "provider", "modules", "db", "encryption", "tlsServername" FROM "database_instance"`);
await queryRunner.query(`DROP TABLE "database_instance"`);
await queryRunner.query(`ALTER TABLE "temporary_database_instance" RENAME TO "database_instance"`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "database_instance" RENAME TO "temporary_database_instance"`);
await queryRunner.query(`CREATE TABLE "database_instance" ("id" varchar PRIMARY KEY NOT NULL, "host" varchar NOT NULL, "port" integer NOT NULL, "name" varchar NOT NULL, "username" varchar, "password" varchar, "tls" boolean NOT NULL, "verifyServerCert" boolean NOT NULL, "lastConnection" datetime, "caCertId" varchar, "clientCertId" varchar, "connectionType" varchar NOT NULL DEFAULT ('STANDALONE'), "nodes" varchar, "nameFromProvider" varchar, "sentinelMasterName" varchar, "sentinelMasterUsername" varchar, "sentinelMasterPassword" varchar, "provider" varchar DEFAULT ('UNKNOWN'), "modules" varchar NOT NULL DEFAULT ('[]'), "db" integer, "encryption" varchar, "tlsServername" varchar, CONSTRAINT "FK_d1bc747b5938e22b4b708d8e9a5" FOREIGN KEY ("caCertId") REFERENCES "ca_certificate" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_3b9b625266c00feb2d66a9f36e4" FOREIGN KEY ("clientCertId") REFERENCES "client_certificate" ("id") ON DELETE SET NULL ON UPDATE NO ACTION)`);
await queryRunner.query(`INSERT INTO "database_instance"("id", "host", "port", "name", "username", "password", "tls", "verifyServerCert", "lastConnection", "caCertId", "clientCertId", "connectionType", "nodes", "nameFromProvider", "sentinelMasterName", "sentinelMasterUsername", "sentinelMasterPassword", "provider", "modules", "db", "encryption", "tlsServername") SELECT "id", "host", "port", "name", "username", "password", "tls", "verifyServerCert", "lastConnection", "caCertId", "clientCertId", "connectionType", "nodes", "nameFromProvider", "sentinelMasterName", "sentinelMasterUsername", "sentinelMasterPassword", "provider", "modules", "db", "encryption", "tlsServername" FROM "temporary_database_instance"`);
await queryRunner.query(`DROP TABLE "temporary_database_instance"`);
}

}
2 changes: 2 additions & 0 deletions redisinsight/api/migration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { workbenchGroupMode1663093411715 } from './1663093411715-workbench-group
import { databaseAnalysis1664785208236 } from './1664785208236-database-analysis';
import { databaseAnalysisExpirationGroups1664886479051 } from './1664886479051-database-analysis-expiration-groups';
import { workbenchExecutionTime1667368983699 } from './1667368983699-workbench-execution-time';
import { database1667477693934 } from './1667477693934-database';

export default [
initialMigration1614164490968,
Expand All @@ -44,4 +45,5 @@ export default [
databaseAnalysis1664785208236,
databaseAnalysisExpirationGroups1664886479051,
workbenchExecutionTime1667368983699,
database1667477693934,
];
119 changes: 76 additions & 43 deletions redisinsight/api/src/__mocks__/app-settings.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,76 @@
import { IAgreement } from 'src/models';
import {
AgreementsEntity,
IAgreementsJSON,
} from 'src/modules/core/models/agreements.entity';
import {
ISettingsJSON,
SettingsEntity,
} from 'src/modules/core/models/settings.entity';

export const mockAppAgreement: IAgreement = {
defaultValue: false,
required: true,
since: '1.0.0',
disabled: false,
displayInSetting: false,
editable: false,
title: 'License Terms',
label: 'I have read and understood the License Terms',
};

export const mockAgreementsJSON = {
version: null,
};

export const mockAgreementsEntity: AgreementsEntity = {
id: 1,
version: null,
data: null,
toJSON: (): IAgreementsJSON => mockAgreementsJSON,
};

export const mockSettingsJSON: ISettingsJSON = {
theme: null,
scanThreshold: null,
batchSize: null,
};

export const mockSettingsEntity: SettingsEntity = {
id: 1,
data: null,
toJSON: (): ISettingsJSON => mockSettingsJSON,
};
import { Settings } from 'src/modules/settings/models/settings';
import { Agreements } from 'src/modules/settings/models/agreements';
import { mockUserId } from 'src/__mocks__/user';
import { GetAppSettingsResponse } from 'src/modules/settings/dto/settings.dto';
import { AgreementsEntity } from 'src/modules/settings/entities/agreements.entity';
import { SettingsEntity } from 'src/modules/settings/entities/settings.entity';

export const mockSettings = Object.assign(new Settings(), {
id: mockUserId,
data: {
theme: 'DARK',
scanThreshold: 500,
batchSize: 10,
},
});

export const mockSettingsEntity = Object.assign(new SettingsEntity(), {
id: mockSettings.id,
data: JSON.stringify(mockSettings.data),
});

export const mockAgreements = Object.assign(new Agreements(), {
id: mockUserId,
version: '1.0.0',
data: {
eula: true,
analytics: true,
encryption: true,
notifications: true,
},
});

export const mockAgreementsEntity = Object.assign(new AgreementsEntity(), {
id: mockAgreements.id,
version: mockAgreements.version,
data: JSON.stringify(mockAgreements.data),
});

export const mockAppSettings = Object.assign(new GetAppSettingsResponse(), {
...mockSettings.data,
agreements: {
version: mockAgreements.version,
...mockAgreements.data,
},
});

export const mockAppSettingsWithoutPermissions = Object.assign(new GetAppSettingsResponse(), {
...mockSettings.data,
agreements: {
version: mockAgreements.version,
eula: false,
analytics: false,
encryption: false,
notifications: false,
},
});

export const mockAppSettingsInitial = Object.assign(new GetAppSettingsResponse(), {
agreements: null,
});

export const mockAgreementsRepository = jest.fn(() => ({
getOrCreate: jest.fn(),
update: jest.fn(),
}));

export const mockSettingsRepository = jest.fn(() => ({
getOrCreate: jest.fn(),
update: jest.fn(),
}));

export const mockSettingsService = jest.fn(() => ({
getAppSettings: jest.fn(),
updateAppSettings: jest.fn(),
getAgreementsSpec: jest.fn(),
}));
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
getTCPEndpoints,
} from 'src/utils/auto-discovery-helper';

const winNetstat = ''
export const mockWinNetstat = ''
+ 'Proto Local Address Foreign Address State PID\n'
+ 'TCP 0.0.0.0:5000 0.0.0.0:0 LISTENING 13728\n'
+ 'TCP 0.0.0.0:6379 0.0.0.0:0 LISTENING 13728\n'
Expand All @@ -15,7 +11,7 @@ const winNetstat = ''
+ 'TCP [::]:5000 [::]:0 LISTENING 6056\n'
+ 'TCP *:* LISTENING 6056';

const linuxNetstat = ''
export const mockLinuxNetstat = ''
+ 'Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name \n'
+ 'tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN - \n'
+ 'tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN - \n'
Expand All @@ -30,7 +26,7 @@ const linuxNetstat = ''
+ 'tcp6 0 0 ::1:6379 :::* LISTEN - \n';

/* eslint-disable max-len */
const macNetstat = ''
export const mockMacNetstat = ''
+ 'Proto Recv-Q Send-Q Local Address Foreign Address (state) rhiwat shiwat pid epid state options\n'
+ 'tcp4 0 0 10.55.1.235.5000 10.55.1.235.52217 FIN_WAIT_2 407280 146988 30555 0 0x2131 0x00000104\n'
+ 'tcp4 0 0 10.55.1.235.6379 10.55.1.235.5001 CLOSE_WAIT 407682 146988 872 0 0x0122 0x00000008\n'
Expand All @@ -40,54 +36,7 @@ const macNetstat = ''
+ 'tcp6 0 0 ::1.52167 ::1.5002 ESTABLISHED 406172 146808 31200 0 0x0102 0x00000008\n';
/* eslint-enable max-len */

const getTCPEndpointsTests = [
{
name: 'win output',
input: winNetstat.split('\n'),
output: [
{ host: 'localhost', port: 5000 },
{ host: 'localhost', port: 6379 },
{ host: 'localhost', port: 6380 },
{ host: 'localhost', port: 135 },
{ host: 'localhost', port: 445 },
{ host: 'localhost', port: 808 },
{ host: 'localhost', port: 2701 },
],
},
{
name: 'linux output',
input: linuxNetstat.split('\n'),
output: [
{ host: 'localhost', port: 5000 },
{ host: 'localhost', port: 6379 },
{ host: 'localhost', port: 6380 },
{ host: 'localhost', port: 28100 },
{ host: 'localhost', port: 8100 },
{ host: 'localhost', port: 8101 },
{ host: 'localhost', port: 8102 },
{ host: 'localhost', port: 8103 },
{ host: 'localhost', port: 8200 },
],
},
{
name: 'mac output',
input: macNetstat.split('\n'),
output: [
{ host: 'localhost', port: 5000 },
{ host: 'localhost', port: 6379 },
{ host: 'localhost', port: 6380 },
{ host: 'localhost', port: 5002 },
{ host: 'localhost', port: 52167 },
],
},
];

describe('getTCP4Endpoints', () => {
getTCPEndpointsTests.forEach((test) => {
it(`Should return endpoints to test ${test.name}`, async () => {
const result = getTCPEndpoints(test.input);

expect(result).toEqual(test.output);
});
});
});
export const mockAutodiscoveryEndpoint = {
host: '127.0.0.1',
port: 6379,
};
Loading