diff --git a/build/build.sh b/build/build.sh index 071680e..51d799f 100755 --- a/build/build.sh +++ b/build/build.sh @@ -12,7 +12,7 @@ BIN_NAME="pinger" # set the default version to undefined if [ -z ${VERSION} ] then - CURRENT_TAG="undefined" + CURRENT_TAG="dev" else CURRENT_TAG="${VERSION}" fi diff --git a/deploy/pinger.apache.conf b/deploy/pinger.apache.conf new file mode 100644 index 0000000..1c7c41c --- /dev/null +++ b/deploy/pinger.apache.conf @@ -0,0 +1,11 @@ +Listen 80 + + ServerName pinger.staging.sdslabs.* pinger.sdslabs.* + # Other directives here + + ProxyPass http://127.0.0.1:9010 + ProxyPassReverse http://127.0.0.1:9010 + Order allow,deny + Allow from all + + \ No newline at end of file diff --git a/deploy/pinger.nginx.conf b/deploy/pinger.nginx.conf new file mode 100644 index 0000000..82d916a --- /dev/null +++ b/deploy/pinger.nginx.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name pinger.staging.sdslabs.* pinger.sdslabs.*; + + location / { + client_max_body_size 20M; + proxy_pass http://127.0.0.1:9010; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 86400; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $host:$server_port; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Forwarded-Port $server_port; + } +} \ No newline at end of file diff --git a/docs/src/contributing/build-process.md b/docs/src/contributing/build-process.md index 6192c42..b352620 100644 --- a/docs/src/contributing/build-process.md +++ b/docs/src/contributing/build-process.md @@ -19,6 +19,8 @@ required for the frontend. Once we have our resources ready, we can build the executable using the `make build` command. We have `VERSION` flag for setting the version of the binary. +> **Note:** In case no `VERSION` is provided, version defaults to `dev` + ```sh # Building the binary $ make build VERSION=1.0.1 @@ -62,7 +64,7 @@ $ make docker TAG="pinger:v1.2.3" ## Docker Compose A `docker-compose.yml` is also provided to get pinger started more easier. -Just add an `agent.yml` according to your use case, replace +Just add an `agent.yml` according to your use case, replace `CMD [ "./pinger", "version" ]` in the `Dockerfile` with `CMD [ "./pinger", "agent" ]` and then run `docker-compose up`. This will get both the timescale db and pinger container up and running in no time!