Changes between Initial Version and Version 3 of Ticket #28737


Ignore:
Timestamp:
Dec 7, 2018, 8:23:42 AM (11 months ago)
Author:
teor
Comment:

Tweak the spec.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28737 – Description

    initial v3  
    33Here's a better scheme:
    441. sbws config.default.ini and config.ini contain the following sections:
    5   * tor.launch_options: a minimal set of options that must be configured when tor is launched. The minimal set contains the data directory config, control config, and log config. The network is disabled at launch. The initial options are:
     5  * tor.options.launch: a minimal set of options that must be configured when tor is launched. The minimal set contains the data directory config, control config, and log config. The network is disabled at launch. The initial options are:
    66{{{
    77    'DataDirectory': conf.getpath('tor', 'datadir'),
     
    2626    'DisableNetwork': '1',
    2727}}}
    28   * tor.runtime_options: any other tor options that can be set at runtime. The network is enabled at runtime. The initial options are:
     28  * tor.options.runtime.(group_name): Zero or more groups of tor options that can be set at runtime. The network is enabled at runtime. The "50-default" group of options is:
    2929{{{
    3030    # We will find out via the ControlPort and not setting something static
     
    4545    'DisableNetwork': '0',
    4646}}}
    47   * Zero or more tor.ignore_failure_options.(group name): tor options that are set in groups at runtime, but ignored if they fail. #28692 and #28694 will add options to this list.
     47  * Zero or more tor.runtime.ignore_failure.(group name): tor options that are set in groups at runtime, but ignored if they fail. #28692 and #28694 will add options to this list.
    4848
    49 Options in config.ini override options with the same name in sbws.default.ini, with + and / having the same meaning as in a torrc file (+ appends, / removes). Tor will make ignore failure options replace runtime options, and both replace launch options.
     49Options in config.ini override options with the same name in sbws.default.ini, with + and / having the same meaning as in a torrc file (+ appends, / removes). Launch options are applied first, then runtime options are applied in group name order. Tor will make later runtime options replace earlier runtime options, and launch options.
    5050
    51512. sbws gets its control socket from the launch_options ControlSocket option(s)
     
    5353
    54544. For backwards compatibility:
    55   * if tor.extra_lines is present, it should be applied at launch. sbws' option merging code never worked, so we can just append extra_lines to launch_options. This shouldn't cause any more issues than the existing code.
    56   * if these sbws options are present in an old config file, synthesise the corresponding torrc options. If launch_options is also present, it overrides the synthetic options. (sbws' option merging never worked for these options.)
     55  * if tor.extra_lines is present, it should be appended to tor.options.launch. sbws' option merging code never worked, so appending shouldn't cause any more issues than the existing code.
     56  * if any of these sbws options are present in an old config file, synthesise options.launch from the sbws options. If options.launch is also present in the same config file, it overrides the synthetic options. (sbws' option merging never worked for these options.)
    5757{{{
    5858        'DataDirectory': conf.getpath('tor', 'datadir'),
     
    7070
    7171The final option order is:
    72 * sbws merges launch_options:
     72* sbws creates options.launch, using the last option from:
    7373  * synthetic legacy config options from config.default.ini
    74   * launch_options + extra_lines from config.default.ini
     74  * options.launch from config.default.ini
    7575  * synthetic legacy config options from config.ini
    76   * launch_options + extra_lines from config.ini
    77 * sbws merges runtime_options from:
     76  * options.launch from config.ini
     77* sbws appends extra_lines to options.launch, using the last extra_lines from:
    7878  * config.default.ini
    7979  * config.ini
    80 * sbws merges each group of ignore_failure_options from:
     80* sbws creates options.runtime groups, using the last one of each group from:
    8181  * config.default.ini
    8282  * config.ini
    8383
    84 sbws launches tor with launch_options, then applies runtime_options, then applies each group of ignore_failure_options.
     84sbws launches tor with options.launch, then applies each group of options.runtime in order.
    8585
    8686This is a new feature, so it should go in sbws 1.1.