mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 00:20:45 +00:00
389e11f33b
* Remove mostly unused TechnicalError and featureflag. Fold Group into GroupService. * move modutil to util * remove unused public/assets * Remove anomaly service, fold logic into groups * remove unused modules * Remove AnomalyService import from tests * remove shutdownservice * remove unused filetracker service * [will break prod] remove Puter AI Module, inline to coremodue * MariaDB compatibility
67 lines
1.9 KiB
JavaScript
67 lines
1.9 KiB
JavaScript
/*
|
|
* Copyright (C) 2024-present Puter Technologies Inc.
|
|
*
|
|
* This file is part of Puter.
|
|
*
|
|
* Puter is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published
|
|
* by the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
import LocalDiskStorageModule from '@heyputer/backend/src/LocalDiskStorageModule.js';
|
|
import process from 'node:process';
|
|
|
|
try {
|
|
await import('dotenv/config');
|
|
} catch (e) {
|
|
// dotenv is optional
|
|
}
|
|
|
|
// Annoying polyfill for inconsistency in different node versions
|
|
if ( ! import.meta.filename ) {
|
|
Object.defineProperty(import.meta, 'filename', {
|
|
get: () => import.meta.url.slice('file://'.length),
|
|
});
|
|
}
|
|
|
|
const main = async () => {
|
|
const {
|
|
Kernel,
|
|
EssentialModules,
|
|
DatabaseModule,
|
|
SelfHostedModule,
|
|
BroadcastModule,
|
|
TestDriversModule,
|
|
TestConfigModule,
|
|
InternetModule,
|
|
} = (await import('@heyputer/backend')).default;
|
|
|
|
const k = new Kernel({
|
|
entry_path: import.meta.filename,
|
|
});
|
|
for ( const mod of EssentialModules ) {
|
|
k.add_module(new mod());
|
|
}
|
|
k.add_module(new DatabaseModule());
|
|
k.add_module(new LocalDiskStorageModule());
|
|
k.add_module(new SelfHostedModule());
|
|
k.add_module(new BroadcastModule());
|
|
k.add_module(new TestDriversModule());
|
|
k.add_module(new TestConfigModule());
|
|
k.add_module(new InternetModule());
|
|
k.boot();
|
|
};
|
|
|
|
(async () => {
|
|
await main();
|
|
})();
|