Skip to content
Snippets Groups Projects
  1. Oct 31, 2015
    • Andrew Price's avatar
      Fix !folder name command · 0ac74891
      Andrew Price authored
      !folder name was not working because strlen("name") was expected to be
      5. Expect it to be 4 instead.
      0ac74891
    • Andrew Price's avatar
      Folder file overhaul · 6bcd1e4b
      Andrew Price authored
      This moves the folder index, text, moderation and tmp files into
      directories corresponding to the file name suffixes currently in use.
      
      Old                     New
      ---                     ---
      STATEDIR/foo.i          STATEDIR/index/foo
      STATEDIR/foo.i.m        STATEDIR/index/mod/foo
      STATEDIR/foo.i.t        STATEDIR/index/new/foo
      STATEDIR/foo.t          STATEDIR/text/foo
      STATEDIR/foo.t.m        STATEDIR/text/mod/foo
      STATEDIR/foo.t.t        STATEDIR/text/new/foo
      
      This has the following advantages:
      1. No more ugly folder path building all over the place
      2. STATEDIR and PATHSIZE used in far fewer places
      3. No longer assumes paths to folder files will fit in 256 chars
      4. A tidier STATEDIR
      5. Better separation of concerns (more folder stuff hidden in folders.c)
      6. Should make it easier to move the folder stuff into the server
      7. Improved error checking/reporting
      
      This makes use of the *at family of syscalls so, instead of building
      paths, we now use file descriptors.
      6bcd1e4b
  2. Oct 29, 2015
  3. Oct 24, 2015
  4. Oct 23, 2015
  5. Oct 22, 2015
  6. Oct 21, 2015
  7. Oct 19, 2015
  8. 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
  9. Oct 17, 2015
  10. Oct 12, 2015
Loading