The official web app for [Lemmy](https://github.com/LemmyNet/lemmy), written in inferno.\r
\r
Based off of MrFoxPro's [inferno-isomorphic-template](https://github.com/MrFoxPro/inferno-isomorphic-template).\r
+\r
+## Configuration\r
+\r
+The following environment variables can be used to configure lemmy-ui:\r
+\r
+`ENV_VAR` | type | default | description\r
+--- | --- | --- | ---\r
+`LEMMY_UI_HOST` | `string` | `0.0.0.0:1234` | The IP / port that the lemmy-ui isomorphic node server is hosted at.\r
+`LEMMY_UI_LEMMY_INTERNAL_HOST` | `string` | `0.0.0.0:8536` | The internal IP / port that lemmy is hosted at. Often `lemmy:8536` if using docker.\r
+`LEMMY_UI_LEMMY_EXTERNAL_HOST` | `string` | `0.0.0.0:8536` | The external IP / port that lemmy is hosted at. Often `DOMAIN.TLD`.\r
+`LEMMY_UI_LEMMY_WS_HOST` | `string` | `0.0.0.0:8536` | An alternate location for lemmy's websocket address. Not usually necessary.\r
+`LEMMY_UI_HTTPS` | `bool` | `false` | Whether to use https.\r
+`LEMMY_UI_EXTRA_THEMES_FOLDER` | `string` | `./extra_themes` | A location for additional lemmy css themes.\r
+`LEMMY_UI_DEBUG` | `bool` | `false` | Loads the [Eruda](https://github.com/liriliri/eruda) debugging utility.\r
+`LEMMY_UI_DISABLE_CSP` | `bool` | `false` | Disables CSP security headers\r
+`LEMMY_UI_CUSTOM_HTML_HEADER` | `string` | | Injects a custom script into `<head>`.\r
const symbols = renderToString(SYMBOLS);
const helmet = Helmet.renderStatic();
- const config: ILemmyConfig = { wsHost: process.env.LEMMY_WS_HOST };
+ const config: ILemmyConfig = { wsHost: process.env.LEMMY_UI_LEMMY_WS_HOST };
res.send(`
<!DOCTYPE html>
const testHost = "0.0.0.0:8536";
let internalHost =
- (!isBrowser() && process.env.LEMMY_INTERNAL_HOST) || testHost; // used for local dev
+ (!isBrowser() && process.env.LEMMY_UI_LEMMY_INTERNAL_HOST) || testHost; // used for local dev
export let externalHost: string;
let host: string;
let wsHost: string;
secure = window.location.protocol == "https:" ? "s" : "";
} else {
// server-side
- externalHost = process.env.LEMMY_EXTERNAL_HOST || testHost;
+ externalHost = process.env.LEMMY_UI_LEMMY_EXTERNAL_HOST || testHost;
host = internalHost;
- wsHost = process.env.LEMMY_WS_HOST || externalHost;
- secure = process.env.LEMMY_HTTPS == "true" ? "s" : "";
+ wsHost = process.env.LEMMY_UI_LEMMY_WS_HOST || externalHost;
+ secure = process.env.LEMMY_UI_HTTPS == "true" ? "s" : "";
}
export const httpBaseInternal = `http://${host}`; // Don't use secure here