Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/scripts/test_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Create .env.example file with test variables
cat <<EOL > .env.example
SERVER_PUBLIC_DOMAIN=https://example.com
SERVER_HOST=127.0.0.1
SERVER_LOCAL_PORT=3000
STORAGE_DIRPATH=test/storage
MONGO_URI=mongodb://localhost:27017/
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ You need to create a **`.env`** file in the root directory of the project and ad

```sh
SERVER_PUBLIC_DOMAIN="http://localhost:8080"
SERVER_HOST="127.0.0.1" # The host address to bind to (default: 0.0.0.0)
SERVER_LOCAL_PORT="8080" # The port to listen on
STORAGE_DIRPATH="./storage"
MONGO_DBN="DIDComm_DB"
MONGO_URI="mongodb://localhost:27017"
Expand Down
1 change: 1 addition & 0 deletions mediator-charts/templates/env-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
data:
MONGO_DBN: MediatorDB
SERVER_LOCAL_PORT: "8080"
SERVER_HOST: "0.0.0.0"
SERVER_PUBLIC_DOMAIN: "https://didcomm-mediator.eudi-adorsys.com"
MONGO_INITDB_ROOT_USERNAME: root
STORAGE_DIRPATH: /storage
Expand Down
7 changes: 5 additions & 2 deletions mediator-charts/templates/mediator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ spec:
configMapKeyRef:
key: SERVER_LOCAL_PORT
name: {{ .Values.mediator.configmap.name }}

- name: SERVER_HOST
valueFrom:
configMapKeyRef:
key: SERVER_HOST
name: {{ .Values.mediator.configmap.name }}
- name: MONGO_DBN
valueFrom:
configMapKeyRef:
key: MONGO_DBN
name: {{ .Values.mediator.configmap.name }}


- name: STORAGE_DIRPATH
valueFrom:
configMapKeyRef:
Expand Down
2 changes: 0 additions & 2 deletions mediator-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ kube-prometheus:
ruleSelector:
matchLabels:
app: mediator
scrapeInterval: 15s
evaluationInterval: 15s
secrets: ["alertmanager-mediator-kube-prometheus-alertmanager", "mediator-eks-secret"]

service:
Expand Down
10 changes: 6 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use axum::routing::get;
use didcomm_mediator::{app, health, metrics};
use eyre::{Result, WrapErr};
use std::net::SocketAddr;
use std::net::{Ipv4Addr, SocketAddr};
use tokio::net::TcpListener;

#[tokio::main]
Expand All @@ -13,12 +13,14 @@ async fn main() -> Result<()> {
config_tracing();

// Configure server
let host = std::env::var("SERVER_HOST").unwrap_or_else(|_| "0.0.0.0".to_string());
let port = std::env::var("SERVER_LOCAL_PORT").unwrap();
let port = port.parse().context("failed to parse port")?;
let addr = SocketAddr::from(([0, 0, 0, 0], port));
let port: u16 = port.parse().context("failed to parse port")?;
let host: Ipv4Addr = host.parse().context("failed to parse host")?;
let addr = SocketAddr::from((host, port));
let listener = TcpListener::bind(addr)
.await
.context("failed to parse address")?;
.context("failed to bind address")?;

tracing::debug!("listening on {addr}");

Expand Down
Loading