traefik / traefik

The Cloud Native Application Proxy
https://traefik.io
MIT License
51.37k stars 5.1k forks source link

Add snapd backend #3911

Open ThyMYthOS opened 6 years ago

ThyMYthOS commented 6 years ago

Do you want to request a feature or report a bug?

Feature

What did you expect to see?

Please add support for a snapd backend. Right now every service on Ubuntu Core typically opens a different non-standard port for HTTP. This is not very user-friendly for an IoT device. Imagine running Nextcloud and OpenHAB on a Raspi. The user has to connect to https://<local.domain>:4201/ to access the snapweb frontend, to http://<local.domain>:8080/ to access OpenHAB and only Nextcloud is available via http://<local.domain>/.

Træfik would be a perfect companion to provide the different services via the same domain name, all on port 80 or 443.

The snapd API can be accessed via REST calls, see https://docs.ubuntu.com/core/en/reference/rest. Every snap can have configuration data assigned to it. This data can be set by the user (right now via command line, but snapweb support could be possible). So Træfik can read it's configuration from there.

emilevauge commented 6 years ago

Hey @ThyMYthOS Thanks for your suggestion! I don't recall having seen this feature request before, but let's see how big is the need :)

ThyMYthOS commented 6 years ago

I made a rough sketch how this could work: https://gist.github.com/ThyMYthOS/7b27c8828bedcef8230c483c0046c986 I never did anything in go before, so expect the worst.