chore: restore FOSS startup process (#35198)

pull/35016/head^2
Pierre Lehnen 3 months ago committed by GitHub
parent 67ae288668
commit 943155649b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/meteor/server/ee.ts
  2. 3
      apps/meteor/server/foss.ts
  3. 10
      apps/meteor/server/main.ts
  4. 19
      apps/meteor/startRocketChat.ts
  5. 4
      apps/meteor/startRocketChatFOSS.ts
  6. 4
      scripts/fossify.ts

@ -1,2 +0,0 @@
export { startLicense } from '../ee/app/license/server/startup';
export { registerEEBroker } from '../ee/server';

@ -1,3 +0,0 @@
// This file is used in FOSS builds of Rocket.Chat to replace the default ee.ts file with mocked functions
export const startLicense = async () => undefined;
export const registerEEBroker = async () => undefined;

@ -11,9 +11,7 @@ import { configureServer } from './configuration';
import { registerServices } from './services/startup';
import { startup } from './startup';
import { settings } from '../app/settings/server';
import { startLicense } from '../ee/app/license/server/startup';
import { registerEEBroker } from '../ee/server';
import { startFederationService } from '../ee/server/startup/services';
import { startRocketChat } from '../startRocketChat';
import './routes';
import '../app/lib/server/startup';
@ -24,8 +22,6 @@ import '../lib/oauthRedirectUriServer';
import './lib/pushConfig';
import './features/EmailInbox/index';
await Promise.all([configureServer(settings), registerServices(), registerEEBroker(), startup()]);
await Promise.all([configureServer(settings), registerServices(), startup()]);
await startLicense();
await Promise.all([startFederationService()]);
await startRocketChat();

@ -0,0 +1,19 @@
import { startLicense } from './ee/app/license/server/startup';
import { registerEEBroker } from './ee/server';
import { startFederationService } from './ee/server/startup/services';
const loadBeforeLicense = async () => {
await registerEEBroker();
};
const loadAfterLicense = async () => {
await startFederationService();
};
export const startRocketChat = async () => {
await loadBeforeLicense();
await startLicense();
await loadAfterLicense();
};

@ -0,0 +1,4 @@
// This file is used in FOSS builds of Rocket.Chat to replace the default startRocketChat.ts file, removing references to licensed code.
export const startRocketChat = async () => {
// Nothing to do here
};

@ -16,9 +16,9 @@ const fossify = async () => {
await fs.rmdir('./apps/meteor/ee', removeOptions);
console.log('Replacing main files...');
await fs.unlink('./apps/meteor/server/ee.ts');
await fs.unlink('./apps/meteor/startRocketChat.ts');
await fs.rename('./apps/meteor/server/foss.ts', './apps/meteor/server/ee.ts');
await fs.rename('./apps/meteor/startRocketChatFOSS.ts', './apps/meteor/startRocketChat.ts');
console.log('Done.');
};

Loading…
Cancel
Save