Skip to content
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
26 changes: 0 additions & 26 deletions DOCKER_README.md

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ RUN mkdir -p /data && chown -R node:node /data
COPY --chown=node:node ./docker-entry.sh ./
RUN chmod +x docker-entry.sh

# since RI is hard-code to port 5000, expose it from the container
EXPOSE 5000
# since RI is hard-code to port 5540, expose it from the container
EXPOSE 5540

# don't run the node process as root
USER node
Expand Down
2 changes: 1 addition & 1 deletion api.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ RUN chmod +x api-docker-entry.sh
ENTRYPOINT ["./api-docker-entry.sh"]
CMD ["node", "dist/src/main"]

EXPOSE 5000
EXPOSE 5540

2 changes: 1 addition & 1 deletion configs/webpack.config.web.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const configuration: webpack.Configuration = {
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
RI_APP_TYPE: 'web',
RI_APP_PORT: '5000',
RI_APP_PORT: '5540',
RI_BASE_API_URL: '',
RI_API_PREFIX: 'api',
RI_SCAN_COUNT_DEFAULT: '500',
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 @@ -42,7 +42,7 @@ export default {
version,
env: process.env.NODE_ENV || 'development',
host: process.env.RI_APP_HOST ?? '0.0.0.0',
port: parseInt(process.env.RI_APP_PORT, 10) || 5000,
port: parseInt(process.env.RI_APP_PORT, 10) || 5540,
docPrefix: 'api/docs',
globalPrefix: 'api',
customPluginsUri: '/plugins',
Expand Down
19 changes: 19 additions & 0 deletions redisinsight/api/src/modules/server/health.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
Controller,
Get,
} from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { ApiEndpoint } from 'src/decorators/api-endpoint.decorator';

@ApiTags('Info')
@Controller('health')
export class HealthController {
@Get('')
@ApiEndpoint({
description: 'Get server info',
statusCode: 200,
})
async health(): Promise<object> {
return { status: 'up' };
}
}
6 changes: 5 additions & 1 deletion redisinsight/api/src/modules/server/server.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ServerService } from 'src/modules/server/server.service';
import { ServerRepository } from 'src/modules/server/repositories/server.repository';
import { LocalServerRepository } from 'src/modules/server/repositories/local.server.repository';
import { FeatureModule } from 'src/modules/feature/feature.module';
import { HealthController } from 'src/modules/server/health.controller';

@Module({})
export class ServerModule {
Expand All @@ -12,7 +13,10 @@ export class ServerModule {
) {
return {
module: ServerModule,
controllers: [ServerController],
controllers: [
ServerController,
HealthController,
],
providers: [
ServerService,
{
Expand Down
30 changes: 30 additions & 0 deletions redisinsight/api/test/api/info/GET-health.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {
expect,
describe,
deps,
Joi,
getMainCheckFn
} from '../deps';
const { server, request } = deps;

// endpoint to test
const endpoint = () => request(server).get('/health');

const responseSchema = Joi.object().keys({
status: Joi.string().required(),
}).required();

const mainCheckFn = getMainCheckFn(endpoint);

describe('GET /health', () => {
[
{
name: 'Should return server health',
statusCode: 200,
responseSchema,
checkFn: ({ body }) => {
expect(body.status).to.eql('up');
}
},
].map(mainCheckFn);
});
4 changes: 2 additions & 2 deletions tests/e2e/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COMMON_URL=https://app:5000
API_URL=https://app:5000/api
COMMON_URL=https://app:5540
API_URL=https://app:5540/api
OSS_SENTINEL_PASSWORD=password
RI_NOTIFICATION_UPDATE_URL=https://s3.amazonaws.com/redisinsight.test/public/tests/e2e/notifications.json
RI_NOTIFICATION_SYNC_INTERVAL=30000
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/helpers/conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Chance } from 'chance';
const chance = new Chance();

// Urls for using in the tests
export const commonUrl = process.env.COMMON_URL || 'https://localhost:5000';
export const apiUrl = process.env.API_URL || 'https://localhost:5000/api';
export const commonUrl = process.env.COMMON_URL || 'https://localhost:5540';
export const apiUrl = process.env.API_URL || 'https://localhost:5540/api';

export const workingDirectory = process.env.RI_APP_FOLDER_ABSOLUTE_PATH
|| (joinPath(os.homedir(), process.env.RI_APP_FOLDER_NAME || '.redisinsight-app'));
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/local.web.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ services:
- ./.env
environment:
TEST_FILES: $TEST_FILES
COMMON_URL: 'http://app:5000'
API_URL: 'http://app:5000/api'
COMMON_URL: 'http://app:5540'
API_URL: 'http://app:5540/api'
E2E_CLOUD_DATABASE_HOST: $E2E_CLOUD_DATABASE_HOST
E2E_CLOUD_DATABASE_PORT: $E2E_CLOUD_DATABASE_PORT
E2E_CLOUD_DATABASE_PASSWORD: $E2E_CLOUD_DATABASE_PASSWORD
Expand Down Expand Up @@ -54,4 +54,4 @@ services:
- ./test-data/certs:/root/certs
- ./test-data/ssh:/root/ssh
ports:
- 5000:5000
- 5540:5540