Skip to content
Snippets Groups Projects
  1. Nov 11, 2015
  2. Nov 07, 2015
  3. Oct 23, 2015
    • Andrew Price's avatar
      Introduce struct user · a8b7a0a2
      Andrew Price authored
      Wrap the userposn and struct person in a new user structure which can be
      used to pass around all of the date related to the user, not just the
      on-disk bits. This should make things easier down the line when
      replacing the users.bb format with a more flexible one.
      a8b7a0a2
  4. Oct 21, 2015
  5. Oct 18, 2015
    • Andrew Price's avatar
      Add a configuration system to the server · 83256d1c
      Andrew Price authored
      Until now configuring mwserv has been limited to command line options
      and build configuration. This config system should make things a bit
      more flexible by adding the ability to load bits and pieces from a
      json config file (or many json config files).
      
      This is how it works:
      1. A json object 'cfg' is built containing the build-time defaults for
         each config option recognised by mwserv. This will be used to
         validate the options in config files later.
      2. A json config file in the user's home directory is loaded if it
         exists. It does not have to be complete: its contents will be merged
         into the defaults. Unrecognised options are ignored.
      3. Otherwise, a config file in /etc is loaded and used similarly.
      4. Command line options are parsed and the cfg object is updated with
         cfg_set_* in the order in which the options are found.
         4a. If the [--config|-c <file>] option is encountered, the file is
         loaded and merged into the cfg object as before.
      5. Once all of the config information is gathered and merged into the
         cfg object, if the [--print-config|-P] option was given, the final
         merged config is printed in json format (mwserv then exits).
      6. Config options are then accessed using the cfg_get_* type-specific
         functions.
      
      This should allow the build system to be simplified in future, e.g.
      'make test' could go away in favour of using ~/.mwserv.conf to store
      the test environment configuration.
      
      For now, the place to add new config options and their default values is
      in cfg_init_defaults() in servercfg.c.
      83256d1c
  6. Oct 17, 2015
  7. Oct 08, 2015
  8. Nov 01, 2013
  9. Oct 31, 2013
    • Andrew Price's avatar
      Split out the who file stuff from files.* into who.* and tidy up the code a... · 99262954
      Andrew Price authored
      Split out the who file stuff from files.* into who.* and tidy up the code a bit. Intention here is to modularise the who file code so that it can be replaced with a server-managed sqlite db (or whatever) easily in future. There's still a lot of code which does its own operations on the who file with read() and lseek() so a good next step will be to hide that code behind an iterator or similar.
      
      99262954
  10. Dec 12, 2012
  11. Nov 29, 2012
  12. Nov 28, 2012
  13. Nov 19, 2012
  14. Nov 18, 2012
  15. Nov 17, 2012
  16. Nov 07, 2012
  17. Nov 06, 2012
  18. Nov 05, 2012
  19. Nov 04, 2012
  20. Nov 03, 2012
Loading