This repository has been archived by the owner on Dec 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Archive: Merge final presentation backend (#173)
This PR merges the presentation day backend, Thanks @AnnsAnns for reminding me...
- Loading branch information
Showing
86 changed files
with
1,860 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/usr/bin/env bash | ||
|
||
USB_CDC_ECM_DIR="$(dirname "$(readlink -f "$0")")" | ||
|
||
INTERFACE_CHECK_COUNTER=5 # 5 attempts to find usb interface | ||
|
||
find_interface() { | ||
INTERFACE=$(ls -A /sys/bus/usb/drivers/cdc_ether/*/net/ 2>/dev/null) | ||
INTERFACE_CHECK=$(echo -n "${INTERFACE}" | head -c1 | wc -c) | ||
if [ "${INTERFACE_CHECK}" -eq 0 ] && [ ${INTERFACE_CHECK_COUNTER} != 0 ]; then | ||
# We want to have multiple opportunities to find the USB interface | ||
# as sometimes it can take a few seconds for it to enumerate after | ||
# the device has been flashed. | ||
sleep 1 | ||
((INTERFACE_CHECK_COUNTER=INTERFACE_CHECK_COUNTER-1)) | ||
find_interface | ||
fi | ||
INTERFACE=${INTERFACE%/} | ||
} | ||
|
||
echo "Waiting for network interface." | ||
find_interface | ||
|
||
if [ "${INTERFACE_CHECK}" -eq 0 ]; then | ||
echo "Unable to find network interface" | ||
exit 1 | ||
else | ||
echo "Found interface: ${INTERFACE}" | ||
fi | ||
|
||
setup_interface() { | ||
sysctl -w net.ipv6.conf."${INTERFACE}".forwarding=1 | ||
sysctl -w net.ipv6.conf."${INTERFACE}".accept_ra=0 | ||
ip link set "${INTERFACE}" up | ||
ip a a fe80::1/64 dev "${INTERFACE}" | ||
ip a a fd00:dead:beef::1/128 dev lo | ||
} | ||
|
||
cleanup_interface() { | ||
ip a d fe80::1/64 dev "${INTERFACE}" | ||
ip a d fd00:dead:beef::1/128 dev lo | ||
ip route del "${PREFIX}" via fe80::2 dev "${INTERFACE}" | ||
} | ||
|
||
cleanup() { | ||
echo "Cleaning up..." | ||
cleanup_interface | ||
if [ -n "${UHCPD_PID}" ]; then | ||
kill "${UHCPD_PID}" | ||
fi | ||
if [ -n "${DHCPD_PIDFILE}" ]; then | ||
kill "$(cat "${DHCPD_PIDFILE}")" | ||
rm "${DHCPD_PIDFILE}" | ||
fi | ||
trap "" INT QUIT TERM EXIT | ||
} | ||
|
||
start_uhcpd() { | ||
ip route add "${PREFIX}" via fe80::2 dev "${INTERFACE}" | ||
${UHCPD} "${INTERFACE}" "${PREFIX}" > /dev/null & | ||
UHCPD_PID=$! | ||
} | ||
|
||
start_dhcpd() { | ||
ip route add "${PREFIX}" via fe80::2 dev "${INTERFACE}" | ||
DHCPD_PIDFILE=$(mktemp) | ||
${DHCPD} -d -p "${DHCPD_PIDFILE}" "${INTERFACE}" "${PREFIX}" 2> /dev/null | ||
} | ||
|
||
start_radvd() { | ||
ADDR=$(echo "${PREFIX}" | sed -e 's/::\//::1\//') | ||
ip a a "${ADDR}" dev "${INTERFACE}" | ||
sysctl net.ipv6.conf."${INTERFACE}".accept_ra=2 | ||
sysctl net.ipv6.conf."${INTERFACE}".accept_ra_rt_info_max_plen=64 | ||
${RADVD} -c "${INTERFACE}" "${PREFIX}" | ||
} | ||
|
||
if [ "$1" = "-d" ] || [ "$1" = "--use-dhcpv6" ]; then | ||
USE_DHCPV6=1 | ||
shift 1 | ||
else | ||
USE_DHCPV6=0 | ||
fi | ||
|
||
if [ "$1" = "-r" ] || [ "$1" = "--use-radvd" ]; then | ||
USE_RADVD=1 | ||
shift 1 | ||
else | ||
USE_RADVD=0 | ||
fi | ||
|
||
PREFIX=$1 | ||
[ -z "${PREFIX}" ] && { | ||
echo "usage: $0 [-d|--use-dhcpv6] [-r|--use-radvd ] <prefix> [<serial-port>]" | ||
exit 1 | ||
} | ||
|
||
if [ -n "$2" ]; then | ||
PORT=$2 | ||
fi | ||
|
||
trap "cleanup" INT QUIT TERM EXIT | ||
|
||
setup_interface | ||
|
||
if [ ${USE_DHCPV6} -eq 1 ]; then | ||
DHCPD="$(readlink -f "${USB_CDC_ECM_DIR}/../dhcpv6-pd_ia/")/dhcpv6-pd_ia.py" | ||
start_dhcpd | ||
elif [ ${USE_RADVD} -eq 1 ]; then | ||
RADVD="$(readlink -f "${USB_CDC_ECM_DIR}/../radvd/")/radvd.sh" | ||
start_radvd | ||
else | ||
UHCPD="$(readlink -f "${USB_CDC_ECM_DIR}/../uhcpd/bin")/uhcpd" | ||
start_uhcpd | ||
fi | ||
|
||
if [ -z "${PORT}" ]; then | ||
echo "Network enabled over CDC-ECM" | ||
echo "Press Return to stop" | ||
read -r | ||
else | ||
"${USB_CDC_ECM_DIR}/../pyterm/pyterm" -p "${PORT}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
openssl genrsa -out ./data/ssl/certs/server.key 2048 | ||
openssl req -new -out ./data/ssl/certs/server.csr -key ./data/ssl/certs/server.key -config ./data/ssl/openssl.cnf | ||
openssl x509 -req -days 3650 -in ./data/ssl/certs/server.csr -signkey ./data/ssl/certs/server.key -out ./data/ssl/certs/server.crt -extensions v3_req -extfile ./data/ssl/openssl.cnf | ||
|
||
#openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./data/nginx.key -out ./data/ssl/nginx.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitkeep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDqDCCApCgAwIBAgIUR0OdADZcrVfEHXFeElxOzUNy8REwDQYJKoZIhvcNAQEL | ||
BQAwXzELMAkGA1UEBhMCREUxEDAOBgNVBAgMB0hhbWJ1cmcxEDAOBgNVBAcMB0hh | ||
bWJ1cmcxFzAVBgNVBAoMDlRlYW1hZ29jaGlASEFXMRMwEQYDVQQDDAp0ZWFtYWdv | ||
Y2hpMB4XDTI0MDcwMTA4NTAxNFoXDTM0MDYyOTA4NTAxNFowXzELMAkGA1UEBhMC | ||
REUxEDAOBgNVBAgMB0hhbWJ1cmcxEDAOBgNVBAcMB0hhbWJ1cmcxFzAVBgNVBAoM | ||
DlRlYW1hZ29jaGlASEFXMRMwEQYDVQQDDAp0ZWFtYWdvY2hpMIIBIjANBgkqhkiG | ||
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtfEFZYnTIue1nhW4fhLkKDi8HON9yfrzqFPy | ||
iDGQK04laAo/1VZoTvjtRJB0WwbH8jkG9pTz/07QCiLhQRoqHluJKr0vL8/qlNEB | ||
i7Ct0mNgnnFjQjjKN06j9wi5lM9LuHzBHDdou+UwGT0bAWdyxED6HS4t31ncviKq | ||
8P83TH+6u/3/RnEmQmHXRmNnfZwdZ3gsqJFvGUpTJlDS63THm1RcGI3WSBQt53fF | ||
sg7F+MIEH7i1dzWKYJqROU1HiasgP6yZaEicMn6UbQWMjijdHxiZqTSWfRU6Z8CO | ||
JB0ggigAXjdGzJRILkHPtjR7pSDqPRm49s3q6yfUZB43KhU81wIDAQABo1wwWjA5 | ||
BgNVHREEMjAwggwqLnRlYW1hZ29jaGmCDnRlYW1hZ29jaGkuZGV2ghAqLnRlYW1h | ||
Z29jaGkuZGV2MB0GA1UdDgQWBBT3+Qex8n7ofXOnKBWw9O9JNzt7zTANBgkqhkiG | ||
9w0BAQsFAAOCAQEAJNZ6A5cHqd4grUL/OZCE42vLpCP5WS3z4mvFTdJWx7lXk5Zu | ||
QnKHl2yPOb9AZL9FI4xLXTwUpNoSqAxv7cv4OJjdarHGAdNMDxDMkZgpbf70KxH7 | ||
fHoleM0NATLHwW+U4hM8gqcszzlXVbJqxw98wEXwTeClnxPmNSG/7/Hihaxdrdf8 | ||
L0nJN5ELRX6oLz9Lh8ZKIqiJ8bm0ZZcPcRC6wFXPr2MuNHIPnXaWSQPxaeE6wJ0D | ||
SIEHxYUtXbF52/cNUeVVeP8z61sefJX12+xNUC+0ftf6brRwFq5kvdkHRwDD6mcg | ||
BGSHIVaQinlzsdS+SjpGAykR9+j7JfRZKqiu0g== | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-----BEGIN CERTIFICATE REQUEST----- | ||
MIIC8DCCAdgCAQAwXzELMAkGA1UEBhMCREUxEDAOBgNVBAgMB0hhbWJ1cmcxEDAO | ||
BgNVBAcMB0hhbWJ1cmcxFzAVBgNVBAoMDlRlYW1hZ29jaGlASEFXMRMwEQYDVQQD | ||
DAp0ZWFtYWdvY2hpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtfEF | ||
ZYnTIue1nhW4fhLkKDi8HON9yfrzqFPyiDGQK04laAo/1VZoTvjtRJB0WwbH8jkG | ||
9pTz/07QCiLhQRoqHluJKr0vL8/qlNEBi7Ct0mNgnnFjQjjKN06j9wi5lM9LuHzB | ||
HDdou+UwGT0bAWdyxED6HS4t31ncviKq8P83TH+6u/3/RnEmQmHXRmNnfZwdZ3gs | ||
qJFvGUpTJlDS63THm1RcGI3WSBQt53fFsg7F+MIEH7i1dzWKYJqROU1HiasgP6yZ | ||
aEicMn6UbQWMjijdHxiZqTSWfRU6Z8COJB0ggigAXjdGzJRILkHPtjR7pSDqPRm4 | ||
9s3q6yfUZB43KhU81wIDAQABoEwwSgYJKoZIhvcNAQkOMT0wOzA5BgNVHREEMjAw | ||
ggwqLnRlYW1hZ29jaGmCDnRlYW1hZ29jaGkuZGV2ghAqLnRlYW1hZ29jaGkuZGV2 | ||
MA0GCSqGSIb3DQEBCwUAA4IBAQANgs+qxKQ1zTcM+sEV90kYE1e1fyH1lAKuk9Bm | ||
2/7YTLxGAryQSMfWsZgCKCT8FbGBGRTP6cC6O33Yk+7xYWDft23+sBJcZ350jeqC | ||
pBo3ChigkP5vutl5uyyp/n0T7BvoNqQazgQovBA/iWybP1RLg+PdLB2u8F0x7aDq | ||
otbI8odrlbkEAkDrADwvNdUI34HwXI+adNgLQdIQvDOKoablEAMUMxdmBnbKbfwt | ||
38YOmJnHddn/1Oj9g9xh/3/SxcwY1OsxIVbEu97fk8KUJDVdjTnWmk+vhCv0idhp | ||
ySF+rRQ6McyGLI6tzQvkPTOf9HyzVPABWjJx7AExWdijax4w | ||
-----END CERTIFICATE REQUEST----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC18QVlidMi57We | ||
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dWTDJjD4tzPV7Co16 | ||
+eZ8fwwTGQKBgQC4h8/Wn2kjeGmt0G/kGhT5Me4CUyawGSOYawU3JUWZnf+s+E6q | ||
5Vyi2dzpIZxfH9gLEJXMH2gwW7NhjeUtY74xw06Mg1Z1Vh6fMu2vm6Ax9/0Xn9da | ||
koxUvSD3YzhBmV3lqe0OMGUmqmAqeDSkE4a5l1C1y956awTRY0Qv0NGK9wKBgGnn | ||
GrFhK8+RmlokALMUF/sNpBMVW0O7YSoBVtRAZztfsnYqEfkg8So5GXwx1dBb1WrA | ||
P5ZuIIFpxJA+J1YBilxCdNp+fs68I08WpqGEVlMQSufhYZnJPSOtSGQ7TVzcRgpt | ||
KoCLO5csps8i8UFnFXyuxTy9r77wQO/+RD3ngMIpAoGBAMBmzNVEPj+9XY1Zd5k0 | ||
80PEBjZ+E9qsXTuyNorKPHeELKTQ6Ms6VUIsa9sU0COFO/y0XgYrbqyy/09N8hVs | ||
Fu/TtyiTiPtNCs43sBgjN8CRjsC+k+7HNA3AdCSGjx1APJC+woAeHngGnmgEplxj | ||
zYRxxM0+UwjyS3MDig8LneVl | ||
-----END PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[req] | ||
default_bits = 2048 | ||
distinguished_name = req_distinguished_name | ||
req_extensions = v3_req | ||
prompt = no | ||
[req_distinguished_name] | ||
countryName = DE | ||
stateOrProvinceName = Hamburg | ||
localityName = Hamburg | ||
organizationName = Teamagochi@HAW | ||
commonName = teamagochi | ||
[v3_req] | ||
subjectAltName = @alt_names | ||
[alt_names] | ||
DNS.1 = *.teamagochi | ||
DNS.2 = teamagochi.dev | ||
DNS.3 = *.teamagochi.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
echo $TEAMAGOCHI_TOKEN | docker login ghcr.io -u ozfox --password-stdin | ||
./mvnw install -Dquarkus.profile=prod,publish |
Oops, something went wrong.