From 92a77d0489e8064be4855520bea8de57af2f5406 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Sun, 25 Sep 2022 16:24:10 +0200 Subject: [PATCH] fix: rename directory, fix script and correct README.md Signed-off-by: Tilman Vatteroth --- {docker => dev-reverse-proxy}/.gitignore | 0 {docker => dev-reverse-proxy}/Caddyfile | 0 dev-reverse-proxy/README.md | 12 ++++++++++++ .../run-caddy.sh | 8 +++++++- docker/README.md | 13 ------------- 5 files changed, 19 insertions(+), 14 deletions(-) rename {docker => dev-reverse-proxy}/.gitignore (100%) rename {docker => dev-reverse-proxy}/Caddyfile (100%) create mode 100644 dev-reverse-proxy/README.md rename docker/download-caddy.sh => dev-reverse-proxy/run-caddy.sh (61%) mode change 100755 => 100644 delete mode 100644 docker/README.md diff --git a/docker/.gitignore b/dev-reverse-proxy/.gitignore similarity index 100% rename from docker/.gitignore rename to dev-reverse-proxy/.gitignore diff --git a/docker/Caddyfile b/dev-reverse-proxy/Caddyfile similarity index 100% rename from docker/Caddyfile rename to dev-reverse-proxy/Caddyfile diff --git a/dev-reverse-proxy/README.md b/dev-reverse-proxy/README.md new file mode 100644 index 000000000..80992804e --- /dev/null +++ b/dev-reverse-proxy/README.md @@ -0,0 +1,12 @@ + + +To use backend and frontend together you need a reverse proxy that combines both services under one URL origin. + +We provide a ready to use config for caddy. +Make sure that the backend is running on port 3000 with the env var HD_DOMAIN set to `http://localhost:8080` and the frontend is running on port 3001 with the env var HD_EDITOR_BASE_URL set to `http://localhost:8080/`. + +You can either use the script `run-caddy.sh` in this directory or download a caddy binary from [caddy](https://caddyserver.com/) and start it using `caddy run`. diff --git a/docker/download-caddy.sh b/dev-reverse-proxy/run-caddy.sh old mode 100755 new mode 100644 similarity index 61% rename from docker/download-caddy.sh rename to dev-reverse-proxy/run-caddy.sh index aa4b3ae4e..a807285c7 --- a/docker/download-caddy.sh +++ b/dev-reverse-proxy/run-caddy.sh @@ -6,5 +6,11 @@ # set -e -curl -o caddy "https://caddyserver.com/api/download?os=linux&arch=amd64" + +if [ ! -f caddy ] +then +curl -o caddy "https://caddyserver.com/api/download" chmod +x ./caddy +fi + +exec ./caddy run diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 762400f5b..000000000 --- a/docker/README.md +++ /dev/null @@ -1,13 +0,0 @@ - - -To use backend and frontend together you need a reverse proxy that combines both services under one origin. - -We provide a ready to use config for nginx and caddy. -Make sure that in the backend HD_DOMAIN is set to `http://localhost:8080`. - -If you have docker you can use our docker-compose file that starts a nginx using `docker-compose up`. -If you're on Windows or macOS you rather might want to download [caddy](https://caddyserver.com/) and start it using `caddy run` in this directory.