-
Notifications
You must be signed in to change notification settings - Fork 88
feat(adr):Add an option to use Caddy instead of Nginx #1360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
herrdragon
wants to merge
2
commits into
edgexfoundry:main
Choose a base branch
from
herrdragon:feat-caddy-web-server
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # Caddy Web Server as option | ||
|
|
||
| ## Submitters | ||
| - Miguel Herrnsdorf | ||
|
|
||
| ## Changelog | ||
| <!-- | ||
| List the changes to the document, incl. state, date, and PR URL. | ||
| State is one of: pending, approved, amended, deprecated. | ||
| Date is an ISO 8601 (YYYY-MM-DD) string. | ||
| PR is the pull request that submitted the change, including information such as the diff, contributors, and reviewers. | ||
|
|
||
| E.g.: | ||
| - [approved](URL of PR) (2022-04-01) | ||
| - [amended](URL of PR) (2022-05-01) | ||
| --> | ||
|
|
||
| ## Referenced Use Case(s) | ||
| <!-- | ||
| List all relevant use case / requirements documents. | ||
| ADR requires at least one relevant, approved use case. | ||
|
|
||
| Format: | ||
| - [UC Name](URL of use case) | ||
|
|
||
| Add explanations if the ADR is not addressing all the requirements of a use case. | ||
| --> | ||
|
|
||
| ## 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. | ||
| <!-- | ||
| Describe: | ||
| - how the design is architecturally significant - warranting an ADR (versus simple issue and PR to fix a problem) | ||
| - the high level design approach (details described in the proposed design below) | ||
| --> | ||
|
|
||
| ## 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. | ||
| <!-- | ||
| Details of the design (without getting into implementation where possible). | ||
| Outline: | ||
| - services/modules to be impacted (changed) | ||
| - new services/modules to be added | ||
| - model and DTO impact (changes/additions/removals) | ||
| - API impact (changes/additions/removals) | ||
| - general configuration impact (establishment of new sections, changes/additions/removals) | ||
| - devops impact | ||
| --> | ||
|
|
||
| ## Considerations | ||
|
|
||
| Full Caddy features can found [here](https://caddyserver.com/features) | ||
herrdragon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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 | ||
| <!-- | ||
| Document any agreed upon important implementation detail, caveats, future considerations, remaining or deferred design issues. | ||
| Document any part of the requirements not satisfied by the proposed design. | ||
| --> | ||
|
|
||
| ## Other Related ADRs | ||
| <!-- | ||
| List any relevant ADRs - such as a design decision for a sub-component of a feature, a design deprecated as a result of this design, etc. | ||
|
|
||
| Format: | ||
| - [ADR Title](URL) - the relevance | ||
| --> | ||
|
|
||
| ## References | ||
| <!-- | ||
| List additional references | ||
|
|
||
| Format: | ||
| - [Title](URL) | ||
| --> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.