diff --git a/completion/bash/itkdev-docker-compose-completion.bash b/completion/bash/itkdev-docker-compose-completion.bash index 0fb27d4..0b52a60 100644 --- a/completion/bash/itkdev-docker-compose-completion.bash +++ b/completion/bash/itkdev-docker-compose-completion.bash @@ -9,7 +9,7 @@ _idc_completions() fi # Keep the suggestions in a local variable - local suggestions=($(compgen -W "dory:start dory:stop url open drush nfs:enable template:install template:update traefik:start traefik:stop traefik:open traefik:url mail:open mail:url mailhog:open mailhog:url sql:cli sql:connect sql:log sql:port sql:open xdebug xdebug3 hosts:insert self:update sync sync:db sync:files images:pull composer php version bin/console" -- "${COMP_WORDS[1]}")) + local suggestions=($(compgen -W "url open drush nfs:enable template:install template:update traefik:start traefik:stop traefik:open traefik:url mail:open mail:url mailhog:open mailhog:url sql:cli sql:connect sql:log sql:port sql:open xdebug xdebug3 hosts:insert self:update sync sync:db sync:files images:pull composer php version bin/console" -- "${COMP_WORDS[1]}")) COMPREPLY=("${suggestions[@]}") diff --git a/completion/zsh/_itkdev-docker-compose b/completion/zsh/_itkdev-docker-compose index 9a15bfe..78cc251 100644 --- a/completion/zsh/_itkdev-docker-compose +++ b/completion/zsh/_itkdev-docker-compose @@ -27,8 +27,6 @@ _itkdev-docker-compose() { case $state in (command) _values 'itkdev-docker-compose command' \ - 'dory\:start[Start reverse proxy]' \ - 'dory\:stop[Stop reverse proxy]' \ 'url[Print url to site.]' \ 'open[Open url in default browser.]' \ 'drush[Run drush command.]' \ diff --git a/scripts/itkdev-docker-compose b/scripts/itkdev-docker-compose index 679e357..1f12e4b 100755 --- a/scripts/itkdev-docker-compose +++ b/scripts/itkdev-docker-compose @@ -41,7 +41,7 @@ function self_update { git checkout "$branch" git pull - echo "${bold}Done.${normal}" + echo "${bold}Done. Please run traefik:pull to ensure you have the latest containers.${normal}" echo echo "Latest changes:" @@ -187,12 +187,6 @@ Usage: itkdev-docker-compose command [command arguments] Commands: - dory:start - Start dory reverse proxy - - dory:stop - Stop dory reverse proxy - url [service [port]] Print url to site or a service @@ -264,16 +258,22 @@ Commands: Update template installed in project. traefik:start - Start træfik reverse proxy. + Start traefik reverse proxy. traefik:stop - Stop træfik reverse proxy + Stop traefik reverse proxy traefik:url - URL for the administrative UI for træfik. + URL for the administrative UI for traefik. traefik:open - Open the administrative UI for træfik. + Open the administrative UI for traefik. + + traefik:logs + See traefik logs + + traefik:pull + Pull latest traefik & socket-proxy containers mail:url URL for the test mail web interface. @@ -459,10 +459,6 @@ fi # Allow traefik:start without existence of .env if [[ "$#" -gt "0" && "$1" == "traefik:start" ]]; then - if [ "$(docker inspect -f '{{.State.Running}}' dory_dnsmasq 2>/dev/null)" == "true" ]; then - (>&2 echo "${bold}Dory reverse proxy should be stopped first. Run itkdev-docker-compose dory:stop.${normal}") - exit 22; - fi docker network inspect frontend >/dev/null 2>&1 || docker network create --driver=bridge --attachable --internal=false frontend $(cd ${script_dir}/../traefik/; docker compose up -d) exit @@ -474,19 +470,9 @@ if [[ "$#" -gt "0" && "$1" == "traefik:stop" ]]; then exit fi -# Allow dory:start without existence of .env -if [[ "$#" -gt "0" && "$1" == "dory:start" ]]; then - if [ "$(docker inspect -f '{{.State.Running}}' traefik 2>/dev/null)" == "true" ]; then - (>&2 echo "${bold}Traefik reverse proxy should be stopped first. Run itkdev-docker-compose traefik:stop.${normal}") - exit 22; - fi - dory up - exit -fi - -# Allow dory:start without existence of .env -if [[ "$#" -gt "0" && "$1" == "dory:stop" ]]; then - dory down +# Allow traefik:pull without existence of .env +if [[ "$#" -gt "0" && "$1" == "traefik:pull" ]]; then + $(cd ${script_dir}/../traefik/; docker compose pull) exit fi @@ -548,10 +534,9 @@ fi # Check if revers proxy is running and print warning if not. set +o errexit is_treafik_running=$(docker inspect -f '{{.State.Running}}' traefik 2>/dev/null) -is_dory_running=$(docker inspect -f '{{.State.Running}}' dory_dnsmasq 2>/dev/null) set -o errexit -if [ ! "$is_treafik_running" == "true" ] && [ ! "$is_dory_running" == "true" ]; then +if [ ! "$is_treafik_running" == "true" ]; then (>&2 echo "${bold}Reverse proxy has not been started. Hostname will not be resolved to containers and not all commands will work correctly.${normal}") fi @@ -728,6 +713,11 @@ EOF echo http://${url}:8080; ;; + traefik:logs) + echo "docker logs --tail 20 traefik" + docker logs --tail 20 traefik + ;; + mail:url) url="http://${COMPOSE_DOMAIN}:$(docker_compose port mail 8025 | cut -d: -f2)" echo $url diff --git a/traefik/traefik.yml b/traefik/traefik.yml index b8ff017..f51c7ef 100644 --- a/traefik/traefik.yml +++ b/traefik/traefik.yml @@ -5,9 +5,9 @@ api: disableDashboardAd: true entryPoints: - http: + web: address: ":80" - https: + websecure: address: ":443" http: tls: {}