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
4 changes: 2 additions & 2 deletions redisinsight/api/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ export default {
},
tutorials: {
updateUrl: process.env.RI_TUTORIALS_UPDATE_URL
|| 'https://github.com/RedisInsight/Tutorials/releases/download/2.x.x',
|| 'https://github.com/RedisInsight/Tutorials/releases/download/2.42',
zip: process.env.RI_TUTORIALS_ZIP || dataZipFileName,
buildInfo: process.env.RI_TUTORIALS_INFO || buildInfoFileName,
devMode: !!process.env.RI_TUTORIALS_PATH,
},
content: {
updateUrl: process.env.RI_CONTENT_UPDATE_URL
|| 'https://github.com/RedisInsight/Statics/releases/download/latest',
|| 'https://github.com/RedisInsight/Statics/releases/download/2.42',
zip: process.env.RI_CONTENT_ZIP || dataZipFileName,
buildInfo: process.env.RI_CONTENT_INFO || buildInfoFileName,
devMode: !!process.env.RI_CONTENT_PATH,
Expand Down
1 change: 1 addition & 0 deletions redisinsight/api/config/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
customPlugins: join(homedir, 'plugins'),
customTutorials: join(homedir, 'custom-tutorials'),
commands: join(homedir, 'commands'),
guides: process.env.RI_GUIDES_PATH || join(homedir, 'guides'),
tutorials: process.env.RI_TUTORIALS_PATH || join(homedir, 'tutorials'),
content: process.env.RI_CONTENT_PATH || join(homedir, 'content'),
caCertificates: join(homedir, 'ca_certificates'),
Expand Down
1 change: 1 addition & 0 deletions redisinsight/api/config/staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
customPlugins: join(homedir, 'plugins'),
customTutorials: join(homedir, 'custom-tutorials'),
commands: join(homedir, 'commands'),
guides: process.env.RI_GUIDES_PATH || join(homedir, 'guides'),
tutorials: process.env.RI_TUTORIALS_PATH || join(homedir, 'tutorials'),
content: process.env.RI_CONTENT_PATH || join(homedir, 'content'),
caCertificates: join(homedir, 'ca_certificates'),
Expand Down
13 changes: 13 additions & 0 deletions redisinsight/api/src/init-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,16 @@ export const migrateHomeFolder = async () => {
// continue initialization even without migration
}
};

/**
* Remove old guides folder
*/
export const removeGuidesFolder = async () => {
try {
if (await fs.pathExists(PATH_CONFIG.guides)) {
await fs.rm(PATH_CONFIG.guides, { recursive: true, force: true });
}
} catch (e) {
// continue initialization even without migration
}
};
3 changes: 2 additions & 1 deletion redisinsight/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as bodyParser from 'body-parser';
import { WinstonModule } from 'nest-winston';
import { GlobalExceptionFilter } from 'src/exceptions/global-exception.filter';
import { get, Config } from 'src/utils';
import { migrateHomeFolder } from 'src/init-helper';
import { migrateHomeFolder, removeGuidesFolder } from 'src/init-helper';
import { LogFileProvider } from 'src/modules/profiler/providers/log-file.provider';
import { WindowsAuthAdapter } from 'src/modules/auth/window-auth/adapters/window-auth.adapter';
import { AppModule } from './app.module';
Expand All @@ -24,6 +24,7 @@ interface IApp {

export default async function bootstrap(apiPort?: number): Promise<IApp> {
await migrateHomeFolder();
await removeGuidesFolder();

const { port, host } = serverConfig;
const logger = WinstonModule.createLogger(LOGGER_CONFIG);
Expand Down