From f143eba002eaf2f8daee2c9da47610537cb182cf Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Wed, 10 Aug 2022 16:07:10 -0500 Subject: [PATCH 1/2] allow overriding public url for localdev --- Makefile | 3 +++ Procfile | 2 +- Procfile.prod | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4e34c6396d..cef9c5882a 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ export GOALERT_DB_URL_NEXT = $(DB_URL_NEXT) PROD_CY_PROC = Procfile.cypress.prod +PUBLIC_URL := http://localhost:3030$(HTTP_PREFIX) +export GOALERT_PUBLIC_URL := $(PUBLIC_URL) + ifeq ($(CI), 1) PROD_CY_PROC = Procfile.cypress.ci endif diff --git a/Procfile b/Procfile index 050b57698b..c2da4852fa 100644 --- a/Procfile +++ b/Procfile @@ -1,7 +1,7 @@ build: while true; do make -qs bin/goalert || make bin/goalert || (echo '\033[0;31mBuild Failure'; sleep 3); sleep 0.1; done @watch-file=./bin/goalert -goalert: ./bin/goalert -l=localhost:3030 --ui-dir=web/src/build --db-url=postgres://goalert@localhost --listen-sysapi=localhost:1234 --listen-prometheus=localhost:2112 --public-url=http://localhost:3030$HTTP_PREFIX +goalert: ./bin/goalert -l=localhost:3030 --ui-dir=web/src/build --db-url=postgres://goalert@localhost --listen-sysapi=localhost:1234 --listen-prometheus=localhost:2112 smtp: go run github.com/mailhog/MailHog -ui-bind-addr=localhost:8025 -api-bind-addr=localhost:8025 -smtp-bind-addr=localhost:1025 | grep -v KEEPALIVE prom: bin/tools/prometheus --log.level=warn --config.file=devtools/prometheus/prometheus.yml --storage.tsdb.path=bin/prom-data/ --web.listen-address=localhost:9090 diff --git a/Procfile.prod b/Procfile.prod index 5ca04e8542..931b747458 100644 --- a/Procfile.prod +++ b/Procfile.prod @@ -1,7 +1,7 @@ build: while true; do make -qs bin/goalert BUNDLE=1 || make bin/goalert BUNDLE=1 || (echo '\033[0;31mBuild Failure'; sleep 3); sleep 0.1; done @watch-file=./bin/goalert -goalert: ./bin/goalert -l=localhost:3030 --db-url=postgres://goalert@localhost --listen-sysapi=localhost:1234 --listen-prometheus=localhost:2112 --public-url=http://localhost:3030$HTTP_PREFIX +goalert: ./bin/goalert -l=localhost:3030 --db-url=postgres://goalert@localhost --listen-sysapi=localhost:1234 --listen-prometheus=localhost:2112 smtp: go run github.com/mailhog/MailHog -ui-bind-addr=localhost:8025 -api-bind-addr=localhost:8025 -smtp-bind-addr=localhost:1025 | grep -v KEEPALIVE prom: bin/tools/prometheus --log.level=warn --config.file=devtools/prometheus/prometheus.yml --storage.tsdb.path=bin/prom-data/ --web.listen-address=localhost:9090 From 8542d9ce2dad8de35e7822d8d0687cc7f84cd3e2 Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Wed, 10 Aug 2022 16:07:23 -0500 Subject: [PATCH 2/2] document external traffic setup for localdev --- docs/development-setup.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/development-setup.md b/docs/development-setup.md index fffa8f15a3..62cc0a6c95 100644 --- a/docs/development-setup.md +++ b/docs/development-setup.md @@ -23,6 +23,20 @@ podman machine ssh sudo rpm-ostree install qemu-user-static podman machine ssh sudo systemctl reboot ``` +## External Traffic + +To do local development with external traffic you will need a publicly-routable URL and can start localdev with `PUBLIC_URL` set. For example: + +```bash +make start PUBLIC_URL=http://localdev.example.com +``` + +You may add additional startup commands to the `Procfile.local` file to have them automatically run with `make start` and similar commands. + +```bash +ngrok: ngrok http -subdomain=localdev 3030 +``` + ## Database (PostgreSQL) GoAlert is built and tested against Postgres 11. Version 9.6 should still work as of this writing, but is not recommended as future versions may begin using newer features.