Skip to content

Commit

Permalink
docs, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperknot committed Jun 11, 2024
1 parent 2ef9252 commit b9ce661
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
12 changes: 8 additions & 4 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ target-version = "py310"
line-length = 100
extend-exclude = ["temp"]

select = [


lint.select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
Expand All @@ -18,11 +20,12 @@ select = [
'DTZ', # flake8-datetimez, https://beta.ruff.rs/docs/rules/#flake8-datetimez-dtz
]

ignore = [
lint.ignore = [
'A003',
'E501',
'E711',
'E712',
# 'E721', # type comparison
'E741',
'F401', # unused imports
'F841',
Expand All @@ -36,9 +39,10 @@ ignore = [
[format]
quote-style = "single"

[isort]
[lint.isort]
known-first-party = ["ssh_lib"]
lines-after-imports = 2

[flake8-comprehensions]
[lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ You can run `./host_manager.py --help` to see which options are available. Some

_note: Tile generation is 100% optional, as we are providing the processed full planet files for public download._

The `tile_gen` scripts downloads a full planet OSM extract and runs it through Planetiler.
The `tile_gen` script downloads a full planet OSM extract and runs it through Planetiler.

The created .mbtiles file is then extracted into a Btrfs partition image using the custom [extract_mbtiles](scripts/tile_gen/extract_mbtiles) script. The partition is shrunk using the [shrink_btrfs](scripts/tile_gen/shrink_btrfs) script.

Expand All @@ -87,9 +87,9 @@ A very important part, probably needs the most work in the long term future.

Round Robin DNS based load balancer, script for health checking and updating records.

Pushed warnings to a Telegram bot.
Pushes warnings to a Telegram bot.

Currently it's running in warning-only mode, DNS updates need manual confirmation.
Currently it's running in read-only mode, DNS updates need manual confirmation.

## Self hosting

Expand All @@ -103,7 +103,7 @@ The original idea of this project is to avoid using tile servers altogether. Ins

This replaces a running service with a pure, file-system-level implementation. Since the Linux kernel's file caching is among the highest-performing and most thoroughly tested codes ever written, it delivers serious performance.

I run some [benchmarks](docs/quick_notes/http_benchmark.md) on a Hetzner server, the aim was to saturate a gigabit connection. At the end, it was able to serve 30 Gbit on localhost, on a cold nginx cache.
I run some [benchmarks](docs/quick_notes/http_benchmark.md) on a Hetzner server, the aim was to saturate a gigabit connection. At the end, it was able to serve 30 Gbit on loopback interface, on cold nginx cache.

## FAQ

Expand Down Expand Up @@ -158,15 +158,16 @@ Bigger tasks:
Tasks outside the scope of this project:

- Make a successor for the OpenMapTiles schema.
- Docker image for running this self-hosted on any machine.

#### Dev setup

See [dev setup docs](docs/dev_setup.md).

## Changelog

v0.1 - everything works. 1 server for tile gen, 2 servers for HTTP host. <- we are here!
##### v0.1

Everything works. 1 server for tile gen, 2 servers for HTTP host. Load-balancing script is running in a read-only mode.

## Attribution

Expand Down
2 changes: 1 addition & 1 deletion scripts/loadbalancer/loadbalancer_lib/cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def delete_record(zone_id, *, id_: str, cloudflare_api_token: str):
res = requests.delete(
f'https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records/{id_}',
headers=headers,
json=dict(),
json={},
)
res.raise_for_status()
data = res.json()
Expand Down
8 changes: 4 additions & 4 deletions website/blocks/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ GitHub: [openfreemap](https://github.com/hyperknot/openfreemap) and [openfreemap

## What is the tech stack?

The map schema is [OpenMapTiles](https://github.com/openmaptiles/openmaptiles).
Special thanks go to [Michael Barry](https://github.com/msbarry) for developing [Planetiler](https://github.com/onthegomap/planetiler). It made it possible to generate the tiles in 5 hours instead of 5 weeks.
The [styles](https://github.com/hyperknot/openfreemap-styles) are forked and heavily modified.

There is no tile server running; only Btrfs partition images with 300 million hard-linked files. This was my idea; I haven't read about anyone else doing this in production, but it works really well.

There is no cloud, just dedicated servers. The HTTPS server is nginx on Ubuntu.

Special thanks go to [Michael Barry](https://github.com/msbarry) for developing [Planetiler](https://github.com/onthegomap/planetiler). It made it possible to generate the tiles in 5 hours instead of 5 weeks. The map schema is [OpenMapTiles](https://github.com/openmaptiles/openmaptiles).

The [styles](https://github.com/hyperknot/openfreemap-styles) are forked and heavily modified.

## Domains

`tiles.openfreemap.org` - Cloudflare proxied
Expand Down
4 changes: 1 addition & 3 deletions website/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ <h1>OpenFreeMap</h1>
<a href="https://github.com/hyperknot/openfreemap" target="_blank"
><img src="github.svg" alt="github" height="28"
/></a>
<a href="https://x.com/hyperknot" target="_blank"
><img src="x.svg" alt="x" height="28"
/></a>
<a href="https://x.com/hyperknot" target="_blank"><img src="x.svg" alt="x" height="28" /></a>
</div>

{main}
Expand Down

0 comments on commit b9ce661

Please sign in to comment.