Skip to content

Commit

Permalink
Align env variables (#209)
Browse files Browse the repository at this point in the history
* align env variables

* bumped version

* updated args

* fixed makefile

* updated readme

* added setup target
  • Loading branch information
lassemand authored Sep 12, 2024
1 parent bd092db commit b78b624
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion notification-server/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 notification-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Concordium AG [email protected]"]
edition = "2021"
name = "notification-server"
version = "0.2.5"
version = "0.2.6"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
8 changes: 5 additions & 3 deletions notification-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

all: docker-up wait-for-db create-tables

setup: setup-db setup-credentials

setup-db:
@echo "Setting default password"
@DB_PASSWORD=$$(openssl rand -base64 12) && \
export DB_PASSWORD=$$DB_PASSWORD && \
cat .env.template | envsubst > .env

setup-credentials:
echo "Please enter the path to your Google application credentials file:" && \
@echo "Please enter the path to your Google application credentials file:"
read GOOGLE_APPLICATION_CREDENTIALS_PATH && \
mkdir -p secrets && \
cp $$GOOGLE_APPLICATION_CREDENTIALS_PATH secrets/google-credentials.json && \
cp $$GOOGLE_APPLICATION_CREDENTIALS_PATH secrets/google-credentials.json

docker-up:
@echo "Starting Docker containers..."
Expand Down Expand Up @@ -40,4 +42,4 @@ create-tables:
docker compose exec -T db psql --username=postgres < $$sql_file; \
done

.PHONY: setup all docker-up wait-for-db create-tables
.PHONY: setup setup-credential setup-db all docker-up wait-for-db create-tables
4 changes: 2 additions & 2 deletions notification-server/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Notification server
# Notification api

Server to obtain information about particular account to device mappings and store them in a persistence layer.
API to obtain information about particular account to device mappings and store them in a persistence layer.

# Notification service

Expand Down
1 change: 1 addition & 0 deletions notification-server/src/bin/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct Args {
listen_address: std::net::SocketAddr,
#[arg(
long = "prometheus-address",
help = "Listen address for the prometheus metrics server.",
env = "NOTIFICATION_SERVER_PROMETHEUS_ADDRESS"
)]
prometheus_address: Option<std::net::SocketAddr>,
Expand Down
6 changes: 3 additions & 3 deletions notification-server/src/bin/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ struct Args {
)]
block_process_timeout_sec: u64,
#[arg(
long = "listen-address",
help = "Listen address for the server.",
env = "NOTIFICATION_SERVER_METRICS_LISTEN_ADDRESS"
long = "prometheus-address",
help = "Listen address for the prometheus metrics server.",
env = "NOTIFICATION_SERVER_PROMETHEUS_ADDRESS"
)]
listen_address: Option<std::net::SocketAddr>,
}
Expand Down

0 comments on commit b78b624

Please sign in to comment.