fix: {ci race condition,traefik}
All checks were successful
continuous-integration/drone/push Build is passing

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/'.
This commit is contained in:
surtur 2022-08-08 15:27:27 +02:00
parent cfe496dcb7
commit c3a29bef55
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 11 additions and 22 deletions

@ -239,14 +239,6 @@ steps:
- hugo version - hugo version
- hugo --gc=true --minify - 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 - name: hadolint
image: hadolint/hadolint:v2.9.1-alpine image: hadolint/hadolint:v2.9.1-alpine
depends_on: depends_on:
@ -272,6 +264,8 @@ steps:
path: /go path: /go
depends_on: depends_on:
- go fmt - go fmt
# wait until the site is output into './public'.
- hugo-extended
commands: commands:
- go vet - go vet
@ -282,11 +276,17 @@ steps:
path: /go path: /go
depends_on: depends_on:
- go vet - go vet
# wait until the site is output into './public'.
- hugo-extended
commands: commands:
- go build -v -ldflags "-s -w -X main.Version=${DRONE_COMMIT}" . - 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 - name: build
pull: always pull: always
image: tmaier/docker-compose:latest image: tmaier/docker-compose:latest

@ -10,7 +10,7 @@ services:
- internal-nw - internal-nw
- default - default
ports: ports:
- 127.0.0.1:1314:1314 - 127.0.0.1:1314:80
restart: always restart: always
volumes: volumes:
# So that traefik can listen to the Docker events # So that traefik can listen to the Docker events
@ -28,17 +28,6 @@ services:
- traefik.enable=true - traefik.enable=true
- traefik.http.services.homepage.loadbalancer.server.port=1314 - 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`) - 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: logging:
driver: json-file driver: json-file