4 Commits

Author SHA1 Message Date
f4737f4dcf Don't create self signed cert in production build pipeline
All checks were successful
Build Backend and Frontend / Build & Test .NET Backend (push) Successful in 32s
Build Backend and Frontend / Build Frontend (push) Successful in 12s
2025-05-23 16:33:23 +02:00
1d68f177de Fixed a small stupid mistake
Some checks failed
Build Backend and Frontend / Build & Test .NET Backend (push) Successful in 31s
Build Backend and Frontend / Build Frontend (push) Failing after 11s
2025-05-23 16:18:14 +02:00
ae5096bacd Installed zod, because I somehow didin't have to do that locally
Some checks failed
Build Backend and Frontend / Build & Test .NET Backend (push) Successful in 41s
Build Backend and Frontend / Build Frontend (push) Failing after 10s
- Also use v4
2025-05-23 16:05:08 +02:00
a2608eac5b Rebuild package-lock.json
Some checks failed
Build Backend and Frontend / Build & Test .NET Backend (push) Successful in 36s
Build Backend and Frontend / Build Frontend (push) Failing after 10s
2025-05-23 15:58:26 +02:00
6 changed files with 849 additions and 1050 deletions

View File

@ -22,5 +22,5 @@ jobs:
working-directory: ./usentrycoach.client working-directory: ./usentrycoach.client
- name: Build frontend - name: Build frontend
run: npm run build run: NODE_ENV=production npm run build
working-directory: ./usentrycoach.client working-directory: ./usentrycoach.client

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,8 @@
}, },
"dependencies": { "dependencies": {
"react": "^19.1.0", "react": "^19.1.0",
"react-dom": "^19.1.0" "react-dom": "^19.1.0",
"zod": "^3.25.23"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.25.0", "@eslint/js": "^9.25.0",

View File

@ -1,6 +1,6 @@
import {useState, useRef, useEffect} from 'react'; import {useState, useRef, useEffect} from 'react';
import useLoginToken from "../Hooks/useLoginToken.tsx"; import useLoginToken from "../Hooks/useLoginToken.tsx";
import { z } from 'zod'; import { z } from 'zod/v4';
function SessionActive({stopSession} : {stopSession: () => void}) function SessionActive({stopSession} : {stopSession: () => void})
{ {

View File

@ -1,5 +1,5 @@
import { useState, type FormEvent } from 'react'; import { useState, type FormEvent } from 'react';
import { z } from 'zod'; import { z } from 'zod/v4';
export default function Login({ setToken } : {setToken: (token: string) => void}) export default function Login({ setToken } : {setToken: (token: string) => void})
{ {

View File

@ -7,6 +7,8 @@ import path from 'path';
import child_process from 'child_process'; import child_process from 'child_process';
import { env } from 'process'; import { env } from 'process';
const isDevelopment = env.NODE_ENV !== 'production';
const baseFolder = const baseFolder =
env.APPDATA !== undefined && env.APPDATA !== '' env.APPDATA !== undefined && env.APPDATA !== ''
? `${env.APPDATA}/ASP.NET/https` ? `${env.APPDATA}/ASP.NET/https`
@ -21,7 +23,8 @@ if (!fs.existsSync(baseFolder))
fs.mkdirSync(baseFolder, { recursive: true }); fs.mkdirSync(baseFolder, { recursive: true });
} }
if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) // Generate dev certificate, if we are in development mode, and it doesn't exist yet.
if (isDevelopment && (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)))
{ {
if (0 !== child_process.spawnSync('dotnet', [ if (0 !== child_process.spawnSync('dotnet', [
'dev-certs', 'dev-certs',
@ -68,9 +71,10 @@ export default defineConfig({
server: { server: {
proxy: proxyConfig, proxy: proxyConfig,
port: parseInt(env.DEV_SERVER_PORT ?? '54044'), port: parseInt(env.DEV_SERVER_PORT ?? '54044'),
https: { // This is only relevant for development anyway.
https: isDevelopment ? {
key: fs.readFileSync(keyFilePath), key: fs.readFileSync(keyFilePath),
cert: fs.readFileSync(certFilePath), cert: fs.readFileSync(certFilePath),
} } : undefined
} }
}) })