Skip to content

Commit 8f5dfb8

Browse files
committed
Merge branch 'main' into be/feature/RI-5188-add-additional-build-type
2 parents c42b324 + 996a325 commit 8f5dfb8

File tree

21 files changed

+346
-268
lines changed

21 files changed

+346
-268
lines changed

.circleci/build/build.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.18-alpine
1+
FROM node:20.14-alpine
22

33
# runtime args and environment variables
44
ARG DIST=Redis-Insight.tar.gz

.circleci/config.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ aliases:
176176

177177
orbs:
178178
win: circleci/[email protected]
179-
node: circleci/node@5.0.2
179+
node: circleci/node@5.2.0
180180
aws: circleci/[email protected]
181181

182182
executors:
@@ -189,7 +189,7 @@ executors:
189189
docker_layer_caching: true
190190
docker-node:
191191
docker:
192-
- image: cimg/node:18.15.0
192+
- image: cimg/node:20.15
193193
docker:
194194
docker:
195195
- image: cibuilds/docker:19.03.5
@@ -387,7 +387,8 @@ jobs:
387387
steps:
388388
- checkout
389389
- node/install:
390-
node-version: '18.15.0'
390+
install-yarn: true
391+
node-version: '20.15'
391392
- attach_workspace:
392393
at: .
393394
- run: sudo apt-get install net-tools
@@ -443,8 +444,8 @@ jobs:
443444
at: .
444445
- run:
445446
command: |
446-
nvm install 18.15.0
447-
nvm use 18.15.0
447+
nvm install 20.15
448+
nvm use 20.15
448449
npm install --global yarn
449450
- run:
450451
command: |
@@ -614,7 +615,8 @@ jobs:
614615
steps:
615616
- checkout
616617
- node/install:
617-
node-version: '18.15.0'
618+
install-yarn: true
619+
node-version: '20.15'
618620
- attach_workspace:
619621
at: .
620622
- run:
@@ -675,7 +677,7 @@ jobs:
675677
- release/*-linux.yml
676678
macosx:
677679
executor: macos
678-
resource_class: macos.x86.medium.gen2
680+
resource_class: macos.m1.medium.gen1
679681
parameters:
680682
env:
681683
description: Build environment (stage || prod)
@@ -693,7 +695,7 @@ jobs:
693695
steps:
694696
- checkout
695697
- node/install:
696-
node-version: '18.15.0'
698+
node-version: '20.15'
697699
- attach_workspace:
698700
at: .
699701
- run:
@@ -792,8 +794,8 @@ jobs:
792794
- run:
793795
name: Build windows exe
794796
command: |
795-
nvm install 18.15.0
796-
nvm use 18.15.0
797+
nvm install 20.15
798+
nvm use 20.15
797799
npm install --global yarn
798800
799801
# set ALL_REDIS_COMMANDS=$(curl $ALL_REDIS_COMMANDS_RAW_URL)
@@ -884,7 +886,8 @@ jobs:
884886
steps:
885887
- checkout
886888
- node/install:
887-
node-version: '18.15.0'
889+
install-yarn: true
890+
node-version: '20.15'
888891
- run:
889892
name: Install dependencies
890893
command: |

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# the best way to minimize the number of node_module restores and build steps
77
# while still keeping the final image small.
88

9-
FROM node:18.18-alpine as build
9+
FROM node:20.14-alpine as build
1010

1111
# update apk repository and install build dependencies
1212
RUN apk update && apk add --no-cache --virtual .gyp \
@@ -39,7 +39,7 @@ RUN yarn --cwd ./redisinsight/api install --production
3939
COPY ./redisinsight/api/.yarnclean.prod ./redisinsight/api/.yarnclean
4040
RUN yarn --cwd ./redisinsight/api autoclean --force
4141

42-
FROM node:18.18-alpine
42+
FROM 20.14-alpine
4343

4444
# runtime args and environment variables
4545
ARG NODE_ENV=production

api.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.15.0-alpine as build
1+
FROM node:20.14-alpine as build
22

33
RUN apk update && apk add bash libsecret dbus-x11 gnome-keyring
44
RUN dbus-uuidgen > /var/lib/dbus/machine-id
@@ -19,7 +19,7 @@ RUN yarn install --production
1919
RUN cp .yarnclean.prod .yarnclean && yarn autoclean --force
2020

2121
# Production image
22-
FROM node:18.15.0-alpine as production
22+
FROM node:20.14-alpine as production
2323

2424
RUN apk update && apk add bash libsecret dbus-x11 gnome-keyring
2525
RUN dbus-uuidgen > /var/lib/dbus/machine-id

electron-builder.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"node_modules",
88
"package.json"
99
],
10-
"afterSign": "electron-builder-notarize",
1110
"artifactName": "Redis-Insight-${os}-${arch}.${ext}",
1211
"compression": "normal",
1312
"asarUnpack": [
@@ -32,6 +31,9 @@
3231
"arch": ["x64", "arm64"]
3332
}
3433
],
34+
"notarize": {
35+
"teamId": "UUK47G4BAZ"
36+
},
3537
"type": "distribution",
3638
"hardenedRuntime": true,
3739
"darkModeSupport": true,
@@ -55,9 +57,7 @@
5557
"Contents/Resources/app-arm64.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-arm64/node_sqlite3.node",
5658
"Contents/Resources/app-arm64.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-x64/node_sqlite3.node",
5759
"Contents/Resources/app-arm64.asar.unpacked/node_modules/keytar/build/Release/keytar.node",
58-
"Contents/Resources/app-x64.asar.unpacked/node_modules/keytar/build/Release/keytar.node",
59-
"Contents/Resources/app-arm64.asar.unpacked/node_modules/cpu-features/build/Release/cpufeatures.node",
60-
"Contents/Resources/app-x64.asar.unpacked/node_modules/cpu-features/build/Release/cpufeatures.node"
60+
"Contents/Resources/app-x64.asar.unpacked/node_modules/keytar/build/Release/keytar.node"
6161
],
6262
"artifactName": "Redis-Insight-${os}-${arch}-mas.${ext}"
6363
},
@@ -75,9 +75,7 @@
7575
"Contents/Resources/app-arm64.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-arm64/node_sqlite3.node",
7676
"Contents/Resources/app-arm64.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-x64/node_sqlite3.node",
7777
"Contents/Resources/app-arm64.asar.unpacked/node_modules/keytar/build/Release/keytar.node",
78-
"Contents/Resources/app-x64.asar.unpacked/node_modules/keytar/build/Release/keytar.node",
79-
"Contents/Resources/app-arm64.asar.unpacked/node_modules/cpu-features/build/Release/cpufeatures.node",
80-
"Contents/Resources/app-x64.asar.unpacked/node_modules/cpu-features/build/Release/cpufeatures.node"
78+
"Contents/Resources/app-x64.asar.unpacked/node_modules/keytar/build/Release/keytar.node"
8179
],
8280
"artifactName": "Redis-Insight-${os}-${arch}-masDev.${ext}"
8381
},

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"resolutions": {
8181
"**/trim": "0.0.3",
8282
"word-wrap": "1.2.4",
83-
"electron-builder/app-builder-lib/@electron/universal/dir-compare/minimatch": "^3.0.5",
8483
"**/semver": "^7.5.2",
8584
"rawproto/protobufjs": "^7.2.5"
8685
},
@@ -140,9 +139,9 @@
140139
"css-minimizer-webpack-plugin": "^6.0.0",
141140
"csv-parser": "^3.0.0",
142141
"csv-stringify": "^6.4.0",
143-
"electron": "25.8.4",
144-
"electron-builder": "^23.6.0",
145-
"electron-builder-notarize": "^1.5.1",
142+
"electron": "31.0.2",
143+
"electron-builder": "^24.13.3",
144+
"electron-builder-notarize": "^1.5.2",
146145
"electron-debug": "^3.2.0",
147146
"electron-devtools-installer": "^3.2.0",
148147
"esbuild-plugin-react-virtualized": "^1.0.4",

redisinsight/api/src/app.module.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
import { ServeStaticModule } from '@nestjs/serve-static';
66
import { RouterModule } from '@nestjs/core';
77
import { join } from 'path';
8+
import { Response } from 'express';
89
import config, { Config } from 'src/utils/config';
910
import { PluginModule } from 'src/modules/plugin/plugin.module';
1011
import { CommandsModule } from 'src/modules/commands/commands.module';
@@ -33,11 +34,16 @@ import { CliModule } from './modules/cli/cli.module';
3334
import { StaticsManagementModule } from './modules/statics-management/statics-management.module';
3435
import { ExcludeRouteMiddleware } from './middleware/exclude-route.middleware';
3536
import SubpathProxyMiddleware from './middleware/subpath-proxy.middleware';
37+
import XFrameOptionsMiddleware from './middleware/x-frame-options.middleware';
3638
import { routes } from './app.routes';
3739

3840
const SERVER_CONFIG = config.get('server') as Config['server'];
3941
const PATH_CONFIG = config.get('dir_path') as Config['dir_path'];
4042

43+
const setXFrameOptionsHeader = (res: Response) => {
44+
res.setHeader('X-Frame-Options', 'SAMEORIGIN');
45+
};
46+
4147
@Module({
4248
imports: [
4349
LocalDatabaseModule,
@@ -73,6 +79,7 @@ const PATH_CONFIG = config.get('dir_path') as Config['dir_path'];
7379
serveRoot: SERVER_CONFIG.proxyPath ? `/${SERVER_CONFIG.proxyPath}` : '',
7480
serveStaticOptions: {
7581
index: false,
82+
setHeaders: setXFrameOptionsHeader,
7683
},
7784
}),
7885
]
@@ -83,6 +90,7 @@ const PATH_CONFIG = config.get('dir_path') as Config['dir_path'];
8390
exclude: ['/api/**'],
8491
serveStaticOptions: {
8592
fallthrough: false,
93+
setHeaders: setXFrameOptionsHeader,
8694
},
8795
}),
8896
ServeStaticModule.forRoot({
@@ -91,6 +99,7 @@ const PATH_CONFIG = config.get('dir_path') as Config['dir_path'];
9199
exclude: ['/api/**'],
92100
serveStaticOptions: {
93101
fallthrough: false,
102+
setHeaders: setXFrameOptionsHeader,
94103
},
95104
}),
96105
StaticsManagementModule,
@@ -115,7 +124,7 @@ export class AppModule implements OnModuleInit, NestModule {
115124

116125
configure(consumer: MiddlewareConsumer) {
117126
consumer
118-
.apply(SubpathProxyMiddleware)
127+
.apply(SubpathProxyMiddleware, XFrameOptionsMiddleware)
119128
.forRoutes('*');
120129

121130
consumer
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NestMiddleware, Injectable } from '@nestjs/common';
2+
import { Request, Response, NextFunction } from 'express';
3+
4+
@Injectable()
5+
export default class XFrameOptionsMiddleware implements NestMiddleware {
6+
use(req: Request, res: Response, next: NextFunction) {
7+
res.setHeader('X-Frame-Options', 'SAMEORIGIN');
8+
next();
9+
}
10+
}

redisinsight/api/src/modules/cluster-monitor/strategies/cluster-shards.info.strategy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export class ClusterShardsInfoStrategy extends AbstractInfoStrategy {
3535
const node = {
3636
id: nodeObj.id,
3737
host: nodeObj.ip,
38-
port: nodeObj.port,
38+
port: nodeObj.port || nodeObj.get('tls-port'),
39+
tlsPort: nodeObj.get('tls-port'),
3940
role: nodeObj.role === 'master' ? NodeRole.Primary : NodeRole.Replica,
4041
health: nodeObj.health,
4142
};

redisinsight/api/src/modules/redis/client/redis.client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface IRedisClientOptions {
3131
port?: number,
3232
natHost?: string,
3333
natPort?: number,
34+
tlsPort?: number,
3435
connectTimeout?: number,
3536
}
3637

0 commit comments

Comments
 (0)