inspircd / inspircd-docker

InspIRCd Docker image
https://hub.docker.com/r/inspircd/inspircd-docker
MIT License
112 stars 41 forks source link

How to override with conf.d? #147

Closed dluc closed 6 months ago

dluc commented 6 months ago

Super easy to start the server and everything works, however I'd like to customize some settings, e.g. I don't want to block local apps while I'm developing and testing my code. I'm trying to figure out what I should put under conf.d folder...

Here's how I start the server:

docker run -it --rm --name inspircd -p 6667:6667 -v ./inspircd:/inspircd/conf.d/ inspircd/inspircd-docker

and under "inspircd" dir I added an overrides.conf file that looks like this:

<connect
    # name: Name to use for this connect block. Mainly used for
    # connect class inheriting.
    name="main2"

    # allow: The IP address or hostname of clients that can use this
    # class. You can specify either an exact match, a glob match, or
    # a CIDR range here.
    allow="*"

    # password: Password to use for this block/user(s)
    password="foobar"

    maxchans="200"
    localmax="300"
    globalmax="300"
    resolvehostnames="no"
    modes="+x">

I have no idea why I can't override "main" settings, I get an error, so I created "main2". Is that the right approach? Does the file content make sense?

I'm testing the password "foobar" but the config doesn't seem to work, e.g. clients can sign in without a password or with any incorrect password.

genius3000 commented 6 months ago

I don't think overriding works here, at least I know it doesn't with a non-Docker install of InspIRCd, assuming Docker install would be the same. That'd explain receiving an error trying to use the name 'main', guessing the error is for the duplicate name. In fact, the Docker notes clarify under Generic configuration includes:

You have to take care about possible conflicts with the existing configuration. If you want a full custom configuration, copy or mount it to /inspircd/conf/ instead of /inspircd/conf.d/.

As for the password not seeming to take effect, I'm guessing all your connections are ending up in the default 'main' connect class (allow all, port 6667). Connect classes are checked from top to bottom, likely the include for the 'conf.d' folder happens after that 'main' class is defined.