From c3a29bef559ae5d852827c7e9488d3e934b9125b Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 8 Aug 2022 15:27:27 +0200 Subject: [PATCH] fix: {ci race condition,traefik} as a result of #33: * traefik proxy according to compose was pointing nowhere * traefik was attempting to redirect as it used to when the site was behind nginx, which is unneccessary now, the go app can properly handle paths such as '/tags/'. --- .drone.yml | 20 ++++++++++---------- docker-compose.yml | 13 +------------ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.drone.yml b/.drone.yml index d6e1983..9e1ed4b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -239,14 +239,6 @@ steps: - hugo version - hugo --gc=true --minify - - name: rm-intermediate - pull: if-not-exists - image: immawanderer/fedora-hugo:linux-amd64 - depends_on: - - hugo-extended - commands: - - rm -rf ./public - - name: hadolint image: hadolint/hadolint:v2.9.1-alpine depends_on: @@ -272,6 +264,8 @@ steps: path: /go depends_on: - go fmt + # wait until the site is output into './public'. + - hugo-extended commands: - go vet @@ -282,11 +276,17 @@ steps: path: /go depends_on: - go vet - # wait until the site is output into './public'. - - hugo-extended commands: - go build -v -ldflags "-s -w -X main.Version=${DRONE_COMMIT}" . + - name: rm-intermediate + pull: if-not-exists + image: immawanderer/fedora-hugo:linux-amd64 + depends_on: + - go build + commands: + - rm -rf ./public + - name: build pull: always image: tmaier/docker-compose:latest diff --git a/docker-compose.yml b/docker-compose.yml index f412030..e1c998c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: - internal-nw - default ports: - - 127.0.0.1:1314:1314 + - 127.0.0.1:1314:80 restart: always volumes: # So that traefik can listen to the Docker events @@ -28,17 +28,6 @@ services: - traefik.enable=true - traefik.http.services.homepage.loadbalancer.server.port=1314 - traefik.http.routers.homepage.rule=Host(`localhost`) || Host(`127.0.0.1`) || Host(`homepage`) || Host(`6426tqrh4y5uobmo5y2csaip3m3avmjegd2kpa24sadekpxglbm34aqd.onion`) - # ref: https://stackoverflow.com/a/61976953 - # ref: https://github.com/traefik/traefik/issues/563 - - "traefik.http.routers.homepage.middlewares=homepage-redirectregex, homepage-replacepathregex" - - - "traefik.http.middlewares.homepage-replacepathregex.replacepathregex.regex=^/tags/(.*)$$" - - "traefik.http.middlewares.homepage-replacepathregex.replacepathregex.replacement=https://dotya.ml/tags/$$1/" - - "traefik.http.middlewares.homepage-redirectregex.redirectregex.regex=^/tags$$" - - "traefik.http.middlewares.homepage-redirectregex.redirectregex.replacement=https://dotya.ml/tags/" - - "traefik.frontend.redirect.regex=^https://dotya.ml/tags/(.*)$$" - - "traefik.frontend.redirect.replacement=https://dotya.ml/tags/$$1/" - - "traefik.frontend.rule=PathPrefix:/tags;ReplacePathRegex: ^/tags/(.*) /tags/$$1/" logging: driver: json-file