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 --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

@ -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