Cannot get WebIRC to work with thelounge

If your UnrealIRCd is up and running but you have a question about it, then use this forum.
(NOT for installation or connecting issues! Use the other forum instead.)

Moderator: Supporters

Post Reply
danielp
Posts: 1
Joined: Tue Apr 06, 2021 8:50 pm

Cannot get WebIRC to work with thelounge

Post by danielp »

I installed the lounge via yarn global add and configured the Unreal Webirc block and thelounges Webirc block no errors are being given and everyone is still using the ip of my VPS when they connect.

This is thlounge's Webirc Block

Code: Select all

 //
        // 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
        //   webirc: {
        //     "irc.example.net": "thisiswebircpassword1",
        //     "irc.example.org": "thisiswebircpassword2",
        //   },
        //   ```
        //
        // - **Advanced**: an object where keys are IRC hosts and values are functions
        //   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:
        //
        //   ```js
        //   webirc: {
        //     "irc.example.com": (webircObj, network) => {
        //       webircObj.password = "thisiswebircpassword";
        //       webircObj.hostname = `webirc/${webircObj.hostname}`;
        //       return webircObj;
        //     },
        //   },
        //   ```
        //
        // This value is set to `null` to disable WEBIRC by default.
        webirc: {
                "51.222.193.93": "webirclink",
        },
This is Unrealircd's Webirc block

Code: Select all

webirc {
        mask 51.161.32.214;
        password "webirclink";
};
except ban {
        mask 51.161.32.214;
        type { connect-flood; unknown-data-flood; blacklist; };
};
This is the bind and hosts section of thelounge

Code: Select all

module.exports = {
        // ## Server settings

        // ### `public`
        //
        // When set to `true`, The Lounge starts in public mode. When set to `false`,
        // it starts in private mode.
        //
        // - 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.
        //
        // This value is set to `false` by default.
        public: true,

        // ### `host`
        //
        // 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.
        //
        // For UNIX domain sockets, use `"unix:/absolute/path/to/file.sock"`.
        //
        // This value is set to `undefined` by default to listen on all interfaces.
        host: undefined,

        // ### `port`
        //
        // Set the port to listen to.
        //
        // This value is set to `9000` by default.
        port: 9000,

        // ### `bind`
        //
        // Set the local IP to bind to for outgoing connections.
        //
        // This value is set to `undefined` by default to let the operating system
        // pick its preferred one.
        bind: "51.161.32.214",
this is the output of ifconfig

Code: Select all

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 51.161.32.214  netmask 255.255.255.255  broadcast 51.161.32.214
        ether fa:16:3e:31:81:82  txqueuelen 1000  (Ethernet)
        RX packets 260650  bytes 161547680 (154.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 248535  bytes 46270550 (44.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 51.222.193.93  netmask 255.255.255.255  broadcast 51.222.193.93
        ether fa:16:3e:31:81:82  txqueuelen 1000  (Ethernet)

eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 51.222.193.94  netmask 255.255.255.255  broadcast 51.222.193.94
        ether fa:16:3e:31:81:82  txqueuelen 1000  (Ethernet)
 
unreal is using 51.222.193.93
Sensiva
Posts: 3
Joined: Sat Apr 10, 2021 1:47 pm

Re: Cannot get WebIRC to work with thelounge

Post by Sensiva »

In order to get webirc to work correctly with TheLounge I did it this way in my local network test (TheLounge is on a separate machine)
TheLounge webirc block

Code: Select all

webirc: {
               "IRC_Server_Domain_Name": "Pa$$w0rD",
       },
NOT the IP address, NOT the server name defined in the unrealircd.conf.. those didn't work for me. I used the domain name specified in the unrealircd machine hosts file

UnrealIRCD webirc block

Code: Select all

webirc {
        mask IP_ADDRESS_OF_THELOUNGE_MACHINE;
        password "Pa$$w0rD";
};
NOT the hostname, NOT the domain name.. THE IP ADDRESS!

I am not sure yet what is the mechanism behind this exactly. But I am suspecting it is related to network configuration and TheLounge way of authenticating.

I hope this helps
PeGaSuS
Posts: 80
Joined: Tue Jun 27, 2017 4:42 pm

Re: Cannot get WebIRC to work with thelounge

Post by PeGaSuS »

Code: Select all

webirc: {
                "51.222.193.93": "webirclink",
        },
1) Try to make the above in one line like:

Code: Select all

webirc: { "51.222.193.93": "webirclink" },
2) Restart TheLounge and rehash the IRCd.

3) If that doesn't work, if TheLounge is in the same machine as UnrealIRCd, use localhost for that.

4) Give feedback.

Cheers

NOTE: Edited to fix wrong quoting (original answer was via mobile :D)
Last edited by PeGaSuS on Sat Apr 10, 2021 4:33 pm, edited 2 times in total.
What goes around comes around!
Sensiva
Posts: 3
Joined: Sat Apr 10, 2021 1:47 pm

Re: Cannot get WebIRC to work with thelounge

Post by Sensiva »

PeGaSuS wrote: Sat Apr 10, 2021 2:20 pm

Code: Select all

webirc: {
               "IRC_Server_Domain_Name": "Pa$$w0rD",
       },
1) Try to make the above in one line like:

Code: Select all

webirc: { "irc_server_ip": "password_of_thelounge" },
2) Restart TheLounge and rehash the IRCd.

3) If that doesn't work, if TheLounge is in the same machine as UnrealIRCd, use localhost for that.

4) Give feedback.

Cheers
Me or the original poster?
Lord255
Posts: 86
Joined: Sat Feb 29, 2020 12:58 am
Location: offline

Re: Cannot get WebIRC to work with thelounge

Post by Lord255 »

obviously the person who have problems with this. lol :D
Sensiva
Posts: 3
Joined: Sat Apr 10, 2021 1:47 pm

Re: Cannot get WebIRC to work with thelounge

Post by Sensiva »

I tried PeGaSuS's suggestion and it didn't work.
I found out it works if irc server host value in TheLounge config file is equal to the irc server IP.
i.e. webirc works if host = webirc_server
so if network configuration in TheLounge config file look like this

Code: Select all

        defaults: {
        ..
                host: "irc.server.domain",
                port: 6697,
        ..
        },
Then webirc section in TheLounge should look like this

Code: Select all

webirc: {
               "irc.server.domain": "Pa$$w0rD",
               "
       },
But if network configuration in TheLounge config file look like this

Code: Select all

        defaults: {
        ..
                host: "51.222.193.93",
                port: 6697,
        ..
        },
Then webirc section in TheLounge should look like this

Code: Select all

webirc: {
               "51.222.193.93": "Pa$$w0rD",
               "
       },
I believe this is not related to unrealircd as far as I can understand.
I hope this helps
Post Reply