Skip to content

Commit 4444fc1

Browse files
authored
Merge pull request #58 from SafeExamBrowser/SEBSERV-832__simplify-proxy-server
SEBSERV-832: simplify proxy server
2 parents 024c961 + f4d27d7 commit 4444fc1

157 files changed

Lines changed: 2952 additions & 7902 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/auto-test-deploy.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
- "auto-testing-deploy"
77

88
jobs:
9-
109
shai-hulud-detector:
1110
runs-on: ubuntu-latest
1211
steps:
@@ -27,12 +26,11 @@ jobs:
2726
chmod +x ./hulud/shai-hulud-detector.sh
2827
./hulud/shai-hulud-detector.sh ./seb
2928
30-
3129
build-and-push-admin-auto-test:
3230
runs-on: ubuntu-latest
3331
strategy:
3432
matrix:
35-
tag_suffix: [ "", "-single-host" ]
33+
tag_suffix: ["", "-single-host"]
3634
include:
3735
- tag_suffix: ""
3836
path_name: ""
@@ -63,7 +61,6 @@ jobs:
6361
context: .
6462
push: true
6563
tags: docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-server-gui-auto-testing:${{ env.TAG_NAME }}
66-
build-args: VITE_SUB_PATH=${{ matrix.path_name }}
6764

6865
build-and-push-auto-test-storybook:
6966
runs-on: ubuntu-latest

.github/workflows/docker-build-push.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
context: .
6666
push: true
6767
tags: docker.io/naritter/seb-server-gui:${{ env.TAG_NAME }}
68-
build-args: VITE_SUB_PATH=${{ matrix.path_name }}
6968

7069
build-and-push-admin:
7170
needs: shai-hulud-detector
@@ -103,4 +102,3 @@ jobs:
103102
context: .
104103
push: true
105104
tags: docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-server-gui:${{ env.TAG_NAME }}
106-
build-args: VITE_SUB_PATH=${{ matrix.path_name }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ bin-release/
66

77
# Other files and folders
88
.settings/
9+
application-prod.properties
910

1011
# Executables
1112
*.swf

Dockerfile

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
1-
# Stage 1: Build the Vue app
2-
FROM node:22.2.0 as client-builder
1+
# Build client
2+
FROM node:22.12.0 AS client-builder
33
WORKDIR /app/client
44
COPY client/package*.json ./
5-
RUN npm install
5+
RUN npm ci
66
COPY client/ .
7-
8-
# Inject environment variables for Vue.js
9-
ARG VITE_SUB_PATH
10-
RUN echo "VITE_SUB_PATH=$VITE_SUB_PATH" > .env
11-
127
RUN npm run build
138

14-
# Stage 2: Build the Express server
15-
FROM node:22.2.0 as server-builder
9+
# Build server
10+
FROM node:22.12.0 AS server-builder
1611
WORKDIR /app/server
1712
COPY server/package*.json ./
18-
RUN npm install
19-
RUN npm install typescript
13+
RUN npm ci
2014
COPY server/ .
2115
RUN npm run build
2216

23-
# Stage 3: Create the final image
24-
FROM node:22.2.0-alpine
17+
# Create final image
18+
FROM node:22.12.0-alpine
2519
WORKDIR /app
20+
ENV SERVE_CLIENT=true
2621
COPY --from=server-builder /app/server/dist ./server/dist
2722
COPY --from=client-builder /app/client/dist ./server/dist/views
28-
COPY --from=client-builder /app/client/.env ./server/dist/views
29-
COPY server/package*.json ./
30-
RUN npm install
31-
32-
# Stage 4: Copy env-var bash script
33-
COPY env.sh /app/env.sh
34-
RUN chmod +x /app/env.sh
23+
COPY --from=server-builder /app/server/node_modules ./node_modules
3524

3625
EXPOSE 3001
3726

38-
# Start the server
39-
CMD ["/bin/sh", "-c", "./env.sh && node ./server/dist/app.js"]
27+
# Start server
28+
CMD ["node", "./server/dist/index.js"]

README.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,36 @@ This is a sub-project of SEB Server. For full usage and installation, please vis
88

99
**This project is still under development and has not yet an official release or release data.**
1010

11-
This project consists of two parts. A client component and a server component. The server contains no businesses logic but serves as a lightweight api-gateway between the client and the [SEB-Server](https://github.com/SafeExamBrowser/seb-server). The easiest way to build and deploy the project is via docker.
11+
This project consists of two parts. A client component and a server component. The server contains no businesses logic but serves as a lightweight api gateway. The easiest way to build and deploy the project is via docker.
1212

13-
### Client
13+
# Development Setup
1414

15-
The client uses the following technologies:
15+
## Intro
1616

17-
#### [VueJs Version 3.4.\*](https://vuejs.org/)
17+
If you're just working on the frontend part (SEB Server GUI), this is the easiest way to have a working environment. This pulls the backend services (mariadb, seb-server and sps-webservice) from existing images
1818

19-
- Composition API and Script Setup Syntax
20-
- Typescript
21-
- [Vuetify](https://vuetifyjs.com/en/) as the componenet framework
19+
## Setup docker containers
2220

23-
### Server
21+
1. Run `docker-compose up -d`
2422

25-
The server uses the following technologies:
23+
## Setup the client
2624

27-
#### [ExpressJs Version 4.19.\*](https://expressjs.com/)
25+
1. `cd client`
26+
1. Start virtual node env: `nvm use`
27+
1. Install dependencies: `npm ci`
28+
1. Copy the example `.env` file and adapt it to your needs: `cp .env.example .env`
29+
1. Start the client: `npm run dev`
2830

29-
- Typescript
30-
- Axios as API-Request library
31+
## Setup the server
3132

32-
# Development Setup
33+
1. See `README.md` in `/server`
3334

34-
## Intro
35+
## Confirm setup worked
3536

36-
If you're just working on the frontend part (SEB Server GUI), this is the easiest way to have a working environment. This pulls the backend services (mariadb, seb-server and sps-webservice) from existing images. The frontend services (fe-server and fe-client) are built from the local code of this repository.
37-
38-
## Setup docker containers
39-
40-
1. Run `docker-compose up -d`
4137
1. Visit http://localhost:8082 and login to confirm that the full setup works
4238

4339
## Install the pre-commit hook
4440

45-
The following steps have to be done on your **host machine** (not in the docker-container)
46-
4741
1. Run `cd client && nvm use && npm run prepare`
4842
1. Run `git config core.hooksPath` and verify, that the `hooksPath` was correctly set to `./client/.husky/_`
4943

client/.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

client/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_DEV_API_SERVER_TARGET=http://localhost:3001

client/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ node_modules
44
.vscode
55

66
# local env files
7+
.env
78
.env.local
89
.env.*.local
910

client/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.2.0
1+
v22.12.0

client/env.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)