summaryrefslogtreecommitdiff
path: root/src/app/config/config.h
AgeCommit message (Collapse)Author
2021-05-17Make SAVECONF keep only one backup and add sandbox rules for it. #40317Daniel Pinto
When seccomp sandbox is active, SAVECONF failed because it was not able to save the backup files for torrc. This commit simplifies the implementation of SAVECONF and sandbox by making it keep only one backup of the configuration file.
2020-08-18Merge branch 'maint-0.4.4'David Goulet
2020-08-18Merge branch 'tor-gitlab/mr/121' into maint-0.4.4David Goulet
2020-08-11Rename argument to compute_real_max_mem_in_queues()Nick Mathewson
2020-07-21Rename get_primary_dir_port()Nick Mathewson
Also, remove get_primary_or_port() -- nothing used it.
2020-07-21Rename get_first_advertised_{addr,port}_by_type_af().Nick Mathewson
Rationale: these don't actually give the first advertised address/port, but instead give us the first such port that we are _configured_ to advertise. Putting them in a portconf_ namespace therefore makes sense. Similarly, there are no other functions that get the first configured advertised addr/port, so the "by_type_af()" part is needless. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ get_first_advertised_addr_by_type_af portconf_get_first_advertised_addr \ get_first_advertised_port_by_type_af portconf_get_first_advertised_port
2020-06-25Remove now-unused OPTIONS_DUMP_DEFAULTS.Nick Mathewson
2020-05-05config: New file resolve_addr.{c|h}David Goulet
Move a series of function from config.c into that new file which is related to address resolving. Part of #33789 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-09Merge remote-tracking branch 'tor-github/pr/1801/head'Nick Mathewson
2020-04-01Move LOG_PROTOCOL_WARN to app/config.hteor
LOG_PROTOCOL_WARN was in core/or.h, but the function it depends on is in app/config.h. Put them in the same header, to reduce dependencies. Part of 33633.
2020-03-21Merge branch 'bug32588_042' into bug32588_043teor
Merge static function declaration deletions from bug32588_042 and maint-0.4.3 in app/config/config.c.
2020-03-21Merge branch 'bug32588_041' into bug32588_042teor
2020-03-21Merge branch 'bug32588_035' into bug32588_041teor
Merge tests from maint-0.4.1 with new tests from bug32588_035 in test_router.c.
2020-03-21Add tests for get_first_advertised_{addr,port}_by_type_af()Nick Mathewson
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2020-01-06Merge branch 'haxxpop/tcp_proxy_squashed' into tcp_proxy_squshed_and_mergedNick Mathewson
2019-11-20Some tests for log changes, commit, and rollbackNick Mathewson
2019-11-20Make KeyDirectory's GroupReadable behave the same as CacheDirectory's.Nick Mathewson
In #26913 we solved a bug where CacheDirectoryGroupReadable would override DataDirectoryGroupReadable when the two directories are the same. We never did the same for KeyDirectory, though, because that's a rare setting. Now that I'm testing this code, though, fixing this issue seems fine. Fixes bug #27992; bugfix on 0.3.3.1-alpha.
2019-11-19Split log configuration out of options_act_reversible().Nick Mathewson
2019-11-05config: Rename new global functions with a prefixteor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ get_dirportfrontpage relay_get_dirportfrontpage \ parse_port_config port_parse_config \ count_real_listeners port_count_real_listeners \ parse_transport_line pt_parse_transport_line \ ensure_bandwidth_cap config_ensure_bandwidth_cap \ get_effective_bwrate relay_get_effective_bwrate \ get_effective_bwburst relay_get_effective_bwburst \ warn_nonlocal_ext_orports port_warn_nonlocal_ext_orports \ parse_ports_relay port_parse_ports_relay \ update_port_set_relay port_update_port_set_relay \ get_transport_bindaddr_from_config pt_get_bindaddr_from_config \ get_options_for_server_transport pt_get_options_for_server_transport It was generated with --no-verify, because it has some long lines. Part of 32213.
2019-10-31config: Delete get_list_of_ports_to_forward()teor
Tor has not supported automatic port forwarding for some time.
2019-10-31config: Move relay config actions into the relay moduleteor
This commit: * moves relay config actions into relay_config, * moves get_dirportfrontpage() into relay_config, * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-31config: Move accounting/bandwidth config into the relay moduleteor
This commit: * moves accounting and bandwidth checks into relay_config, * moves testing options checks into relay_config, * moves some other minor checks into relay_config, * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-31config: Move server transport config into the relay moduleteor
This commit: * creates feature/relay/transport_config.[ch], * moves server transport config checks into them, * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-31config: Move relay config checks into the relay moduleteor
This commit: * moves relay config checks into relay_config.[ch], * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-31config: Move relay port parsing into the relay moduleteor
This commit: * creates feature/relay/relay_config.[ch], * moves relay port parsing into them, * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. Part of 32213.
2019-10-24config: make options_act*() mockable.Nick Mathewson
I'll need this for testing options_trial_assign().
2019-10-24config.c: extract validate, check-transition, and set into a functionNick Mathewson
This eliminates duplicated code. The options_validate() function itself is now tests-only.
2019-10-22config validation: make the "old_options" argument const.Nick Mathewson
We can't do this with the "options" argument yet, since several places in the code change those right now.
2019-10-22Remove unused arguments from options_validate().Nick Mathewson
This change breaks compilation; a subsequent commit will fix it with a coccinelle patch.
2019-10-22Make options_init_logs STATIC for testing.Nick Mathewson
2019-10-17Use an enum for quiet_level.Nick Mathewson
2019-10-17Move responsibility for setting the "quiet level" into a table.Nick Mathewson
Previously this was done with a big list of options in main.c which implied "hush" or "quiet". One of these options ("--digests") no longer existed, but we still checked for it. Now we use the table of command-line-only arguments to set this value.
2019-10-17Make the command-line parser understand "commands".Nick Mathewson
Previously these were implemented with a search in options_init_from_torrc(), but that led to each option being declared more than needed: once to say that it was a valid option, and once to say what it meant.
2019-10-17Add a return type for the parsed commandline.Nick Mathewson
Previously it was stored in two outvars, but this is more elegant. I'm going to be expanding this struct in later commits.
2019-10-17config: Add TCPProxy option for haproxy protocolSuphanat Chunhapanya
Read the TCPProxy option and put in or_options_t.
2019-07-24Add a config_mgr_t type to wrap config_format_tNick Mathewson
Remember that our goal in the present refactoring is to allow each subsystem to declare its own configuration structure and variables. To do this, each module will get its own config_format_t, and so we'll want a different structure that wraps several config_format_t objects. This is a "config_mgr_t".
2019-07-24Make config_var and config_fmt const.Nick Mathewson
Now that we have a reasonable implementation for overriding the default options for TestingTorNetwork, we don't need to modify config_var_t structs any more. And therefore, we can have constant format options, like reasonable people.
2019-02-08Merge branch 'maint-0.3.5'Nick Mathewson
2019-02-08Merge branch 'ticket29040_1_changes' into maint-0.3.5Nick Mathewson
2019-01-24hs-v3: add an option param to safe log functionsSuphanat Chunhapanya
We add an option param to safe_str and safe_str_client because in some case we need to use those functions before global_options is set.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-11-05Move the code that knows our tor version into a lowest-level libNick Mathewson
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.