Skip to content

Commit

Permalink
update for deployment
Browse files Browse the repository at this point in the history
Signed-off-by: SammyOina <[email protected]>
  • Loading branch information
SammyOina committed May 30, 2023
1 parent 1703418 commit 8df67f6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# Go workspace file
go.work

.env

/build

*.cov
Expand Down
10 changes: 10 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MF_CALLHOME_LOG_LEVEL="debug"
MF_JAEGER_URL="localhost:6831"
MF_CALLHOME_IP_DB="IP2LOCATION-LITE-DB5.BIN"
MF_CALLHOME_TIMESCALE_HOST="timescaledb"
MF_CALLHOME_TIMESCALE_PORT=5432
MF_CALLHOME_TIMESCALE_USER="mainflux"
MF_CALLHOME_TIMESCALE_PASSWORD="mainflux"
MF_CALLHOME_TIMESCALE_DB_NAME="mainflux"
MF_CALLHOME_RELEASE_TAG="latest"
MF_CALLHOME_PORT=8855
2 changes: 1 addition & 1 deletion docker/certbot/init-letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if ! [ -x "$(command -v docker compose)" ]; then
exit 1
fi

domains=(callhome.mainflux.com www.callhome.mainflux.com)
domains=(deployments.mainflux.io www.deployments.mainflux.io)
rsa_key_size=4096
data_path="./certbot"
email="[email protected]"
Expand Down
15 changes: 12 additions & 3 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ http{
upstream callome_server {
server callhome-server:8855;
}
upstream callhome_ui {
server callhome-ui:80;
}

map $http_apikey $mf_version{
"77e04a7c-f207-40dd-8950-c344871fd516" "0.13";
Expand All @@ -16,7 +19,7 @@ http{

server {
listen 80;
location / {
location /telemetry {
if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
Expand All @@ -28,11 +31,14 @@ http{
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods '*';
add_header Access-Control-Allow-Headers '*';
return 307 https://$host$request_uri;
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}

server {
Expand All @@ -47,7 +53,7 @@ http{
}
return 204;
}
location / {
location /telemetry {
if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
Expand All @@ -64,6 +70,9 @@ http{
limit_req_status 429;
proxy_pass http://callome_server;
}
location / {
proxy_pass http://callhome_ui;
}
ssl_certificate /etc/letsencrypt/live/callhome.mainflux.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/callhome.mainflux.com/privkey.pem;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const environment = {
production: false,
apiKey: '77e04a7c-f207-40dd-8950-c344871fd516',
callHomeBaseUrl: "http://64.226.105.108"
callHomeBaseUrl: "https://deployments.mainflux.io"
};

0 comments on commit 8df67f6

Please sign in to comment.