From b368e713379f102ab30f85529d96c5bd8d736343 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij <45041769+jnoordsij@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:58:05 +0200 Subject: [PATCH 1/6] Bump Docker images use for documentation to Alpine 3.20 --- .github/workflows/test-integration.yaml | 2 +- docs/check.Dockerfile | 2 +- docs/docs.Dockerfile | 8 ++-- docs/requirements.txt | 56 ++++++++----------------- docs/runtime.txt | 1 - 5 files changed, 24 insertions(+), 45 deletions(-) delete mode 100644 docs/runtime.txt diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 51e2b1ab0..cd157edad 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -42,7 +42,7 @@ jobs: fail-fast: true matrix: parallel: [12] - index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , 11] + index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] steps: - name: Check out code diff --git a/docs/check.Dockerfile b/docs/check.Dockerfile index d33a46af3..824a97081 100644 --- a/docs/check.Dockerfile +++ b/docs/check.Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.18 as alpine +FROM alpine:3.20 RUN apk --no-cache --no-progress add \ build-base \ diff --git a/docs/docs.Dockerfile b/docs/docs.Dockerfile index ee10a5302..2ed4d0528 100644 --- a/docs/docs.Dockerfile +++ b/docs/docs.Dockerfile @@ -1,10 +1,12 @@ -FROM alpine:3.14 +FROM alpine:3.20 -ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin +ENV PATH="${PATH}:/venv/bin" COPY requirements.txt /mkdocs/ WORKDIR /mkdocs VOLUME /mkdocs RUN apk --no-cache --no-progress add py3-pip gcc musl-dev python3-dev \ - && pip3 install --user -r requirements.txt + && python3 -m venv /venv \ + && source /venv/bin/activate \ + && pip3 install -r requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt index 8274f4d68..68126a411 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,45 +1,23 @@ -mkdocs==1.2.2 +markdown-include==0.5.1 +mkdocs==1.2.4 +mkdocs-exclude==1.0.2 mkdocs-traefiklabs>=100.0.7 -appdirs==1.4.4 -CacheControl==0.12.6 -certifi==2020.12.5 -chardet==4.0.0 -click==8.0.4 -colorama==0.4.4 -contextlib2==0.6.0 -distlib==0.3.1 -distro==1.5.0 -ghp-import==2.0.2 -html5lib==1.1 -idna==3.2 -importlib-metadata==4.11.3 -Jinja2==3.0.0 -lockfile==0.12.2 +click==8.1.7 +colorama==0.4.6 +ghp-import==2.1.0 +importlib_metadata==7.1.0 +Jinja2==3.1.3 Markdown==3.3.6 -markdown-include==0.5.1 -MarkupSafe==2.1.1 +MarkupSafe==2.1.5 mergedeep==1.3.4 -mkdocs-bootswatch==1.0 -mkdocs-exclude==1.0.2 -mkdocs-material-extensions==1.0.3 -msgpack==1.0.2 -ordered-set==4.0.2 -packaging==20.9 -pep517==0.10.0 -progress==1.5 -Pygments==2.11.2 +mkdocs-material-extensions==1.3.1 +packaging==24.0 +Pygments==2.18.0 pymdown-extensions==7.0 -pyparsing==2.4.7 -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 PyYAML==6.0.1 -pyyaml-env-tag==0.1 -requests==2.25.1 -retrying==1.3.3 -six==1.15.0 -toml==0.10.2 -urllib3==1.26.5 -watchdog==2.1.7 -webencodings==0.5.1 -zipp==3.7.0 - +pyyaml_env_tag==0.1 +six==1.16.0 +watchdog==4.0.0 +zipp==3.18.1 diff --git a/docs/runtime.txt b/docs/runtime.txt deleted file mode 100644 index 475ba515c..000000000 --- a/docs/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -3.7 From cdf0c8b3ecc1dbc4ab343ac9ee261b39fcb8a8bc Mon Sep 17 00:00:00 2001 From: Henrik Norlin Date: Thu, 6 Jun 2024 15:46:03 +0200 Subject: [PATCH 2/6] Add user guides link to getting started --- docs/content/getting-started/quick-start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/getting-started/quick-start.md b/docs/content/getting-started/quick-start.md index 6ebb1b065..cdae1c45c 100644 --- a/docs/content/getting-started/quick-start.md +++ b/docs/content/getting-started/quick-start.md @@ -119,6 +119,6 @@ IP: 172.27.0.4 !!! question "Where to Go Next?" - Now that you have a basic understanding of how Traefik can automatically create the routes to your services and load balance them, it is time to dive into [the documentation](/) and let Traefik work for you! + Now that you have a basic understanding of how Traefik can automatically create the routes to your services and load balance them, it is time to dive into [the user guides](../../user-guides/docker-compose/basic-example/ "Link to the user guides") and [the documentation](/ "Link to the docs landing page") and let Traefik work for you! {!traefik-for-business-applications.md!} From c23c3e0ed337555cf7f85de136871a6c8534d84b Mon Sep 17 00:00:00 2001 From: Dmitry Romashov Date: Fri, 7 Jun 2024 11:06:05 +0200 Subject: [PATCH 3/6] Run UI tests on the CI --- .github/workflows/test-unit.yaml | 21 +++++++++++++++++++++ Makefile | 9 ++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 36721ba85..43ea42853 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -29,3 +29,24 @@ jobs: - name: Tests run: make test-unit + + test-ui-unit: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version-file: webui/.nvmrc + cache: 'yarn' + cache-dependency-path: webui/yarn.lock + + - name: UI unit tests + run: | + yarn --cwd webui install + yarn --cwd webui test:unit:ci diff --git a/Makefile b/Makefile index 7a810fff8..9204814ab 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ crossbinary-default: generate generate-webui .PHONY: test #? test: Run the unit and integration tests -test: test-unit test-integration +test: test-ui-unit test-unit test-integration .PHONY: test-unit #? test-unit: Run the unit tests @@ -100,6 +100,13 @@ test-unit: test-integration: binary GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./integration -test.timeout=20m -failfast -v $(TESTFLAGS) +.PHONY: test-ui-unit +#? test-ui-unit: Run the unit tests for the webui +test-ui-unit: + $(MAKE) build-webui-image + docker run --rm -v "$(PWD)/webui/static":'/src/webui/static' traefik-webui yarn --cwd webui install + docker run --rm -v "$(PWD)/webui/static":'/src/webui/static' traefik-webui yarn --cwd webui test:unit:ci + .PHONY: pull-images #? pull-images: Pull all Docker images to avoid timeout during integration tests pull-images: From 5c48e3c96c6f5be65c321e29e7a3063873e73bee Mon Sep 17 00:00:00 2001 From: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:56:04 +0200 Subject: [PATCH 4/6] chore(ci): improve webui build and lint --- .github/workflows/build.yaml | 14 +++++++++++++- .github/workflows/experimental.yaml | 11 ++++++++++- webui/Dockerfile | 2 +- webui/package.json | 11 ++++++----- webui/readme.md | 2 +- webui/src/components/_commons/AvatarState.vue | 2 +- webui/src/components/_commons/MainTable.vue | 6 +++--- webui/src/components/_commons/PanelHealthCheck.vue | 2 +- webui/src/components/_commons/PanelMiddlewares.vue | 4 ++-- .../components/_commons/PanelMirroringServices.vue | 2 +- .../src/components/_commons/PanelRouterDetails.vue | 4 ++-- webui/src/components/_commons/PanelServers.vue | 2 +- .../components/_commons/PanelServiceDetails.vue | 2 +- webui/src/components/_commons/PanelTLS.vue | 10 +++++----- .../components/_commons/PanelWeightedServices.vue | 2 +- webui/src/components/_commons/ProviderIcon.vue | 2 +- .../components/_commons/StickyServiceDetails.vue | 2 +- webui/src/components/_commons/ToolBarTable.vue | 5 +++-- webui/src/components/dashboard/PanelChart.vue | 6 +++--- webui/src/components/dashboard/PanelEntry.vue | 8 ++++---- webui/src/components/dashboard/PanelFeature.vue | 5 ++++- webui/src/components/dashboard/PanelProvider.vue | 7 +++++-- webui/src/pages/_commons/MiddlewareDetail.vue | 4 ++-- webui/src/pages/_commons/RouterDetail.vue | 4 ++-- webui/src/pages/_commons/ServiceDetail.vue | 4 ++-- 25 files changed, 76 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ec0c32edb..95e921ebf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,9 +20,21 @@ jobs: with: fetch-depth: 0 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version-file: webui/.nvmrc + cache: yarn + cache-dependency-path: webui/yarn.lock + - name: Build webui + working-directory: ./webui + run: | + yarn install + yarn build + + - name: Package webui run: | - make clean-webui generate-webui tar czvf webui.tar.gz ./webui/static/ - name: Artifact webui diff --git a/.github/workflows/experimental.yaml b/.github/workflows/experimental.yaml index b20d31124..fa91bfda5 100644 --- a/.github/workflows/experimental.yaml +++ b/.github/workflows/experimental.yaml @@ -25,9 +25,18 @@ jobs: with: fetch-depth: 0 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version-file: webui/.nvmrc + cache: yarn + cache-dependency-path: webui/yarn.lock + - name: Build webui + working-directory: ./webui run: | - make clean-webui generate-webui + yarn install + yarn build - name: Set up Go ${{ env.GO_VERSION }} uses: actions/setup-go@v5 diff --git a/webui/Dockerfile b/webui/Dockerfile index 3939d56b0..df6ca6167 100644 --- a/webui/Dockerfile +++ b/webui/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.11 +FROM node:20.14 # Current Active LTS release according to (https://nodejs.org/en/about/releases/) ENV WEBUI_DIR /src/webui diff --git a/webui/package.json b/webui/package.json index f33140de3..f6d7acb42 100644 --- a/webui/package.json +++ b/webui/package.json @@ -8,10 +8,10 @@ "scripts": { "transfer": "node dev/scripts/transfer.js", "lint": "eslint --ext .js,.vue src", - "dev": "export APP_ENV='development' && quasar dev", + "dev": "APP_ENV=development quasar dev", "build-quasar": "quasar build", - "build-staging": "export NODE_ENV='production' && export APP_ENV='development' && yarn build-quasar", - "build": "export NODE_ENV='production' && export APP_ENV='production' && yarn build-quasar && yarn transfer spa", + "build-staging": "NODE_ENV=production APP_ENV=development yarn build-quasar", + "build": "NODE_ENV=production APP_ENV=production yarn build-quasar && yarn transfer spa", "build:nc": "yarn build", "test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test:unit": "vitest", @@ -56,6 +56,7 @@ "engines": { "node": "^20 || ^18 || ^16", "npm": ">= 6.13.4", - "yarn": ">= 1.21.1" - } + "yarn": ">= 1.22.22" + }, + "packageManager": "yarn@1.22.22" } diff --git a/webui/readme.md b/webui/readme.md index e621e4080..812cbdf5a 100644 --- a/webui/readme.md +++ b/webui/readme.md @@ -20,7 +20,7 @@ make clean-webui generate-webui # Generate static contents in `webui/static/` fo ## How to build (only for frontend developer) -- prerequisite: [Node 20.11+](https://nodejs.org) [Yarn 1.22.19](https://yarnpkg.com/) +- prerequisite: [Node 20.14+](https://nodejs.org) [Yarn 1.22.22](https://yarnpkg.com/) - Go to the `webui/` directory diff --git a/webui/src/components/_commons/AvatarState.vue b/webui/src/components/_commons/AvatarState.vue index e74e73104..1b99f976e 100644 --- a/webui/src/components/_commons/AvatarState.vue +++ b/webui/src/components/_commons/AvatarState.vue @@ -24,7 +24,7 @@ import { defineComponent } from 'vue' export default defineComponent({ name: 'AvatarState', props: { - state: String + state: { type: String, default: undefined, required: false } } }) diff --git a/webui/src/components/_commons/MainTable.vue b/webui/src/components/_commons/MainTable.vue index 4b64c8999..100e76ad7 100644 --- a/webui/src/components/_commons/MainTable.vue +++ b/webui/src/components/_commons/MainTable.vue @@ -104,12 +104,12 @@ export default defineComponent({ QPageScroller }, props: { - data: Object, + data: { type: Object, default: undefined, required: false }, columns: Array[Object], loading: Boolean, - onLoadMore: Function, + onLoadMore: { type: Function, default: undefined, required: false }, endReached: Boolean, - onRowClick: Function + onRowClick: { type: Function, default: undefined, required: false } }, methods: { getColumn (columnName) { diff --git a/webui/src/components/_commons/PanelHealthCheck.vue b/webui/src/components/_commons/PanelHealthCheck.vue index 7513cded0..0d1689d0d 100644 --- a/webui/src/components/_commons/PanelHealthCheck.vue +++ b/webui/src/components/_commons/PanelHealthCheck.vue @@ -137,7 +137,7 @@ export default { filters: { }, props: { - data: Object, + data: { type: Object, default: undefined, required: false }, dense: Boolean }, computed: { diff --git a/webui/src/components/_commons/PanelMiddlewares.vue b/webui/src/components/_commons/PanelMiddlewares.vue index 5ef836118..ced92222d 100644 --- a/webui/src/components/_commons/PanelMiddlewares.vue +++ b/webui/src/components/_commons/PanelMiddlewares.vue @@ -75,8 +75,8 @@ ERRORS {{ errorMsg }} diff --git a/webui/src/components/_commons/PanelMirroringServices.vue b/webui/src/components/_commons/PanelMirroringServices.vue index 3a3fa3319..a526f3f0f 100644 --- a/webui/src/components/_commons/PanelMirroringServices.vue +++ b/webui/src/components/_commons/PanelMirroringServices.vue @@ -70,7 +70,7 @@ export default { name: 'PanelMirroringServices', props: { - data: Object, + data: { type: Object, default: undefined, required: false }, dense: Boolean }, computed: { diff --git a/webui/src/components/_commons/PanelRouterDetails.vue b/webui/src/components/_commons/PanelRouterDetails.vue index 2ae068fa7..25a01e902 100644 --- a/webui/src/components/_commons/PanelRouterDetails.vue +++ b/webui/src/components/_commons/PanelRouterDetails.vue @@ -131,8 +131,8 @@ export default defineComponent({ AvatarState }, props: { - data: Object, - protocol: String + data: { type: Object, default: undefined, required: false }, + protocol: { type: String, default: undefined, required: false } }, computed: { getProviderLogoPath () { diff --git a/webui/src/components/_commons/PanelServers.vue b/webui/src/components/_commons/PanelServers.vue index 5b07eda44..5c3e8f54b 100644 --- a/webui/src/components/_commons/PanelServers.vue +++ b/webui/src/components/_commons/PanelServers.vue @@ -102,7 +102,7 @@ export default defineComponent({ AvatarState }, props: { - data: Object, + data: { type: Object, default: undefined, required: false }, dense: Boolean, hasStatus: Boolean }, diff --git a/webui/src/components/_commons/PanelServiceDetails.vue b/webui/src/components/_commons/PanelServiceDetails.vue index 91708c35c..0f6758e52 100644 --- a/webui/src/components/_commons/PanelServiceDetails.vue +++ b/webui/src/components/_commons/PanelServiceDetails.vue @@ -171,7 +171,7 @@ export default defineComponent({ StickyServiceDetails }, props: { - data: Object, + data: { type: Object, default: undefined, required: false }, dense: Boolean }, computed: { diff --git a/webui/src/components/_commons/PanelTLS.vue b/webui/src/components/_commons/PanelTLS.vue index eb7af91a8..905d8878f 100644 --- a/webui/src/components/_commons/PanelTLS.vue +++ b/webui/src/components/_commons/PanelTLS.vue @@ -77,12 +77,12 @@ {{ domain.main }} - {{ domain }} + {{ sanDomain }} @@ -130,8 +130,8 @@ export default defineComponent({ BooleanState }, props: { - data: Object, - protocol: String + data: { type: Object, default: undefined, required: false }, + protocol: { type: String, default: undefined, required: false } } }) diff --git a/webui/src/components/_commons/PanelWeightedServices.vue b/webui/src/components/_commons/PanelWeightedServices.vue index 178bc8d4b..b8eeaa72a 100644 --- a/webui/src/components/_commons/PanelWeightedServices.vue +++ b/webui/src/components/_commons/PanelWeightedServices.vue @@ -66,7 +66,7 @@ export default defineComponent({ name: 'PanelWeightedServices', components: {}, props: { - data: Object, + data: { type: Object, default: undefined, required: false }, dense: Boolean }, computed: { diff --git a/webui/src/components/_commons/ProviderIcon.vue b/webui/src/components/_commons/ProviderIcon.vue index 9be76c746..4511b696b 100644 --- a/webui/src/components/_commons/ProviderIcon.vue +++ b/webui/src/components/_commons/ProviderIcon.vue @@ -9,7 +9,7 @@ import { defineComponent } from 'vue' export default defineComponent({ props: { - name: String + name: { type: String, default: undefined, required: false } }, computed: { getLogoPath () { diff --git a/webui/src/components/_commons/StickyServiceDetails.vue b/webui/src/components/_commons/StickyServiceDetails.vue index f2e53f4a9..de81f1119 100644 --- a/webui/src/components/_commons/StickyServiceDetails.vue +++ b/webui/src/components/_commons/StickyServiceDetails.vue @@ -55,7 +55,7 @@ export default defineComponent({ BooleanState }, props: { - sticky: Object, + sticky: { type: Object, default: undefined, required: false }, dense: Boolean } }) diff --git a/webui/src/components/_commons/ToolBarTable.vue b/webui/src/components/_commons/ToolBarTable.vue index 03d4b6a52..65a6e3d6b 100644 --- a/webui/src/components/_commons/ToolBarTable.vue +++ b/webui/src/components/_commons/ToolBarTable.vue @@ -42,9 +42,10 @@ import Helps from '../../_helpers/Helps' export default defineComponent({ name: 'ToolBarTable', props: { - status: String, - filter: String + status: { type: String, default: undefined, required: false }, + filter: { type: String, default: undefined, required: false } }, + emits: ['update:status', 'update:filter'], computed: { getStatus: { get () { diff --git a/webui/src/components/dashboard/PanelChart.vue b/webui/src/components/dashboard/PanelChart.vue index 411de01e6..3f2bc0a8f 100644 --- a/webui/src/components/dashboard/PanelChart.vue +++ b/webui/src/components/dashboard/PanelChart.vue @@ -118,9 +118,9 @@ export default defineComponent({ AvatarState }, props: { - name: String, - data: Object, - type: String + name: { type: String, default: undefined, required: false }, + data: { type: Object, default: undefined, required: false }, + type: { type: String, default: undefined, required: false } }, data () { return { diff --git a/webui/src/components/dashboard/PanelEntry.vue b/webui/src/components/dashboard/PanelEntry.vue index 969c321b3..3077ce157 100644 --- a/webui/src/components/dashboard/PanelEntry.vue +++ b/webui/src/components/dashboard/PanelEntry.vue @@ -28,11 +28,11 @@ import { defineComponent } from 'vue' export default defineComponent({ name: 'PanelEntry', props: { - address: String, - name: String, - type: String, + address: { type: String, default: undefined, required: false }, + name: { type: String, default: undefined, required: false }, + type: { type: String, default: undefined, required: false }, focus: Boolean, - exSize: Number + exSize: { type: Number, default: undefined, required: false } } }) diff --git a/webui/src/components/dashboard/PanelFeature.vue b/webui/src/components/dashboard/PanelFeature.vue index 9edff71c8..1b3ee5b64 100644 --- a/webui/src/components/dashboard/PanelFeature.vue +++ b/webui/src/components/dashboard/PanelFeature.vue @@ -28,7 +28,10 @@