Changeset 507 in code


Ignore:
Timestamp:
Apr 21, 2021, 4:15:04 PM (4 years ago)
Author:
contact
Message:

Make db and log config options more future-proof

Rename the "sql" directive to "db". Rename the "log" directive to
"log fs".

In the future, we'll maybe support more databases and more message
stores. Make it so it's easy to integrate these new festures to the
config file format.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/config.in

    r506 r507  
    1 sql sqlite3 /var/lib/soju/main.db
    2 log /var/lib/soju/logs/
     1db sqlite3 /var/lib/soju/main.db
     2log fs /var/lib/soju/logs/
  • trunk/config/config.go

    r426 r507  
    8787                        }
    8888                        srv.TLS = tls
    89                 case "sql":
     89                case "db":
    9090                        if err := d.ParseParams(&srv.SQLDriver, &srv.SQLSource); err != nil {
    9191                                return nil, err
    9292                        }
    9393                case "log":
    94                         if err := d.ParseParams(&srv.LogPath); err != nil {
     94                        var driver string
     95                        if err := d.ParseParams(&driver, &srv.LogPath); err != nil {
    9596                                return nil, err
     97                        }
     98                        if driver != "fs" {
     99                                return nil, fmt.Errorf("directive %q: unknown driver %q", d.Name, driver)
    96100                        }
    97101                case "http-origin":
  • trunk/doc/soju.1.scd

    r491 r507  
    102102        Enable TLS support. The certificate and the key files must be PEM-encoded.
    103103
    104 *sql* <driver> <source>
    105         Set the SQL driver settings. The only supported driver is "sqlite3". The
    106         source is the path to the SQLite database file. By default, the path to the
    107         database file is "soju.db".
    108 
    109 *log* <path>
     104*db* sqlite3 <path>
     105        Set the SQLite database path (default: "soju.db" in the current directory).
     106
     107*log* fs <path>
    110108        Path to the bouncer logs root directory, or empty to disable logging. By
    111109        default, logging is disabled.
Note: See TracChangeset for help on using the changeset viewer.