config.js.tmpl (20172B)
1 // https://github.com/thelounge/thelounge/blob/master/defaults/config.js 2 3 "use strict"; 4 5 module.exports = { 6 // ## Server settings 7 8 // ### `public` 9 // 10 // When set to `true`, The Lounge starts in public mode. When set to `false`, 11 // it starts in private mode. 12 // 13 // - A **public server** does not require authentication. Anyone can connect 14 // to IRC networks in this mode. All IRC connections and channel 15 // scrollbacks are lost when a user leaves the client. 16 // - A **private server** requires users to log in. Their IRC connections are 17 // kept even when they are not using or logged in to the client. All joined 18 // channels and scrollbacks are available when they come back. 19 // 20 // This value is set to `false` by default. 21 public: false, 22 23 // ### `host` 24 // 25 // IP address or hostname for the web server to listen to. For example, set it 26 // to `"127.0.0.1"` to accept connections from localhost only. 27 // 28 // For UNIX domain sockets, use `"unix:/absolute/path/to/file.sock"`. 29 // 30 // This value is set to `undefined` by default to listen on all interfaces. 31 host: "0.0.0.0", 32 33 // ### `port` 34 // 35 // Set the port to listen to. 36 // 37 // This value is set to `9000` by default. 38 port: {{ env "NOMAD_PORT_http" }}, 39 40 // ### `bind` 41 // 42 // Set the local IP to bind to for outgoing connections. 43 // 44 // This value is set to `undefined` by default to let the operating system 45 // pick its preferred one. 46 bind: undefined, 47 48 // ### `reverseProxy` 49 // 50 // When set to `true`, The Lounge is marked as served behind a reverse proxy 51 // and will honor the `X-Forwarded-For` header. 52 // 53 // This value is set to `false` by default. 54 reverseProxy: true, 55 56 // ### `maxHistory` 57 // 58 // Defines the maximum number of history lines that will be kept in memory per 59 // channel/query, in order to reduce the memory usage of the server. Setting 60 // this to `-1` will keep unlimited amount. 61 // 62 // This value is set to `10000` by default. 63 maxHistory: 10000, 64 65 // ### `https` 66 // 67 // These settings are used to run The Lounge's web server using encrypted TLS. 68 // 69 // If you want more control over the webserver, 70 // [use a reverse proxy instead](https://thelounge.chat/docs/guides/reverse-proxies). 71 // 72 // The available keys for the `https` object are: 73 // 74 // - `enable`: when set to `false`, HTTPS support is disabled 75 // and all other values are ignored. 76 // - `key`: Path to the private key file. 77 // - `certificate`: Path to the certificate. 78 // - `ca`: Path to the CA bundle. 79 // 80 // The value of `enable` is set to `false` to disable HTTPS by default, in 81 // which case the other two string settings are ignored. 82 https: { 83 enable: false, 84 key: "", 85 certificate: "", 86 ca: "", 87 }, 88 89 // ## Client settings 90 91 // ### `theme` 92 // 93 // Set the default theme to serve to new users. They will be able to select a 94 // different one in their client settings among those available. 95 // 96 // The Lounge ships with two themes (`default` and `morning`) and can be 97 // extended by installing more themes. Read more about how to manage them 98 // [here](https://thelounge.chat/docs/guides/theme-creation). 99 // 100 // This value needs to be the package name and not the display name. For 101 // example, the value for Morning would be `morning`, and the value for 102 // Solarized would be `thelounge-theme-solarized`. 103 // 104 // This value is set to `"default"` by default. 105 theme: "default", 106 107 // ### `prefetch` 108 // 109 // When set to `true`, The Lounge will load thumbnails and site descriptions 110 // from URLs posted in channels and private messages. 111 // 112 // This value is set to `false` by default. 113 prefetch: false, 114 115 // ### `disableMediaPreview` 116 // 117 // When set to `true`, The Lounge will not preview media (images, video and 118 // audio) hosted on third-party sites. This ensures the client does not 119 // make any requests to external sites. If `prefetchStorage` is enabled, 120 // images proxied via the The Lounge will be previewed. 121 // 122 // This has no effect if `prefetch` is set to `false`. 123 // 124 // This value is set to `false` by default. 125 disableMediaPreview: false, 126 127 // ### `prefetchStorage` 128 129 // When set to `true`, The Lounge will store and proxy prefetched images and 130 // thumbnails on the filesystem rather than directly display the content at 131 // the original URLs. 132 // 133 // This option primarily exists to resolve mixed content warnings by not 134 // loading images from http hosts. This option does not work for video 135 // or audio as The Lounge will only load these from https hosts. 136 // 137 // If storage is enabled, The Lounge will fetch and store images and thumbnails 138 // in the `${THELOUNGE_HOME}/storage` folder. 139 // 140 // Images are deleted when they are no longer referenced by any message 141 // (controlled by `maxHistory`), and the folder is cleaned up when The Lounge 142 // restarts. 143 // 144 // This value is set to `false` by default. 145 prefetchStorage: false, 146 147 // ### `prefetchMaxImageSize` 148 // 149 // When `prefetch` is enabled, images will only be displayed if their file 150 // size does not exceed this limit. 151 // 152 // This value is set to `2048` kilobytes by default. 153 prefetchMaxImageSize: 2048, 154 155 // ### prefetchMaxSearchSize 156 // 157 // This value sets the maximum response size allowed when finding the Open 158 // Graph tags for link previews. The entire response is temporarily stored 159 // in memory and for some sites like YouTube this can easily exceed 300 160 // kilobytes. 161 // 162 // This value is set to `50` kilobytes by default. 163 prefetchMaxSearchSize: 50, 164 165 // ### `prefetchTimeout` 166 // 167 // When `prefetch` is enabled, this value sets the number of milliseconds 168 // before The Lounge gives up attempting to fetch a link. This can be useful 169 // if you've increased the `prefetchMaxImageSize`. 170 // 171 // Take caution, however, that an inordinately large value may lead to 172 // performance issues or even a denial of service, since The Lounge will not 173 // be able to clean up outgoing connections as quickly. Usually the default 174 // value is appropriate, so only change it if necessary. 175 // 176 // This value is set to `5000` milliseconds by default. 177 prefetchTimeout: 5000, 178 179 // ### `fileUpload` 180 // 181 // Allow uploading files to the server hosting The Lounge. 182 // 183 // Files are stored in the `${THELOUNGE_HOME}/uploads` folder, do not expire, 184 // and are not removed by The Lounge. This may cause issues depending on your 185 // hardware, for example in terms of disk usage. 186 // 187 // The available keys for the `fileUpload` object are: 188 // 189 // - `enable`: When set to `true`, files can be uploaded on the client with a 190 // drag-and-drop or using the upload dialog. 191 // - `maxFileSize`: When file upload is enabled, users sending files above 192 // this limit will be prompted with an error message in their browser. A value of 193 // `-1` disables the file size limit and allows files of any size. **Use at 194 // your own risk.** This value is set to `10240` kilobytes by default. 195 // - `baseUrl`: If you want to change the URL where uploaded files are accessed, 196 // you can set this option to `"https://example.com/folder/"` and the final URL 197 // would look like `"https://example.com/folder/aabbccddeeff1234/name.png"`. 198 // If you use this option, you must have a reverse proxy configured, 199 // to correctly proxy the uploads URLs back to The Lounge. 200 // This value is set to `null` by default. 201 fileUpload: { 202 enable: false, 203 maxFileSize: 10240, 204 baseUrl: null, 205 }, 206 207 // ### `transports` 208 // 209 // Set `socket.io` transports. 210 // 211 // This value is set to `["polling", "websocket"]` by default. 212 transports: ["polling", "websocket"], 213 214 // ### `leaveMessage` 215 // 216 // Set users' default `quit` and `part` messages if they are not providing 217 // one. 218 // 219 // This value is set to `"The Lounge - https://thelounge.chat"` by 220 // default. 221 leaveMessage: "The Lounge - https://thelounge.chat", 222 223 // ## Default network 224 225 // ### `defaults` 226 // 227 // Specifies default network information that will be used as placeholder 228 // values in the *Connect* window. 229 // 230 // The available keys for the `defaults` object are: 231 // 232 // - `name`: Name to display in the channel list of The Lounge. This value is 233 // not forwarded to the IRC network. 234 // - `host`: IP address or hostname of the IRC server. 235 // - `port`: Usually 6667 for unencrypted connections and 6697 for 236 // connections encrypted with TLS. 237 // - `password`: Connection password. If the server supports SASL capability, 238 // then this password will be used in SASL authentication. 239 // - `tls`: Enable TLS connections 240 // - `rejectUnauthorized`: Whether the server certificate should be verified 241 // against the list of supplied Certificate Authorities (CAs) by your 242 // Node.js installation. 243 // - `nick`: Nick name. Percent signs (`%`) will be replaced by random 244 // numbers from 0 to 9. For example, `Guest%%%` may become `Guest123`. 245 // - `username`: User name. 246 // - `realname`: Real name displayed by some clients. Defaults to the nick if set to "" 247 // - `leaveMessage`: Network specific leave message (overrides global leaveMessage) 248 // - `join`: Comma-separated list of channels to auto-join once connected. 249 // 250 // This value is set to connect to the official channel of The Lounge on 251 // Libera.Chat by default: 252 // 253 // ```js 254 // defaults: { 255 // name: "Libera.Chat", 256 // host: "irc.libera.chat", 257 // port: 6697, 258 // password: "", 259 // tls: true, 260 // rejectUnauthorized: true, 261 // nick: "thelounge%%", 262 // username: "thelounge", 263 // realname: "The Lounge User", 264 // join: "#thelounge" 265 // } 266 // ``` 267 defaults: { 268 name: "Soju", 269 host: "oc.in0rdr.ch", 270 port: 6697, 271 password: "", 272 tls: true, 273 rejectUnauthorized: true, 274 nick: "thelounge%%", 275 username: "thelounge", 276 realname: "", 277 leaveMessage: "", 278 join: "" 279 }, 280 281 // ### `lockNetwork` 282 // 283 // When set to `true`, users will not be able to modify host, port and TLS 284 // settings and will be limited to the configured network. 285 // These fields will also be hidden from the UI. 286 // 287 // This value is set to `false` by default. 288 lockNetwork: false, 289 290 // ## User management 291 292 // ### `messageStorage` 293 294 // The Lounge can log user messages, for example to access them later or to 295 // reload messages on server restart. 296 297 // Set this array with one or multiple values to enable logging: 298 // - `text`: Messages per network and channel will be stored as text files. 299 // **Messages will not be reloaded on restart.** 300 // - `sqlite`: Messages are stored in SQLite database files, one per user. 301 // 302 // Logging can be disabled globally by setting this value to an empty array 303 // `[]`. Logging is also controlled per user individually in the `log` key of 304 // their JSON configuration file. 305 // 306 // This value is set to `["sqlite", "text"]` by default. 307 messageStorage: ["sqlite", "text"], 308 309 // ### `storagePolicy` 310 311 // When the sqlite storage is in use, control the maximum storage duration. 312 // A background task will periodically clean up messages older than the limit. 313 314 // The available keys for the `storagePolicy` object are: 315 // 316 // - `enabled`: If this is false, the cleaning task is not running. 317 // - `maxAgeDays`: Maximum age of an entry in days. 318 // - `deletionPolicy`: Controls what types of messages are being deleted. 319 // Valid options are: 320 // - `statusOnly`: Only delete message types which are status related (e.g. away, back, join, parts, mode, ctcp...) 321 // but keep actual messages from nicks. This keeps the DB size down while retaining "precious" messages. 322 // - `everything`: Delete everything, including messages from irc nicks 323 storagePolicy: { 324 enabled: false, 325 maxAgeDays: 7, 326 deletionPolicy: "statusOnly", 327 }, 328 329 // ### `useHexIp` 330 // 331 // When set to `true`, users' IP addresses will be encoded as hex. 332 // 333 // This is done to share the real user IP address with the server for host 334 // masking purposes. This is encoded in the `username` field and only supports 335 // IPv4. 336 // 337 // This value is set to `false` by default. 338 useHexIp: false, 339 340 // ## WEBIRC support 341 // 342 // When enabled, The Lounge will pass the connecting user's host and IP to the 343 // IRC server. Note that this requires to obtain a password from the IRC 344 // network that The Lounge will be connecting to and generally involves a lot 345 // of trust from the network you are connecting to. 346 // 347 // There are 2 ways to configure the `webirc` setting: 348 // 349 // - **Basic**: an object where keys are IRC hosts and values are passwords. 350 // For example: 351 // 352 // ```json 353 // webirc: { 354 // "irc.example.net": "thisiswebircpassword1", 355 // "irc.example.org": "thisiswebircpassword2", 356 // }, 357 // ``` 358 // 359 // - **Advanced**: an object where keys are IRC hosts and values are functions 360 // that take two arguments (`webircObj`, `network`) and return an 361 // object to be directly passed to `irc-framework`. `webircObj` contains the 362 // generated object which you can modify. For example: 363 // 364 // ```js 365 // webirc: { 366 // "irc.example.com": (webircObj, network) => { 367 // webircObj.password = "thisiswebircpassword"; 368 // webircObj.hostname = `webirc/${webircObj.hostname}`; 369 // return webircObj; 370 // }, 371 // }, 372 // ``` 373 // 374 // This value is set to `null` to disable WEBIRC by default. 375 webirc: null, 376 377 // ## identd and oidentd support 378 379 // ### `identd` 380 // 381 // Run The Lounge with `identd` support. 382 // 383 // The available keys for the `identd` object are: 384 // 385 // - `enable`: When `true`, the identd daemon runs on server start. 386 // - `port`: Port to listen for ident requests. 387 // 388 // The value of `enable` is set to `false` to disable `identd` support by 389 // default, in which case the value of `port` is ignored. The default value of 390 // `port` is 113. 391 identd: { 392 enable: false, 393 port: 113, 394 }, 395 396 // ### `oidentd` 397 // 398 // When this setting is a string, this enables `oidentd` support using the 399 // configuration file located at the given path. 400 // 401 // This is set to `null` by default to disable `oidentd` support. 402 oidentd: null, 403 404 // ## LDAP support 405 406 // These settings enable and configure LDAP authentication. 407 // 408 // They are only being used in private mode. To know more about private mode, 409 // see the `public` setting above. 410 411 // 412 // The authentication process works as follows: 413 // 414 // 1. The Lounge connects to the LDAP server with its system credentials. 415 // 2. It performs an LDAP search query to find the full DN associated to the 416 // user requesting to log in. 417 // 3. The Lounge tries to connect a second time, but this time using the 418 // user's DN and password. Authentication is validated if and only if this 419 // connection is successful. 420 // 421 // The search query takes a couple of parameters in `searchDN`: 422 // 423 // - a base DN `searchDN/base`. Only children nodes of this DN will likely 424 // be returned; 425 // - a search scope `searchDN/scope` (see LDAP documentation); 426 // - the query itself, built as `(&(<primaryKey>=<username>) <filter>)` 427 // where `<username>` is the user name provided in the log in request, 428 // `<primaryKey>` is provided by the config and `<filter>` is a filtering 429 // complement also given in the config, to filter for instance only for 430 // nodes of type `inetOrgPerson`, or whatever LDAP search allows. 431 // 432 // Alternatively, you can specify the `bindDN` parameter. This will make The 433 // Lounge ignore `searchDN` options and assume that the user DN is always 434 // `<bindDN>,<primaryKey>=<username>`, where `<username>` is the user name 435 // provided in the log in request, and `<bindDN>` and `<primaryKey>` are 436 // provided by the configuration. 437 // 438 // The available keys for the `ldap` object are: 439 ldap: { 440 // - `enable`: when set to `false`, LDAP support is disabled and all other 441 // values are ignored. 442 enable: false, 443 444 // - `url`: A url of the form `ldaps://<ip>:<port>`. 445 // For plain connections, use the `ldap` scheme. 446 url: "ldaps://example.com", 447 448 // - `tlsOptions`: LDAP connection TLS options (only used if scheme is 449 // `ldaps://`). It is an object whose values are Node.js' `tls.connect()` 450 // options. It is set to `{}` by default. 451 // For example, this option can be used in order to force the use of IPv6: 452 // ```js 453 // { 454 // host: 'my::ip::v6', 455 // servername: 'example.com' 456 // } 457 // ``` 458 tlsOptions: {}, 459 460 // - `primaryKey`: LDAP primary key. It is set to `"uid"` by default. 461 primaryKey: "uid", 462 463 // - `baseDN`: LDAP base DN, alternative to `searchDN`. For example, set it 464 // to `"ou=accounts,dc=example,dc=com"`. 465 // When unset, the LDAP auth logic with use `searchDN` instead to locate users. 466 467 // - `searchDN`: LDAP search DN settings. This defines the procedure by 468 // which The Lounge first looks for the user DN before authenticating them. 469 // It is ignored if `baseDN` is specified. It is an object with the 470 // following keys: 471 searchDN: { 472 // - `rootDN`: This bind DN is used to query the server for the DN of 473 // the user. This is supposed to be a system user that has access in 474 // read-only to the DNs of the people that are allowed to log in. 475 // It is set to `"cn=thelounge,ou=system-users,dc=example,dc=com"` by 476 // default. 477 rootDN: "cn=thelounge,ou=system-users,dc=example,dc=com", 478 479 // - `rootPassword`: Password of The Lounge LDAP system user. 480 rootPassword: "1234", 481 482 // - `filter`: it is set to `"(&(objectClass=person)(memberOf=ou=accounts,dc=example,dc=com))"` 483 // by default. 484 filter: "(&(objectClass=person)(memberOf=ou=accounts,dc=example,dc=com))", 485 486 // - `base`: LDAP search base (search only within this node). It is set 487 // to `"dc=example,dc=com"` by default. 488 base: "dc=example,dc=com", 489 490 // - `scope`: LDAP search scope. It is set to `"sub"` by default. 491 scope: "sub", 492 }, 493 }, 494 495 // ## Debugging settings 496 497 // The `debug` object contains several settings to enable debugging in The 498 // Lounge. Use them to learn more about an issue you are noticing but be aware 499 // this may produce more logging or may affect connection performance so it is 500 // not recommended to use them by default. 501 // 502 // All values in the `debug` object are set to `false`. 503 debug: { 504 // ### `debug.ircFramework` 505 // 506 // When set to true, this enables extra debugging output provided by 507 // [`irc-framework`](https://github.com/kiwiirc/irc-framework), the 508 // underlying IRC library for Node.js used by The Lounge. 509 ircFramework: false, 510 511 // ### `debug.raw` 512 // 513 // When set to `true`, this enables logging of raw IRC messages into each 514 // server window, displayed on the client. 515 raw: false, 516 }, 517 };