Compare commits

..

9 Commits

Author SHA1 Message Date
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
Dieter Blocher
1b1addfa42 Format stuff 2025-01-29 19:24:15 +00:00
Dieter Blocher
c3d50d2ac1 Add logging 2025-01-29 19:10:24 +00:00
Dieter Blocher
826cfb48c9 Add database connection... 2025-01-29 16:12:24 +00:00
Dieter Blocher
ca77e0842d add a div container to all pages... 2025-01-29 14:54:16 +00:00
Dieter Blocher
4ed3721ce5 Update stuff 2025-01-29 14:42:49 +00:00
Dieter Blocher
bffd60bb94 add other public pages 2025-01-29 14:26:45 +00:00
Dieter Blocher
5146f356b6 add howto clone and start the devcontainer and how to start express inside. 2025-01-29 10:12:12 +00:00
30 changed files with 686 additions and 356 deletions

View File

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

View File

@@ -16,7 +16,8 @@
"vscode": { "vscode": {
// Add the IDs of extensions you want installed when the container is created. // Add the IDs of extensions you want installed when the container is created.
"extensions": [ "extensions": [
"mongodb.mongodb-vscode" "mongodb.mongodb-vscode",
"ms-azuretools.vscode-docker"
] ]
} }
} }

View File

@@ -16,6 +16,7 @@ services:
# (Adding the "ports" property to this file will not forward from a Codespace.) # (Adding the "ports" property to this file will not forward from a Codespace.)
db: db:
container_name: mongodb
image: mongo:latest image: mongo:latest
restart: unless-stopped restart: unless-stopped
volumes: volumes:

View File

@@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDojCCAoqgAwIBAgIQY8oAt3ThH4xLeXIsyw6zrTANBgkqhkiG9w0BAQsFADBQ
MRIwEAYKCZImiZPyLGQBGRYCREUxHDAaBgoJkiaJk/IsZAEZFgxNSVRVVE9ZTy1D
VEwxHDAaBgNVBAMTE01JVFVUT1lPLUNUTC1CREMtQ0EwHhcNMjMxMDEyMDk1MTQ5
WhcNMzgxMDEyMTAwMTQ4WjBQMRIwEAYKCZImiZPyLGQBGRYCREUxHDAaBgoJkiaJ
k/IsZAEZFgxNSVRVVE9ZTy1DVEwxHDAaBgNVBAMTE01JVFVUT1lPLUNUTC1CREMt
Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCe07y85lBkGeKPOUkx
uqxtj79AxFy6an7oh6LjyDcm0Uf8p4Yl/StwQ474qg+SQ5vFh9KDVR9kkT6q1W1r
+SCI0u/lynngSGgcJlCa4m+EqPPoSFQRh0iAJ7rPGxZWW4Ny6Dn1D0PF/FwbNIHr
1qBmcvSGvVW4cYvcFaU3luclB7s9qSFM3+H7GcDdsZ2en6SVKhKEGSSqM5dC9+n4
Ml9BBV5BgUW6j1q0yzgtKRG7/1oMtV/Yj+RCnwEzmF40raXWqYOvpBMCmTChE14P
GW7UVWwS+6jHeqzFpvLzv5WLrzW22FViR/qV/5bmGoSj74JZ/oefkozeTg/yViC0
IxUhAgMBAAGjeDB2MAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud
DgQWBBQOLNNUoeBKVbAApH/ZX3FRZClCMDASBgkrBgEEAYI3FQEEBQIDAQABMCMG
CSsGAQQBgjcVAgQWBBRseoY/hsUyKpvnSnM37Vozh8et2TANBgkqhkiG9w0BAQsF
AAOCAQEAKaCpNic5zq3tnKW1qZy/XPDC7PSQzSAlkb3PAbk4g1hm8RfmW9Z5ktfZ
L5r1inGQvSeq8nkAuqGbX9eUyxTwJK7UioD5fds8uSYsJQKVvtcZxA8V+2Era1jy
FPMOzO4my76kSwFjDCHRT8VvkaN3uuoHUTqZvUzb0cfjM8er9guNlnIpvoTKEXt7
0oJ0GPxix80Rkcx7trK8Vmj4iG5C5/UDA3a8sQDHE2uqOallNPqBgSEE1SCPSpWn
L2xg+fC5yAc7dOb/9OTKJGHcc3FgY51lrE0KhKgh6WSjCmjQrAPLQ1KpthVo0xyq
NM9LX2+pAqNoANrxa7fiFqlnrXKcCg==
-----END CERTIFICATE-----

View File

@@ -13,7 +13,7 @@ Passport-js
https://www.youtube.com/watch?v=-RCnNyD0L-s https://www.youtube.com/watch?v=-RCnNyD0L-s
# Certificate # Certificate
The Container need our certificate! The Container need our certificate! -> Check if this works now?
# Documentation # Documentation

View File

@@ -1,4 +1,32 @@
# Start the Server: # Clone the Repository into a container
'''npm run devStart'''
![alt text](./assets/image.png) Open VS Code and press ```Ctrl + Shift + P``` (Windows/Linux) or ```Cmd + Shift + P``` (Mac) to get to the Command Palette
Type ```DevContainers Clone...``` until you can see the command:
DevContainers: Clone Repository in Container Volume...
![alt text](./assets/command_palllete.png)
Enter the URL of the repository:
https://gitea.not-my.cloud/dieter/test_dev.git
![alt text](./assets/repo_url.png)
The repo should be cloned and the container starts up:
![alt text](./assets/devcontainer_start.png)
Now you are able to open a new terminal:
![alt text](./assets/new_terminal.png)
# Start the Server:
```npm run devStart``` or ```npx nodemon```
![alt text](./assets/start_node_server.png)
or
![alt text](./assets/start_node_server2.png)
the second method uses the [nodemon.json](../nodemon.json) to configure nodemon.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
doc/assets/new_terminal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

BIN
doc/assets/repo_url.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,5 +1,5 @@
{ {
"watch": ["src", "src/public", "config"], "watch": ["src", "src/public", "src/views", "config", "stylesheets"],
"ext": "js,json,html", "ext": "js,json,css,html,ejs",
"exec": "node ./src/server.js" "exec": "node ./src/server.js"
} }

293
package-lock.json generated
View File

@@ -11,7 +11,9 @@
"dependencies": { "dependencies": {
"dotenv": "^16.4.7", "dotenv": "^16.4.7",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"express": "^4.21.2" "express": "^4.21.2",
"mongoose": "^8.9.5",
"morgan": "^1.10.0"
}, },
"devDependencies": { "devDependencies": {
"connect-livereload": "^0.6.1", "connect-livereload": "^0.6.1",
@@ -19,6 +21,30 @@
"nodemon": "^3.1.9" "nodemon": "^3.1.9"
} }
}, },
"node_modules/@mongodb-js/saslprep": {
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz",
"integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==",
"license": "MIT",
"dependencies": {
"sparse-bitfield": "^3.0.3"
}
},
"node_modules/@types/webidl-conversions": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz",
"integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==",
"license": "MIT"
},
"node_modules/@types/whatwg-url": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
"license": "MIT",
"dependencies": {
"@types/webidl-conversions": "*"
}
},
"node_modules/accepts": { "node_modules/accepts": {
"version": "1.3.8", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@@ -79,6 +105,24 @@
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
"license": "MIT",
"dependencies": {
"safe-buffer": "5.1.2"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/basic-auth/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"license": "MIT"
},
"node_modules/binary-extensions": { "node_modules/binary-extensions": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
@@ -139,6 +183,15 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/bson": {
"version": "6.10.1",
"resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz",
"integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==",
"license": "Apache-2.0",
"engines": {
"node": ">=16.20.1"
}
},
"node_modules/bytes": { "node_modules/bytes": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@@ -775,6 +828,15 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/kareem": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz",
"integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==",
"license": "Apache-2.0",
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/livereload": { "node_modules/livereload": {
"version": "0.9.3", "version": "0.9.3",
"resolved": "https://registry.npmjs.org/livereload/-/livereload-0.9.3.tgz", "resolved": "https://registry.npmjs.org/livereload/-/livereload-0.9.3.tgz",
@@ -819,6 +881,12 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/memory-pager": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
"license": "MIT"
},
"node_modules/merge-descriptors": { "node_modules/merge-descriptors": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
@@ -882,6 +950,162 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/mongodb": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz",
"integrity": "sha512-RM7AHlvYfS7jv7+BXund/kR64DryVI+cHbVAy9P61fnb1RcWZqOW1/Wj2YhqMCx+MuYhqTRGv7AwHBzmsCKBfA==",
"license": "Apache-2.0",
"dependencies": {
"@mongodb-js/saslprep": "^1.1.9",
"bson": "^6.10.1",
"mongodb-connection-string-url": "^3.0.0"
},
"engines": {
"node": ">=16.20.1"
},
"peerDependencies": {
"@aws-sdk/credential-providers": "^3.188.0",
"@mongodb-js/zstd": "^1.1.0 || ^2.0.0",
"gcp-metadata": "^5.2.0",
"kerberos": "^2.0.1",
"mongodb-client-encryption": ">=6.0.0 <7",
"snappy": "^7.2.2",
"socks": "^2.7.1"
},
"peerDependenciesMeta": {
"@aws-sdk/credential-providers": {
"optional": true
},
"@mongodb-js/zstd": {
"optional": true
},
"gcp-metadata": {
"optional": true
},
"kerberos": {
"optional": true
},
"mongodb-client-encryption": {
"optional": true
},
"snappy": {
"optional": true
},
"socks": {
"optional": true
}
}
},
"node_modules/mongodb-connection-string-url": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz",
"integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==",
"license": "Apache-2.0",
"dependencies": {
"@types/whatwg-url": "^11.0.2",
"whatwg-url": "^14.1.0 || ^13.0.0"
}
},
"node_modules/mongoose": {
"version": "8.9.5",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.5.tgz",
"integrity": "sha512-SPhOrgBm0nKV3b+IIHGqpUTOmgVL5Z3OO9AwkFEmvOZznXTvplbomstCnPOGAyungtRXE5pJTgKpKcZTdjeESg==",
"license": "MIT",
"dependencies": {
"bson": "^6.10.1",
"kareem": "2.6.3",
"mongodb": "~6.12.0",
"mpath": "0.9.0",
"mquery": "5.0.0",
"ms": "2.1.3",
"sift": "17.1.3"
},
"engines": {
"node": ">=16.20.1"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mongoose"
}
},
"node_modules/mongoose/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
"node_modules/morgan": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
"integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==",
"license": "MIT",
"dependencies": {
"basic-auth": "~2.0.1",
"debug": "2.6.9",
"depd": "~2.0.0",
"on-finished": "~2.3.0",
"on-headers": "~1.0.2"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/morgan/node_modules/on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
"integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==",
"license": "MIT",
"dependencies": {
"ee-first": "1.1.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/mpath": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz",
"integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==",
"license": "MIT",
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/mquery": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz",
"integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==",
"license": "MIT",
"dependencies": {
"debug": "4.x"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/mquery/node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/mquery/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -1008,6 +1232,15 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/on-headers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
"integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/opts": { "node_modules/opts": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/opts/-/opts-2.0.2.tgz", "resolved": "https://registry.npmjs.org/opts/-/opts-2.0.2.tgz",
@@ -1063,6 +1296,15 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/qs": { "node_modules/qs": {
"version": "6.13.0", "version": "6.13.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
@@ -1286,6 +1528,12 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/sift": {
"version": "17.1.3",
"resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz",
"integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==",
"license": "MIT"
},
"node_modules/simple-update-notifier": { "node_modules/simple-update-notifier": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",
@@ -1299,6 +1547,15 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/sparse-bitfield": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
"integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
"license": "MIT",
"dependencies": {
"memory-pager": "^1.0.2"
}
},
"node_modules/statuses": { "node_modules/statuses": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@@ -1352,6 +1609,18 @@
"nodetouch": "bin/nodetouch.js" "nodetouch": "bin/nodetouch.js"
} }
}, },
"node_modules/tr46": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
"integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==",
"license": "MIT",
"dependencies": {
"punycode": "^2.3.1"
},
"engines": {
"node": ">=18"
}
},
"node_modules/type-is": { "node_modules/type-is": {
"version": "1.6.18", "version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -1399,6 +1668,28 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/webidl-conversions": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
}
},
"node_modules/whatwg-url": {
"version": "14.1.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.0.tgz",
"integrity": "sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==",
"license": "MIT",
"dependencies": {
"tr46": "^5.0.0",
"webidl-conversions": "^7.0.0"
},
"engines": {
"node": ">=18"
}
},
"node_modules/ws": { "node_modules/ws": {
"version": "7.5.10", "version": "7.5.10",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",

View File

@@ -11,7 +11,9 @@
"dependencies": { "dependencies": {
"dotenv": "^16.4.7", "dotenv": "^16.4.7",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"express": "^4.21.2" "express": "^4.21.2",
"mongoose": "^8.9.5",
"morgan": "^1.10.0"
}, },
"devDependencies": { "devDependencies": {
"connect-livereload": "^0.6.1", "connect-livereload": "^0.6.1",

View File

@@ -0,0 +1,33 @@
const mongoose = require("mongoose");
const connectDB = async () => {
try {
const conn = await mongoose.connect('mongodb://mongodb:27017/tombola', {
});
console.log(`MongoDB Connected: ${conn.connection.host}:${conn.connection.port}`);
// Get and log database stats
const dbStats = await conn.connection.db.stats();
console.log("Database Stats:", dbStats);
// Get and log all collections in the database
const collections = await conn.connection.db.collections();
if (collections.length > 0) {
console.log("Collections:");
collections.forEach(collection => {
console.log(collection.collectionName);
});
// Get and log the indexes of a specific collection (optional)
const collectionName = "collectionname"; // Replace with your collection name
const indexes = await conn.connection.db.collection(collectionName).indexes();
console.log(`Indexes in ${collectionName}:`);
console.log(indexes);
}
console.log("Finish Database Stats.");
} catch (error) {
console.error(error.message);
process.exit(1);
}
}
module.exports = connectDB;

12
src/models/users.js Normal file
View File

@@ -0,0 +1,12 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const UserSchema = new Schema({
firstname: { type: String },
familyname: { type: String },
email: { type: String },
phonenumber: { type: String },
},
{
timestamps: true,
});
module.exports = mongoose.model('user', UserSchema, 'users');

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Hacking Game...</title>
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<div class="container">
<h3>Placeholder...</h3>
</div>
</body>
</html>

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Hacking Game...</title>
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<div class="container">
<img class="background-image" src="/pictures/background05.png">
<h3>
<span style="color: red">U</span>nlock the secu<span style="color: red">r</span>ed safe quick<span
style="color: red">l</span>y...
</h3>
</div>
</body>
</html>

View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>Hacking Game...</title>
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<div class="container">
<img class="background-image" src="/pictures/background06.png">
<h3>Congratulations, you got the certificate!!!</h3>
<h4>
Find the hidden link to<a class="hidden_link" href="/4acd7872dbae41e89c548130f6dca980.html" target="_self">
</a>
continue...
</h4>
</div>
</body>
</html>

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
@@ -6,47 +7,11 @@
</head> </head>
<body> <body>
<center><img class="background-image" src="./pictures/background01.png" usemap="#no"> <div class="container">
<img class="background-image" src="./pictures/background01.png" usemap="#no">
<h3>Enter the door...</h3><map name="no"><area shape="rect" coords="501,158,634,380" alt="Test" <h3>Enter the door...</h3><map name="no"><area shape="rect" coords="501,158,634,380" alt="Test"
href="./userpass.html"></map> href="./userpass.html"></map>
</center> </div>
<style>
.tb_button {
padding: 1px;
cursor: pointer;
border-right: 1px solid #8b8b8b;
border-left: 1px solid #FFF;
border-bottom: 1px solid #fff;
}
.tb_button.hover {
border: 2px outset #def;
background-color: #f8f8f8 !important;
}
.ws_toolbar {
z-index: 100000
}
.ws_toolbar .ws_tb_btn {
cursor: pointer;
border: 1px solid #555;
padding: 3px
}
.tb_highlight {
background-color: yellow
}
.tb_hide {
visibility: hidden
}
.ws_toolbar img {
padding: 2px;
margin: 0px
}
</style>
</body> </body>
</html> </html>

View File

@@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Index.html</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Hiidfdcvdfsdgfthjhkjhhhhk</h1>
<img src="./images/free.png">
</body>
</html>

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
@@ -6,7 +7,7 @@
</head> </head>
<body> <body>
<center> <div class="container">
<form id="math-form"> <form id="math-form">
<div class="math-div"><img class="math-image" src="./pictures/background04.png"><input class="math-mask" <div class="math-div"><img class="math-image" src="./pictures/background04.png"><input class="math-mask"
type="text" id="nullstelle" name="nullstelle"><button id="abgeben-button" type="text" id="nullstelle" name="nullstelle"><button id="abgeben-button"
@@ -15,7 +16,6 @@
</div> </div>
<h3>Solve the task...</h3> <h3>Solve the task...</h3>
</form> </form>
</center>
<script>checkInput = function (nullstelle) { <script>checkInput = function (nullstelle) {
nullstelle = btoa(nullstelle); nullstelle = btoa(nullstelle);
if (nullstelle == "MA==") { if (nullstelle == "MA==") {
@@ -31,7 +31,7 @@
if (checkInput(nullstelle)) { if (checkInput(nullstelle)) {
document.getElementById("wrong-solution").classList.add("hidden"); document.getElementById("wrong-solution").classList.add("hidden");
document.getElementById("wrong-solution").classList.remove("visible"); document.getElementById("wrong-solution").classList.remove("visible");
window.location.href = "/access/false/safebox"; window.location.href = "/access/false/safebox.html";
} }
else { else {
document.getElementById("nullstelle").focus(); document.getElementById("nullstelle").focus();
@@ -39,43 +39,7 @@
document.getElementById("wrong-solution").classList.add("visible"); document.getElementById("wrong-solution").classList.add("visible");
} }
});</script> });</script>
<style> </div>
.tb_button {
padding: 1px;
cursor: pointer;
border-right: 1px solid #8b8b8b;
border-left: 1px solid #FFF;
border-bottom: 1px solid #fff;
}
.tb_button.hover {
border: 2px outset #def;
background-color: #f8f8f8 !important;
}
.ws_toolbar {
z-index: 100000
}
.ws_toolbar .ws_tb_btn {
cursor: pointer;
border: 1px solid #555;
padding: 3px
}
.tb_highlight {
background-color: yellow
}
.tb_hide {
visibility: hidden
}
.ws_toolbar img {
padding: 2px;
margin: 0px
}
</style><span id="okta-plugin-message-channel-available" style="display: none;"></span>
</body> </body>
</html> </html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
@@ -6,7 +7,7 @@
</head> </head>
<body> <body>
<center> <div class="container">
<div class="userdata-div"><img class="background-image" src="./pictures/background00.png"> <div class="userdata-div"><img class="background-image" src="./pictures/background00.png">
<div class="typewriter" id="typewriter"><span class="type" style="--n:620">Your goal in this small hacker game is <div class="typewriter" id="typewriter"><span class="type" style="--n:620">Your goal in this small hacker game is
to enroll in university. You start as a student and all you have to do is pass your final math exam. To make to enroll in university. You start as a student and all you have to do is pass your final math exam. To make
@@ -18,44 +19,7 @@
</div><a href="/enter_school.html"> </div><a href="/enter_school.html">
<h3>Start your task and good luck...</h3> <h3>Start your task and good luck...</h3>
</a> </a>
</center> </div>
<style>
.tb_button {
padding: 1px;
cursor: pointer;
border-right: 1px solid #8b8b8b;
border-left: 1px solid #FFF;
border-bottom: 1px solid #fff;
}
.tb_button.hover {
border: 2px outset #def;
background-color: #f8f8f8 !important;
}
.ws_toolbar {
z-index: 100000
}
.ws_toolbar .ws_tb_btn {
cursor: pointer;
border: 1px solid #555;
padding: 3px
}
.tb_highlight {
background-color: yellow
}
.tb_hide {
visibility: hidden
}
.ws_toolbar img {
padding: 2px;
margin: 0px
}
</style>
</body> </body>
</html> </html>

View File

@@ -1,30 +1,24 @@
.h3 .h3 {
{
color: white; color: white;
} }
h3:link h3:link {
{
color: white; color: white;
} }
h3:visited h3:visited {
{
color: white; color: white;
} }
h3:hover h3:hover {
{
color: white; color: white;
} }
h3:active h3:active {
{
color: white; color: white;
} }
h3:link h3:link {
{
color: white; color: white;
} }
@@ -33,27 +27,35 @@ body {
padding: 0px; padding: 0px;
font: 26px "Lucida Grande", Helvetica, Arial, sans-serif; font: 26px "Lucida Grande", Helvetica, Arial, sans-serif;
color: white; color: white;
display: flex;
justify-content: center;
/* Centers horizontally */
align-items: center;
/* Centers vertically */
height: 100vh;
/* Ensures full height */
margin: 0;
} }
a { a {
color: white; color: white;
} }
.login-div{ .login-div {
position:relative; position: relative;
display:inline-block; display: inline-block;
width:960px; width: 960px;
} }
#login-hint{ #login-hint {
position: absolute; position: absolute;
left: 220px; left: 220px;
top: 353px; top: 353px;
visibility: hidden; visibility: hidden;
} }
#login-hint-map{ #login-hint-map {
z-index: 1000; z-index: 1000;
position: absolute; position: absolute;
top: 370px; top: 370px;
@@ -62,100 +64,109 @@ a {
height: 80px; height: 80px;
} }
.login-image-div:hover{ .login-image-div:hover {
float: left; float: left;
width: 240px; width: 240px;
height: 90px; height: 90px;
background: url("/pictures/userpass/background03_5x2.png") background: url("/pictures/userpass/background03_5x2.png")
} }
.login-mask{ .login-mask {
border:none; border: none;
margin: 0; margin: 0;
padding-inline: 5px; padding-inline: 5px;
background: #212121; background: #212121;
color: #36cb09; color: #36cb09;
width:311px; width: 311px;
height: 27px; height: 27px;
} }
#login-button{ #login-button {
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
border: 0; border: 0;
padding-inline: 2px; padding-inline: 2px;
background: #36cb09; background: #36cb09;
color: #212121; color: #212121;
width:75px; width: 75px;
height: 33px; height: 33px;
font-weight: bold; font-weight: bold;
position: absolute; position: absolute;
left: 566px; left: 566px;
top: 301px; top: 301px;
cursor: pointer;
} }
.login-mask:focus{ .login-mask:focus {
border:none; border: none;
outline: none; outline: none;
} }
.visible{ .visible {
visibility: visible; visibility: visible;
} }
.hidden{ .hidden {
visibility: hidden; visibility: hidden;
} }
#user{ #user {
position: absolute; left: 320px; top: 154px; position: absolute;
left: 320px;
top: 154px;
} }
#password{ #password {
position: absolute; left: 319px; top: 246px; position: absolute;
left: 319px;
top: 246px;
} }
#credentials-error { #credentials-error {
position: absolute; left: 315px; top: 300px; position: absolute;
left: 315px;
top: 300px;
color: #36cb09; color: #36cb09;
} }
.math-div{ .math-div {
position:relative; position: relative;
display:inline-block; display: inline-block;
width:960px; width: 960px;
} }
.math-mask{
border:none; .math-mask {
border: none;
margin: 0; margin: 0;
padding-inline: 5px; padding-inline: 5px;
background: #FFFFFF; background: #FFFFFF;
color: black; color: black;
width:144px; width: 144px;
height: 22px; height: 22px;
} }
.math-mask:focus{ .math-mask:focus {
border:none; border: none;
outline: none; outline: none;
} }
#abgeben-button{ #abgeben-button {
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
padding-inline: 2px; padding-inline: 2px;
background: white; background: white;
color: #212121; color: #212121;
width:75px; width: 75px;
height: 33px; height: 33px;
font-weight: bold; font-weight: bold;
position: absolute; position: absolute;
left: 529px; left: 529px;
top: 405px; top: 405px;
cursor: pointer;
} }
#wrong-solution{ #wrong-solution {
position: absolute; position: absolute;
left: 613px; left: 613px;
top: 343px; top: 343px;
@@ -163,142 +174,150 @@ a {
font-size: xx-large; font-size: xx-large;
} }
#nullstelle{ #nullstelle {
position: absolute; left: 446px; top: 346px; position: absolute;
left: 446px;
top: 346px;
} }
.hidden_content .hidden_content {
{
color: black; color: black;
} }
.hidden_link:link .hidden_link:link {
{
color: black; color: black;
} }
.hidden_link:visited .hidden_link:visited {
{
color: black; color: black;
} }
.hidden_link:hover .hidden_link:hover {
{
color: black; color: black;
} }
.hidden_link:active .hidden_link:active {
{
color: black; color: black;
} }
.hidden_link:link .hidden_link:link {
{
color: black; color: black;
} }
.userdata-div{ .userdata-div {
position:relative; position: relative;
display:inline-block; display: inline-block;
width:960px; width: 960px;
} }
.userdata-mask .userdata-mask {
{
margin: 0; margin: 0;
padding-inline: 5px; padding-inline: 5px;
background: #FFFFFF; background: #FFFFFF;
color: black; color: black;
width:300px; width: 300px;
height: 22px; height: 22px;
} }
.userdata-submit-mask .userdata-submit-mask {
{
margin: 0; margin: 0;
padding-inline: 5px; padding-inline: 5px;
background: lightgrey; background: lightgrey;
color: black; color: black;
width:150px; width: 150px;
height: 24px; height: 24px;
} }
.userdata-lable-mask .userdata-lable-mask {
{
color: black; color: black;
font-size: small; font-size: small;
} }
#firstname_label #firstname_label {
{ position: absolute;
position: absolute; left: 300px; top: 170px; left: 300px;
top: 170px;
} }
#firstname #firstname {
{ position: absolute;
position: absolute; left: 300px; top: 200px; left: 300px;
top: 200px;
} }
#familyname_label #familyname_label {
{ position: absolute;
position: absolute; left: 300px; top: 230px; left: 300px;
top: 230px;
} }
#familyname #familyname {
{ position: absolute;
position: absolute; left: 300px; top: 260px; left: 300px;
top: 260px;
} }
#email_label #email_label {
{ position: absolute;
position: absolute; left: 300px; top: 290px; left: 300px;
top: 290px;
} }
#email #email {
{ position: absolute;
position: absolute; left: 300px; top: 320px; left: 300px;
top: 320px;
} }
#phonenumber_label #phonenumber_label {
{ position: absolute;
position: absolute; left: 300px; top: 350px; left: 300px;
top: 350px;
} }
#phonenumber #phonenumber {
{ position: absolute;
position: absolute; left: 300px; top: 380px; left: 300px;
top: 380px;
} }
#submit_data #submit_data {
{ position: absolute;
position: absolute; left: 300px; top: 440px; left: 300px;
top: 440px;
} }
#typewriter #typewriter {
{ position: absolute;
position: absolute; left: 275px; top: 50px; left: 275px;
width:410px; top: 50px;
width: 410px;
text-align: left; text-align: left;
} }
.type { .type {
font-size: 17px; font-size: 17px;
color:#0000; color: #0000;
background: background:
linear-gradient(-90deg,black 5px,#0000 0) 10px 0, linear-gradient(-90deg, black 5px, #0000 0) 10px 0,
linear-gradient(black 0 0) 0 0; linear-gradient(black 0 0) 0 0;
background-size:calc(var(--n)*1ch) 200%; background-size: calc(var(--n)*1ch) 200%;
-webkit-background-clip:padding-box,text; -webkit-background-clip: padding-box, text;
background-clip:padding-box,text; background-clip: padding-box, text;
background-repeat:no-repeat; background-repeat: no-repeat;
animation: animation:
b .2s infinite steps(1), b .2s infinite steps(1),
t calc(var(--n)*.03s) steps(var(--n)) forwards; t calc(var(--n)*.03s) steps(var(--n)) forwards;
} }
@keyframes t{ @keyframes t {
from {background-size:0 200%} from {
background-size: 0 200%
}
} }
@keyframes b{
50% {background-position:0 -100%,0 0} @keyframes b {
50% {
background-position: 0 -100%, 0 0
}
} }

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
@@ -5,8 +6,9 @@
<link rel="stylesheet" href="/stylesheets/style.css"> <link rel="stylesheet" href="/stylesheets/style.css">
</head> </head>
<body><audio src="/sounds/background-electro.mp3" autoplay="" loop=""></audio> <body>
<center> <audio src="./sounds/background-electro.mp3" autoplay loop></audio>
<div class="container">
<form id="login-form"> <form id="login-form">
<div class="login-div"><img src="./pictures/background02.png"><img id="login-hint" <div class="login-div"><img src="./pictures/background02.png"><img id="login-hint"
src="./pictures/background03-cropped.png" style="visibility: hidden;"> src="./pictures/background03-cropped.png" style="visibility: hidden;">
@@ -14,11 +16,10 @@
placeholder="Enter Username here..."><input class="login-mask" type="password" name="password" placeholder="Enter Username here..."><input class="login-mask" type="password" name="password"
id="password" placeholder="Enter Password here..."><button id="login-button" id="password" placeholder="Enter Password here..."><button id="login-button"
type="submit">Ok!</button> type="submit">Ok!</button>
<div class="visible" id="credentials-error">Wrong credentials!</div> <div class="hidden" id="credentials-error">Wrong credentials!</div>
</div> </div>
<h3>Enter your credentials...</h3> <h3>Enter your credentials...</h3>
</form> </form>
</center>
<script>checkCredentials = function (username, password) { <script>checkCredentials = function (username, password) {
username = btoa(username); username = btoa(username);
password = btoa(password); password = btoa(password);
@@ -53,44 +54,8 @@
document.getElementById("login-hint-map").addEventListener("mouseout", function (event) { document.getElementById("login-hint-map").addEventListener("mouseout", function (event) {
document.getElementById("login-hint").style.visibility = "hidden"; document.getElementById("login-hint").style.visibility = "hidden";
});</script><span id="okta-plugin-message-channel-available" style="display: none;"></span> });</script>
<style> </div>
.tb_button {
padding: 1px;
cursor: pointer;
border-right: 1px solid #8b8b8b;
border-left: 1px solid #FFF;
border-bottom: 1px solid #fff;
}
.tb_button.hover {
border: 2px outset #def;
background-color: #f8f8f8 !important;
}
.ws_toolbar {
z-index: 100000
}
.ws_toolbar .ws_tb_btn {
cursor: pointer;
border: 1px solid #555;
padding: 3px
}
.tb_highlight {
background-color: yellow
}
.tb_hide {
visibility: hidden
}
.ws_toolbar img {
padding: 2px;
margin: 0px
}
</style>
</body> </body>
</html> </html>

View File

@@ -1,8 +1,10 @@
const express = require('express') const express = require('express')
require('dotenv').config(); require('dotenv').config();
const path = require('path'); const path = require('path');
const morgan = require('morgan');
const livereload = require('livereload'); const livereload = require('livereload');
const connectLivereload = require('connect-livereload'); const connectLivereload = require('connect-livereload');
const connectDB = require('./middleware/database');
// Setup livereload // Setup livereload
@@ -10,6 +12,10 @@ const liveReloadServer = livereload.createServer();
liveReloadServer.watch(__dirname + "public"); // Watch public directory liveReloadServer.watch(__dirname + "public"); // Watch public directory
const app = express() const app = express()
connectDB();
// Use morgan to log requests in 'combined' format (includes status code, method, URL, etc.)
app.use(morgan('combined'));
// Middleware to inject livereload script // Middleware to inject livereload script
app.use(connectLivereload()); app.use(connectLivereload());

View File

@@ -1 +1,16 @@
<h1>Hi...</h1> <!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<div class="container">
<h1>Hi...</h1>
<a href="/start.html">Go to Start!!</a>
</div>
</body>
</html>