From 92c044add9834dd2171dd49cda8e6d089f090256 Mon Sep 17 00:00:00 2001 From: Miguel Herrnsdorf Date: Mon, 15 Jul 2024 10:33:15 -0400 Subject: [PATCH 1/2] Add an option to use Caddy instead of Nginx Signed-off-by: Miguel Herrnsdorf --- .../adr/0028-Caddy-Web-Server-as-option.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docs_src/design/adr/0028-Caddy-Web-Server-as-option.md diff --git a/docs_src/design/adr/0028-Caddy-Web-Server-as-option.md b/docs_src/design/adr/0028-Caddy-Web-Server-as-option.md new file mode 100644 index 000000000..f6cce64e1 --- /dev/null +++ b/docs_src/design/adr/0028-Caddy-Web-Server-as-option.md @@ -0,0 +1,79 @@ +# Caddy Web Server as option + +## Submitters +- Miguel Herrnsdorf + +## Changelog + + +## Referenced Use Case(s) + + +## Context + +Currently there is only one option to use as webserver with Edgex, Nginx. This proposal is to add Caddy as web server alternative of Nginx, leveraging the many advantages and easy to implement usage that Caddy offers out of the box. Also, there are many plugins available for most common use, but you can write your own if you have a specific requirements. And since is written in Go and with extensibility in mind, plugins can compile as native code, in a way that cannot be broken during deployments or by system upgrades. + + +## Proposed Design + +A flag should be passed to let the system know that the user wants to use Caddy as a reverse-proxy instead of Nginx (like NATS). If flag is used, a new Caddy container will be created instead of the Nginx coantainer. + + +## Considerations + +Full Caddy features can found [here](https://caddyserver.com/features) + + +## Decision + + +## Other Related ADRs + + +## References + From b8c2c4dcafc04f104408d94520400fa9fbe38ce6 Mon Sep 17 00:00:00 2001 From: Miguel Herrnsdorf Date: Thu, 18 Jul 2024 11:20:59 -0400 Subject: [PATCH 2/2] Update 0028-Caddy-Web-Server-as-option.md Explain more about the flag and add pros and cons --- .../adr/0028-Caddy-Web-Server-as-option.md | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/docs_src/design/adr/0028-Caddy-Web-Server-as-option.md b/docs_src/design/adr/0028-Caddy-Web-Server-as-option.md index f6cce64e1..8598fbb41 100644 --- a/docs_src/design/adr/0028-Caddy-Web-Server-as-option.md +++ b/docs_src/design/adr/0028-Caddy-Web-Server-as-option.md @@ -38,6 +38,9 @@ Describe: ## Proposed Design A flag should be passed to let the system know that the user wants to use Caddy as a reverse-proxy instead of Nginx (like NATS). If flag is used, a new Caddy container will be created instead of the Nginx coantainer. +Ex: make gen ds-virtual ds-rest caddy_reverse_proxy +With that flag edgex will load Caddy config file. Caddy also supports Nginx config so current file can be use. +No other service will need to be modified since Caddy will use the same address and port as Nginx. + +Advantages of Caddy: + -Using Automatic HTTPS + This is probably the most well-known thing about Caddy. It will switch all HTTP traffic to HTTPS and acquire and renew SSL/TLS certificates for your site automatically through Let's Encrypt. + + -The Easy Configuration: + The Caddyfile is an easy-to-understand and-write configuration file used by Caddy. Because of this, configuring your server might be easier and faster. + + -Wide applicability: + Plugins allow you to extend Caddy's capabilities as needed. Apart from the numerous pre-made plugins, you also have the choice to make your own. + + -Coded in the Go language: + The speed and efficiency of Go are passed on to Caddy because it is written in Go. Additionally, there are no dependencies to be concerned about because it is statically linked. + +Disadvantages of Caddy: + -Less Mature + Although Caddy offers numerous unique capabilities, it is still a relatively young project that lacks the experience and thorough testing of more established web servers. + + -The Limited Module Ecosystem + Although Caddy's extensibility is a strong point, the module ecosystem is not as developed or extensive as it is for other servers, such as Apache or Nginx. The responsability fall on the user. + + -A Lesser Community Support + Because of its smaller user base, obtaining community support and finding solutions to issues may be a bit more complicated than with more established web servers such as Apache or Nginx. ## Decision