summaryrefslogtreecommitdiff
path: root/crates/tor-geoip
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions of 0.x tor-* and arti-* cratesIan Jackson2024-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for p in `cat ../u`; do cargo set-version --locked --offline -p $p; done where u contains tor-basic-utils tor-async-utils tor-error tor-config tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-memquota tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-hyper
* remove unused dependenciestrinity-1686a2024-04-021-2/+1
| | | | Edited-by: Nick Mathewson <[email protected]>
* Update unstable `tor/arti-*` crates to 0.17.0.Nick Mathewson2024-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with: ``` CRATES=" tor-basic-utils tor-async-utils tor-error tor-config tor-events tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-hspow tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-congestion tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-bench arti-testing " for crate in $CRATES; do cargo set-version -p "$crate" 0.17.0 done ```
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Breaking version bumps in preparation for 1.1.12.Nick Mathewson2024-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have breaking changes on their own: tor-error tor-netdoc tor-dirmgr tor-keymgr Because of the breaking change in tor-error, and the fact that basically every crate publicly depends on tor-error (by implementing ErrorKind), we need to call this a breaking change on all of the following: tor-config tor-geoip tor-rtmock tor-log-ratelim tor-rpcbase tor-bytes tor-hscrypto tor-socksproto tor-cell tor-proto tor-netdoc tor-netdir tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-testing
* Two more patchlevel bumpsNick Mathewson2023-12-041-1/+1
| | | | | | | | | These crates both depend on tor-error. Since tor-error got a patchlevel bump, they now depend on the new version, which means by our rules that _they_ get a patchlevel bump themselves. tor-geoip tor-rpcbase
* Bump patchlevel versions in preparation for releaseNick Mathewson2023-12-041-1/+1
| | | | | | | | | | | | | | | These crates had backward-compatible changes, and get a patchlevel bump only: fs-mistrust tor-error tor-config tor-rtcompat tor-rtmock This crate exposes no non-CLI APIs, and gets a patchlevel bump only: arti
* In every crate, change rust-version to 1.70.Nick Mathewson2023-11-281-1/+1
|
* Bump patchlevel (not dependents) on crates with trivial changesNick Mathewson2023-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: ``` tor-basic-utils caret fs-mistrust safelog retry-error tor-events tor-units tor-geoip tor-rtcompat tor-rpcbase tor-protover tor-socksproto tor-checkable tor-congestion tor-persist tor-circmgr arti-rpcserver arti-config arti-hyper arti-bench arti-testing tor-consdiff ```
* Update patchlevel for crates with nontrivial changes.Nick Mathewson2023-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are: ``` hashx equix tor-async-utils tor-error tor-config tor-rtmock tor-llcrypto tor-bytes tor-hscrypto tor-hspow tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-netdir tor-chanmgr tor-guardmgr tor-dirmgr tor-keymgr tor-hsclient tor-hsservice arti-client arti ```
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Increment patchlevel versions of crates with minor changesNick Mathewson2023-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are at version 0.x.y, so we don't need to distinguish new-feature changes from other changes: ``` tor-basic-utils fs-mistrust tor-error tor-geoip tor-checkable tor-linkspec tor-netdoc tor-netdir tor-persist tor-ptmgr tor-hsservice ``` This crate has a breaking change, but only when the semver-breaking feature `experimental-api` is enabled: ``` tor-config ``` This crate is at version 1.x.y, but has no new public APIs, and therefore does not need a minor version bump: ``` arti ```
* tor-geoip: Fix a doc warningIan Jackson2023-07-211-1/+1
| | | | | | | | | | | | cargo doc --locked --document-private-items --workspace --all-features warning: unclosed HTML tag `CountryCode` --> crates/tor-geoip/src/lib.rs:90:54 | 90 | /// We store these as NonZeroU8 so that an Option<CountryCode> only has to | ^^^^^^^^^^^^^ | = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
* Merge branch 'cc_niche' into 'main'Nick Mathewson2023-07-201-5/+37
|\ | | | | | | | | geoip: Enable the niche optimization for CountryCode. See merge request tpo/core/arti!1384
| * geoip: Use from_raw_parts instead of transmute.gabi-2502023-07-131-1/+5
| |
| * geoip: Enable the niche optimization for CountryCode.Nick Mathewson2023-07-071-5/+33
| | | | | | | | | | | | | | | | Since we're going to be using `Option<CountryCode>` all over, let's save the extra byte. Sadly this required std::mem::transmute(), which is unsafe, so maybe we should think twice.
* | geoip: Add derive macros to GeoipDbjuga2023-07-181-0/+1
| | | | | | | | to be able to debug it, for instance.
* | geoip: Allow ASNs as zeros when creating NetDefnjuga2023-07-181-6/+2
| | | | | | | | | | | | | | so that GeoipDb can be created from files including ASNs generated with tor/scripts/maint/geoip/geoip-db-tool. Closes #961
* | Add country codes to relays inside a NetDireta2023-07-131-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | - When the `geoip` feature flag of `tor-netdir` is enabled, perform GeoIP lookups for all relays added to the directory and add the resulting country code to the `Relay` struct. - The GeoIP database is provided in a new `PartialNetDir::new_with_geoip` constructor. - A new trait was also added to `tor-linkspec`, `HasCountryCode`, to enable getting this data out from other crates. Part of onionmasq#47.
* | Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|/
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* Bump patchlevel versions on crates with smaller changesNick Mathewson2023-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with the commands below. The following crates have had various changes, and should get a patchlevel bump. Since they are pre-1.0, we do not need to distinguish new APIs from other changes. ``` cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p safelog cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-circmgr cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p tor-linkspec cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-netdoc cargo set-version --bump patch -p tor-proto cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-socksproto ``` This crate has new features, but no new non-experimental Rust APIs. So even though it is post-1.0, it gets a patchlevel bump. ``` cargo set-version --bump patch -p arti ```
* Resolve XXXs from fixup-features.Nick Mathewson2023-06-291-4/+1
| | | | | Some of these seem spurious: it looks like fixup-features resolved an issue and then complained about it too. I'll investigate further.
* Run "cargo sort".Nick Mathewson2023-06-291-1/+0
|
* Run "fixup-features".Nick Mathewson2023-06-291-0/+5
|
* geoip: conditionalise a testIan Jackson2023-06-281-0/+1
| | | | | Without this, the build fails with cargo test --workspace --no-default-features --features=tokio,native-tls
* Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lints (again)Ian Jackson2023-06-211-0/+2
| | | | | | | | | | I prepared 161b9844d against an earlier version of main without the geoip crate. Run maint/add_warning again.
* | geoip: Add a few more tests.Nick Mathewson2023-06-201-1/+59
| |
* | geoip: Explain in more detail what a CountryCode is to us.Nick Mathewson2023-06-201-1/+14
| |
* | geoip: require that ccs actually are printable ascii.Nick Mathewson2023-06-201-3/+8
| | | | | | | | | | | | (There are plenty of strings that convert into 2 bytes of UTF8 without being two ascii characters, and there are plenty of sequences of two ascii characters that aren't printable.)
* | geoip: Make ?? a little more bullet-proofNick Mathewson2023-06-203-5/+51
|/ | | | We want to make sure that ?? is always None, never a CountryCode.
* tor-geoip: Add new crate with GeoIP database functionalityeta2023-06-206-0/+293548
- This adds a new crate, `tor-geoip`, which can parse and perform lookups in the GeoIP database C-tor already uses (generated by a maintenance utility in the C-tor codebase). - We embed a copy of C-tor's databases with the crate and use `include_str!` to ship them with the binary, bloating its size somewhat. - This does, however, solve the problem of figuring out how to distribute these. - The plan is to gate this functionality behind a feature flag anyway, so the cost should be nil unless explicitly opted into. Part of tpo/core/onionmasq#47.