Skip to content

Commit fdd6a68

Browse files
committed
dockerization, log placeholder, release 1.0 beta version
1 parent 8dd42c3 commit fdd6a68

File tree

11 files changed

+127
-1
lines changed

11 files changed

+127
-1
lines changed

backend/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
npm-debug.log
3+
.dockerignore
4+
Dockerfile
5+
config.yaml
6+
users

backend/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:22-bookworm
2+
3+
WORKDIR /src
4+
5+
COPY package*.json ./
6+
RUN npm install
7+
8+
STOPSIGNAL SIGKILL
9+
10+
COPY . .
11+
12+
ENTRYPOINT [ "./start.sh" ]

backend/config-template.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": "1.0",
3+
"fullname": "John Smith",
4+
"refresh": "default",
5+
"password": "",
6+
"password_created": "",
7+
"active": false,
8+
"webuntis": {
9+
"server": "nessa.webuntis.com",
10+
"school": "bodenseegym-lindau",
11+
"username": "john.smith",
12+
"password_configured": ""
13+
},
14+
"webuntis_password": "",
15+
"google": {
16+
"oauth_configured": "",
17+
"calendarId": "",
18+
"examColor": "6",
19+
"updatedColor": "2",
20+
"cancelledColor": "10",
21+
"homeworkColor": "5",
22+
"messageOfTheDayColor": "2",
23+
"holidayColor": "4"
24+
},
25+
"google_oauth": "",
26+
"lastRefresh": ""
27+
}

backend/config.yaml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ encryption_key: pleasechangemetoo # PLEASE CHANGE THIS! Random value can be gen
2020
google:
2121
client_id: pleasechangeme # Retrieve from Google Cloud Console
2222
client_secret: pleasechangeme # Retrieve from Google Cloud Console
23-
redirect_uri: http://localhost:3000/api/oauth2/google/callback # Adjust for used API URL
23+
redirect_uri: https://webuntis.nikogenia.de/api/oauth2/google/callback # Adjust for used API URL
2424

2525
# Refresh timestamp profiles
2626
refresh:

backend/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ export async function refreshUser(username, user, fullRefresh = false) {
242242
}
243243
);
244244
} catch (e) {
245+
console.info(`[${username}/${execution}]`, "Unexpected error:", e);
245246
log(
246247
username,
247248
execution,

backend/start.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Copy files
4+
shopt -s extglob
5+
cp -r !(start.sh) /backend
6+
7+
# Change workdir
8+
# shellcheck disable=SC2164
9+
cd /backend
10+
11+
# Log version
12+
echo "----------------------------------------"
13+
echo "Node version"
14+
echo "----------------------------------------"
15+
node --version
16+
17+
# Start node.js
18+
echo "----------------------------------------"
19+
echo "Start node.js"
20+
echo "----------------------------------------"
21+
exec npm run start

frontend/.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
npm-debug.log
3+
.next
4+
.dockerignore
5+
Dockerfile

frontend/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:22-bookworm
2+
3+
WORKDIR /src
4+
5+
COPY package*.json ./
6+
RUN npm install
7+
8+
STOPSIGNAL SIGKILL
9+
10+
COPY . .
11+
12+
ENTRYPOINT [ "./start.sh" ]

frontend/next.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
devIndicators: false,
4+
eslint: {
5+
ignoreDuringBuilds: true,
6+
},
47
async rewrites() {
58
return [
69
{

frontend/src/app/[username]/logs.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
Newspaper,
2424
Calendar1,
2525
Timer,
26+
Settings,
2627
} from "lucide-react";
2728
import {
2829
Tooltip,
@@ -225,6 +226,17 @@ export default function Logs({ user, router }) {
225226
)}
226227
<ScrollArea className="h-full" ref={scrollAreaRef}>
227228
<div className="space-y-4">
229+
{(!logs ||
230+
logs.length === 0 ||
231+
(logs.length === 1 && logs[0].type === "start")) && (
232+
<div className="flex items-center flex-col text-center mt-40 text-muted-foreground">
233+
<Settings className="h-8 w-8 mb-2" />
234+
<span className="font-medium">
235+
There are no logs to display
236+
</span>
237+
<span>Please configure and sync your account</span>
238+
</div>
239+
)}
228240
{logs.map(
229241
(log) =>
230242
log.type !== "start" && (

0 commit comments

Comments
 (0)