From 9afc77cfc56118c7d31eb2ca3d24fa64587adde2 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sat, 26 Apr 2025 15:45:08 +0200 Subject: [PATCH 01/32] Terraform workflows trigger path update --- .github/workflows/terraform-apply-cicd.yml | 2 +- .github/workflows/terraform-plan-cicd.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform-apply-cicd.yml b/.github/workflows/terraform-apply-cicd.yml index a6e818c..8db63d9 100644 --- a/.github/workflows/terraform-apply-cicd.yml +++ b/.github/workflows/terraform-apply-cicd.yml @@ -5,7 +5,7 @@ on: branches: - cicd # TODO change to main after debug paths: - - aws/iac + - aws/iac/** workflow_dispatch: env: diff --git a/.github/workflows/terraform-plan-cicd.yml b/.github/workflows/terraform-plan-cicd.yml index 86bf5a0..af922d2 100644 --- a/.github/workflows/terraform-plan-cicd.yml +++ b/.github/workflows/terraform-plan-cicd.yml @@ -5,7 +5,7 @@ on: branches: - cicd # TODO change to main after debug paths: - - aws/iac + - aws/iac/** workflow_dispatch: env: From 1b26843e2e3c7c7a6ef97fe35467b4df6591dbc7 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sat, 26 Apr 2025 16:06:06 +0200 Subject: [PATCH 02/32] Added secret Terraform values preparation to Terraform workflows --- .github/workflows/terraform-apply-cicd.yml | 9 +++++++++ .github/workflows/terraform-plan-cicd.yml | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform-apply-cicd.yml b/.github/workflows/terraform-apply-cicd.yml index 8db63d9..11a005f 100644 --- a/.github/workflows/terraform-apply-cicd.yml +++ b/.github/workflows/terraform-apply-cicd.yml @@ -23,6 +23,15 @@ jobs: permissions: contents: read steps: + - name: Prepare variable values + working-directory: aws/iac + run: | + echo "email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} + email_host_password_secret = ${{ secrets.EMAIL_HOST_PASSWORD }} + secret_key_secret = ${{ secrets.SECRET_KEY }} + email = ${{ secrets.NOTIFICATION_EMAIL }} + " > prod.auto.tfvars + - name: Upload Configuration uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0 id: apply-upload diff --git a/.github/workflows/terraform-plan-cicd.yml b/.github/workflows/terraform-plan-cicd.yml index af922d2..9c60fad 100644 --- a/.github/workflows/terraform-plan-cicd.yml +++ b/.github/workflows/terraform-plan-cicd.yml @@ -35,7 +35,7 @@ jobs: run: terraform fmt -recursive - name: Terraform Validate - run: terraform validate + run: terraform validate -backend=false plan: @@ -43,6 +43,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Prepare variable values + working-directory: aws/iac + run: | + echo "email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} + email_host_password_secret = ${{ secrets.EMAIL_HOST_PASSWORD }} + secret_key_secret = ${{ secrets.SECRET_KEY }} + email = ${{ secrets.NOTIFICATION_EMAIL }} + " > prod.auto.tfvars + - name: Upload Configuration uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0 id: plan-upload From a4c06559bfc250cea0fbb9240093fe1ab8dda94a Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sat, 26 Apr 2025 16:16:26 +0200 Subject: [PATCH 03/32] Terraform workflows refactor --- .github/workflows/terraform-apply-cicd.yml | 10 ++++++++ .github/workflows/terraform-plan-cicd.yml | 28 +++++++--------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/terraform-apply-cicd.yml b/.github/workflows/terraform-apply-cicd.yml index 11a005f..3dc805c 100644 --- a/.github/workflows/terraform-apply-cicd.yml +++ b/.github/workflows/terraform-apply-cicd.yml @@ -23,6 +23,8 @@ jobs: permissions: contents: read steps: + - uses: actions/checkout@v4 + - name: Prepare variable values working-directory: aws/iac run: | @@ -32,6 +34,14 @@ jobs: email = ${{ secrets.NOTIFICATION_EMAIL }} " > prod.auto.tfvars + - name: Set up Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.11.4 + + - name: Terraform Format + run: terraform fmt -recursive + - name: Upload Configuration uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0 id: apply-upload diff --git a/.github/workflows/terraform-plan-cicd.yml b/.github/workflows/terraform-plan-cicd.yml index 9c60fad..098af31 100644 --- a/.github/workflows/terraform-plan-cicd.yml +++ b/.github/workflows/terraform-plan-cicd.yml @@ -15,7 +15,7 @@ env: CONFIG_DIRECTORY: "./aws/iac" jobs: - format-and-validate: + plan: runs-on: ubuntu-latest permissions: contents: read @@ -26,25 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Terraform - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: 1.11.4 - - - name: Terraform Format - run: terraform fmt -recursive - - - name: Terraform Validate - run: terraform validate -backend=false - - - plan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Prepare variable values - working-directory: aws/iac run: | echo "email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} email_host_password_secret = ${{ secrets.EMAIL_HOST_PASSWORD }} @@ -52,6 +34,14 @@ jobs: email = ${{ secrets.NOTIFICATION_EMAIL }} " > prod.auto.tfvars + - name: Set up Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.11.4 + + - name: Terraform Format + run: terraform fmt -recursive + - name: Upload Configuration uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0 id: plan-upload From f3ca17a554ad19db864fe6f64d8ecb9f07b06e9b Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sat, 26 Apr 2025 16:23:40 +0200 Subject: [PATCH 04/32] Terraform workflows value file creation fix --- .github/workflows/terraform-apply-cicd.yml | 5 +++-- .github/workflows/terraform-plan-cicd.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform-apply-cicd.yml b/.github/workflows/terraform-apply-cicd.yml index 3dc805c..f564cb4 100644 --- a/.github/workflows/terraform-apply-cicd.yml +++ b/.github/workflows/terraform-apply-cicd.yml @@ -28,11 +28,12 @@ jobs: - name: Prepare variable values working-directory: aws/iac run: | - echo "email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} + cat > prod.auto.tfvars<< EOF + email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} email_host_password_secret = ${{ secrets.EMAIL_HOST_PASSWORD }} secret_key_secret = ${{ secrets.SECRET_KEY }} email = ${{ secrets.NOTIFICATION_EMAIL }} - " > prod.auto.tfvars + EOF - name: Set up Terraform uses: hashicorp/setup-terraform@v3 diff --git a/.github/workflows/terraform-plan-cicd.yml b/.github/workflows/terraform-plan-cicd.yml index 098af31..867dfee 100644 --- a/.github/workflows/terraform-plan-cicd.yml +++ b/.github/workflows/terraform-plan-cicd.yml @@ -28,11 +28,12 @@ jobs: - name: Prepare variable values run: | - echo "email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} + cat > prod.auto.tfvars<< EOF + email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} email_host_password_secret = ${{ secrets.EMAIL_HOST_PASSWORD }} secret_key_secret = ${{ secrets.SECRET_KEY }} email = ${{ secrets.NOTIFICATION_EMAIL }} - " > prod.auto.tfvars + EOF - name: Set up Terraform uses: hashicorp/setup-terraform@v3 From 5e71911fb61d43f5f8404c384250ea564efc32b6 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sat, 26 Apr 2025 16:32:58 +0200 Subject: [PATCH 05/32] Terraform workflows value file creation text formatting fix --- .github/workflows/terraform-apply-cicd.yml | 8 ++++---- .github/workflows/terraform-plan-cicd.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/terraform-apply-cicd.yml b/.github/workflows/terraform-apply-cicd.yml index f564cb4..b6ab775 100644 --- a/.github/workflows/terraform-apply-cicd.yml +++ b/.github/workflows/terraform-apply-cicd.yml @@ -29,10 +29,10 @@ jobs: working-directory: aws/iac run: | cat > prod.auto.tfvars<< EOF - email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} - email_host_password_secret = ${{ secrets.EMAIL_HOST_PASSWORD }} - secret_key_secret = ${{ secrets.SECRET_KEY }} - email = ${{ secrets.NOTIFICATION_EMAIL }} + email_host_user_secret = "${{ secrets.EMAIL_HOST_USER }}" + email_host_password_secret = "${{ secrets.EMAIL_HOST_PASSWORD }}" + secret_key_secret = "${{ secrets.SECRET_KEY }}" + email = "${{ secrets.NOTIFICATION_EMAIL }}" EOF - name: Set up Terraform diff --git a/.github/workflows/terraform-plan-cicd.yml b/.github/workflows/terraform-plan-cicd.yml index 867dfee..3f1936f 100644 --- a/.github/workflows/terraform-plan-cicd.yml +++ b/.github/workflows/terraform-plan-cicd.yml @@ -29,10 +29,10 @@ jobs: - name: Prepare variable values run: | cat > prod.auto.tfvars<< EOF - email_host_user_secret = ${{ secrets.EMAIL_HOST_USER }} - email_host_password_secret = ${{ secrets.EMAIL_HOST_PASSWORD }} - secret_key_secret = ${{ secrets.SECRET_KEY }} - email = ${{ secrets.NOTIFICATION_EMAIL }} + email_host_user_secret = "${{ secrets.EMAIL_HOST_USER }}" + email_host_password_secret = "${{ secrets.EMAIL_HOST_PASSWORD }}" + secret_key_secret = "${{ secrets.SECRET_KEY }}" + email = "${{ secrets.NOTIFICATION_EMAIL }}" EOF - name: Set up Terraform From 8885fd6b8d89c0f59ab1aa64c1e04eb08bce7b54 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sat, 26 Apr 2025 16:38:01 +0200 Subject: [PATCH 06/32] Changed NAT Instance SSH key pair usage to SSM --- aws/iac/modules/vpc/main.tf | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/aws/iac/modules/vpc/main.tf b/aws/iac/modules/vpc/main.tf index 02d43b4..5b6510a 100644 --- a/aws/iac/modules/vpc/main.tf +++ b/aws/iac/modules/vpc/main.tf @@ -64,11 +64,6 @@ resource "aws_subnet" "private" { } # NAT Instance -resource "aws_key_pair" "nat_key" { - key_name = "nat-key" - public_key = file("${path.module}/nat-key.pub") -} - resource "aws_instance" "nat" { ami = "ami-0274f4b62b6ae3bd5" # Amazon Linux 2023 AMI eu-north-1 instance_type = "t3.micro" @@ -76,7 +71,6 @@ resource "aws_instance" "nat" { associate_public_ip_address = true source_dest_check = false ebs_optimized = true - key_name = aws_key_pair.nat_key.key_name ebs_block_device { device_name = "/dev/xvda" @@ -90,6 +84,7 @@ resource "aws_instance" "nat" { user_data = <<-EOF #!/bin/bash + # NAT configuration sudo dnf install iptables-services -y sudo systemctl enable iptables sudo systemctl start iptables @@ -97,6 +92,12 @@ resource "aws_instance" "nat" { sudo sysctl -p /etc/sysctl.d/custom-ip.conf sudo /sbin/iptables -t nat -A POSTROUTING -o ens5 -j MASQUERADE sudo service iptables save + # SSM Agent + sudo yum update -y + sudo yum upgrade -y + sudo yum install -y amazon-ssm-agent + sudo systemctl enable amazon-ssm-agent + sudo systemctl start amazon-ssm-agent EOF tags = merge(var.tags, { From dcb792c8b516da41590ba6312a16493a6474313b Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sat, 26 Apr 2025 17:07:17 +0200 Subject: [PATCH 07/32] Terraform plan workflow debugged --- .github/workflows/terraform-plan-cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-cicd.yml b/.github/workflows/terraform-plan-cicd.yml index 3f1936f..deacd84 100644 --- a/.github/workflows/terraform-plan-cicd.yml +++ b/.github/workflows/terraform-plan-cicd.yml @@ -3,7 +3,7 @@ name: The Plug Terraform infrastructure CI/CD - plan on: pull_request: branches: - - cicd # TODO change to main after debug + - main paths: - aws/iac/** workflow_dispatch: From 4dd9d22adf8e826cc4cea26206a49508fa319641 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sun, 27 Apr 2025 11:25:16 +0200 Subject: [PATCH 08/32] Prevented application pipelines from running unnecessary jobs on pull_request event --- .github/workflows/django-backend-cicd.yml | 6 +++++- .github/workflows/svelte-frontend-cicd.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/django-backend-cicd.yml b/.github/workflows/django-backend-cicd.yml index 281c4d5..695757b 100644 --- a/.github/workflows/django-backend-cicd.yml +++ b/.github/workflows/django-backend-cicd.yml @@ -38,6 +38,7 @@ jobs: dependencies-and-test-backend: runs-on: ubuntu-latest needs: [ sonarcloud-backend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug defaults: run: working-directory: backend/the_plug_backend_django @@ -80,6 +81,7 @@ jobs: e2e-tests: runs-on: ubuntu-latest needs: [ dependencies-and-test-backend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -152,6 +154,7 @@ jobs: performance-tests: runs-on: ubuntu-latest needs: [ dependencies-and-test-backend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug defaults: run: working-directory: backend/the_plug_backend_django @@ -167,6 +170,7 @@ jobs: dast-tests: runs-on: ubuntu-latest needs: [ dependencies-and-test-backend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -179,7 +183,7 @@ jobs: docker-build-and-push-backend: runs-on: ubuntu-latest needs: [ e2e-tests, performance-tests, dast-tests ] - if: always() + if: github.ref == 'refs/heads/cicd' && (success() || failure()) # TODO change to main after debug steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/svelte-frontend-cicd.yml b/.github/workflows/svelte-frontend-cicd.yml index c5249f6..a6a3bc0 100644 --- a/.github/workflows/svelte-frontend-cicd.yml +++ b/.github/workflows/svelte-frontend-cicd.yml @@ -37,6 +37,7 @@ jobs: build-and-test-frontend: runs-on: ubuntu-latest needs: [ sonarcloud-frontend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug defaults: run: working-directory: frontend/the_plug_svelte_frontend @@ -67,6 +68,7 @@ jobs: e2e-tests: runs-on: ubuntu-latest needs: [ build-and-test-frontend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -139,6 +141,7 @@ jobs: performance-tests: runs-on: ubuntu-latest needs: [ build-and-test-frontend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -152,6 +155,7 @@ jobs: dast-tests: runs-on: ubuntu-latest needs: [ build-and-test-frontend ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -164,7 +168,7 @@ jobs: docker-build-and-push-frontend: runs-on: ubuntu-latest needs: [ e2e-tests, performance-tests, dast-tests ] - if: always() + if: github.ref == 'refs/heads/cicd' && (success() || failure()) # TODO change to main after debug steps: - uses: actions/checkout@v4 From d7b0b88c8a35f10163180855907487733a02d499 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sun, 27 Apr 2025 11:48:22 +0200 Subject: [PATCH 09/32] Divided SonarCloud analysis to separate backend and frontend analysis --- .github/workflows/django-backend-cicd.yml | 4 ++-- .github/workflows/svelte-frontend-cicd.yml | 4 ++-- .../the_plug_backend_django/sonar-project.properties | 2 +- frontend/the_plug_svelte_frontend/sonar-project.properties | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) rename sonar-project.properties => backend/the_plug_backend_django/sonar-project.properties (55%) create mode 100644 frontend/the_plug_svelte_frontend/sonar-project.properties diff --git a/.github/workflows/django-backend-cicd.yml b/.github/workflows/django-backend-cicd.yml index 695757b..ec55bcf 100644 --- a/.github/workflows/django-backend-cicd.yml +++ b/.github/workflows/django-backend-cicd.yml @@ -27,12 +27,12 @@ jobs: fetch-depth: 0 - name: SonarCloud Linting + SAST scan - uses: SonarSource/sonarcloud-github-action@master + uses: SonarSource/sonarcloud-github-action@v5 with: projectBaseDir: backend/the_plug_backend_django env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} dependencies-and-test-backend: diff --git a/.github/workflows/svelte-frontend-cicd.yml b/.github/workflows/svelte-frontend-cicd.yml index a6a3bc0..6bd01f5 100644 --- a/.github/workflows/svelte-frontend-cicd.yml +++ b/.github/workflows/svelte-frontend-cicd.yml @@ -26,12 +26,12 @@ jobs: fetch-depth: 0 - name: SonarCloud Linting + SAST scan - uses: SonarSource/sonarcloud-github-action@master + uses: SonarSource/sonarcloud-github-action@v5 with: projectBaseDir: frontend/the_plug_svelte_frontend env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }} build-and-test-frontend: diff --git a/sonar-project.properties b/backend/the_plug_backend_django/sonar-project.properties similarity index 55% rename from sonar-project.properties rename to backend/the_plug_backend_django/sonar-project.properties index c66582d..68085d8 100644 --- a/sonar-project.properties +++ b/backend/the_plug_backend_django/sonar-project.properties @@ -1,3 +1,3 @@ -sonar.projectKey=the-plug_the-plug +sonar.projectKey=the-plug-backend sonar.organization=the-plug sonar.sources=. \ No newline at end of file diff --git a/frontend/the_plug_svelte_frontend/sonar-project.properties b/frontend/the_plug_svelte_frontend/sonar-project.properties new file mode 100644 index 0000000..7519a81 --- /dev/null +++ b/frontend/the_plug_svelte_frontend/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=the-plug-frontend +sonar.organization=the-plug +sonar.sources=. \ No newline at end of file From 6e5d432fadfe7725ed1e5486bce7b23caa4e2a5d Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sun, 27 Apr 2025 13:23:00 +0200 Subject: [PATCH 10/32] Fix exporting environment variables, changed cache usage, added shared frontend build artifact, added job to install backend dependencies and cache them for other actions, fixed running server commands to execute in background --- .github/workflows/svelte-frontend-cicd.yml | 189 +++++++++++++++++---- 1 file changed, 153 insertions(+), 36 deletions(-) diff --git a/.github/workflows/svelte-frontend-cicd.yml b/.github/workflows/svelte-frontend-cicd.yml index 6bd01f5..c6ee8a1 100644 --- a/.github/workflows/svelte-frontend-cicd.yml +++ b/.github/workflows/svelte-frontend-cicd.yml @@ -12,7 +12,18 @@ on: workflow_dispatch: env: + DB_PASSWORD: ${{ secrets.DB_PASSWORD }} + DB_USER: ${{ secrets.DB_USER }} + DB_NAME: ${{ secrets.DB_NAME }} + DB_HOST: ${{ secrets.DB_HOST }} + EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} + EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} + SECRET_KEY: ${{ secrets.SECRET_KEY }} + ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }} + DEBUG: ${{ secrets.DEBUG }} USE_CACHE: 0 + CACHE_ENDPOINT: ${{ secrets.CACHE_ENDPOINT }} + CACHE_PASSWORD: ${{ secrets.CACHE_PASSWORD }} DOCKER_REGISTRY: 'docker.io/wallys' FRONTEND_IMAGE: 'wallys02/the-plug-frontend' AWS_REGION: 'eu-north-1' @@ -48,15 +59,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - - - name: Cache node modules - uses: actions/cache@v4 - with: - path: frontend/the_plug_svelte_frontend/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('frontend/the_plug_svelte_frontend/package-lock.json') }} + cache: 'npm' + cache-dependency-path: frontend/the_plug_svelte_frontend/package-lock.json - name: Install npm dependencies - run: npm install + run: npm ci - name: Run npm tests run: npm run test @@ -64,10 +71,17 @@ jobs: - name: Build npm run: npm run build + - name: Upload frontend build + uses: actions/upload-artifact@v4 + with: + name: frontend-build + path: frontend/the_plug_svelte_frontend/dist/ + retention-days: 1 - e2e-tests: + + backend-dependencies: runs-on: ubuntu-latest - needs: [ build-and-test-frontend ] + needs: [ sonarcloud-frontend ] if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -76,6 +90,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.12 + cache: pip + cache-dependency-path: backend/the_plug_backend_django/requirements.txt - name: Install pip dependencies working-directory: backend/the_plug_backend_django @@ -83,21 +99,37 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - - name: Export environment variables + + e2e-tests: + runs-on: ubuntu-latest + needs: [ build-and-test-frontend, backend-dependencies ] + if: github.ref == 'refs/heads/cicd' # TODO change to main after debug + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: backend/the_plug_backend_django/requirements.txt + + - name: Install pip dependencies working-directory: backend/the_plug_backend_django - run: | - export DB_PASSWORD="${{ secrets.DB_PASSWORD }}" - export DB_USER="${{ secrets.DB_USER }}" - export DB_NAME="${{ secrets.DB_NAME }}" - export DB_HOST="${{ secrets.DB_HOST }}" - export EMAIL_HOST_PASSWORD="${{ secrets.EMAIL_HOST_PASSWORD }}" - export EMAIL_HOST_USER="${{ secrets.EMAIL_HOST_USER }}" - export SECRET_KEY="${{ secrets.SECRET_KEY }}" - export ALLOWED_HOSTS="${{ secrets.ALLOWED_HOSTS }}" - export DEBUG="${{ secrets.DEBUG }}" - export USE_CACHE="${{ env.USE_CACHE }}" - export CACHE_ENDPOINT="${{ secrets.CACHE_ENDPOINT }}" - export CACHE_PASSWORD="${{ secrets.CACHE_PASSWORD }}" + run: pip install -r requirements.txt + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: frontend/the_plug_svelte_frontend/package-lock.json + + - name: Download frontend build + uses: actions/download-artifact@v4 + with: + name: frontend-build + path: frontend/the_plug_svelte_frontend/dist/ - name: Run Django makemigrations working-directory: backend/the_plug_backend_django @@ -113,16 +145,7 @@ jobs: - name: Run Django backend working-directory: backend/the_plug_backend_django - run: python manage.py runserver 0.0.0.0:8080 --settings=the_plug_backend_django.e2e_test_settings - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - - - name: Install npm dependencies - working-directory: frontend/the_plug_svelte_frontend - run: npm install + run: python manage.py runserver 0.0.0.0:8080 --settings=the_plug_backend_django.e2e_test_settings & - name: Run Cypress tests uses: cypress-io/github-action@v6 @@ -140,11 +163,55 @@ jobs: performance-tests: runs-on: ubuntu-latest - needs: [ build-and-test-frontend ] + needs: [ build-and-test-frontend, backend-dependencies ] if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: backend/the_plug_backend_django/requirements.txt + + - name: Install pip dependencies + working-directory: backend/the_plug_backend_django + run: pip install -r requirements.txt + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: frontend/the_plug_svelte_frontend/package-lock.json + + - name: Download frontend build + uses: actions/download-artifact@v4 + with: + name: frontend-build + path: frontend/the_plug_svelte_frontend/dist/ + + - name: Run Django makemigrations + working-directory: backend/the_plug_backend_django + run: python manage.py makemigrations api --settings=the_plug_backend_django.e2e_test_settings + + - name: Run Django migrations + working-directory: backend/the_plug_backend_django + run: python manage.py migrate --settings=the_plug_backend_django.e2e_test_settings + + - name: Run Django loaddata + working-directory: backend/the_plug_backend_django + run: python manage.py loaddata api/fixtures/herbs.json --settings=the_plug_backend_django.e2e_test_settings + + - name: Run Django backend + working-directory: backend/the_plug_backend_django + run: python manage.py runserver 0.0.0.0:8080 --settings=the_plug_backend_django.e2e_test_settings & + + - name: Run Svelte frontend + working-directory: frontend/the_plug_svelte_frontend + run: npm run dev & + - name: Run Lighthouse uses: treosh/lighthouse-ci-action@v12 with: @@ -154,11 +221,55 @@ jobs: dast-tests: runs-on: ubuntu-latest - needs: [ build-and-test-frontend ] + needs: [ build-and-test-frontend, backend-dependencies ] if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: backend/the_plug_backend_django/requirements.txt + + - name: Install pip dependencies + working-directory: backend/the_plug_backend_django + run: pip install -r requirements.txt + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: frontend/the_plug_svelte_frontend/package-lock.json + + - name: Download frontend build + uses: actions/download-artifact@v4 + with: + name: frontend-build + path: frontend/the_plug_svelte_frontend/dist/ + + - name: Run Django makemigrations + working-directory: backend/the_plug_backend_django + run: python manage.py makemigrations api --settings=the_plug_backend_django.e2e_test_settings + + - name: Run Django migrations + working-directory: backend/the_plug_backend_django + run: python manage.py migrate --settings=the_plug_backend_django.e2e_test_settings + + - name: Run Django loaddata + working-directory: backend/the_plug_backend_django + run: python manage.py loaddata api/fixtures/herbs.json --settings=the_plug_backend_django.e2e_test_settings + + - name: Run Django backend + working-directory: backend/the_plug_backend_django + run: python manage.py runserver 0.0.0.0:8080 --settings=the_plug_backend_django.e2e_test_settings & + + - name: Run Svelte frontend + working-directory: frontend/the_plug_svelte_frontend + run: npm run dev & + - name: OWASP ZAP scan uses: zaproxy/action-full-scan@v0.12.0 with: @@ -195,7 +306,7 @@ jobs: deploy-s3-frontend: runs-on: ubuntu-latest needs: [ e2e-tests, performance-tests, dast-tests ] - if: github.ref == 'refs/heads/main' && (success() || failure()) + if: github.ref == 'refs/heads/main' && (success() || failure()) # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -206,6 +317,12 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} + - name: Download frontend build + uses: actions/download-artifact@v4 + with: + name: frontend-build + path: frontend/the_plug_svelte_frontend/dist/ + - name: Sync frontend with S3 working-directory: frontend/the_plug_svelte_frontend run: aws s3 sync dist s3://${{ secrets.S3_BUCKET }} --delete \ No newline at end of file From e9a0065e8b3e67dbb59e1d10a54fc08fd5477b66 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sun, 27 Apr 2025 13:40:01 +0200 Subject: [PATCH 11/32] Changed deprecated Sonar Cloud action, added installing cached npm dependencies --- .github/workflows/svelte-frontend-cicd.yml | 47 ++++++++++------------ 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/svelte-frontend-cicd.yml b/.github/workflows/svelte-frontend-cicd.yml index c6ee8a1..abaac34 100644 --- a/.github/workflows/svelte-frontend-cicd.yml +++ b/.github/workflows/svelte-frontend-cicd.yml @@ -29,15 +29,15 @@ env: AWS_REGION: 'eu-north-1' jobs: - sonarcloud-frontend: + sonarqube-frontend: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: SonarCloud Linting + SAST scan - uses: SonarSource/sonarcloud-github-action@v5 + - name: SonarQube Linting + SAST scan + uses: SonarSource/sonarqube-scan-action@v5 with: projectBaseDir: frontend/the_plug_svelte_frontend env: @@ -47,7 +47,7 @@ jobs: build-and-test-frontend: runs-on: ubuntu-latest - needs: [ sonarcloud-frontend ] + needs: [ sonarqube-frontend ] if: github.ref == 'refs/heads/cicd' # TODO change to main after debug defaults: run: @@ -81,7 +81,7 @@ jobs: backend-dependencies: runs-on: ubuntu-latest - needs: [ sonarcloud-frontend ] + needs: [ sonarqube-frontend ] if: github.ref == 'refs/heads/cicd' # TODO change to main after debug steps: - uses: actions/checkout@v4 @@ -114,7 +114,7 @@ jobs: cache: pip cache-dependency-path: backend/the_plug_backend_django/requirements.txt - - name: Install pip dependencies + - name: Install cached pip dependencies working-directory: backend/the_plug_backend_django run: pip install -r requirements.txt @@ -125,11 +125,9 @@ jobs: cache: 'npm' cache-dependency-path: frontend/the_plug_svelte_frontend/package-lock.json - - name: Download frontend build - uses: actions/download-artifact@v4 - with: - name: frontend-build - path: frontend/the_plug_svelte_frontend/dist/ + - name: Install cached npm dependencies + working-directory: frontend/the_plug_svelte_frontend + run: npm ci - name: Run Django makemigrations working-directory: backend/the_plug_backend_django @@ -147,14 +145,15 @@ jobs: working-directory: backend/the_plug_backend_django run: python manage.py runserver 0.0.0.0:8080 --settings=the_plug_backend_django.e2e_test_settings & + - name: Run Svelte frontend + working-directory: frontend/the_plug_svelte_frontend + run: npm run dev & + - name: Run Cypress tests uses: cypress-io/github-action@v6 with: config-file: frontend/the_plug_svelte_frontend/cypress.config.ts browser: chrome - start: | - cd frontend/the_plug_svelte_frontend - npm run dev wait-on: 'http://localhost, http://localhost:8080/api/herbs/list/' env: API_URL: 'http://localhost:8080/api/' @@ -175,7 +174,7 @@ jobs: cache: pip cache-dependency-path: backend/the_plug_backend_django/requirements.txt - - name: Install pip dependencies + - name: Install cached pip dependencies working-directory: backend/the_plug_backend_django run: pip install -r requirements.txt @@ -186,11 +185,9 @@ jobs: cache: 'npm' cache-dependency-path: frontend/the_plug_svelte_frontend/package-lock.json - - name: Download frontend build - uses: actions/download-artifact@v4 - with: - name: frontend-build - path: frontend/the_plug_svelte_frontend/dist/ + - name: Install cached npm dependencies + working-directory: frontend/the_plug_svelte_frontend + run: npm ci - name: Run Django makemigrations working-directory: backend/the_plug_backend_django @@ -233,7 +230,7 @@ jobs: cache: pip cache-dependency-path: backend/the_plug_backend_django/requirements.txt - - name: Install pip dependencies + - name: Install cached pip dependencies working-directory: backend/the_plug_backend_django run: pip install -r requirements.txt @@ -244,11 +241,9 @@ jobs: cache: 'npm' cache-dependency-path: frontend/the_plug_svelte_frontend/package-lock.json - - name: Download frontend build - uses: actions/download-artifact@v4 - with: - name: frontend-build - path: frontend/the_plug_svelte_frontend/dist/ + - name: Install cached npm dependencies + working-directory: frontend/the_plug_svelte_frontend + run: npm ci - name: Run Django makemigrations working-directory: backend/the_plug_backend_django From 39b542836696ac100e03ecc502de2ccc42425c68 Mon Sep 17 00:00:00 2001 From: WallyS02 Date: Sun, 27 Apr 2025 14:10:10 +0200 Subject: [PATCH 12/32] Changed running frontend application to allowed port --- .github/workflows/svelte-frontend-cicd.yml | 18 ++++++------- .idea/The-Plug.iml | 2 +- .../e2e/adding-location-and-offer.cy.ts | 3 +-- .../cypress/e2e/requesting-meeting.cy.ts | 4 +-- .../package-lock.json | 25 ++++++++++++++++++- .../the_plug_svelte_frontend/package.json | 2 +- .../src/lib/Navbar.svelte | 2 +- 7 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/workflows/svelte-frontend-cicd.yml b/.github/workflows/svelte-frontend-cicd.yml index abaac34..aea63c0 100644 --- a/.github/workflows/svelte-frontend-cicd.yml +++ b/.github/workflows/svelte-frontend-cicd.yml @@ -145,19 +145,15 @@ jobs: working-directory: backend/the_plug_backend_django run: python manage.py runserver 0.0.0.0:8080 --settings=the_plug_backend_django.e2e_test_settings & - - name: Run Svelte frontend - working-directory: frontend/the_plug_svelte_frontend - run: npm run dev & - - name: Run Cypress tests uses: cypress-io/github-action@v6 with: config-file: frontend/the_plug_svelte_frontend/cypress.config.ts browser: chrome wait-on: 'http://localhost, http://localhost:8080/api/herbs/list/' - env: - API_URL: 'http://localhost:8080/api/' - APP_URL: 'http://localhost' + config: baseUrl=http://localhost:4200 + working-directory: frontend/the_plug_svelte_frontend + start: npm run dev -- --port 4200 performance-tests: @@ -207,12 +203,12 @@ jobs: - name: Run Svelte frontend working-directory: frontend/the_plug_svelte_frontend - run: npm run dev & + run: npm run dev -- --port 4200 & - name: Run Lighthouse uses: treosh/lighthouse-ci-action@v12 with: - urls: http://localhost + urls: http://localhost:4200 temporaryPublicStorage: true @@ -263,12 +259,12 @@ jobs: - name: Run Svelte frontend working-directory: frontend/the_plug_svelte_frontend - run: npm run dev & + run: npm run dev -- --port 4200 & - name: OWASP ZAP scan uses: zaproxy/action-full-scan@v0.12.0 with: - target: http://localhost + target: http://localhost:4200 docker-build-and-push-frontend: diff --git a/.idea/The-Plug.iml b/.idea/The-Plug.iml index 21fd21c..5371dbd 100644 --- a/.idea/The-Plug.iml +++ b/.idea/The-Plug.iml @@ -16,7 +16,7 @@ - + diff --git a/frontend/the_plug_svelte_frontend/cypress/e2e/adding-location-and-offer.cy.ts b/frontend/the_plug_svelte_frontend/cypress/e2e/adding-location-and-offer.cy.ts index f5718c0..a3a9e08 100644 --- a/frontend/the_plug_svelte_frontend/cypress/e2e/adding-location-and-offer.cy.ts +++ b/frontend/the_plug_svelte_frontend/cypress/e2e/adding-location-and-offer.cy.ts @@ -1,7 +1,7 @@ describe('Adding Location and Herb Offer as a new Plug', () => { beforeEach(() => { cy.viewport(1280, 720); - cy.visit('http://localhost', { + cy.visit('/', { onBeforeLoad(win) { win.caches.delete('L'); } @@ -19,7 +19,6 @@ describe('Adding Location and Herb Offer as a new Plug', () => { cy.get('input[type="submit"]').click(); // Verify registration - cy.url().should('eq', Cypress.config().baseUrl + '/#/'); cy.contains('nav a', randomUsername).should('exist'); cy.contains('nav', 'Locations').should('not.exist'); diff --git a/frontend/the_plug_svelte_frontend/cypress/e2e/requesting-meeting.cy.ts b/frontend/the_plug_svelte_frontend/cypress/e2e/requesting-meeting.cy.ts index 31862a9..00eeb53 100644 --- a/frontend/the_plug_svelte_frontend/cypress/e2e/requesting-meeting.cy.ts +++ b/frontend/the_plug_svelte_frontend/cypress/e2e/requesting-meeting.cy.ts @@ -4,7 +4,7 @@ describe('Requesting a meeting as a new user', () => { beforeEach(() => { cy.viewport(1280, 720); cy.setupInitialData('http://localhost:8080/api'); - cy.visit('http://localhost'); + cy.visit('/'); }) const testUser = { @@ -28,7 +28,7 @@ describe('Requesting a meeting as a new user', () => { cy.contains('Registration successful!').should('exist'); // Search on a map - cy.visit('/'); + cy.get('a[id="home"]').click(); cy.get('#map', { timeout: 10000 }).should('be.visible'); // Choose location diff --git a/frontend/the_plug_svelte_frontend/package-lock.json b/frontend/the_plug_svelte_frontend/package-lock.json index b28d408..9808792 100644 --- a/frontend/the_plug_svelte_frontend/package-lock.json +++ b/frontend/the_plug_svelte_frontend/package-lock.json @@ -10,7 +10,6 @@ "dependencies": { "@fortawesome/fontawesome-free": "^6.6.0", "@mapbox/timespace": "^2.0.4", - "axios": "^1.8.4", "leaflet": "^1.9.4", "moment-timezone": "^0.5.45", "svelte-notifications": "github:louchebem06/svelte-notifications#fix-warn-vite-plugin-svelte", @@ -28,6 +27,7 @@ "@types/leaflet": "^1.9.12", "@vitest/coverage-v8": "^3.1.2", "autoprefixer": "^10.4.20", + "axios": "^1.8.4", "cypress": "^14.3.2", "cypress-browser-permissions": "^1.1.0", "cypress-vite": "^1.6.0", @@ -2220,6 +2220,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, "license": "MIT" }, "node_modules/at-least-node": { @@ -2291,6 +2292,7 @@ "version": "1.8.4", "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", + "dev": true, "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -2302,6 +2304,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, "license": "MIT" }, "node_modules/axobject-query": { @@ -3156,6 +3159,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -3566,6 +3570,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" @@ -4252,6 +4257,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.4.0" @@ -4412,6 +4418,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -4530,6 +4537,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4539,6 +4547,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4555,6 +4564,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -4567,6 +4577,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -5449,6 +5460,7 @@ "version": "1.15.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "dev": true, "funding": [ { "type": "individual", @@ -5495,6 +5507,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", @@ -5575,6 +5588,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5595,6 +5609,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -5619,6 +5634,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -5802,6 +5818,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5899,6 +5916,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5924,6 +5942,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" @@ -5939,6 +5958,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -7639,6 +7659,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -7714,6 +7735,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -7726,6 +7748,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" diff --git a/frontend/the_plug_svelte_frontend/package.json b/frontend/the_plug_svelte_frontend/package.json index 4fe3e9c..3031188 100644 --- a/frontend/the_plug_svelte_frontend/package.json +++ b/frontend/the_plug_svelte_frontend/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite --host", + "dev": "vite --host --port", "build": "vite build", "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json", diff --git a/frontend/the_plug_svelte_frontend/src/lib/Navbar.svelte b/frontend/the_plug_svelte_frontend/src/lib/Navbar.svelte index 43400e8..ad3a054 100644 --- a/frontend/the_plug_svelte_frontend/src/lib/Navbar.svelte +++ b/frontend/the_plug_svelte_frontend/src/lib/Navbar.svelte @@ -19,7 +19,7 @@