### Get Help for 'start' Command Source: https://thelounge.chat/docs/usage Example of getting specific help for the 'start' command to understand its options. ```bash thelounge start --help ``` -------------------------------- ### Install The Lounge from Source Source: https://thelounge.chat/docs/install-and-upgrade Commands to clone the repository, install dependencies, build the project, and create a symbolic link for the executable. Ensure Node.js LTS and Yarn are installed. ```bash git clone https://github.com/thelounge/thelounge cd thelounge yarn install NODE_ENV=production yarn build # pick a folder which is in your $PATH env var, ~/.local/bin here ln -s $(pwd)/index.js ~/.local/bin/thelounge ``` -------------------------------- ### Install a Plugin Source: https://thelounge.chat/docs/usage Installs a plugin from the npm registry. The Lounge automatically loads and activates the plugin after installation. ```bash thelounge install thelounge-plugin-closepms ``` -------------------------------- ### Install a Theme Source: https://thelounge.chat/docs/usage Installs a theme from the npm registry. The Lounge automatically loads the theme after installation. ```bash thelounge install thelounge-theme-solarized ``` -------------------------------- ### Log messages on server start Source: https://thelounge.chat/docs/api/logger This example demonstrates how to log debug and error messages using the Logger API when the server starts. It shows how to log a simple string and an error object. ```javascript module.exports = { onServerStart(api) { api.Logger.debug("hello world") const err = doSomethingThatMayFail() if (err) { api.Logger.error("failed to do something", err) } } }; ``` -------------------------------- ### Start Server with Multiple Configurations Source: https://thelounge.chat/docs/usage Starts The Lounge server with multiple configuration options specified using the -c flag. ```bash thelounge start -c port=9001 -c public=true ``` -------------------------------- ### Install The Lounge from npm Releases Source: https://thelounge.chat/docs/install-and-upgrade Install The Lounge globally using Yarn. Ensure Node.js LTS and Yarn 1 are installed first. ```bash yarn global add thelounge ``` -------------------------------- ### Start The Lounge Server Source: https://thelounge.chat/docs/usage Run this command to start the The Lounge server with default settings. The server will create a configuration file if one does not exist. ```bash thelounge start ``` -------------------------------- ### Install Redbird Source: https://thelounge.chat/docs/guides/reverse-proxies Install Redbird using yarn. ```bash yarn add redbird ``` -------------------------------- ### Access Server Configuration and Persistent Storage Source: https://thelounge.chat/docs/api/config This example demonstrates how to retrieve the server's current configuration and the directory for persistent storage. It then writes a JSON database file to the persistent storage location. ```javascript module.exports = { onServerStart(thelounge) { const config = thelounge.Config.getConfig(); } const db = {theAnswer: 42} db_path = path.join(thelounge.Config.getPersistentStorageDir(), "db.json"); fs.writeFile(db_path, JSON.stringify(db)) }; ``` -------------------------------- ### Install a Local Package Source: https://thelounge.chat/docs/usage Installs a package (theme or plugin) from a local file system directory. Use this during development or if you don't want to publish to npm. ```bash thelounge install file:~/path/to/package_dir ``` -------------------------------- ### Start Server in Public Mode Source: https://thelounge.chat/docs/usage Starts The Lounge server in public mode using the --config option. ```bash thelounge start --config public=true ``` -------------------------------- ### Install The Lounge on Arch Linux using Yay Source: https://thelounge.chat/docs/install-and-upgrade Use this command to install The Lounge from the Arch User Repository (AUR) with the Yay helper. ```bash yay -aS thelounge ``` -------------------------------- ### Start The Lounge User Service on Arch Linux Source: https://thelounge.chat/docs/install-and-upgrade Start the user systemd service for The Lounge. This runs The Lounge with configuration in ~/.thelounge/config.js. ```bash systemctl --user start thelounge.service ``` -------------------------------- ### Start Server on a Specific Port Source: https://thelounge.chat/docs/usage Starts The Lounge server on a specified port using the --config option. ```bash thelounge start --config port=9001 ``` -------------------------------- ### Get General Command Line Help Source: https://thelounge.chat/docs/usage Use the --help flag to view general information about the thelounge program and its available commands. ```bash thelounge --help ``` -------------------------------- ### Enable and Start The Lounge System Service on Arch Linux Source: https://thelounge.chat/docs/install-and-upgrade Enable and start the systemd service for The Lounge. This runs The Lounge as the 'thelounge' user with configuration in /etc/thelounge/config.js. ```bash systemctl enable --now thelounge.service ``` -------------------------------- ### Get Specific Command Help Source: https://thelounge.chat/docs/usage To get help for a specific command, append --help to the command. ```bash thelounge --help ``` -------------------------------- ### Start The Lounge Server with Custom Configuration Source: https://thelounge.chat/docs/usage Use the THELOUNGE_HOME environment variable to specify a custom path for the configuration file and other server data. This is useful for running multiple instances or storing data on different partitions. ```bash THELOUNGE_HOME=/tmp thelounge start ``` -------------------------------- ### Install The Lounge on Debian/Ubuntu Source: https://thelounge.chat/docs/install-and-upgrade Installs The Lounge using a .deb package on Debian and Ubuntu-based systems. This method requires root access and sets up a systemd service for automatic management. ```bash sudo apt install ./thelounge.deb ``` -------------------------------- ### LDAP TLS Options Example Source: https://thelounge.chat/docs/configuration Example of TLS options for LDAP connections, used when the scheme is 'ldaps://'. This can be used to force IPv6. ```javascript { host: 'my::ip::v6', servername: 'example.com' } ``` -------------------------------- ### Check The Lounge Version Source: https://thelounge.chat/docs/usage Use the --version flag to check the currently installed version of The Lounge. ```bash thelounge --version ``` -------------------------------- ### Run The Lounge with Docker Compose Source: https://thelounge.chat/docs/install-and-upgrade Use this command to start The Lounge in a detached Docker container using Docker Compose. ```bash docker-compose up --detach ``` -------------------------------- ### Basic WEBIRC Configuration Source: https://thelounge.chat/docs/configuration Configure WEBIRC with a simple object mapping IRC network hosts to their respective passwords. This is suitable for straightforward WEBIRC setups. ```javascript webirc: { "irc.example.net": "thisiswebircpassword1", "irc.example.org": "thisiswebircpassword2", } ``` -------------------------------- ### Hide Realnames in Joins Source: https://thelounge.chat/docs/guides/custom-css Removes the realname part (e.g., `Example realname -`) from join messages. ```css #chat .realname { display: none; } ``` -------------------------------- ### Initialize Theme Package Source: https://thelounge.chat/docs/guides/theme-creation Use `yarn init -y` to create a new `package.json` for your theme. ```bash yarn init -y ``` -------------------------------- ### Add a New User Source: https://thelounge.chat/docs/users Use the `add` command to create a new user. You will be prompted for the user's name and password, and whether to enable logging. The new user is available immediately. ```bash thelounge add ``` -------------------------------- ### Configure Theme Keywords Source: https://thelounge.chat/docs/guides/theme-creation Add 'thelounge' and 'thelounge-theme' to the `keywords` array in `package.json` for discoverability. ```json "keywords": [ "thelounge", "thelounge-theme" ] ``` -------------------------------- ### Advanced Configuration via JavaScript Source: https://thelounge.chat/docs/guides/theme-creation Export theme metadata from a JavaScript file specified as the `main` entry point in `package.json`. ```javascript module.exports = { thelounge: { css: "theme.css", name: "Theme Name", type: "theme" } }; ``` -------------------------------- ### Register a Custom Stylesheet Source: https://thelounge.chat/docs/api/stylesheets Use the `onServerStart` hook to register a CSS file with the Stylesheets API. The provided filename must exist within the server's file system. ```javascript module.exports = { onServerStart(thelounge) { thelounge.Stylesheets.addFile("file.css"); } }; ``` -------------------------------- ### #addFile(filename) Source: https://thelounge.chat/docs/api/stylesheets Registers a CSS file to be applied to all clients. The content of the specified file will be injected into the clients. ```APIDOC ## addFile(filename) ### Description Registers a CSS file to be applied to all clients. The content of the specified file will be injected into the clients. ### Method `addFile` ### Parameters #### Path Parameters - **filename** (string) - Required - The name of the CSS file to register. ### Request Example ```javascript module.exports = { onServerStart(thelounge) { thelounge.Stylesheets.addFile("file.css"); } }; ``` ``` -------------------------------- ### The Lounge Connection Settings (Clientbuffer Module) Source: https://thelounge.chat/docs/guides/znc Configure The Lounge to connect to an IRC network through ZNC when using the clientbuffer module. Include a client ID in the username. ```text Username: zncUser@clientid/network Password: zncPassword ``` -------------------------------- ### Basic Theme Metadata Source: https://thelounge.chat/docs/guides/theme-creation Define the main CSS file and display name in the `thelounge` section of `package.json`. ```json "thelounge": { "css": "theme.css", "name": "Theme Name", "type": "theme" } ``` -------------------------------- ### List All Users Source: https://thelounge.chat/docs/users Use the `list` command to retrieve a list of all existing users in The Lounge. This is useful for verifying user creation or deletion. ```bash thelounge list ``` -------------------------------- ### add(commandText: string, command: Object) Source: https://thelounge.chat/docs/api/commands Registers a new command for users on the lounge. `commandText` is what the users will type after `/`, and `command` is the command object. ```APIDOC ## add(commandText: string, command: Object) ### Description Registers a new command for users on the lounge. `commandText` is what the users will type after `/`, and `command` is the command object. ### Parameters #### Path Parameters - **commandText** (string) - Required - The text users will type after `/` to invoke the command. - **command** (Object) - Required - The command object containing its implementation and configuration. ### Command Object Attributes: - **input** (Function) - Required - The implementation of the command. It receives `client`, `target`, `command`, and `args` as arguments. - **allowDisconnected** (Boolean) - Optional - If `true`, this command can be executed when the client isn’t connected. ### Arguments of a command: - **client** (PublicClient) - The client API object. - **target** (Object) - The context in which the command was run. Contains `network` and `chan`. - **command** (String) - The command name (lowercase). - **args** (Array of String) - The arguments the command was executed with. ### Example ```javascript const helloWorldCommand = { input: function (client, target, command, args) { if(args.length === 0) { client.sendMessage("Hello World", target.chan); } else { client.sendMessage("Hello " + args[0], target.chan); } }, allowDisconnected: true }; module.exports = { onServerStart: api => { api.Commands.add("helloworld", helloWorldCommand); }, }; ``` ``` -------------------------------- ### getConfig() Source: https://thelounge.chat/docs/api/config Retrieves the server's current configuration object. ```APIDOC ## getConfig() ### Description Returns the server ### Method GET ### Endpoint /config ### Parameters None ### Request Example None ### Response #### Success Response (200) - **config** (object) - The server's current configuration object. #### Response Example ```json { "setting1": "value1", "setting2": 123 } ``` ``` -------------------------------- ### Set permissions for oidentd configuration file Source: https://thelounge.chat/docs/guides/identd-and-oidentd These commands set the necessary file permissions for The Lounge's home directory and the oidentd configuration file, allowing oidentd to read the ident information. ```bash chmod 711 /home/thelounge/ chmod 644 /home/thelounge/.oidentd.conf ``` -------------------------------- ### Apache Configuration for The Lounge Source: https://thelounge.chat/docs/guides/reverse-proxies Basic Apache configuration using mod_rewrite and mod_proxy to serve The Lounge. Ensure necessary modules are enabled. ```apache RewriteEngine On RewriteCond %{REQUEST_URI} ^/socket.io [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /(.*) ws://127.0.0.1:9000/$1 [P,L] RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} ProxyVia On ProxyRequests Off ProxyAddHeaders On ProxyPass / http://127.0.0.1:9000/ ProxyPassReverse / http://127.0.0.1:9000/ # By default Apache times out connections after one minute, # set to 86400 seconds (1 day) instead ProxyTimeout 86400 ``` -------------------------------- ### Theme with Additional Files Source: https://thelounge.chat/docs/guides/theme-creation Include additional assets like fonts or sprites in the `files` array within the `thelounge` configuration. ```json "thelounge": { "css": "theme.css", "name": "Theme Name", "type": "theme", "files": [ "alternative-font.woff2", "sprites.png" ] } ``` -------------------------------- ### Apache Configuration for Subfolder Access Source: https://thelounge.chat/docs/guides/reverse-proxies Apache configuration to serve The Lounge from a subfolder like '/irc/'. Includes WebSocket proxying and timeout settings. ```apache RewriteEngine On RewriteRule ^/irc$ /irc/ [R] RewriteCond %{REQUEST_URI} ^/irc/socket.io [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /irc/(.*) ws://127.0.0.1:9000/$1 [P,L] RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} ProxyVia On ProxyRequests Off ProxyAddHeaders On ProxyPass /irc/ http://127.0.0.1:9000/ ProxyPassReverse /irc/ http://127.0.0.1:9000/ # By default Apache times out connections after one minute, # set to 86400 seconds (1 day) instead ProxyTimeout 86400 ``` -------------------------------- ### Configure List of Transports Source: https://thelounge.chat/docs/usage Sets a list of values for a configuration option, such as transports, by wrapping them in square brackets. ```bash thelounge start -c transports=[websocket,polling] ``` -------------------------------- ### Edit User Configuration File Source: https://thelounge.chat/docs/users Use the `edit` command to open a user's configuration file in a text editor. Changes to most fields require a server restart to take effect, except for the password. ```bash thelounge edit ``` -------------------------------- ### The Lounge Connection Settings (Direct) Source: https://thelounge.chat/docs/guides/znc Configure The Lounge to connect to an IRC network through ZNC without the clientbuffer module. Specify the network in the username field. ```text Username: zncUser/network Password: zncPassword ``` -------------------------------- ### Run The Lounge with Docker Source: https://thelounge.chat/docs/install-and-upgrade This command runs The Lounge in a detached Docker container, mapping port 9000 and setting up a persistent volume and restart policy. ```bash docker run --detach \ --name thelounge \ --publish 9000:9000 \ --volume thelounge:/var/opt/thelounge \ --restart always \ ghcr.io/thelounge/thelounge:latest ``` -------------------------------- ### Configure oidentd to forward to The Lounge's built-in identd Source: https://thelounge.chat/docs/guides/identd-and-oidentd This configuration forwards ident requests to The Lounge's built-in server running on a specified port. Ensure the port matches The Lounge's `identd.port` setting. ```bash user "thelounge" { default { allow spoof # Use this if The Lounge needs to spoof local user names allow spoof_all # 9001 is the port you set in The Lounge's config force forward 127.0.0.1 9001 } } ``` -------------------------------- ### Caddy Reverse Proxy with Subfolder Source: https://thelounge.chat/docs/guides/reverse-proxies Caddy configuration to access The Lounge from a subfolder. ```caddy route /irc/* { uri strip_prefix /irc reverse_proxy http://127.0.0.1:9000 } ``` -------------------------------- ### Nginx Configuration for File Uploads Source: https://thelounge.chat/docs/guides/reverse-proxies Configure Nginx to proxy upload URLs when 'baseUrl' is set in The Lounge. Adjust 'client_max_body_size' to manage upload limits. ```nginx location /folder/ { proxy_pass http://127.0.0.1:9000/uploads/; proxy_set_header X-Forwarded-For $remote_addr; } ``` -------------------------------- ### Configure Name with Whitespace Source: https://thelounge.chat/docs/usage Sets a configuration option with a value containing whitespace by wrapping the value in quotes. ```bash thelounge start -c defaults.name="Cool Network" ``` -------------------------------- ### runAsUser Source: https://thelounge.chat/docs/api/public-client Allows you to make the client send a message or run a command. This method simulates a user executing an IRC command within a specified channel. ```APIDOC ## runAsUser(command: String, targetId: String) ### Description Allows you to make the client send a message/run a command. ### Method N/A (SDK Method) ### Parameters #### Arguments - **command** (String) - Required - IRC command to run, this is in the same format that a client would send to the server (eg: JOIN #test). - **targetId** (String) - Required - The id of the channel to simulate the command coming from. Replies will go to this channel if appropriate ``` -------------------------------- ### Execute The Lounge Commands as System User Source: https://thelounge.chat/docs/usage When running The Lounge as a system service on Unix-like systems, execute all commands as the 'thelounge' user using 'sudo -u'. ```bash sudo -u thelounge thelounge ``` -------------------------------- ### Default Network Configuration Source: https://thelounge.chat/docs/configuration Specifies default network information used as placeholder values in the Connect window. This includes server host, port, TLS settings, and user credentials. ```javascript defaults: { name: "Libera.Chat", host: "irc.libera.chat", port: 6697, password: "", tls: true, rejectUnauthorized: true, nick: "thelounge%%", username: "thelounge", realname: "The Lounge User", join: "#thelounge" } ``` -------------------------------- ### Referencing Theme Files in CSS Source: https://thelounge.chat/docs/guides/theme-creation Use the `/packages//` path to reference additional files distributed with the theme. ```css @font-face { font-family: "Alternative Font Name"; src: url(/packages//alternative-font.woff2) format("woff2"); } ``` -------------------------------- ### Advanced WEBIRC Configuration with Function Source: https://thelounge.chat/docs/configuration Configure WEBIRC using a function for more complex scenarios, allowing modification of the webirc object before it's passed to irc-framework. This enables dynamic hostname generation or other advanced options. ```javascript webirc: { "irc.example.com": (webircObj, network) => { webircObj.password = "thisiswebircpassword"; webircObj.hostname = `webirc/${webircObj.hostname}`; return webircObj; }, } ``` -------------------------------- ### Redbird with Let's Encrypt Source: https://thelounge.chat/docs/guides/reverse-proxies Node.js configuration for Redbird to proxy requests with automatic Let's Encrypt SSL. ```javascript const redbird = require("redbird")({ port: 80, // Port to listen HTTP connections letsencrypt: { path: __dirname + "/certs/", // Certificates will be saved, updated and archived there }, ssl: { port: 443, // Port to listen HTTPS connections }, }); redbird.register("example.com", "http://127.0.0.1:9000", { ssl: { letsencrypt: { email: "mail@example.com", // Must be a host with MX record production: true, // WARNING: Only use this flag when the proxy is verified to work correctly to avoid being banned! } } }); ``` -------------------------------- ### Configure Nested Debug Option Source: https://thelounge.chat/docs/usage Sets a nested configuration option using dot notation with the --config flag. ```bash thelounge start -c debug.raw=true ``` -------------------------------- ### Add a new command Source: https://thelounge.chat/docs/api/commands Registers a new command for users. The `input` function defines the command's behavior, and `allowDisconnected` determines if it can be run offline. ```javascript const helloWorldCommand = { input: function (client, target, command, args) { if(args.length === 0) { client.sendMessage("Hello World", target.chan); } else { client.sendMessage("Hello " + args[0], target.chan); } }, allowDisconnected: true }; module.exports = { onServerStart: api => { api.Commands.add("helloworld", helloWorldCommand); }, }; ``` -------------------------------- ### createChannel Source: https://thelounge.chat/docs/api/public-client Allows you to create a new channel with specified attributes. You can define various properties of the channel, including its ID, messages, name, key, topic, type, state, and user information. ```APIDOC ## createChannel(attributes: Object) ### Description Allows you to create a new channel. ### Method N/A (SDK Method) ### Parameters #### Arguments - **attributes** (Object) - Required - An object containing channel attributes: - **id** (Number) - Optional - The id of the channel, defaults to 0. - **messages** (Array of Msg) - Optional - The messages of the channel, defaults to empty array. - **name** (String) - Optional - The name of the channel, defaults to empty string. - **key** (String) - Optional - The key of the channel, defaults to empty string. - **topic** (String) - Optional - The topic of the channel, defaults to empty string. - **type** (Chan.Type) - Optional - The type of the channel, defaults to `CHANNEL`. Available types: `CHANNEL`, `LOBBY`, `QUERY`, `SPECIAL`. Special is used for banlist, invitelist, channellist or ignorelist. - **state** (Chan.State) - Optional - The state of the channel, defaults to `PARTED`, Possible states: `PARTED`, `JOINED`. - **firstUnread** (Number) - Optional - The first unread message, defaults to 0. - **unread** (Number) - Optional - The number of unread messages, defaults to 0. - **highlight** (Number) - Optional - The number of highlights, defaults to 0. - **users** (Map from String to User) - Optional - The users of the channel, key is the lowercase nick, the value is the user object. Defaults to empty map. ``` -------------------------------- ### Enlarge Images in Link Previews Source: https://thelounge.chat/docs/guides/custom-css Increases the maximum width and height of thumbnail images in link previews. Also adjusts text wrapping for descriptions to accommodate larger images. ```css #chat .toggle-content .thumb { max-width: 200px; max-height: 200px; } #chat .toggle-text { /* Larger images means that there is more than one line of space available for the description, so it can wrap to multiple lines */ white-space: initial; } ``` -------------------------------- ### Remove a User Source: https://thelounge.chat/docs/users Use the `remove` command to delete a user's configuration. This action takes effect immediately, disconnecting the user if The Lounge is running. Log files are not deleted. ```bash thelounge remove ``` -------------------------------- ### Nginx Configuration for The Lounge Source: https://thelounge.chat/docs/guides/reverse-proxies Basic Nginx configuration to proxy requests to The Lounge. Ensure 'proxy_read_timeout' is set appropriately for long-lived connections. ```nginx location / { proxy_pass http://127.0.0.1:9000/; proxy_http_version 1.1; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; # by default nginx times out connections in one minute proxy_read_timeout 1d; } ``` -------------------------------- ### Configure oidentd for standalone use with The Lounge Source: https://thelounge.chat/docs/guides/identd-and-oidentd This configuration allows oidentd to handle ident requests by reading The Lounge user information from a file. It enables spoofing capabilities for user identification. ```bash user "thelounge" { default { allow spoof allow spoof_all } } ``` -------------------------------- ### HAProxy Configuration Source: https://thelounge.chat/docs/guides/reverse-proxies HAProxy configuration to route traffic to The Lounge based on host header. ```haproxy frontend main bind *:1000 option forwardfor http-request set-header X-Forwarded-Proto https if { ssl_fc } acl thelounge_site hdr(host) thelounge.example.com use_backend thelounge if thelounge_site backend thelounge server thelounge 127.0.0.1:9000 ``` -------------------------------- ### Compact Sidebar Source: https://thelounge.chat/docs/guides/custom-css Reduces spacing in the sidebar to display more networks and channels on screen. ```css #sidebar .networks { padding: 10px 0; } #sidebar .network { margin-bottom: 10px; } .channel-list-item { padding: 5px 15px; } ``` -------------------------------- ### Logger Methods Source: https://thelounge.chat/docs/api/logger Methods for logging messages at different severity levels. All methods accept a variable number of arguments which are converted to strings and appended. ```APIDOC ## Logger Methods ### Description Provides methods to log messages at different severity levels. Messages are automatically prefixed with the plugin name. Accepts any number of JavaScript objects as arguments, which are converted to their string representations and appended together. ### Methods - `error(...args)`: Logs a message with the highest severity. - `warn(...args)`: Logs a message with a warning severity. - `info(...args)`: Logs an informational message. - `debug(...args)`: Logs a debug message with the lowest severity. ### Example ```javascript module.exports = { onServerStart(api) { api.Logger.debug("hello world") const err = doSomethingThatMayFail() if (err) { api.Logger.error("failed to do something", err) } } }; ``` ``` -------------------------------- ### Thinner User List Source: https://thelounge.chat/docs/guides/custom-css Reduces the width of the user list panel in the chat view. ```css #chat .userlist { width: 150px; } ``` -------------------------------- ### Reset User Password Source: https://thelounge.chat/docs/users Use the `reset` command to change a user's password. You will be interactively prompted for a new password. The change takes effect immediately without requiring a server restart. ```bash thelounge reset ``` -------------------------------- ### Custom Nick Colors Source: https://thelounge.chat/docs/guides/custom-css Applies a specific color to a target nick in both the user list and the chat area. Matching is case-insensitive. ```css #chat .msg .user[data-name="targetnick" i], #chat .userlist .names .user[data-name="targetnick" i] { color: #ff79c6; } ``` -------------------------------- ### Nginx Configuration for Subfolder Access Source: https://thelounge.chat/docs/guides/reverse-proxies Modify the 'location' directive to serve The Lounge from a subfolder, e.g., '/irc/'. ```nginx location ^~ /irc/ { proxy_pass http://127.0.0.1:9000/; proxy_http_version 1.1; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; # by default nginx times out connections in one minute proxy_read_timeout 1d; } ``` -------------------------------- ### Caddy Reverse Proxy Source: https://thelounge.chat/docs/guides/reverse-proxies Basic Caddy configuration to proxy requests to The Lounge. ```caddy reverse_proxy http://127.0.0.1:9000 ``` -------------------------------- ### sendToBrowser Source: https://thelounge.chat/docs/api/public-client Emits an event to the browser client with specified data. This is used to communicate events and data from the server to the browser interface. ```APIDOC ## sendToBrowser(event: String, data: Object) ### Description Emits an `event` to the browser client, with `data` in the body of the event. ### Method N/A (SDK Method) ### Parameters #### Arguments - **event** (String) - Required - Name of the event, must be something the browser will recognise. - **data** (Object) - Required - Body of the event, can be anything, but will need to be properly interpreted by the client. ``` -------------------------------- ### getPersistentStorageDir() Source: https://thelounge.chat/docs/api/config Returns the directory path for storing persistent plugin files. ```APIDOC ## getPersistentStorageDir() ### Description Returns the pathname a plugin may use to store persistent files (say databases, images or similar things which are considered state). ### Method GET ### Endpoint /config/persistent-storage ### Parameters None ### Request Example None ### Response #### Success Response (200) - **path** (string) - The absolute path to the persistent storage directory. #### Response Example ```json { "path": "/var/lib/thelounge/plugins/myplugin/data" } ``` ``` -------------------------------- ### sendMessage Source: https://thelounge.chat/docs/api/public-client Sends a message to a specified channel. The message will be displayed as a plugin message, with the sender name derived from the plugin's package.json. ```APIDOC ## sendMessage(text: String, chan: Chan) ### Description Sends a message to this client, displayed in the given channel. This message will be displayed as a plugin message, the sender will be the name of your plugin (defined in your package.json under thelounge.name) and defaults to the package name. ### Method N/A (SDK Method) ### Parameters #### Arguments - **text** (String) - Required - The content of the message. - **chan** (Chan) - Required - The channel to send this message into. ``` -------------------------------- ### Display Action Messages in Italics Source: https://thelounge.chat/docs/guides/custom-css Styles action messages (e.g., `/me` commands) in italics. Applies italic font style to the sender, message type, and content. ```css #chat .msg[data-type="action"] .from::before, #chat .msg[data-type="action"] .from, #chat .msg[data-type="action"] .content, #chat .msg[data-type="action"] .user { font-style: italic; } ``` -------------------------------- ### Wrap Nicks with Chevrons Source: https://thelounge.chat/docs/guides/custom-css Adds `<` and `>` characters around sender nicks in messages for a specific format. ```css #chat .msg[data-type="message"] .from .user::before { content: "<"; } #chat .msg[data-type="message"] .from .user::after { content: ">"; } ``` -------------------------------- ### Change Default Font Source: https://thelounge.chat/docs/guides/custom-css Applies a different font family to the entire application body. ```css body { font-family: "Comic Sans MS"; } ``` -------------------------------- ### Thinner Channel Sidebar Source: https://thelounge.chat/docs/guides/custom-css Reduces the width of the channel sidebar. ```css #sidebar { width: 180px; } ``` -------------------------------- ### Hide Account Names in Joins Source: https://thelounge.chat/docs/guides/custom-css Removes the account name part (e.g., `[ExampleAccount]`) from join messages. ```css #chat .account { display: none; } ``` -------------------------------- ### Hide Hostmasks Source: https://thelounge.chat/docs/guides/custom-css Removes the ident and hostmask part (e.g., `(~ident@irc.example.com)`) from join, part, and quit messages. ```css #chat .hostmask { display: none; } ``` -------------------------------- ### getChannel Source: https://thelounge.chat/docs/api/public-client Looks up a channel by its ID. This method retrieves channel information based on the provided channel ID. ```APIDOC ## getChannel(channelId: Number) ### Description Looks up a channel by ID. ### Method N/A (SDK Method) ### Parameters #### Arguments - **channelId** (Number) - Required - The id of the channel to return. ``` -------------------------------- ### Hide Insecure Warning Source: https://thelounge.chat/docs/guides/custom-css Hides the 'Insecure Warning' indicator (yellow triangle icon) in the sidebar. Useful for users who prefer a cleaner interface. ```css /* Hide Insecure Warning */ #sidebar .not-secure-tooltip { display: none; } ``` -------------------------------- ### Hide Link Previews for a Specific User Source: https://thelounge.chat/docs/guides/custom-css Hides link previews and toggle buttons for messages originating from a specific user. Useful for silencing bots that auto-fetch previews. ```css #chat .msg[data-from="MyBot"] .preview, #chat .msg[data-from="MyBot"] .toggle-preview { display: none; } ``` -------------------------------- ### Customize Sidebar Channel Badges Source: https://thelounge.chat/docs/guides/custom-css Replaces unread counters in the sidebar with a circular badge. Allows customization of badge colors for unread messages and mentions. ```css /* Do not touch this */ .channel-list-item .badge { text-indent: -9999px; background: 0; height: 10px; width: 10px; border-radius: 50%; margin: auto; padding: 0;} /* Replace the #xxxxxx bit with the color that you want if there are unread messages. */ .channel-list-item .badge { background-color: #0000ff;} /* Replace the #xxxxxx bit with the color that you want if you were mentioned */ .channel-list-item .badge.highlight { background-color: #ff9900 ;} ``` -------------------------------- ### No Nick Indentation Source: https://thelounge.chat/docs/guides/custom-css Forces messages to align directly next to the nick, mimicking a mobile view and preventing indentation. ```css #chat .content { padding-left: 0; } #chat .messages { display: block; } #chat .time { display: inline; } #chat .from, #chat .text { background: none; border: 0; display: inline; } #chat .from { width: auto; padding-left: 5px; padding-right: 5px; -webkit-mask-image: none; mask-image: none; } ``` -------------------------------- ### Hide Link Previews in a Channel Source: https://thelounge.chat/docs/guides/custom-css Hides link previews and their toggle buttons for all messages in a specified channel. Prevents automatic fetching and display of URL content. ```css #chat-container[data-current-channel="#thelounge"] .preview, #chat-container[data-current-channel="#thelounge"] .toggle-preview { display: none; } ``` -------------------------------- ### Hide Message Input Bar in a Channel Source: https://thelounge.chat/docs/guides/custom-css Hides the message input bar for a specific channel. Recommended for channels where message sending is disabled, such as news feeds. ```css #chat-container[data-current-channel="#thelounge"] #form { display: none; } ``` -------------------------------- ### Hide Sidebar Close Buttons Source: https://thelounge.chat/docs/guides/custom-css Removes the '×' close buttons from active channel list items to prevent accidental channel leaving. ```css .channel-list-item.active .close-tooltip { display: none; } ``` -------------------------------- ### Hide Join/Part/Quit in Specific Channel Source: https://thelounge.chat/docs/guides/custom-css Hides status messages (join, part, quit) only within a specified channel, identified by its data attribute. ```css #chat-container[data-current-channel="#thelounge"] .msg[data-type="quit"], #chat-container[data-current-channel="#thelounge"] .msg[data-type="part"], #chat-container[data-current-channel="#thelounge"] .msg[data-type="join"] { display: none; } ``` -------------------------------- ### Hide Messages with Links in a Channel Source: https://thelounge.chat/docs/guides/custom-css Hides all message content containing links within a specific channel. Useful for channels where link previews are not desired. ```css #chat-container[data-current-channel="#thelounge"] .content a { display: none; } ``` -------------------------------- ### Hide Unread Counters for Muted Channels Source: https://thelounge.chat/docs/guides/custom-css Hides the unread message badge for channels that are muted in the sidebar. Ensures muted channels do not display unread indicators. ```css .channel-list-item.is-muted .badge { display: none; } ``` -------------------------------- ### Disable IRC Styling in Messages Source: https://thelounge.chat/docs/guides/custom-css Removes all inline IRC styling (colors, bold, italics, etc.) from message content. ```css #chat .content span[class*="irc-"] { color: inherit; background-color: inherit; font-weight: inherit; font-style: inherit; font-family: inherit; text-decoration: inherit; } ``` -------------------------------- ### Increase Custom CSS Field Height Source: https://thelounge.chat/docs/guides/custom-css Use this snippet to make the custom CSS input area larger for easier editing. ```css textarea#user-specified-css-input { height: 400px; } ``` -------------------------------- ### Adjust Message Spacing Source: https://thelounge.chat/docs/guides/custom-css Modifies the vertical padding for message elements to control spacing and density. Lower values increase density, higher values improve readability. ```css #chat .time, #chat .from, #chat .content { padding-top: 2px; padding-bottom: 2px; } ```