Commit Graph

13 Commits

Author SHA1 Message Date
Yuri Astrakhan
66b7fdc4ea
Multi-source support, new path structure (#456)
Partial implementation of the #430

* New endpoint structure:
  * `GET /` -- a placeholder for the future home page
* `GET /catalog` -- get a list of available sources, as a list of json
blobs.
* `[{id, name, description, attribution, vector_layer}, ...]` (some
fields might be missing)
* `GET /<id>` -- get tilejson for the given source, or a combination of
sources. No `.json` extension
  * `GET /<id>/<z>/<x>/<y>` -- get a tile. No format extension.
  * `GET /health` -- healthcheck
* Introduce a new tile format support crate (using code from the
maplibre/mbtileserve project)
* Removed the `/rpc/...` routes - all source IDs are accessed in the
same way
* Can print auto-generated configuration or save it to a file
* Refactored to support multiple sources from multiple backends, with a
proper naming conflict resolution

TODO:
* benchmarks need to be rewritten - they were relying on some internal
structures that are no longer there. This might be done as a separate PR
due to a very different internal architecture - might need to rethink
benchmarking approaches.
2022-11-26 04:46:40 -05:00
Yuri Astrakhan
0e0763a739
Make SSL support optional (#488)
By default, Martin is now compiled without openssl, simplifying
debugging and simple case usage, whereas the docker build and CI
publishing would still use openssl
2022-11-19 09:50:27 -05:00
Yuri Astrakhan
def4a6f1ec
Warn on unknown cfg, CI cleanup (#461)
* Detect all unrecognized config file values, and report them. Ideally
we want to use `serde-ignored` crate, but it doesn't work with flattened
structs (yet). So using a bad workaround.
* CI test has been using all sorts of somewhat duplicated temporary pbf
files - cleaned up to `tmp.pbf`, and made sure curl only shows errors,
not download stats.
* In CI, crash psql instead of silently ignoring errors
* Don't serialize optional config values as nulls
* Tiny error message cleanup
2022-10-24 19:45:26 +02:00
Yuri Astrakhan
911076e3bc
Mostly noop code refactorings (#439)
* remove most of the utils:: and dev:: namespace usage
* rename `configure_db_source` to `configure_db_sources`
* use defaults from other table info objects (using the `..obj` syntax)
* use doc comments vs regular comment in a few places
* refactor server_test.rs to make it more readable and much shorter
  * use a macro for identical code
  * use a test_get() for identical GET request
* rename fn test_foo() into fn foo() for simplicity
2022-10-12 11:52:26 +03:00
Yuri Astrakhan
aed3274162
Breakup config for pg and srv (#420)
Getting ready for multi-backend system, where each backend would have its own configuration.

All 3 config structs (clap args, config, and configbuilder) are now separated into 3 files - the main one, one for service  (actix stuff), and one for PostgreSQL.

The files have been moved to `/pg` and `/srv`, but otherwise the logic should be mostly intact.
2022-10-01 07:48:11 +00:00
Yuri Astrakhan
2c44dc2ac3
Lint code based on clippy suggestions (#417) 2022-09-27 12:05:55 -04:00
Yuri Astrakhan
1e8e676e44
feat: use latest actix, switch to bb8 (async everywhere), remove actions (#377)
* remove all actions and other low-level magic code, making it more straightforward for the most common usage
* replace r2d2 with bb8 to make it all async
* use first significant version in cargo.toml - this makes it easier to maintain

This fixes #349
2022-08-15 09:54:48 -04:00
Yuri Astrakhan
ad6c5297dd
sort use-statements during fmt (#376)
This does not force automatic use statement sorting,
but it sorts all them now, and we can manually keep them ordered until
the fmt features becomes stable.
2022-08-06 12:48:10 -04:00
Yuri Astrakhan
275d15a4fb
chore: fix clippy in benchmarks, and adjust CI (#363)
Clippy wasn't happy, and we apparently weren't testing all targets.
2022-07-06 12:24:45 +03:00
Yuri Astrakhan
d0655fd2b3
Use 2021 edition, modern format (#331) (h/t @nyurik)
* switch to 2021 rust edition
* use `format!("{var}")` instead of `"{}", var`
2022-05-27 14:03:48 +03:00
Stepan Kuzmin
194a83e63f
feat: add minzoom and maxzoom support (#265) 2021-10-13 14:51:29 +03:00
Stepan Kuzmin
40b0a0c26a
feat: add bounds to tilejson endpoints (#260) (h/t @jaspervercnocke) 2021-10-10 12:09:56 +03:00
Stepan Kuzmin
f935db9f1f
chore: add benchmarks (#230) 2021-07-23 11:04:34 +03:00