go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.26k stars 193 forks source link

[Feature Request]: Redis SSL connection via redis.ParseURL #815

Closed iwpnd closed 2 years ago

iwpnd commented 2 years ago

Hi 👋

Tegola does not yet support redis SSL connections and I'd like to change that, or request this feature. e.g.: redis://:password@host

For this to work I'd like to add another option to [cache] called uri or url. If this option is set, I'd change this to use ParseURL to create redis.Options instead of creating the config manually. ParseURL attaches the TLSConfig to the redis.Options if rediss:// is part of the connection url. That way both options stay viable and tegola is a feature richer. 😁

What do you think?

ARolek commented 2 years ago

@iwpnd I just looked at the redis config and it does appear to support a password attribute. Is this request more around using ParseURL instead of breaking up the attributes into separate key-value pairs or is SSL not currently supported?

iwpnd commented 2 years ago

Hey, SSL is currently not supported. There are several ways to enable it. ParseURL is just one of them. Another would be as add a TLSConfig to redis.Options upon receiving something like ssl=true in the cache option. Either is fine and solves the problem.

ARolek commented 2 years ago

@iwpnd I would say we start with enhancing the current implementation by supporting an ssl config option as a boolean. I do like the idea of adding a url or uri property (I want to do this for the PostGIS provider too). Is this something you want to tackle and send in a PR for? I'm happy to help with it.

iwpnd commented 2 years ago

Happy to do it. :)

ARolek commented 2 years ago

closed via https://github.com/go-spatial/tegola/commit/bdce754abe57b76517cbed8a33e6499af0365f46. Thanks for the contribution!