From bef49705a4600a72345e96b5aee79aa0a76192d5 Mon Sep 17 00:00:00 2001 From: Darren Clarke Date: Fri, 10 Feb 2023 12:14:44 +0000 Subject: [PATCH] Docker updates --- .gitpod.yml | 10 ++++++++++ Makefile | 5 ++--- docker-compose.yml | 12 ++++++------ link/components/ZammadWrapper.tsx | 2 +- link/next.config.js | 16 ++++++++++------ link/pages/index.tsx | 2 +- zammad-proxy/docker-entrypoint.sh | 7 +++++++ zammad-proxy/middleware.ts | 30 +++++++++++++----------------- 8 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 .gitpod.yml create mode 100644 zammad-proxy/docker-entrypoint.sh diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..63a3e4f --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,10 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) +# and commit this file to your remote git repository to share the goodness with others. + +# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart + +tasks: + - init: make + + diff --git a/Makefile b/Makefile index c2fb668..4b78b9a 100644 --- a/Makefile +++ b/Makefile @@ -62,9 +62,8 @@ force-run-migrations: docker-compose -p link-docker-compose exec zammad-railsserver bundle exec rails r 'require "/opt/zammad/db/addon/cdr_signal/20210525091356_cdr_signal_channel.rb";require "/opt/zammad/db/addon/cdr_voice/20210525091357_cdr_voice_channel.rb";require "/opt/zammad/db/addon/cdr_whatsapp/20210525091358_cdr_whatsapp_channel.rb"; require "/opt/zammad/db/addon/pgpsupport/20220403000001_pgpsupport.rb";CdrSignalChannel.new.up;CdrVoiceChannel.new.up;CdrWhatsappChannel.new.up;PGPSupport.new.up;' sso: - docker-compose -p link-docker-compose exec zammad-nginx sed -i '/proxy_pass http:\/\/zammad-railsserver;/a proxy_set_header X-Forwarded-Ssl on;' /opt/zammad/contrib/nginx/zammad.conf; - docker-compose -p link-docker-compose exec zammad-nginx sed -i '/proxy_pass http:\/\/zammad-websocket;/a proxy_set_header X-Forwarded-Ssl on;' /opt/zammad/contrib/nginx/zammad.conf; - docker-compose -p link-docker-compose exec zammad-nginx service nginx restart; + docker-compose -p link-shell exec zammad-nginx sed -i '/proxy_set_header X-Forwarded-User "";/d' /opt/zammad/contrib/nginx/zammad.conf; + docker-compose -p link-shell exec zammad-nginx service nginx restart; start: CURRENT_UID=$(CURRENT_UID) docker-compose up -d diff --git a/docker-compose.yml b/docker-compose.yml index 566a1e4..c54e452 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -192,23 +192,23 @@ services: - /var/run/docker.sock:/tmp/docker.sock:ro link-shell: - build: - context: . - dockerfile: ./link/Dockerfile + build: ./link expose: - "3000" ports: - "8003:3000" environment: + ZAMMAD_PROXY_URL: ${ZAMMAD_PROXY_URL} ZAMMAD_URL: ${ZAMMAD_URL} ZAMMAD_API_TOKEN: ${ZAMMAD_API_TOKEN} ZAMMAD_VIRUAL_HOST: ${ZAMMAD_VIRTUAL_HOST} + zammad-proxy: - build: - context: . - dockerfile: ./zammad-proxy/Dockerfile + build: ./zammad-proxy expose: - "3000" + ports: + - "8004:3000" environment: ZAMMAD_URL: ${ZAMMAD_URL} ZAMMAD_API_TOKEN: ${ZAMMAD_API_TOKEN} diff --git a/link/components/ZammadWrapper.tsx b/link/components/ZammadWrapper.tsx index 3eb2b37..f9d597e 100644 --- a/link/components/ZammadWrapper.tsx +++ b/link/components/ZammadWrapper.tsx @@ -10,7 +10,7 @@ export const ZammadWrapper: FC = ({ url, hideSidebar = true, }) => { - const [display, setDisplay] = useState("none"); + const [display, setDisplay] = useState("inherit"); return (