aboutsummaryrefslogtreecommitdiff
path: root/src/app/config
AgeCommit message (Collapse)Author
2020-08-14Revise trac.torproject.org urls to refer to gitlab replacements.Nick Mathewson
Closes #40101.
2020-08-05Replace several C identifiers for ticket 18106.Nick Mathewson
We used to have a single boolean, "FascistFirewall". Ages ago, in tickets #17840 and #9067, we added an improved "ReachableAddresses" mechanism. It's time to rename related identifiers in the code for consistency. This closes #18106. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ fascist_firewall_allows_address reachable_addr_allows \ fascist_firewall_use_ipv6 reachable_addr_use_ipv6 \ fascist_firewall_prefer_ipv6_impl reachable_addr_prefer_ipv6_impl \ fascist_firewall_prefer_ipv6_orport reachable_addr_prefer_ipv6_orport \ fascist_firewall_prefer_ipv6_dirport reachable_addr_prefer_ipv6_dirport \ fascist_firewall_allows_address_addr reachable_addr_allows_addr \ fascist_firewall_allows_address_ap reachable_addr_allows_ap \ fascist_firewall_allows_base reachable_addr_allows_base \ fascist_firewall_allows_ri_impl reachable_addr_allows_ri_impl \ fascist_firewall_allows_rs_impl reachable_addr_allows_rs_impl \ fascist_firewall_allows_rs reachable_addr_allows_rs \ fascist_firewall_allows_md_impl reachable_addr_allows_md_impl \ fascist_firewall_allows_node reachable_addr_allows_node \ fascist_firewall_allows_dir_server reachable_addr_allows_dir_server \ fascist_firewall_choose_address_impl reachable_addr_choose_impl \ fascist_firewall_choose_address reachable_addr_choose \ fascist_firewall_choose_address_base reachable_addr_choose_base \ fascist_firewall_choose_address_rs reachable_addr_choose_from_rs \ fascist_firewall_choose_address_ls reachable_addr_choose_from_ls \ fascist_firewall_choose_address_node reachable_addr_choose_from_node \ fascist_firewall_choose_address_dir_server reachable_addr_choose_from_dir_server
2020-08-03Minor style improvements. #30045Daniel Pinto
2020-08-01Add --format argument to --key-expiration option. #30045Daniel Pinto
2020-07-27Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-27Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2020-07-27Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-07-27Merge branch 'maint-0.3.5' into maint-0.4.2Nick Mathewson
2020-07-24fallbackdir: Remove all three Digitalcourage3 relaysDavid Goulet
They are about to be shutdown in September. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24relay: Add a cache that tracks which address was configuredDavid Goulet
Related to #33247 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24relay: Turn find address "method_used" into enumDavid Goulet
Enum allows us to easily compare what is being returned but also better semantic to the code. Related #33247 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-23Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-23Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-07-23Merge branch 'maint-0.3.5' into maint-0.4.2Nick Mathewson
2020-07-23Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2020-07-23fallbackdir: Update list for 2020David Goulet
Closes #40061 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-22Merge branch 'tor-gitlab/mr/74'David Goulet
2020-07-22addr: Always set addr_out to UNSPEC in find_my_addressDavid Goulet
Related #40058 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-22relay: Limit Directory Authority Addresses to Address and ORPortDavid Goulet
Closes #33239 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-21relay: Automatically Enable an IPv6 ORPortDavid Goulet
This commit makes it that if the ORPort is set with a single port, it will bind to both global listen IPv4 and IPv6 addresses. To pin an "ORPort <PORT>" to be IPv4 or IPv6, the IPv4Only/IPv6Only flags are honored thus this will _only_ bind on IPv6 for that port value: ORPort 9050 IPv6Only Results in: [::]:9050 ORPort 9051 IPv4Only Results in: [0.0.0.0]:9051 Attempting to configure an explicit IPv4 address with IPv6Only flag is an error and vice versa. Closes #33246 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-21Rename get_primary_dir_port()Nick Mathewson
Also, remove get_primary_or_port() -- nothing used it.
2020-07-21Extract shared parts of portcfg_get_first_advertised_*()Nick Mathewson
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-07-21relay: Add AddressDisableIPv6 torrc optionDavid Goulet
This option controls if a tor relay will attempt address auto discovery and thus ultimately publish an IPv6 ORPort in the descriptor. Behavior is from proposal 312 section 3.2.6. Closes #33245 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-20Merge remote-tracking branch 'tor-gitlab/mr/51'Nick Mathewson
2020-07-20Merge remote-tracking branch 'tor-gitlab/mr/59'Nick Mathewson
2020-07-20relay: Don't log at warn level when we find an addressDavid Goulet
Dirauth code use the warn log severity when calling find_my_address() which made it that every time we would find an address, it would log a warning. These are not needed below info level and thus set them to info level. An IP change is set to notice by default. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-20test: Unit test for relay_address_new_suggestion()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-20addr: Continue discovery if Address exits but not for wanted familyDavid Goulet
Commit b14b1f2b1d9 was a mistake. In case an Address statement is missing for the wanted family but another one exists for another family, simply continue the address discovery. It is not a mistake to be missing an Address statement for a family because the address could simply be discovered by the next methods. Not all address family requires a specific Address statement. However, we do bail if we couldn't find any valid address for the requested family _and_ a resolve failed meaning we had a hostname but couldn't resolve it. In that case, we can't know if that hostname would have been for v4 or v6 thus we can't continue the address discovery properly. Couple unit tests case were removed to match this reality. Related #40025 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-17Add running glibc version to the log. #40047Daniel Pinto
Also adds the compiled and running glibc version when using the --library-versions flag.
2020-07-16Use connection_describe() for log messages.Nick Mathewson
2020-07-14Merge remote-tracking branch 'tor-gitlab/merge-requests/48'Alexander Færøy
2020-07-14Merge branch 'ticket40033_045_01_squashed'Nick Mathewson
2020-07-14Rename blacklist and whitelist wordingDavid Goulet
Closes #40033 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14doc: Move manpages into doc/man/David Goulet
Closes #40044 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-13Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-13Bug 31812: Change http URL's to httpsJeremyRand
2020-07-10addr: Remove BUG() that always triggersDavid Goulet
Fix on unreleased code. Logical || in the BUG() made it that it would always trigger the BUG(). Fixes #40034 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10Add IPv6 read and write history to bwhist, state, and extrainfo.Nick Mathewson
These values are stored, persisted, and published. They are not yet actually filled with anything.
2020-07-10Rename public bandwidth-history identifiers to start with "bwhist".Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ rep_hist_note_bytes_read bwhist_note_bytes_read \ rep_hist_note_bytes_written bwhist_note_bytes_written \ rep_hist_note_dir_bytes_read bwhist_note_dir_bytes_read \ rep_hist_note_dir_bytes_written bwhist_note_dir_bytes_written \ rep_hist_get_bandwidth_lines bwhist_get_bandwidth_lines \ rep_hist_update_state bwhist_update_state \ rep_hist_load_state bwhist_load_state \ rep_hist_bandwidth_assess bwhist_bandwidth_assess
2020-07-10Split bandwidth history functions into a separate C file.Nick Mathewson
These are logically independent from the rest of rephist, and make more sense in isolation. The next patch will rename them too.
2020-07-09Merge remote-tracking branch 'tor-gitlab/mr/21'Nick Mathewson
2020-07-09addr: Static assert resolved address cache sizeDavid Goulet
This will make sure that we always properly initialize the cache by the exact size all the time. Related to #40022 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-09Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-08addr: Initialize resolved address cache to NULL addressDavid Goulet
Related to #40022 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-07Revert "config: Make clients tell dual-stack exits they prefer IPv6"David Goulet
This reverts commit bf2a399fc0d90df76e091fa3259f7c1b8fb87781. Don't set by default the prefer IPv6 feature on client ports because it breaks the torsocks use case. The SOCKS resolve command is lacking a mechanism to ask for a specific address family (v4 or v6) thus prioritizing IPv6 when an IPv4 address is asked on the resolve SOCKS interface resulting in a failure. Tor Browser explicitly set PreferIPv6 so this should not affect the majority of our users. Closes #33796 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-07addr: Attempt to learn our address with ORPortDavid Goulet
If no Address statement are found in the configuration file, attempt to learn our address by looking at the ORPort address if any. Specifying an address is optional so if we can't find one, it is fine, we move on to the next discovery mechanism. Note that specifying a hostname on the ORPort is not yet supported at this commit. Closes #33236 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-07addr: New function relay_address_new_suggestion()David Goulet
This behaves like router_new_address_suggestion() but differs in couple of ways: 1. It takes a tor_addr_t instead of an address string and supports both AF_INET and AF_INET6. 2. It does _not_ use the last_guessed_ip local cache and instead only relies on the last resolved address cache in resolve_addr.c It is not used at this commit. This function is made to process a suggested address found in a NETINFO cell exactly like router_new_address_suggestion() does with the address a directory suggests us. Related to #40022 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-07addr: Rename and make resolved_addr_set_last() function publicDavid Goulet
Rename the static function update_resolved_cache() to resolved_addr_set_last() and make it public. We are about to use it in order to record any suggested address from a NETINFO cell. Related to #40022 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-06addr: Fix possible memleak in find_my_address()David Goulet
Unit tests also suffered from a memleak. Closes #40024 Signed-off-by: David Goulet <dgoulet@torproject.org>