Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

# 0.18.5
- changes for maxminddb 0.27.0
- bump libraries

# 0.18.4
- update links and branding related to the HTTP (formerly Mozilla) Observatory
- bump libraries
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "directory"
version = "0.18.4"
version = "0.18.5"
authors = ["El RIDO <elrido@gmx.net>"]
edition = "2021"
license = "AGPL-3.0"
Expand All @@ -12,7 +12,7 @@ futures = "0.3.31"
http-body-util = "0.1.3"
hyper-util = "0.1.18"
isocountry = "0.3.2"
maxminddb = "0.26.0"
maxminddb = "0.27.0"
rand = "0.9.2"
regex = "1.12.2"
tokio = "1.48.0"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY . /home/rust/
RUN cargo build --release

FROM scratch
ARG RELEASE=0.18.4
ARG RELEASE=0.18.5
LABEL org.opencontainers.image.authors=support@privatebin.org \
org.opencontainers.image.vendor=PrivateBin \
org.opencontainers.image.documentation=https://github.com/PrivateBin/Directory/blob/master/README.md \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.standalone
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM rust:1.80-alpine3.20
ARG RELEASE=0.18.4
ARG RELEASE=0.18.5
RUN apk --no-cache update && \
apk add --no-cache \
musl-dev \
Expand All @@ -16,7 +16,7 @@ RUN wget -qO - https://github.com/PrivateBin/Directory/archive/${RELEASE}.tar.gz
upx --ultra-brute target/release/directory

FROM scratch
ARG RELEASE=0.18.4
ARG RELEASE=0.18.5
LABEL org.opencontainers.image.authors=support@privatebin.org \
org.opencontainers.image.vendor=PrivateBin \
org.opencontainers.image.documentation=https://github.com/PrivateBin/Directory/blob/master/README.md \
Expand Down
8 changes: 4 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This document lists the licenses of the projects used in the instance directory.

#### Used by

- [directory](https://crates.io/crates/directory) 0.18.4
- [directory](https://crates.io/crates/directory) 0.18.5

```
GNU AFFERO GENERAL PUBLIC LICENSE
Expand Down Expand Up @@ -8212,7 +8212,7 @@ third-party/chromium/LICENSE.

#### Used by

- [maxminddb](https://github.com/oschwald/maxminddb-rust) 0.26.0
- [maxminddb](https://github.com/oschwald/maxminddb-rust) 0.27.0

```
ISC License
Expand Down Expand Up @@ -8321,7 +8321,7 @@ THE SOFTWARE.

#### Used by

- [hyper](https://github.com/hyperium/hyper) 1.7.0
- [hyper](https://github.com/hyperium/hyper) 1.8.1

```
Copyright (c) 2014-2025 Sean McArthur
Expand Down Expand Up @@ -8829,7 +8829,7 @@ DEALINGS IN THE SOFTWARE.

#### Used by

- [hyper-util](https://github.com/hyperium/hyper-util) 0.1.17
- [hyper-util](https://github.com/hyperium/hyper-util) 0.1.18

```
Copyright (c) 2023-2025 Sean McArthur
Expand Down
10 changes: 7 additions & 3 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,13 @@ impl PrivateBin {
);
}
let reader = opener.unwrap();
if let Ok(Some(country)) = reader.lookup::<Country>(ip) {
if let Some(country) = country.country {
if let Some(iso_code) = country.iso_code {
if let Ok(country) = reader.lookup(ip) {
if let Ok(Some(country)) = country.decode::<Country>() {
if let Some(iso_code) = country.represented_country.iso_code {
country_code = iso_code.into(); // e.g. military base or embassy
} else if let Some(iso_code) = country.registered_country.iso_code {
country_code = iso_code.into(); // e.g. mobile networks or VPNs
} else if let Some(iso_code) = country.country.iso_code {
country_code = iso_code.into();
}
}
Expand Down