Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
daa3955cee | ||
|
|
09b1730954 | ||
|
|
9d9470b8cd | ||
|
|
590a50d959 | ||
|
|
db330b3fad | ||
|
|
1073d8dfde | ||
|
|
e14262db4d | ||
|
|
b2c00cd23d | ||
|
|
f323549ae7 | ||
|
|
60de2961b2 | ||
|
|
0780e1e794 | ||
|
|
930fefb32d |
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Verify Node.js') {
|
||||
steps {
|
||||
sh 'node --version'
|
||||
sh 'npm --version'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Install Dependencies') {
|
||||
steps {
|
||||
sh 'npm ci'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Test') {
|
||||
steps {
|
||||
sh 'npm test'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# Caddy obtains and renews the Let's Encrypt certificate for this hostname
|
||||
# and redirects HTTP to HTTPS automatically. TLS terminates here.
|
||||
git.pollefeys.dev {
|
||||
reverse_proxy gitea:3000
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
# Seat-Back Trivia startup work hub: Gitea behind Caddy on the ssw-590 droplet.
|
||||
# Only Caddy publishes host ports. Gitea is reachable only on the private
|
||||
# gitea-net network, and its SQLite database lives in the gitea-data volume.
|
||||
name: gitea
|
||||
|
||||
services:
|
||||
caddy:
|
||||
image: caddy:2.11.4
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- caddy-data:/data
|
||||
- caddy-config:/config
|
||||
networks:
|
||||
- gitea-net
|
||||
depends_on:
|
||||
- gitea
|
||||
|
||||
gitea:
|
||||
image: docker.gitea.com/gitea:1.27.3
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- GITEA__server__DOMAIN=git.pollefeys.dev
|
||||
- GITEA__server__ROOT_URL=https://git.pollefeys.dev/
|
||||
- GITEA__server__HTTP_PORT=3000
|
||||
- GITEA__server__DISABLE_SSH=true
|
||||
- GITEA__database__DB_TYPE=sqlite3
|
||||
- GITEA__database__PATH=/data/gitea/gitea.db
|
||||
- GITEA__security__INSTALL_LOCK=true
|
||||
- GITEA__service__DISABLE_REGISTRATION=true
|
||||
volumes:
|
||||
- gitea-data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
networks:
|
||||
- gitea-net
|
||||
|
||||
networks:
|
||||
gitea-net:
|
||||
|
||||
volumes:
|
||||
gitea-data:
|
||||
caddy-data:
|
||||
caddy-config:
|
||||
@@ -0,0 +1,17 @@
|
||||
services:
|
||||
jenkins:
|
||||
image: jenkins/jenkins:lts-jdk21
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- jenkins-data:/var/jenkins_home
|
||||
networks:
|
||||
- gitea-net
|
||||
|
||||
volumes:
|
||||
jenkins-data:
|
||||
|
||||
networks:
|
||||
gitea-net:
|
||||
external: true
|
||||
name: gitea_gitea-net
|
||||
Generated
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "seat-back-trivia",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "seat-back-trivia",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"ws": "8.18.3"
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.18.3",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
|
||||
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": ">=5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "seat-back-trivia",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Minimal WebSocket quiz server for SeatBack Trivia",
|
||||
"scripts": {
|
||||
"test": "node --test"
|
||||
},
|
||||
"dependencies": {
|
||||
"ws": "8.18.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
const WebSocket = require('ws');
|
||||
|
||||
const PORT = process.env.PORT || 8080;
|
||||
const wss = new WebSocket.Server({ port: PORT });
|
||||
|
||||
const question = {
|
||||
question: 'What is the capital of France?',
|
||||
answer: 'Paris'
|
||||
};
|
||||
|
||||
wss.on('connection', (ws) => {
|
||||
ws.send(JSON.stringify(question));
|
||||
});
|
||||
|
||||
console.log(`SeatBack Trivia WebSocket server listening on port ${PORT}`);
|
||||
@@ -0,0 +1,11 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
test('sample trivia question has the expected answer', () => {
|
||||
const question = {
|
||||
question: 'What is the capital of France?',
|
||||
answer: 'Paris'
|
||||
};
|
||||
|
||||
assert.equal(question.answer, 'Paris');
|
||||
});
|
||||
Reference in New Issue
Block a user