Compare commits

...

10 Commits

Author SHA1 Message Date
7538d5ea59 Update README.md 2025-01-31 11:38:36 +01:00
Dieter Blocher
4ba3fcea08 Add example.env 2025-01-31 08:23:55 +00:00
Dieter Blocher
b73e655e89 Update stuff 2025-01-30 16:42:28 +00:00
71e3adf351 Update .devcontainer/devcontainer.json 2025-01-30 17:31:04 +01:00
bc8f30e924 Update .devcontainer/Dockerfile 2025-01-30 17:30:42 +01:00
2ed058df64 Update .devcontainer/devcontainer.json 2025-01-30 17:23:27 +01:00
7cc5200f24 Update README.md 2025-01-30 17:17:05 +01:00
1e74de1393 Update doc/README.md 2025-01-30 16:46:14 +01:00
Dieter Blocher
0d11465fcf Add mitutoyo.crt 2025-01-30 09:45:08 +00:00
Dieter Blocher
366fd3311d Add <!DOCTYPE html> 2025-01-30 08:10:22 +00:00
12 changed files with 61 additions and 24 deletions

View File

@@ -1,6 +1,11 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm
# Copy the Sophos CA certificate into the container
COPY sophos.crt /usr/local/share/ca-certificates/sophos.crt
COPY mitutoyo.crt /usr/local/share/ca-certificates/mitutoyo.crt
# Merge multiple CA certificates into one file
RUN cat /usr/local/share/ca-certificates/sophos.crt \
/usr/local/share/ca-certificates/mitutoyo.crt \
> /usr/local/share/ca-certificates/custom-ca.pem
# Update system CA certificates
RUN update-ca-certificates
# Install MongoDB command line tools - though mongo-database-tools not available on arm64

View File

@@ -8,7 +8,7 @@
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
"containerEnv": {
"NODE_EXTRA_CA_CERTS": "/usr/local/share/ca-certificates/sophos.crt"
"NODE_EXTRA_CA_CERTS": "/usr/local/share/ca-certificates/custom-ca.pem"
},
// Configure tool-specific properties.
"customizations": {

View File

@@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDojCCAoqgAwIBAgIQY8oAt3ThH4xLeXIsyw6zrTANBgkqhkiG9w0BAQsFADBQ
MRIwEAYKCZImiZPyLGQBGRYCRE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sQDHE2uqOallNPqBgSEE1SCPSpWn
L2xg+fC5yAc7dOb/9OTKJGHcc3FgY51lrE0KhKgh6WSjCmjQrAPLQ1KpthVo0xyq
NM9LX2+pAqNoANrxa7fiFqlnrXKcCg==
-----END CERTIFICATE-----

View File

@@ -1,20 +1,3 @@
# test_dev
From here:
https://www.youtube.com/watch?v=SDa3v4Quj7Y
Auth:
https://www.youtube.com/watch?v=bgk1mI2pak4
Middelware:
https://www.youtube.com/watch?v=_I6gP_nIFIA
Passport-js
https://www.youtube.com/watch?v=-RCnNyD0L-s
# Certificate
The Container need our certificate! -> Check if this works now?
# Documentation
[Documentation](./doc/README.md)
Repo has moved to: https://gitea.not-my.cloud/education/hacker-game

View File

@@ -20,7 +20,16 @@ Now you are able to open a new terminal:
![alt text](./assets/new_terminal.png)
# Start the Server:
# Install packages
First you should install all related packages with
```npm install```
This will install the packages defined in [package.json](../package.json)
# Start the Server
```npm run devStart``` or ```npx nodemon```
![alt text](./assets/start_node_server.png)
@@ -29,4 +38,14 @@ or
![alt text](./assets/start_node_server2.png)
the second method uses the [nodemon.json](../nodemon.json) to configure nodemon.
the second method uses the [nodemon.json](../nodemon.json) to configure nodemon.
# .env file
To have different behavior on your dev host, you cloud add an .env file.
Here are the key-values of an .evc file:
```bash
PORT = 3000
```

2
example.env Normal file
View File

@@ -0,0 +1,2 @@
# App Port
PORT = 3000

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>
@@ -6,8 +7,8 @@
</head>
<body>
<audio src="./sounds/background-electro.mp3" autoplay loop></audio>
<div class="container">
<audio src="/sounds/background-electro.mp3" autoplay="" loop=""></audio>
<form id="login-form">
<div class="login-div"><img src="./pictures/background02.png"><img id="login-hint"
src="./pictures/background03-cropped.png" style="visibility: hidden;">
@@ -15,7 +16,7 @@
placeholder="Enter Username here..."><input class="login-mask" type="password" name="password"
id="password" placeholder="Enter Password here..."><button id="login-button"
type="submit">Ok!</button>
<div class="visible" id="credentials-error">Wrong credentials!</div>
<div class="hidden" id="credentials-error">Wrong credentials!</div>
</div>
<h3>Enter your credentials...</h3>
</form>

View File

@@ -33,5 +33,6 @@ app.get('/', (req, res) => {
res.render('index.ejs')
})
const port = process.env.PORT;
const port = process.env.PORT || 3000;;
app.listen(port, () => console.log("Server is running on http://localhost:%i", port));