YAIP/docs/config.md
Jonathan Hodgson f48a110429 I have made a start
I have done some work on opening a socket and waiting for a connection.
This can be read line by line and I have started a request struct that
it will accept.

Also started on some docs. Not much is yet working. I am going to start
learning µnit for unit tests:

https://nemequ.github.io/munit/
2021-12-27 21:43:11 +00:00

1.4 KiB

Config

There will be 2 config files available. One at

$XDG_CONFIG_HOME/yaip/proxy.conf and one at proxy.conf in the directory that the tool is run from. Either can be overwritten with command line flags.

The config file is (currently), very simple. Empty lines are ignored, as are lines that start with a # symbol. This is useful if you wish to make comments about configuration choices.

The file in $XDG_CONFIG_HOME is parsed first, followed by the file in the current working directory meaning that the config file in the current directory will take precedence.

To set a configuration option, the line should have the configuration option followed by a colon, an optional space and the value it should be set to.

For example:

port: 8080

All options may also be set via a command line switch -c or --config followed by the name and the value.

For example:

yaip --config port 8080

Available Options

port

The listening port.

Default:

port: 8080

database

The database that requests and responses should be stored in.

Default:

database: proxy.sqlite

localConfig

The name of the local config file:

Default:

localConfig: proxy.conf

userConfig

The name of the user config file:

Default:

$XDG_CONFIG_HOME/yaip/proxy.conf

Note: It only makes sense to change this as a command line argument as it is the first config file that is sourced.