Skip to content

Commit 28fca35

Browse files
Merge branch 'main' into cog_web_5
2 parents 40b5ee3 + 30e4928 commit 28fca35

File tree

62 files changed

+1136
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1136
-417
lines changed

Cargo.lock

Lines changed: 505 additions & 300 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ actix-http = "3"
3131
actix-middleware-etag = "0.4.4"
3232
actix-rt = "2"
3333
actix-web = "4"
34+
actix-web-prom = "0.10.0"
3435
actix-web-static-files = "4"
3536
anyhow = "1.0"
3637
approx = "0.5.1"
@@ -56,13 +57,13 @@ itertools = "0.14"
5657
json-patch = "4"
5758
lambda-web = { version = "0.2.1", features = ["actix4"] }
5859
log = "0.4"
59-
martin-tile-utils = { path = "./martin-tile-utils", version = "0.6.1" }
60+
martin-tile-utils = { path = "./martin-tile-utils", version = "0.6.2" }
6061
mbtiles = { path = "./mbtiles", version = "0.12.2" }
61-
md5 = "0.7.0"
62+
md5 = "0.8.0"
6263
moka = { version = "0.12", features = ["future"] }
6364
num_cpus = "1"
6465
pbf_font_tools = { version = "2.5.1", features = ["freetype"] }
65-
pmtiles = { version = "0.14", features = ["http-async", "mmap-async-tokio", "tilejson", "reqwest-rustls-tls-native-roots", "aws-s3-async"] }
66+
pmtiles = { version = "0.15", features = ["http-async", "mmap-async-tokio", "tilejson", "reqwest-rustls-tls-native-roots", "aws-s3-async"] }
6667
png = "0.17.14"
6768
postgis = "0.9"
6869
postgres = { version = "0.19", features = ["with-time-0_3", "with-uuid-1", "with-serde_json-1"] }
@@ -71,7 +72,7 @@ pprof = { version = "0.15", features = ["flamegraph", "criterion"] }
7172
pretty_assertions = "1"
7273
regex = "1"
7374
rstest = "0.25"
74-
rustls = "0.23.28"
75+
rustls = "0.23.29"
7576
# ring feature does not require NASM windows executable, but works slower
7677
#rustls = { version = "0.23", default-features = false, features = ["logging", "std", "tls12", "ring"] }
7778
rustls-native-certs = "0.8"
@@ -91,7 +92,7 @@ subst = { version = "0.3", features = ["yaml"] }
9192
tempfile = "3.20.0"
9293
testcontainers-modules = { version = "0.12.1", features = ["postgres"] }
9394
thiserror = "2"
94-
tiff = "0.9.1"
95+
tiff = "0.10.0"
9596
tilejson = "0.4"
9697
tokio = { version = "1", features = ["macros"] }
9798
tokio-postgres-rustls = "0.13"

docs/src/config-file.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ preferred_encoding: gzip
4444
# Enable or disable Martin web UI. At the moment, only allows `enable-for-all` which enables the web UI for all connections. This may be undesirable in a production environment. [default: disable]
4545
web_ui: disable
4646

47+
# Advanced monitoring options
48+
observability:
49+
# Configure metrics reported under `/_/metrics`
50+
metrics:
51+
# Add these labels to every metric
52+
# Example: `{ env: prod, server: martin }`
53+
add_labels: {}
54+
4755
# CORS Configuration
4856
#
4957
# Defaults to `cors: true`, which allows all origins.
@@ -196,7 +204,7 @@ postgres:
196204
pmtiles:
197205
# Allows forcing path style URLs for S3 buckets [default: false]
198206
#
199-
# A path style URL is a URL that uses the bucket name as part of the path like mys3.com/somebucket instead of the hostname somebucket.mys3.com
207+
# A path style URL is a URL that uses the bucket name as part of the path like example.org/some_bucket instead of the hostname some_bucket.example.org
200208
force_path_style: false
201209
# Skip loading credentials for S3 buckets [default: false]
202210
#

docs/src/sources-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pmtiles:
4545
4646
We also support forcing path style URLs for S3 buckets via the environment variable `AWS_S3_FORCE_PATH_STYLE=1` or configuration key `force_path_style: true`.
4747
This allows you to use this functionality for [`MinIO`](https://min.io/) or similar s3-compatible instances which use path style URLs.
48-
A path style URL is a URL that uses the bucket name as part of the path (`mys3.com/somebucket`) instead of the hostname (`somebucket.mys3.com`).
48+
A path style URL is a URL that uses the bucket name as part of the path (`example.org/some_bucket`) instead of the hostname (`some_bucket.example.org`).
4949

5050
Example configuration:
5151

docs/src/using.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Martin data is available via the HTTP `GET` endpoints:
1616
| `/font/{font1},…,{fontN}/{start}-{end}` | [Composite Font source](sources-fonts.md) |
1717
| `/style/{style}` | [Style source](sources-styles.md) |
1818
| `/health` | Martin server health check: returns 200 `OK` |
19+
| `/_/metrics` | Martin server Prometheus metrics |
1920

2021
### Duplicate Source ID
2122

justfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ bench-http: (cargo-install 'oha')
5555
bench-server: start
5656
cargo run --release -- tests/fixtures/mbtiles tests/fixtures/pmtiles
5757

58-
# Run integration tests and save its output as the new expected output (ordering is important, but in some cases run `bless-tests` before others)
59-
bless: restart clean-test bless-insta-martin bless-insta-mbtiles bless-tests bless-int
58+
# Run integration tests and save its output as the new expected output (ordering is important)
59+
bless: restart clean-test bless-insta-martin bless-insta-mbtiles bless-int
6060

6161
# Run integration tests and save its output as the new expected output
6262
bless-insta-cp *args: (cargo-install 'cargo-insta')
@@ -77,10 +77,6 @@ bless-int:
7777
tests/test.sh
7878
rm -rf tests/expected && mv tests/output tests/expected
7979

80-
# Run test with bless-tests feature
81-
bless-tests:
82-
cargo test -p martin --features bless-tests
83-
8480
# Build and open mdbook documentation
8581
book: (cargo-install 'mdbook')
8682
mdbook serve docs --open --port 8321
@@ -92,11 +88,10 @@ check:
9288
cargo check --all-targets -p mbtiles --no-default-features
9389
cargo check --all-targets -p martin
9490
cargo check --all-targets -p martin --no-default-features
95-
cargo check --all-targets -p martin --no-default-features --features fonts
96-
cargo check --all-targets -p martin --no-default-features --features mbtiles
97-
cargo check --all-targets -p martin --no-default-features --features pmtiles
98-
cargo check --all-targets -p martin --no-default-features --features postgres
99-
cargo check --all-targets -p martin --no-default-features --features sprites
91+
for feature in $({{just_executable()}} get-features); do \
92+
echo "Checking '$feature' feature" >&2 ;\
93+
cargo check --all-targets -p martin --no-default-features --features $feature ;\
94+
done
10095

10196
# Verify doc build
10297
check-doc:
@@ -192,6 +187,10 @@ fmt-md:
192187
fmt-sql:
193188
docker run -it --rm -v $PWD:/sql sqlfluff/sqlfluff:latest fix --dialect=postgres --exclude-rules=AL07,LT05,LT12
194189

190+
# Get all testable features of the main crate as space-separated list
191+
get-features:
192+
cargo metadata --format-version=1 --no-deps --manifest-path Cargo.toml | jq -r '.packages[] | select(.name == "{{main_crate}}") | .features | keys[] | select(. != "default")' | tr '\n' ' '
193+
195194
# Do any git command, ensuring that the testing environment is set up. Accepts the same arguments as git.
196195
[no-exit-message]
197196
git *args: start

martin-tile-utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "martin-tile-utils"
3-
version = "0.6.1"
3+
version = "0.6.2"
44
authors = ["Yuri Astrakhan <[email protected]>", "MapLibre contributors"]
55
description = "Utilities to help with map tile processing, such as type and compression detection. Used by the MapLibre's Martin tile server."
66
keywords = ["maps", "tiles", "mvt", "tileserver"]

martin/Cargo.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "martin"
3-
version = "0.17.0"
3+
version = "0.18.0"
44
authors = ["Stepan Kuzmin <[email protected]>", "Yuri Astrakhan <[email protected]>", "MapLibre contributors"]
55
description = "Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support"
66
keywords = ["maps", "tiles", "mbtiles", "pmtiles", "postgis"]
@@ -52,23 +52,24 @@ name = "bench"
5252
harness = false
5353

5454
[features]
55-
default = ["webui", "fonts", "lambda", "mbtiles", "pmtiles", "cog", "postgres", "sprites", "styles"]
56-
webui = ["dep:actix-web-static-files", "dep:static-files", "dep:walkdir"]
55+
default = ["cog", "fonts", "lambda", "mbtiles", "metrics", "pmtiles", "postgres", "sprites", "styles", "webui"]
56+
cog = ["dep:image", "dep:imageproc", "dep:png", "dep:tiff"]
5757
fonts = ["dep:bit-set", "dep:pbf_font_tools"]
5858
lambda = ["dep:lambda-web"]
5959
mbtiles = ["dep:mbtiles"]
60+
metrics = ["dep:actix-web-prom"]
6061
pmtiles = ["dep:pmtiles"]
61-
cog = ["dep:tiff", "dep:png", "dep:image", "dep:imageproc"]
62-
styles = ["dep:walkdir", "tokio/fs"]
6362
postgres = ["dep:deadpool-postgres", "dep:json-patch", "dep:postgis", "dep:postgres", "dep:postgres-protocol", "dep:semver", "dep:tokio-postgres-rustls"]
6463
sprites = ["dep:spreet", "tokio/fs"]
65-
bless-tests = []
64+
styles = ["dep:walkdir", "tokio/fs"]
65+
webui = ["dep:actix-web-static-files", "dep:static-files", "dep:walkdir"]
6666

6767
[dependencies]
6868
actix-cors.workspace = true
6969
actix-http.workspace = true
7070
actix-middleware-etag.workspace = true
7171
actix-rt.workspace = true
72+
actix-web-prom = { workspace = true, optional = true }
7273
actix-web-static-files = { workspace = true, optional = true }
7374
actix-web.workspace = true
7475
async-trait.workspace = true
@@ -101,10 +102,10 @@ rustls-native-certs.workspace = true
101102
rustls-pemfile.workspace = true
102103
rustls.workspace = true
103104
semver = { workspace = true, optional = true }
105+
serde.workspace = true
104106
serde_json.workspace = true
105107
serde_with.workspace = true
106108
serde_yaml.workspace = true
107-
serde.workspace = true
108109
spreet = { workspace = true, optional = true }
109110
static-files = { workspace = true, optional = true }
110111
subst.workspace = true
@@ -118,8 +119,8 @@ walkdir = { workspace = true, optional = true }
118119
xxhash-rust.workspace = true
119120

120121
[build-dependencies]
121-
walkdir = { workspace = true, optional = true }
122122
static-files = { workspace = true, optional = true }
123+
walkdir = { workspace = true, optional = true }
123124

124125
[dev-dependencies]
125126
anyhow.workspace = true
@@ -130,8 +131,8 @@ indoc.workspace = true
130131
insta = { workspace = true, features = ["json", "yaml"] }
131132
pprof.workspace = true
132133
rstest.workspace = true
133-
testcontainers-modules.workspace = true
134134
tempfile.workspace = true
135+
testcontainers-modules.workspace = true
135136

136137
[lints]
137138
workspace = true

martin/martin-ui/index.html

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,32 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
66
<link rel="icon" type="image/x-icon" href="/_/assets/favicon.ico">
7-
<meta property="og:url" content="https://maplibre.org"/>
8-
<meta property="og:title" content="Martin — vector tiles server"/>
9-
<meta property="og:description"
10-
content="Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling."/>
11-
<meta property="og:image" content="/martin.png"/>
7+
<title>Martin Tileserver Dashboard</title>
8+
<meta property="description" content="Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling."/>
129
<meta name="msapplication-TileColor" content="#ffffff">
13-
<meta name="msapplication-TileImage" content="/_/assets/favicons/ms-icon-144x144.png">
14-
<meta name="theme-color" content="#ffffff">
15-
<title>Martin — vector tiles server</title>
10+
<meta name="theme-color" content="#7300ff">
11+
<meta name="keywords" content="vector tiles, PostGIS, PMTiles, MBTiles, tile server, mapping, GIS, PostgreSQL, Rust, MapLibre" />
12+
<meta name="author" content="Stepan Kuzmin, Yuri Astrakhan, and MapLibre contributors" />
13+
<meta name="copyright" content="Copyright (c) 2018 Urbica, Copyright (c) 2022 MapLibre contributors" />
14+
15+
<!-- Open Graph / Facebook -->
16+
<meta property="og:type" content="website" />
17+
<meta property="og:url" content="https://martin.maplibre.org/" />
18+
<meta property="og:site_name" content="Martin Tileserver" />
19+
<meta property="og:locale" content="en_US" />
20+
<meta property="og:title" content="Martin Tileserver Dashboard" />
21+
<meta property="og:description" content="Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling" />
22+
<meta property="og:image" content="/_/assets/og-image.png" />
23+
<meta property="og:image:alt" content="Martin Tileserver logo and dashboard interface" />
24+
<meta property="og:image:width" content="1200" />
25+
<meta property="og:image:height" content="630" />
26+
27+
<!-- Twitter -->
28+
<meta property="twitter:card" content="summary_large_image" />
29+
<meta property="twitter:title" content="Martin Tileserver Dashboard" />
30+
<meta property="twitter:description" content="Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling" />
31+
<meta property="twitter:image" content="/_/assets/og-image.png" />
32+
<meta property="twitter:image:alt" content="Martin Tileserver logo and dashboard interface" />
1633
</head>
1734
<body>
1835
<noscript>
-33.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)