Skip to content

Commit

Permalink
feat!: bus security default to 127.0.0.1
Browse files Browse the repository at this point in the history
Closes #7
  • Loading branch information
mikejgray committed Nov 17, 2024
1 parent e74b327 commit 3045d7d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ovos_messagebus"
version = "0.3.4"
version = "1.0.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ LABEL org.opencontainers.image.license="Apache-2.0"
RUN apk add --no-cache libgcc
# copy the binary into the final image
COPY --from=0 /app/target/release/ovos_messagebus .

# Be sure to secure this with a firewall or reverse proxy
ENV OVOS_BUS_HOST=0.0.0.0
# set the binary as entrypoint
ENTRYPOINT ["/ovos_messagebus"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ OVOS_BUS_HOST=10.10.10.10 OVOS_BUS_PORT=8181 /usr/local/bin/ovos_messagebus

### Available Environment Variables

- `OVOS_BUS_HOST` (default: `0.0.0.0`)
- `OVOS_BUS_HOST` (default: `127.0.0.1`)
- `OVOS_BUS_PORT` (default: `8181`)
- `OVOS_BUS_CONFIG_FILE` (default: none)
- `OVOS_BUS_MAX_MSG_SIZE` (default: `25`, in MB)
Expand Down Expand Up @@ -87,7 +87,7 @@ docker build -t ovos-rust-messagebus .
To run the container:

```sh
docker run -p 8181:8181 -e OVOS_BUS_HOST=0.0.0.0 ovos-rust-messagebus
docker run -p 8181:8181 -e OVOS_BUS_HOST=127.0.0.1 ovos-rust-messagebus
```

You can adjust the port mapping and environment variables as needed.
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Config {
pub fn new() -> Self {
// Default configuration
let mut config = Config {
host: "0.0.0.0".to_string(),
host: "127.0.0.1".to_string(),
port: 8181,
route: "/core".to_string(),
ssl: false,
Expand Down Expand Up @@ -121,7 +121,7 @@ mod tests {
fn test_default_config() {
setup_default_config_environment();
let test_conf = Config::new();
assert_eq!(test_conf.host, "0.0.0.0".to_string());
assert_eq!(test_conf.host, "127.0.0.1".to_string());
assert_eq!(test_conf.port, 8181);
assert_eq!(test_conf.route, "/core".to_string());
}
Expand Down

0 comments on commit 3045d7d

Please sign in to comment.