Changeset 317 in code for trunk/config


Ignore:
Timestamp:
Jun 4, 2020, 6:16:23 PM (5 years ago)
Author:
contact
Message:

Allow multiple listeners, default to ircs

Users can now specify multiple "listen" directives in their
configuration file. If -listen is specified on the CLI, it's added to
the list of listeners.

Listeners are now parsed as URLs. If the scheme is missing "ircs" is
assumed. URLs allow to enable/disable TLS on a per-listener basis and
will be used for Unix sockets too.

The default listening address is changed from irc+insecure://:6667 to
ircs://:6697. This avoids setting up an insecure listener opened to
everybody.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/config/config.go

    r200 r317  
    1515
    1616type Server struct {
    17         Addr      string
     17        Listen    []string
    1818        Hostname  string
    1919        TLS       *TLS
     
    2929        }
    3030        return &Server{
    31                 Addr:      ":6667",
    3231                Hostname:  hostname,
    3332                SQLDriver: "sqlite3",
     
    6968                switch d.Name {
    7069                case "listen":
    71                         if err := d.parseParams(&srv.Addr); err != nil {
     70                        var uri string
     71                        if err := d.parseParams(&uri); err != nil {
    7272                                return nil, err
    7373                        }
     74                        srv.Listen = append(srv.Listen, uri)
    7475                case "hostname":
    7576                        if err := d.parseParams(&srv.Hostname); err != nil {
Note: See TracChangeset for help on using the changeset viewer.