2016-10-09 19:14:02 +00:00
|
|
|
"use strict";
|
|
|
|
|
2014-09-13 16:41:11 +00:00
|
|
|
module.exports = {
|
2017-02-19 06:25:49 +00:00
|
|
|
// ## Server settings
|
|
|
|
|
|
|
|
// ### `public`
|
2014-09-14 17:50:00 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to `true`, The Lounge starts in public mode. When set to `false`,
|
|
|
|
// it starts in private mode.
|
2014-09-14 17:50:00 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// - A **public server** does not require authentication. Anyone can connect
|
|
|
|
// to IRC networks in this mode. All IRC connections and channel
|
|
|
|
// scrollbacks are lost when a user leaves the client.
|
|
|
|
// - A **private server** requires users to log in. Their IRC connections are
|
|
|
|
// kept even when they are not using or logged in to the client. All joined
|
|
|
|
// channels and scrollbacks are available when they come back.
|
2014-09-15 21:54:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `false` by default.
|
2017-08-23 05:23:24 +00:00
|
|
|
public: false,
|
2014-09-15 21:54:01 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `host`
|
2014-09-14 17:50:00 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// IP address or hostname for the web server to listen to. For example, set it
|
|
|
|
// to `"127.0.0.1"` to accept connections from localhost only.
|
2017-08-31 18:56:20 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// For UNIX domain sockets, use `"unix:/absolute/path/to/file.sock"`.
|
2014-09-14 17:50:00 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `undefined` by default to listen on all interfaces.
|
2016-06-24 10:25:51 +00:00
|
|
|
host: undefined,
|
2014-09-15 21:54:01 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `port`
|
2014-09-14 17:50:00 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Set the port to listen to.
|
2014-09-14 17:50:00 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `9000` by default.
|
2014-09-14 17:50:00 +00:00
|
|
|
port: 9000,
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `bind`
|
2014-10-11 06:17:41 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Set the local IP to bind to for outgoing connections.
|
2014-10-11 06:17:41 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `undefined` by default to let the operating system
|
|
|
|
// pick its preferred one.
|
2014-10-11 06:17:41 +00:00
|
|
|
bind: undefined,
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `reverseProxy`
|
2016-04-03 05:12:49 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to `true`, The Lounge is marked as served behind a reverse proxy
|
|
|
|
// and will honor the `X-Forwarded-For` header.
|
2016-04-03 05:12:49 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `false` by default.
|
2016-04-03 05:12:49 +00:00
|
|
|
reverseProxy: false,
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `maxHistory`
|
2014-09-14 17:50:00 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Defines the maximum number of history lines that will be kept in memory per
|
|
|
|
// channel/query, in order to reduce the memory usage of the server. Setting
|
|
|
|
// this to `-1` will keep unlimited amount.
|
2014-10-10 21:12:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `10000` by default.
|
|
|
|
maxHistory: 10000,
|
2014-09-24 22:23:54 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `https`
|
2017-07-06 15:33:09 +00:00
|
|
|
//
|
2018-10-29 07:54:58 +00:00
|
|
|
// These settings are used to run The Lounge's web server using encrypted TLS.
|
2017-07-06 15:33:09 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// If you want more control over the webserver,
|
2018-11-21 16:47:09 +00:00
|
|
|
// [use a reverse proxy instead](https://thelounge.chat/docs/guides/reverse-proxies).
|
2017-07-06 15:33:09 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// The available keys for the `https` object are:
|
2017-07-06 15:33:09 +00:00
|
|
|
//
|
2018-10-29 07:54:58 +00:00
|
|
|
// - `enable`: when set to `false`, HTTPS support is disabled
|
|
|
|
// and all other values are ignored.
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `key`: Path to the private key file.
|
|
|
|
// - `certificate`: Path to the certificate.
|
|
|
|
// - `ca`: Path to the CA bundle.
|
2017-07-06 15:33:09 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// The value of `enable` is set to `false` to disable HTTPS by default, in
|
|
|
|
// which case the other two string settings are ignored.
|
|
|
|
https: {
|
|
|
|
enable: false,
|
|
|
|
key: "",
|
|
|
|
certificate: "",
|
|
|
|
ca: "",
|
|
|
|
},
|
2017-07-06 15:33:09 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ## Client settings
|
2015-09-30 22:15:53 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `theme`
|
2015-03-22 13:32:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Set the default theme to serve to new users. They will be able to select a
|
|
|
|
// different one in their client settings among those available.
|
2015-03-22 13:32:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// The Lounge ships with two themes (`default` and `morning`) and can be
|
|
|
|
// extended by installing more themes. Read more about how to manage them
|
2018-11-21 16:47:09 +00:00
|
|
|
// [here](https://thelounge.chat/docs/guides/theme-creation).
|
2015-03-22 13:32:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value needs to be the package name and not the display name. For
|
|
|
|
// example, the value for Morning would be `morning`, and the value for
|
|
|
|
// Solarized would be `thelounge-theme-solarized`.
|
2015-03-22 13:32:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `"default"` by default.
|
|
|
|
theme: "default",
|
2015-03-22 13:32:01 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `prefetch`
|
2016-02-21 12:02:35 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to `true`, The Lounge will load thumbnails and site descriptions
|
|
|
|
// from URLs posted in channels and private messages.
|
2016-02-21 12:02:35 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `false` by default.
|
|
|
|
prefetch: false,
|
2016-02-21 12:02:35 +00:00
|
|
|
|
2020-07-12 02:04:04 +00:00
|
|
|
// ### `disableMediaPreview`
|
|
|
|
//
|
|
|
|
// When set to `true`, The Lounge will not preview media (images, video and
|
|
|
|
// audio) hosted on third-party sites. This ensures the client does not
|
|
|
|
// make any requests to external sites. If `prefetchStorage` is enabled,
|
|
|
|
// images proxied via the The Lounge will be previewed.
|
|
|
|
//
|
|
|
|
// This has no effect if `prefetch` is set to `false`.
|
|
|
|
//
|
|
|
|
// This value is set to `false` by default.
|
|
|
|
disableMediaPreview: false,
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `prefetchStorage`
|
2016-11-19 18:32:47 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to `true`, The Lounge will store and proxy prefetched images and
|
|
|
|
// thumbnails on the filesystem rather than directly display the content at
|
|
|
|
// the original URLs.
|
2016-04-03 05:12:49 +00:00
|
|
|
//
|
2020-07-10 10:52:39 +00:00
|
|
|
// This option primarily exists to resolve mixed content warnings by not
|
|
|
|
// loading images from http hosts. This option does not work for video
|
|
|
|
// or audio as The Lounge will only load these from https hosts.
|
2016-04-03 05:12:49 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// If storage is enabled, The Lounge will fetch and store images and thumbnails
|
|
|
|
// in the `${THELOUNGE_HOME}/storage` folder.
|
2016-04-03 05:12:49 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Images are deleted when they are no longer referenced by any message
|
|
|
|
// (controlled by `maxHistory`), and the folder is cleaned up when The Lounge
|
|
|
|
// restarts.
|
2016-04-03 05:12:49 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `false` by default.
|
|
|
|
prefetchStorage: false,
|
2016-04-03 05:12:49 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `prefetchMaxImageSize`
|
2017-11-28 17:56:53 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When `prefetch` is enabled, images will only be displayed if their file
|
|
|
|
// size does not exceed this limit.
|
2017-11-28 17:56:53 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `2048` kilobytes by default.
|
|
|
|
prefetchMaxImageSize: 2048,
|
2017-11-28 17:56:53 +00:00
|
|
|
|
2018-09-03 07:30:05 +00:00
|
|
|
// ### `fileUpload`
|
|
|
|
//
|
|
|
|
// Allow uploading files to the server hosting The Lounge.
|
|
|
|
//
|
|
|
|
// Files are stored in the `${THELOUNGE_HOME}/uploads` folder, do not expire,
|
|
|
|
// and are not removed by The Lounge. This may cause issues depending on your
|
|
|
|
// hardware, for example in terms of disk usage.
|
|
|
|
//
|
|
|
|
// The available keys for the `fileUpload` object are:
|
|
|
|
//
|
|
|
|
// - `enable`: When set to `true`, files can be uploaded on the client with a
|
|
|
|
// drag-and-drop or using the upload dialog.
|
|
|
|
// - `maxFileSize`: When file upload is enabled, users sending files above
|
2018-12-03 18:25:12 +00:00
|
|
|
// this limit will be prompted with an error message in their browser. A value of
|
2018-09-03 07:30:05 +00:00
|
|
|
// `-1` disables the file size limit and allows files of any size. **Use at
|
|
|
|
// your own risk.** This value is set to `10240` kilobytes by default.
|
2019-10-31 11:21:22 +00:00
|
|
|
// - `baseUrl`: If you want change the URL where uploaded files are accessed,
|
|
|
|
// you can set this option to `"https://example.com/folder/"` and the final URL
|
|
|
|
// would look like `"https://example.com/folder/aabbccddeeff1234/name.png"`.
|
|
|
|
// If you use this option, you must have a reverse proxy configured,
|
|
|
|
// to correctly proxy the uploads URLs back to The Lounge.
|
|
|
|
// This value is set to `null` by default.
|
2018-09-03 07:30:05 +00:00
|
|
|
fileUpload: {
|
2018-09-03 07:37:32 +00:00
|
|
|
enable: false,
|
2018-09-03 07:30:05 +00:00
|
|
|
maxFileSize: 10240,
|
2019-10-31 11:21:22 +00:00
|
|
|
baseUrl: null,
|
2018-09-03 07:30:05 +00:00
|
|
|
},
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `transports`
|
2016-04-03 19:43:11 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Set `socket.io` transports.
|
2016-04-03 19:43:11 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `["polling", "websocket"]` by default.
|
|
|
|
transports: ["polling", "websocket"],
|
2016-04-03 19:43:11 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `leaveMessage`
|
2014-09-15 21:54:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Set users' default `quit` and `part` messages if they are not providing
|
|
|
|
// one.
|
2014-09-15 21:54:01 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `"The Lounge - https://thelounge.chat"` by
|
|
|
|
// default.
|
|
|
|
leaveMessage: "The Lounge - https://thelounge.chat",
|
|
|
|
|
|
|
|
// ## Default network
|
|
|
|
|
|
|
|
// ### `defaults`
|
|
|
|
//
|
|
|
|
// Specifies default network information that will be used as placeholder
|
|
|
|
// values in the *Connect* window.
|
|
|
|
//
|
|
|
|
// The available keys for the `defaults` object are:
|
|
|
|
//
|
|
|
|
// - `name`: Name to display in the channel list of The Lounge. This value is
|
|
|
|
// not forwarded to the IRC network.
|
2018-10-29 07:54:58 +00:00
|
|
|
// - `host`: IP address or hostname of the IRC server.
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `port`: Usually 6667 for unencrypted connections and 6697 for
|
|
|
|
// connections encrypted with TLS.
|
2018-10-29 07:54:58 +00:00
|
|
|
// - `password`: Connection password. If the server supports SASL capability,
|
|
|
|
// then this password will be used in SASL authentication.
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `tls`: Enable TLS connections
|
|
|
|
// - `rejectUnauthorized`: Whether the server certificate should be verified
|
|
|
|
// against the list of supplied Certificate Authorities (CAs) by your
|
|
|
|
// Node.js installation.
|
2018-10-29 07:54:58 +00:00
|
|
|
// - `nick`: Nick name. Percent signs (`%`) will be replaced by random
|
|
|
|
// numbers from 0 to 9. For example, `Guest%%%` may become `Guest123`.
|
|
|
|
// - `username`: User name.
|
|
|
|
// - `realname`: Real name.
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `join`: Comma-separated list of channels to auto-join once connected.
|
|
|
|
//
|
|
|
|
// This value is set to connect to the official channel of The Lounge on
|
|
|
|
// Freenode by default:
|
|
|
|
//
|
|
|
|
// ```js
|
|
|
|
// defaults: {
|
|
|
|
// name: "Freenode",
|
|
|
|
// host: "chat.freenode.net",
|
|
|
|
// port: 6697,
|
|
|
|
// password: "",
|
|
|
|
// tls: true,
|
|
|
|
// rejectUnauthorized: true,
|
|
|
|
// nick: "thelounge%%",
|
|
|
|
// username: "thelounge",
|
|
|
|
// realname: "The Lounge User",
|
|
|
|
// join: "#thelounge"
|
|
|
|
// }
|
|
|
|
// ```
|
2014-09-15 21:54:01 +00:00
|
|
|
defaults: {
|
|
|
|
name: "Freenode",
|
2016-02-12 12:54:41 +00:00
|
|
|
host: "chat.freenode.net",
|
2014-09-15 21:54:01 +00:00
|
|
|
port: 6697,
|
|
|
|
password: "",
|
|
|
|
tls: true,
|
2018-02-17 08:22:28 +00:00
|
|
|
rejectUnauthorized: true,
|
2018-02-21 16:05:31 +00:00
|
|
|
nick: "thelounge%%",
|
|
|
|
username: "thelounge",
|
2016-02-10 05:46:29 +00:00
|
|
|
realname: "The Lounge User",
|
2017-11-15 06:35:15 +00:00
|
|
|
join: "#thelounge",
|
2014-09-26 23:26:21 +00:00
|
|
|
},
|
2014-11-06 11:48:10 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `lockNetwork`
|
2014-09-26 23:26:21 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to `true`, users will not be able to modify host, port and TLS
|
|
|
|
// settings and will be limited to the configured network.
|
2020-03-31 17:03:40 +00:00
|
|
|
// These fields will also be hidden from the UI.
|
2014-09-26 23:26:21 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `false` by default.
|
|
|
|
lockNetwork: false,
|
2014-09-26 23:26:21 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ## User management
|
2014-09-26 23:26:21 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `messageStorage`
|
2017-04-10 18:49:58 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// The Lounge can log user messages, for example to access them later or to
|
|
|
|
// reload messages on server restart.
|
2014-10-09 15:46:12 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// Set this array with one or multiple values to enable logging:
|
|
|
|
// - `text`: Messages per network and channel will be stored as text files.
|
|
|
|
// **Messages will not be reloaded on restart.**
|
|
|
|
// - `sqlite`: Messages are stored in SQLite database files, one per user.
|
2017-08-18 19:04:16 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Logging can be disabled globally by setting this value to an empty array
|
|
|
|
// `[]`. Logging is also controlled per user individually in the `log` key of
|
|
|
|
// their JSON configuration file.
|
2017-08-18 19:04:16 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This value is set to `["sqlite", "text"]` by default.
|
|
|
|
messageStorage: ["sqlite", "text"],
|
|
|
|
|
|
|
|
// ### `useHexIp`
|
2017-08-18 19:04:16 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to `true`, users' IP addresses will be encoded as hex.
|
|
|
|
//
|
|
|
|
// This is done to share the real user IP address with the server for host
|
|
|
|
// masking purposes. This is encoded in the `username` field and only supports
|
|
|
|
// IPv4.
|
|
|
|
//
|
|
|
|
// This value is set to `false` by default.
|
|
|
|
useHexIp: false,
|
2017-08-18 19:04:16 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ## WEBIRC support
|
|
|
|
//
|
|
|
|
// When enabled, The Lounge will pass the connecting user's host and IP to the
|
|
|
|
// IRC server. Note that this requires to obtain a password from the IRC
|
|
|
|
// network that The Lounge will be connecting to and generally involves a lot
|
|
|
|
// of trust from the network you are connecting to.
|
|
|
|
//
|
|
|
|
// There are 2 ways to configure the `webirc` setting:
|
|
|
|
//
|
|
|
|
// - **Basic**: an object where keys are IRC hosts and values are passwords.
|
|
|
|
// For example:
|
|
|
|
//
|
|
|
|
// ```json
|
2019-01-29 11:04:42 +00:00
|
|
|
// webirc: {
|
2019-07-16 09:51:22 +00:00
|
|
|
// "irc.example.net": "thisiswebircpassword1",
|
|
|
|
// "irc.example.org": "thisiswebircpassword2",
|
2019-01-29 11:04:42 +00:00
|
|
|
// },
|
2017-02-19 06:25:49 +00:00
|
|
|
// ```
|
|
|
|
//
|
|
|
|
// - **Advanced**: an object where keys are IRC hosts and values are functions
|
2019-07-16 09:51:22 +00:00
|
|
|
// that take two arguments (`webircObj`, `network`) and return an
|
|
|
|
// object to be directly passed to `irc-framework`. `webircObj` contains the
|
|
|
|
// generated object which you can modify. For example:
|
2017-02-19 06:25:49 +00:00
|
|
|
//
|
|
|
|
// ```js
|
2019-01-29 11:04:42 +00:00
|
|
|
// webirc: {
|
2019-07-16 09:51:22 +00:00
|
|
|
// "irc.example.com": (webircObj, network) => {
|
|
|
|
// webircObj.password = "thisiswebircpassword";
|
|
|
|
// webircObj.hostname = `webirc/${webircObj.hostname}`;
|
|
|
|
// return webircObj;
|
|
|
|
// },
|
2019-01-29 11:04:42 +00:00
|
|
|
// },
|
2017-02-19 06:25:49 +00:00
|
|
|
// ```
|
|
|
|
//
|
|
|
|
// This value is set to `null` to disable WEBIRC by default.
|
|
|
|
webirc: null,
|
|
|
|
|
|
|
|
// ## identd and oidentd support
|
|
|
|
|
|
|
|
// ### `identd`
|
2014-10-09 15:46:12 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// Run The Lounge with `identd` support.
|
2014-10-09 15:46:12 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// The available keys for the `identd` object are:
|
2014-10-11 17:33:28 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `enable`: When `true`, the identd daemon runs on server start.
|
|
|
|
// - `port`: Port to listen for ident requests.
|
|
|
|
//
|
|
|
|
// The value of `enable` is set to `false` to disable `identd` support by
|
|
|
|
// default, in which case the value of `port` is ignored. The default value of
|
|
|
|
// `port` is 113.
|
2014-10-09 15:46:12 +00:00
|
|
|
identd: {
|
2014-10-11 17:33:28 +00:00
|
|
|
enable: false,
|
2017-11-15 06:35:15 +00:00
|
|
|
port: 113,
|
2016-04-26 20:41:08 +00:00
|
|
|
},
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `oidentd`
|
2016-04-26 20:41:08 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When this setting is a string, this enables `oidentd` support using the
|
|
|
|
// configuration file located at the given path.
|
2016-04-26 20:41:08 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// This is set to `null` by default to disable `oidentd` support.
|
2016-04-26 20:41:08 +00:00
|
|
|
oidentd: null,
|
2016-07-30 01:20:38 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ## LDAP support
|
|
|
|
|
|
|
|
// These settings enable and configure LDAP authentication.
|
2016-07-30 01:20:38 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// They are only being used in private mode. To know more about private mode,
|
|
|
|
// see the `public` setting above.
|
|
|
|
|
2016-07-30 01:20:38 +00:00
|
|
|
//
|
2017-03-21 14:15:33 +00:00
|
|
|
// The authentication process works as follows:
|
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// 1. The Lounge connects to the LDAP server with its system credentials.
|
|
|
|
// 2. It performs an LDAP search query to find the full DN associated to the
|
|
|
|
// user requesting to log in.
|
|
|
|
// 3. The Lounge tries to connect a second time, but this time using the
|
|
|
|
// user's DN and password. Authentication is validated if and only if this
|
|
|
|
// connection is successful.
|
2017-03-21 14:15:33 +00:00
|
|
|
//
|
2017-08-29 16:05:06 +00:00
|
|
|
// The search query takes a couple of parameters in `searchDN`:
|
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// - a base DN `searchDN/base`. Only children nodes of this DN will be likely
|
|
|
|
// be returned;
|
|
|
|
// - a search scope `searchDN/scope` (see LDAP documentation);
|
|
|
|
// - the query itself, built as `(&(<primaryKey>=<username>) <filter>)`
|
|
|
|
// where `<username>` is the user name provided in the log in request,
|
|
|
|
// `<primaryKey>` is provided by the config and `<filter>` is a filtering
|
|
|
|
// complement also given in the config, to filter for instance only for
|
|
|
|
// nodes of type `inetOrgPerson`, or whatever LDAP search allows.
|
|
|
|
//
|
|
|
|
// Alternatively, you can specify the `bindDN` parameter. This will make The
|
|
|
|
// Lounge ignore `searchDN` options and assume that the user DN is always
|
|
|
|
// `<bindDN>,<primaryKey>=<username>`, where `<username>` is the user name
|
|
|
|
// provided in the log in request, and `<bindDN>` and `<primaryKey>` are
|
|
|
|
// provided by the configuration.
|
|
|
|
//
|
|
|
|
// The available keys for the `ldap` object are:
|
2016-07-30 01:20:38 +00:00
|
|
|
ldap: {
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `enable`: when set to `false`, LDAP support is disabled and all other
|
2018-11-21 16:47:09 +00:00
|
|
|
// values are ignored.
|
2016-07-30 01:20:38 +00:00
|
|
|
enable: false,
|
2018-11-21 16:47:09 +00:00
|
|
|
|
|
|
|
// - `url`: A url of the form `ldaps://<ip>:<port>`.
|
|
|
|
// For plain connections, use the `ldap` scheme.
|
2016-07-30 01:20:38 +00:00
|
|
|
url: "ldaps://example.com",
|
2018-11-21 16:47:09 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `tlsOptions`: LDAP connection TLS options (only used if scheme is
|
|
|
|
// `ldaps://`). It is an object whose values are Node.js' `tls.connect()`
|
|
|
|
// options. It is set to `{}` by default.
|
|
|
|
// For example, this option can be used in order to force the use of IPv6:
|
|
|
|
// ```js
|
2017-03-21 14:15:33 +00:00
|
|
|
// {
|
2017-08-29 16:05:06 +00:00
|
|
|
// host: 'my::ip::v6',
|
|
|
|
// servername: 'example.com'
|
2017-03-21 14:15:33 +00:00
|
|
|
// }
|
2017-02-19 06:25:49 +00:00
|
|
|
// ```
|
2017-03-21 14:15:33 +00:00
|
|
|
tlsOptions: {},
|
2018-11-21 16:47:09 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `primaryKey`: LDAP primary key. It is set to `"uid"` by default.
|
2017-03-21 14:15:33 +00:00
|
|
|
primaryKey: "uid",
|
2018-11-21 16:47:09 +00:00
|
|
|
|
|
|
|
// - `baseDN`: LDAP base DN, alternative to `searchDN`. For example, set it
|
|
|
|
// to `"ou=accounts,dc=example,dc=com"`.
|
|
|
|
// When unset, the LDAP auth logic with use `searchDN` instead to locate users.
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `searchDN`: LDAP search DN settings. This defines the procedure by
|
|
|
|
// which The Lounge first looks for the user DN before authenticating them.
|
|
|
|
// It is ignored if `baseDN` is specified. It is an object with the
|
2018-10-29 07:54:58 +00:00
|
|
|
// following keys:
|
2017-08-29 16:05:06 +00:00
|
|
|
searchDN: {
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `rootDN`: This bind DN is used to query the server for the DN of
|
|
|
|
// the user. This is supposed to be a system user that has access in
|
|
|
|
// read-only to the DNs of the people that are allowed to log in.
|
|
|
|
// It is set to `"cn=thelounge,ou=system-users,dc=example,dc=com"` by
|
|
|
|
// default.
|
2017-08-29 16:05:06 +00:00
|
|
|
rootDN: "cn=thelounge,ou=system-users,dc=example,dc=com",
|
2018-11-21 16:47:09 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `rootPassword`: Password of The Lounge LDAP system user.
|
2017-08-29 16:05:06 +00:00
|
|
|
rootPassword: "1234",
|
2018-11-21 16:47:09 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `ldapFilter`: it is set to `"(objectClass=person)(memberOf=ou=accounts,dc=example,dc=com)"`
|
|
|
|
// by default.
|
2017-08-30 09:49:21 +00:00
|
|
|
filter: "(objectClass=person)(memberOf=ou=accounts,dc=example,dc=com)",
|
2018-11-21 16:47:09 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `base`: LDAP search base (search only within this node). It is set
|
|
|
|
// to `"dc=example,dc=com"` by default.
|
2017-08-29 16:05:06 +00:00
|
|
|
base: "dc=example,dc=com",
|
2018-11-21 16:47:09 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// - `scope`: LDAP search scope. It is set to `"sub"` by default.
|
2017-11-15 06:35:15 +00:00
|
|
|
scope: "sub",
|
|
|
|
},
|
2016-08-06 18:39:39 +00:00
|
|
|
},
|
2016-07-30 01:20:38 +00:00
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ## Debugging settings
|
|
|
|
|
|
|
|
// The `debug` object contains several settings to enable debugging in The
|
|
|
|
// Lounge. Use them to learn more about an issue you are noticing but be aware
|
|
|
|
// this may produce more logging or may affect connection performance so it is
|
|
|
|
// not recommended to use them by default.
|
2016-08-06 18:39:39 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// All values in the `debug` object are set to `false`.
|
2016-12-10 08:53:06 +00:00
|
|
|
debug: {
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `debug.ircFramework`
|
2016-12-10 08:53:06 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to true, this enables extra debugging output provided by
|
|
|
|
// [`irc-framework`](https://github.com/kiwiirc/irc-framework), the
|
|
|
|
// underlying IRC library for Node.js used by The Lounge.
|
2016-12-10 08:53:06 +00:00
|
|
|
ircFramework: false,
|
|
|
|
|
2017-02-19 06:25:49 +00:00
|
|
|
// ### `debug.raw`
|
2016-12-10 08:53:06 +00:00
|
|
|
//
|
2017-02-19 06:25:49 +00:00
|
|
|
// When set to `true`, this enables logging of raw IRC messages into each
|
|
|
|
// server window, displayed on the client.
|
2016-12-10 08:53:06 +00:00
|
|
|
raw: false,
|
|
|
|
},
|
2014-09-13 16:41:11 +00:00
|
|
|
};
|