SPB Git

Repository Public

main.ts 2.6 KB 51 lines typescript

1/**2 * =============================================================================3 *                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : MacLustr Social Engine & Remote Navigator8 * File             : services/navigator-gateway/src/main.ts9 * Module           : services10 * Repository       : https://git.spboucher.ai/maclustr-social11 * Project Website  : https://social.spboucher.ai12 * Created          : 2026-12-0113 * Last Modified    : 2026-12-0114 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: admin@spboucher.ai23 * Technical Contact: dev@spboucher.ai24 * Security/Admin   : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License          : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142import { loadConfig } from '../../control-api/src/config.ts';43import { cookieName } from '../../control-api/src/auth.ts';44import { SECURITY_HEADERS } from '../../control-api/src/app.ts';45import { startGateway } from './gateway.ts';46const cfg = loadConfig();47const gw = await startGateway({ host: process.env.MLS_GATEWAY_HOST ?? cfg.host, port: Number(process.env.MLS_GATEWAY_PORT ?? 8881), internalPort: Number(process.env.MLS_GATEWAY_INTERNAL_PORT ?? 8882), origin: cfg.navigatorOrigin,48  controlUrl: cfg.controlInternalUrl, serviceToken: cfg.secret('service').toString('hex'), webDir: process.env.MLS_NAVIGATOR_WEB_DIR ?? '', cookieName: cookieName(cfg), trustProxy: cfg.trustProxy, allowedPeers: cfg.allowedPeers, securityHeaders: SECURITY_HEADERS });49console.log(JSON.stringify({ msg: 'navigator-gateway prêt', origin: cfg.navigatorOrigin }));50for (const sig of ['SIGTERM', 'SIGINT'] as const) process.on(sig, async () => { await gw.close(); process.exit(0); });51
Files main
Menu

Theme