links icon indicating copy to clipboard operation
links copied to clipboard

Default config entries shadow CLI arguments

Open ChefYeum opened this issue 4 years ago • 4 comments

Port number supplied via --set flag does not seem to override the port given in the default config file.

Suppose you have the following config in the default config file $OPAM_SWITCH_PREFIX/etc/links/config which specifies the port:

port=8081

You then run some Links server with a flag to specify a different port like so:

links example.links --set=port=8082

The server runs in 8081 in the config file, and not 8082 in the flag.

ChefYeum avatar Aug 06 '21 17:08 ChefYeum

We should delete the port= entry from the default configuration file as the default value for the setting port is 8080.

dhil avatar Aug 06 '21 20:08 dhil

The default config does not specify the port

$ cat $OPAM_SWITCH_PREFIX/etc/links/config
jsliburl=/lib/js
jslibdir=/home/dhil/.opam/4.11.2/lib/links/js
stdlib_path=/home/dhil/.opam/4.11.2/lib/links/stdlib
#database_driver=postgresql
#database_args=localhost:5432:user:pass

dhil avatar Aug 06 '21 20:08 dhil

I agree there is an issue with the default config entries shadowing whatever options have been supplied on the commandline. However, the particular instance you describe here with port can only occur if you have manually modified the default config.

dhil avatar Aug 07 '21 06:08 dhil

Yeah, I'm referring to the case where the default config is modified.

ChefYeum avatar Aug 09 '21 09:08 ChefYeum