-
Notifications
You must be signed in to change notification settings - Fork 59
Add twelve-factor app compliance: PORT/BIND_HOST env vars and health endpoints #532
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
Changes from all commits
90fe0fd
342913e
146a6ac
e920008
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -87,8 +87,9 @@ wassette serve --sse | |||||||||||||||||||||||||||||||||
| # Use custom bind address | ||||||||||||||||||||||||||||||||||
| wassette serve --sse --bind-address 0.0.0.0:8080 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Use environment variable for bind address | ||||||||||||||||||||||||||||||||||
| export WASSETTE_BIND_ADDRESS=192.168.1.100:9001 | ||||||||||||||||||||||||||||||||||
| # Use environment variables for bind address | ||||||||||||||||||||||||||||||||||
| export PORT=8080 | ||||||||||||||||||||||||||||||||||
| export BIND_HOST=0.0.0.0 | ||||||||||||||||||||||||||||||||||
| wassette serve --sse | ||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -641,10 +642,20 @@ component_dir = "/opt/wassette/components" | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - **`WASSETTE_CONFIG_FILE`**: Override the default configuration file location | ||||||||||||||||||||||||||||||||||
| - **`WASSETTE_COMPONENT_DIR`**: Override the default component storage location | ||||||||||||||||||||||||||||||||||
| - **`WASSETTE_BIND_ADDRESS`**: Override the default bind address for HTTP-based transports | ||||||||||||||||||||||||||||||||||
| - **`PORT`**: Set the port number for HTTP-based transports (default: 9001) | ||||||||||||||||||||||||||||||||||
| - **`BIND_HOST`**: Set the host address to bind to (default: 127.0.0.1) | ||||||||||||||||||||||||||||||||||
| - **`XDG_CONFIG_HOME`**: Base directory for configuration files (Linux/macOS) | ||||||||||||||||||||||||||||||||||
| - **`XDG_DATA_HOME`**: Base directory for data storage (Linux/macOS) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
+645
to
649
|
||||||||||||||||||||||||||||||||||
| - **`PORT`**: Set the port number for HTTP-based transports (default: 9001) | |
| - **`BIND_HOST`**: Set the host address to bind to (default: 127.0.0.1) | |
| - **`XDG_CONFIG_HOME`**: Base directory for configuration files (Linux/macOS) | |
| - **`XDG_DATA_HOME`**: Base directory for data storage (Linux/macOS) | |
| - **`XDG_CONFIG_HOME`**: Base directory for configuration files (Linux/macOS) | |
| - **`XDG_DATA_HOME`**: Base directory for data storage (Linux/macOS) | |
| ### Bind Address Configuration | |
| The bind address can be configured via: | |
| 1. CLI option `--bind-address` (highest priority) | |
| 2. Environment variable `WASSETTE_BIND_ADDRESS` (deprecated, removed) | |
| 3. Configuration file `bind_address` field | |
| 4. PORT and BIND_HOST environment variables (used as defaults when above are not set) | |
| 5. Built-in defaults: 127.0.0.1:9001 (or 0.0.0.0:9001 in Docker) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The example response for
/infoon line 193 shows"build_info": "0.3.4 version.BuildInfo{...}"which includes the version number twice (once in the JSON field "version" and once at the start of "build_info"). Looking at theformat_build_info()implementation, it returnsformat!("{} version.BuildInfo{{...}}", built_info::PKG_VERSION, ...), so the example is correct. However, this redundancy might be confusing. Consider documenting why the version appears twice or simplify the format.