From b263b521a7512a3844f09cf1ef059efac12a79bc Mon Sep 17 00:00:00 2001 From: antoine lebaud Date: Thu, 11 Jul 2024 20:15:20 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B(frontend)=20fix=20Nginx=20conf?= =?UTF-8?q?iguration=20for=20SPA=20routing=20with=20Vite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configured Nginx to serve index.html for all requests, allowing the client-side router (Wouter) to manage the routing. Added a try_files directive to attempt to serve static files first, falling back to index.html if the requested file is not found. Added an error_page directive to handle 404 errors by internally redirecting to index.html without modifying the URL path. Wouter should make the rest. --- src/frontend/default.conf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/frontend/default.conf b/src/frontend/default.conf index fe8f1cb9..f503449c 100644 --- a/src/frontend/default.conf +++ b/src/frontend/default.conf @@ -4,12 +4,16 @@ server { root /usr/share/nginx/html; + # Serve static files location / { - try_files $uri index.html $uri/ =404; + try_files $uri $uri/ /index.html; + # Add no-cache headers + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; # HTTP 1.0 header for backward compatibility + add_header Expires 0; } - error_page 404 /404.html; - location = /404.html { - internal; - } + # Optionally, handle 404 errors by redirecting to index.html + error_page 404 =200 /index.html; + } From bae17548915af241e20bffa20786221fd724f3f1 Mon Sep 17 00:00:00 2001 From: antoine lebaud Date: Thu, 11 Jul 2024 20:18:24 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9A=A1=EF=B8=8F(frontend)=20add=20cachin?= =?UTF-8?q?g=20headers=20for=20static=20assets=20in=20Nginx=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configured Nginx to set caching headers for static assets by adding a location block to match common static file extensions and set an expiration time of 30 days. It should result in faster loading times, reduced bandwidth usage, and a more efficient and responsive user experience. Wdyt @manuhabitela? --- src/frontend/default.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend/default.conf b/src/frontend/default.conf index f503449c..562d0daa 100644 --- a/src/frontend/default.conf +++ b/src/frontend/default.conf @@ -4,6 +4,12 @@ server { root /usr/share/nginx/html; + # Serve static files with caching + location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 30d; + add_header Cache-Control "public, max-age=2592000"; + } + # Serve static files location / { try_files $uri $uri/ /index.html; @@ -15,5 +21,4 @@ server { # Optionally, handle 404 errors by redirecting to index.html error_page 404 =200 /index.html; - } From 651d0a1b6aeab31e1e33e4f3f67ef9220b0c7605 Mon Sep 17 00:00:00 2001 From: antoine lebaud Date: Thu, 11 Jul 2024 20:30:48 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A5(ci)=20remove=20CI=20steps=20re?= =?UTF-8?q?lated=20to=20ChangeLog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ChangeLog won't be any useful before the first release. Save us time, save the world useless computation, remove the CI steps. They'll be added back as soon as they are necessary. --- .github/workflows/meet.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/meet.yml b/.github/workflows/meet.yml index 0c2a9443..25942428 100644 --- a/.github/workflows/meet.yml +++ b/.github/workflows/meet.yml @@ -30,32 +30,6 @@ jobs: - name: Lint commit messages added to main run: ~/.local/bin/gitlint --commits origin/${{ github.event.pull_request.base.ref }}..HEAD - check-changelog: - runs-on: ubuntu-latest - if: | - contains(github.event.pull_request.labels.*.name, 'noChangeLog') == false && - github.event_name == 'pull_request' - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 50 - - name: Check that the CHANGELOG has been modified in the current branch - run: git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.after }} | grep 'CHANGELOG.md' - - lint-changelog: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Check CHANGELOG max line length - run: | - max_line_length=$(cat CHANGELOG.md | grep -Ev "^\[.*\]: https://github.com" | wc -L) - if [ $max_line_length -ge 80 ]; then - echo "ERROR: CHANGELOG has lines longer than 80 characters." - exit 1 - fi - build-mails: runs-on: ubuntu-latest defaults: