44 Commits

Author SHA1 Message Date
64aa1d404e Merge branch 'development' into f034_merge_dev 2025-07-09 08:12:02 +02:00
fa69fa9dcd include packages 2025-07-09 08:08:59 +02:00
8d92e94bd6 populate db with default user 2025-07-09 08:07:22 +02:00
7c1b8669c0 Merge branch 'development' of ssh://gitea.innovation-hub-niedersachsen.de:4422/innohub/tatort into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit was not built
2025-07-04 10:11:46 +02:00
5f996e7007 added sonar to pipeline 2025-07-04 10:09:06 +02:00
f0df67fb86 Update Jenkinsfile
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit was not built
2025-07-02 08:12:56 +02:00
b63834eb51 Update Jenkinsfile
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-02 07:52:09 +02:00
e9eb2c1163 Update Jenkinsfile
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit was not built
2025-07-02 07:41:05 +02:00
3e926844b8 Merge pull request 'fixed tatort api route for deletion' (#16) from b038-check-api-route into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #16
2025-07-01 16:23:09 +02:00
ba4d810164 Merge pull request 'jenkins-docker' (#17) from jenkins-docker into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #17
2025-07-01 13:30:25 +02:00
b6a52822f1 fixed merge conflicts
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-01 13:29:57 +02:00
b843e3abc0 push docker image only in dev branch
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-01 13:11:36 +02:00
7a25dbf68c change gitea user
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-01 13:07:02 +02:00
32d6245b5a get gitea json object
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 12:54:25 +02:00
45644c9695 get gitea json object
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 12:53:19 +02:00
0622fce790 get gitea json object
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 12:51:42 +02:00
0de66fe533 get gitea json object 2025-07-01 12:50:17 +02:00
0aa03aea19 fix pipeline 2025-07-01 12:39:24 +02:00
2ad9e5d86d added check if pipeline job was running 2025-07-01 09:58:38 +02:00
b57a30338e added check if pipeline job was running 2025-07-01 09:56:01 +02:00
eee820b39e added check if pipeline job was running 2025-07-01 09:52:45 +02:00
c25c8498f3 added check if pipeline job was running 2025-07-01 09:49:43 +02:00
95a9364391 added check if pipeline job was running
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 09:25:21 +02:00
49907da1b1 added check if pipeline job was running
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 09:21:44 +02:00
93be24a8de added check if pipeline job was running
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 09:19:09 +02:00
22fc1f490c activate post message
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-01 08:58:09 +02:00
0235b56637 deactivte post message 2025-07-01 08:55:53 +02:00
7ca8b295db no post statement
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 08:53:31 +02:00
abd756462b post statement only if changes 2025-07-01 08:47:45 +02:00
2939869816 renamed image tag
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-01 08:29:26 +02:00
3bd369c9e2 added params
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-01 08:13:51 +02:00
517654bfbf fixed config names
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-07-01 08:00:16 +02:00
739f67169e added confi for dev and prod
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:57:05 +02:00
2d003a619f set audit level to moderate
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:44:28 +02:00
bb5ade22c6 test jenkins pipeline
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:39:38 +02:00
be4e351217 test jenkins pipeline
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:34:58 +02:00
30b49029b2 fixed jenkinsfile
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:29:07 +02:00
890380609f added build id to image, set correct dockerfile
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:25:04 +02:00
2667db5755 added git ref to message
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:16:05 +02:00
021ec3d383 fixed jenkinsfile
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:11:01 +02:00
7018c74884 added webhook to get discrod message
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 07:07:07 +02:00
2b2fa7a82b added Dockerfile dev and prod
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-07-01 06:56:31 +02:00
fe9f8add88 fixed tatort api route for deletion
Some checks failed
InnoHub Processor/tatort/pipeline/pr-development There was a failure building this commit
2025-06-30 08:35:20 +02:00
de7b27bd71 Jenkinsfile aktualisiert
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
Added additional Infos in pull request
2025-06-30 07:17:53 +02:00
12 changed files with 143 additions and 28 deletions

17
Dockerfile.dev Normal file
View File

@@ -0,0 +1,17 @@
# --- Build stage ---
FROM node:22 AS build
ENV NODE_ENV=production
ENV ORIGIN=https://tatort-dev.innovation-hub-niedersachsen.de
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
COPY config_dev.json ./config.json
RUN npm run build
# --- Production stage ---
FROM node:22-alpine3.20
COPY --from=build /app .
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["sh", "-c", "ORIGIN=https://tatort-dev.innovation-hub-niedersachsen.de node build/index.js"]

View File

@@ -6,6 +6,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
COPY config_prod.json ./config.json
RUN npm run build
# --- Production stage ---
@@ -14,4 +15,3 @@ COPY --from=build /app .
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"]

84
Jenkinsfile vendored
View File

@@ -1,3 +1,8 @@
/* groovylint-disable-next-line UnusedVariable */
@Library('InnoHub-Library') _
Boolean didRun = false
pipeline {
agent any
@@ -7,9 +12,13 @@ pipeline {
environment {
REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/'
IMAGE = 'tatort-app'
USER = 'jared'
TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5')
USER = 'jenkins'
TOKEN = credentials('JenkinsGitea')
}
parameters {
string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name')
string(name: 'GIT_REF', defaultValue: '', description: 'Git Ref')
}
options {
@@ -22,46 +31,73 @@ pipeline {
}
stages {
stage('Validate Repository') {
steps {
script {
checkRepoName(params.REPO_NAME, true)
}
}
}
stage('Install Dependencies') {
steps {
script {
didRun = true
}
sh 'npm ci'
}
}
stage('Test & Security Audit') {
steps {
script {
didRun = true
}
echo 'Start checking security vulnerabilities in npm packages'
sh 'npm audit'
sh 'npm audit --audit-level=moderate'
}
}
// stage('Build') {
// when {
// branch 'development'
// }
// steps {
// sh 'npm run build'
// }
// }
stage('SonarQube Analysis') {
steps {
withSonarQubeEnv('sonarqube') {
sh 'sonar-scanner -Dsonar.projectKey=tatort -Dsonar.sources=src'
}
}
}
// stage('Push image in gitea registry') {
// steps {
// echo 'Start Pushing'
// script {
// docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') {
// docker.build('innohub/tatort-app').push('latest')
// }
// }
// }
// }
stage('Push image to gitea registry') {
when {
branch 'development'
}
steps {
script {
didRun = true
def tag = "innohub/tatort-dev:0.${env.BUILD_ID}"
docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') {
docker.build(tag, '-f Dockerfile.dev .').push('latest')
}
}
}
}
}
post {
success {
echo 'Pipeline erfolgreich!'
script {
if (didRun) {
echo 'Pipeline erfolgreich!'
discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc'
}
}
}
failure {
echo 'Pipeline fehlgeschlagen!'
script {
if (didRun) {
echo 'Pipeline fehlgeschlagen!'
discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc'
}
}
}
}
}

17
config_dev.json Normal file
View File

@@ -0,0 +1,17 @@
{
"minio": {
"endPoint": "sws3.innovation-hub-niedersachsen.de",
"port": 443,
"useSSL": true,
"accessKey": "wjpKrmaqXra99rX3D61H",
"secretKey": "fTPi0u0FR6Lv9Y9IKydWv6WM0EA5XrsK008HCt9u"
},
"jwt": {
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",
"expiresIn": 3600
},
"auth": {
"admin": { "password": "A-InnoHUB_2025!", "admin": true },
"user": { "password": "U-InnoHUB_2025!", "admin": false }
}
}

View File

@@ -8,10 +8,10 @@
},
"jwt": {
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",
"expiresIn": 36000
"expiresIn": 3600
},
"auth": {
"admin": { "password": "A-InnoHUB_2025!", "admin": true },
"user": { "password": "U-InnoHUB_2025!", "admin": false }
}
}
}

View File

@@ -44,9 +44,12 @@
"@sveltejs/adapter-node": "^5.2.12",
"@tailwindcss/forms": "^0.5.10",
"autoprefixer": "^10.4.21",
"crypto": "^1.0.1",
"jsonwebtoken": "^9.0.2",
"jssha": "^3.3.1",
"minio": "^8.0.5",
"postcss": "^8.5.4",
"sqlite3": "^5.1.7",
"tailwindcss": "^3.4.17"
}
}

42
src/init/init_db.js Normal file
View File

@@ -0,0 +1,42 @@
import sqlite3 from 'sqlite3';
import jsSHA from 'jssha';
const db = new sqlite3.Database('./src/lib/data/tatort.db');
db.serialize(() => {
// users table
let create_stmt = `CREATE TABLE IF NOT EXISTS users
(id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
pw TEXT NOT NULL)`;
db.run(create_stmt);
// check if there are any users; if not add one default admin one
let pw = 'pass-123';
let hashed_pw = new jsSHA('SHA-512', 'TEXT').update(pw).getHash('HEX');
let check_ins_stmt = `INSERT INTO users (name, pw) SELECT 'admin', '${hashed_pw}'
WHERE NOT EXISTS (SELECT * FROM users);`;
db.run(check_ins_stmt);
let users_stmt = `SELECT * FROM USERS`;
db.each(users_stmt, (err, row) => {
console.log(`xxx ${row.name} + ${row.pw}`)
});
// cases table
create_stmt = `CREATE TABLE IF NOT EXISTS cases
(id INTEGER PRIMARY KEY AUTOINCREMENT,
token TEXT NOT NULL UNIQUE,
name TEXT NOT NULL,
pw TEXT NOT NULL,
created_by INTEGER NOT NULL,
FOREIGN KEY(created_by) REFERENCES users(id))`;
db.run(create_stmt);
});
db.close();

BIN
src/lib/data/tatort.db Normal file

Binary file not shown.

View File

@@ -208,7 +208,7 @@
url.pathname += `/${filename}`;
try {
const response = await fetch(`api/${url}`, { method: 'DELETE' });
const response = await fetch(`/api${url.pathname}`, { method: 'DELETE' });
if (response.status == 204) {
setTimeout(() => {
window.location.reload();