mirror of
https://github.com/wassname/talk.git
synced 2026-07-26 13:37:38 +08:00
* Repair theming and CSS variables for the rebrand This separates the CSS variables into three sections for admin, stream, as well as a shared set between them. This also adds injection of the raw colours from the design team into post css variables. Lastly, this re-maps the existing theme variables to a new consolidated set with fallbacks for compatibility. Since this is a singular commit from various WIP commits, I am crediting @cvle as well as myself for this work. Thank you all who helped make this rebrand with theming possible! CORL-1155 Co-authored-by: Chi Vinh Le <vinh@vinh.tech> * Convert old css variables in CallOut * Rename postive/negative => success/error CORL-1155 * Change some CSS Variable names * fix TextField/PasswordField colors Co-authored-by: Chi Vinh Le <vinh@vinh.tech>
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import dotenv from "dotenv";
|
|
import { rewrite } from "env-rewrite";
|
|
import express from "express";
|
|
import sourceMapSupport from "source-map-support";
|
|
|
|
import createCoral from "./core";
|
|
import logger from "./core/server/logger";
|
|
|
|
// Configure the source map support so stack traces will reference the source
|
|
// files rather than the transpiled code.
|
|
sourceMapSupport.install({
|
|
environment: "node",
|
|
});
|
|
|
|
// Ensure that we always process the rewrites silently, otherwise it may fail in
|
|
// environments like Heroku.
|
|
process.env.REWRITE_ENV_SILENT = "TRUE";
|
|
|
|
// Perform rewrites to the runtime environment variables based on the contents
|
|
// of the process.env.REWRITE_ENV if it exists. This is done here as it is the
|
|
// entrypoint for the entire applications configuration.
|
|
rewrite();
|
|
|
|
// Apply all the configuration provided in the .env file if it isn't already in
|
|
// the environment.
|
|
dotenv.config();
|
|
|
|
// Makes the script crash on unhandled rejections instead of silently
|
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
// terminate the Node.js process with a non-zero exit code.
|
|
process.on("unhandledRejection", (err) => {
|
|
throw err;
|
|
});
|
|
|
|
// Create the app that will serve as the mounting point for the Coral Server.
|
|
const parent = express();
|
|
|
|
// bootstrap will create a new Coral server, and start it up.
|
|
async function bootstrap() {
|
|
try {
|
|
logger.debug("starting bootstrap");
|
|
|
|
// Create the server instance.
|
|
const server = createCoral();
|
|
|
|
// Connect the server to databases.
|
|
await server.connect();
|
|
|
|
// Start processing jobs.
|
|
await server.process();
|
|
|
|
// Start the server.
|
|
await server.start({ parent });
|
|
} catch (err) {
|
|
logger.error({ err }, "can not bootstrap server");
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
bootstrap().catch(() => {
|
|
process.exit(1);
|
|
});
|