Initial commit with HTTP/2 server

This commit is contained in:
agatha 2023-10-11 16:58:22 -04:00
commit 20ad22f595
8 changed files with 122 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
venv/
.idea/
__pycache__/
*.py[cod]

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# rr-dev
start http/2 enabled nginx server:
```
cd server
docker compose up -d
```
run poc:
```
# needs to be written first, lol
```

View File

@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDlTCCAn2gAwIBAgIUPwmCGNv4nrV6oyD+g2ytNnBX1IwwDQYJKoZIhvcNAQEL
BQAwWjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDETMBEGA1UEAwwKXWxvY2FsaG9zdDAe
Fw0yMzEwMTEyMDM1NDNaFw0yNDEwMTAyMDM1NDNaMFoxCzAJBgNVBAYTAkFVMRMw
EQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0
eSBMdGQxEzARBgNVBAMMCl1sb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQC2HHw9oD8BaY9P/XigRA5hjcIjRqDUgXKVq3wzxLfuAXzqSqiP
y4gc5T0LK0o/rtUkFFJxr6Err37fZJC/NYCaKlyME8viJN1KmlHPPc7oTpYSD/pt
ij9wOoMM3j/s7rpvKk5QFPb7OShTBlUcuf3XZRM6FQTyjRc2E1JdHotZgJ184XcN
e+GT+PMa3/OtI286NTJX4mV2kYxGyKfI8eVAr02TfGVMDzuhLjrdGQYUX/B/Rjwf
+YiTKRWFHY5BYWb4J7qtrRMgPBlgEeCAmRdGPyAKKaMcImMDH1vWx8y3GyczlrRC
/yUHBgmk8ZA9xrLJCs5d1FdwCPsedT4VCpmXAgMBAAGjUzBRMB0GA1UdDgQWBBT6
OMozbcW/m+XRa2g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2fE79u0=
-----END PRIVATE KEY-----

14
server/docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3'
services:
nginx:
image: nginx:latest
container_name: nginx-http2
ports:
- "80:80"
- "443:443"
volumes:
- ./certificates:/etc/nginx/certificates
- ./site:/usr/share/nginx/html
- ./nginx.conf:/etc/nginx/nginx.conf
command: [nginx-debug, '-g', 'daemon off;']

25
server/nginx.conf Normal file
View File

@ -0,0 +1,25 @@
events { }
http {
server {
listen 80;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
http2 on;
ssl_certificate /etc/nginx/certificates/server.crt;
ssl_certificate_key /etc/nginx/certificates/server.key;
location / {
root /usr/share/nginx/html;
index index.html;
}
}
}

15
server/site/index.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Example site</title>
</head>
<body>
<h1>Penis Pump</h1>
<h1>Penis Pump</h1>
<h1>Penis Pump</h1>
<h1>Penis Pump</h1>
<h1>Penis Pump</h1>
<h1>Penis Pump</h1>
<h1>Penis Pump</h1>
</body>
</html>

1
src/requirements.txt Normal file
View File

@ -0,0 +1 @@
httpx