feat: add dockerfile base + remove ollama from core + add custom ext

This commit is contained in:
Mohamed Marrouchi
2024-10-27 12:23:32 +01:00
parent 4a8d0aaef1
commit bce390be84
11 changed files with 59 additions and 46 deletions

View File

@@ -8,11 +8,11 @@
import path from 'path';
import { CacheModule } from '@nestjs/cache-manager';
// eslint-disable-next-line import/order
import { MailerModule } from '@nestjs-modules/mailer';
// eslint-disable-next-line import/order
import { MjmlAdapter } from '@nestjs-modules/mailer/dist/adapters/mjml.adapter';
import { CacheModule } from '@nestjs/cache-manager';
import { Module } from '@nestjs/common';
import { APP_GUARD } from '@nestjs/core';
import { EventEmitterModule } from '@nestjs/event-emitter';
@@ -33,6 +33,7 @@ import { ChannelModule } from './channel/channel.module';
import { ChatModule } from './chat/chat.module';
import { CmsModule } from './cms/cms.module';
import { config } from './config';
import extraModules from './extra';
import { HelperModule } from './helper/helper.module';
import { I18nModule } from './i18n/i18n.module';
import { LoggerModule } from './logger/logger.module';
@@ -128,6 +129,7 @@ const i18nOptions: I18nOptions = {
ttl: config.cache.ttl,
max: config.cache.max,
}),
...extraModules,
],
controllers: [AppController],
providers: [

View File

@@ -32,8 +32,10 @@ export interface ChannelModuleOptions {
@InjectDynamicProviders(
// Core & under dev channels
'dist/extensions/**/*.channel.js',
// Installed channels via npm
'dist/.hexabot/extensions/channels/**/*.channel.js',
// Community extensions installed via npm
'dist/.hexabot/contrib/extensions/channels/**/*.channel.js',
// Custom extensions under dev
'dist/.hexabot/custom/extensions/channels/**/*.channel.js',
)
@Module({
controllers: [WebhookController, ChannelController],

9
api/src/extra/index.ts Normal file
View File

@@ -0,0 +1,9 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/
export default [];

View File

@@ -17,8 +17,10 @@ import { HelperService } from './helper.service';
@InjectDynamicProviders(
// Core & under dev helpers
'dist/extensions/**/*.helper.js',
// Installed helpers via npm
'dist/.hexabot/extensions/helpers/**/*.helper.js',
// Community extensions installed via npm
'dist/.hexabot/contrib/extensions/helpers/**/*.helper.js',
// Custom extensions under dev
'dist/.hexabot/custom/extensions/helpers/**/*.helper.js',
)
@Module({
imports: [HttpModule],

View File

@@ -23,8 +23,10 @@ import { PluginService } from './plugins.service';
@InjectDynamicProviders(
// Core & under dev plugins
'dist/extensions/**/*.plugin.js',
// Installed plugins via npm
'dist/.hexabot/extensions/plugins/**/*.plugin.js',
// Community extensions installed via npm
'dist/.hexabot/contrib/extensions/plugins/**/*.plugin.js',
// Custom extensions under dev
'dist/.hexabot/custom/extensions/plugins/**/*.plugin.js',
)
@Global()
@Module({