balena-io / open-balena-haproxy

Haproxy component for resin environments (bob, onprem, etc)
5 stars 1 forks source link

Remove JSON middle layer for HA Proxy config #69

Open danthegoodman1 opened 3 years ago

danthegoodman1 commented 3 years ago

Currently, the HA proxy config needs to be written in a JSON format that goes through a translation layer. This translation layer expects certain JSON fields, and thus, restricts the ability to fully customize the HA proxy configuration.

For example, I am unable to create the catch all for the jellyfish API using the line default_backend api_backend because the JSON layer won't let me use it anywhere. There are some hacky ways to get around it, but not everything works and a hacky solution is a bad solution.

See this flowdock thread for more: https://www.flowdock.com/app/rulemotion/p-cyclops/threads/EnUxWKD10BannateqlRS_M2Sf29

danthegoodman1 commented 3 years ago

See files https://github.com/balena-io/open-balena-haproxy/blob/master/src/generate-config.ts and https://github.com/balena-io/open-balena-haproxy/blob/master/src/generate.ts