Browse Source

Adding license

Andrej Studen 2 weeks ago
commit
163dc468a8

+ 8 - 0
LICENSE

@@ -0,0 +1,8 @@
+Copyright 2025, Andrej Studen 
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+

+ 4 - 0
bin/envRproxy.sh.sample

@@ -0,0 +1,4 @@
+export COMPOSE=$HOME/rproxyDocker/config/rproxy-compose.yaml
+export CONTAINER_NAME=rproxy
+export NETWORK=docker_network
+export DOCKERCOMPOSE="docker compose"

+ 5 - 0
bin/reloadRproxy.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+. $(dirname $0)/envRproxy.sh
+docker exec ${CONTAINER_NAME} nginx -t
+docker exec ${CONTAINER_NAME} nginx -s reload

+ 5 - 0
bin/startNetwork.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+. $(dirname $0)/envRproxy.sh
+docker network create -d bridge --subnet=172.18.0.0/24 --ip-range=172.18.0.0/24 $NETWORK
+

+ 5 - 0
bin/startRproxy.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+. $(dirname $0)/envRproxy.sh
+$DOCKERCOMPOSE -f $COMPOSE up -d
+

+ 5 - 0
bin/stopNetwork.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+. $(dirname $0)/envRproxy.sh
+docker network rm $NETWORK
+

+ 5 - 0
bin/stopRproxy.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+. $(dirname $0)/envRproxy.sh
+$DOCKERCOMPOSE -f $COMPOSE down
+

+ 65 - 0
config/conf.d/default.conf

@@ -0,0 +1,65 @@
+upstream xlabkey{
+  server labkey-web:8080;
+}
+
+#HTTP -> redirect
+#server {
+#    listen       80;
+#    listen  [::]:80;
+#    server_name merlin.fmf.uni-lj.si;
+#    return 301 https://$host$request_uri;
+#}
+
+
+
+
+#HTTPS
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl; 
+    server_name localhost;
+
+    charset utf-8;
+    keepalive_timeout 5;
+    
+    #SSL
+    ssl_certificate /var/www/localhostBundle.crt;
+    ssl_certificate_key /var/www/localhost.key;
+    ssl_session_timeout 1d;
+    ssl_session_cache shared:SSL:50m;
+    ssl_session_tickets off;
+
+    ssl_verify_client on;
+    ssl_client_certificate /var/www/NIXLJU-CA_chain.crt;
+
+    #Hardening
+    # Accepted protocols and ciphers
+    #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+    ssl_protocols TLSv1.2;
+    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
+    ssl_prefer_server_ciphers on;
+
+    add_header Strict-Transport-Security "max-age=15768000"; # 6 months
+  
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+    
+#    location /{
+#	root /var/www/landing;	
+#    }
+    location /{
+	proxy_pass http://labkey-web:8080/;
+#	proxy_redirect http://labkey-web:8080/ https://merlin.fmf.uni-lj.si/;
+#	proxy_redirect https://xlabkey/ https://merlin.fmf.uni-lj.si/;
+#	proxy_set_header Host $proxy_host;
+#	proxy_set_header X-Real-IP $remote_addr;
+#	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+#	proxy_set_header X-Forwarded-Proto $scheme;
+	#client_max_body_size 0;
+    }
+    #
+
+}
+

+ 56 - 0
config/conf.d/invenio.conf.off

@@ -0,0 +1,56 @@
+#Copy invenio stuff directly to rproxy to avoid multiple forwarding and associated confusion
+#In essence, rproxy replaces invenion frontend
+
+upstream frontend {
+  server frontend:443;
+#could add more servers for load balancing
+}
+
+#HTTP -> redirect
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name invenio.fmf.uni-lj.si;
+    return 301 https://$host$request_uri;
+}
+
+
+#HTTPS
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl; 
+    server_name invenio.fmf.uni-lj.si;
+
+    charset utf-8;
+    keepalive_timeout 5;
+    
+    #SSL
+    ssl_certificate /var/www/invenioBundle.crt;
+    ssl_certificate_key /var/www/invenio.key;
+    ssl_session_timeout 1d;
+    ssl_session_cache shared:SSL:50m;
+    ssl_session_tickets off;
+
+    #Hardening
+    # Accepted protocols and ciphers
+    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
+    ssl_prefer_server_ciphers on;
+
+    add_header Strict-Transport-Security "max-age=15768000"; # 6 months
+  
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+
+    location /{
+	proxy_ssl_trusted_certificate /var/www/NIXLJU-CA_chain.crt;
+	proxy_pass https://frontend;
+	proxy_redirect https://frontend https://invenio.fmf.uni-lj.si;
+    }
+    #no heroics. Since frontend is a virtual server, use http
+    #I believe there is an https redirect as deep as the uiwsg web-ui engine, hence SSL must be maintained
+
+}
+

+ 59 - 0
config/conf.d/labkey-students.conf.off

@@ -0,0 +1,59 @@
+#Copy invenio stuff directly to rproxy to avoid multiple forwarding and associated confusion
+#In essence, rproxy replaces invenion frontend
+
+upstream labkey {
+  server labkey-web-students:8080;
+#could add more servers for load balancing
+}
+
+#HTTP -> redirect
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name labkey-klimt-local-students.fmf.uni-lj.si;
+    return 301 https://$host$request_uri;
+}
+
+
+#HTTPS
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl; 
+    server_name labkey-klimt-local-students.fmf.uni-lj.si;
+
+    charset utf-8;
+    keepalive_timeout 5;
+    
+    #SSL
+    ssl_certificate /var/www/labkey-klimt-local-studentsBundle.crt;
+    ssl_certificate_key /var/www/labkey-klimt-local-students.key;
+    ssl_session_timeout 1d;
+    ssl_session_cache shared:SSL:50m;
+    ssl_session_tickets off;
+
+    #Hardening
+    # Accepted protocols and ciphers
+    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
+    ssl_prefer_server_ciphers on;
+
+    add_header Strict-Transport-Security "max-age=15768000"; # 6 months
+  
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+
+    location /{
+	proxy_ssl_trusted_certificate /var/www/NIXLJU-CA_chain.crt;
+	proxy_pass http://labkey/;
+	#proxy_redirect http://labkey/ https://labkey-klimt-local.fmf.uni-lj.si/;
+	proxy_redirect http://labkey/ https://klimt.fmf.uni-lj.si/;
+ 	#proxy_set_header Host $host;	
+	client_max_body_size 0;
+    }
+    #no heroics. Since frontend is a virtual server, use http
+    #I believe there is an https redirect as deep as the uiwsg web-ui engine, hence SSL must be maintained
+
+}
+

+ 59 - 0
config/conf.d/labkey.conf.off

@@ -0,0 +1,59 @@
+#Copy invenio stuff directly to rproxy to avoid multiple forwarding and associated confusion
+#In essence, rproxy replaces invenion frontend
+
+upstream labkey {
+  server labkey-web:8080;
+#could add more servers for load balancing
+}
+
+#HTTP -> redirect
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name labkey-klimt-local.fmf.uni-lj.si;
+    return 301 https://$host$request_uri;
+}
+
+
+#HTTPS
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl; 
+    server_name labkey-klimt-local.fmf.uni-lj.si;
+
+    charset utf-8;
+    keepalive_timeout 5;
+    
+    #SSL
+    ssl_certificate /var/www/labkey-klimt-localBundle.crt;
+    ssl_certificate_key /var/www/labkey-klimt-local.key;
+    ssl_session_timeout 1d;
+    ssl_session_cache shared:SSL:50m;
+    ssl_session_tickets off;
+
+    #Hardening
+    # Accepted protocols and ciphers
+    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
+    ssl_prefer_server_ciphers on;
+
+    add_header Strict-Transport-Security "max-age=15768000"; # 6 months
+  
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+
+    location /{
+	proxy_ssl_trusted_certificate /var/www/NIXLJU-CA_chainOld.crt;
+	proxy_pass http://labkey/;
+	#proxy_redirect http://labkey/ https://labkey-klimt-local.fmf.uni-lj.si/;
+	proxy_redirect http://labkey/ https://klimt.fmf.uni-lj.si/;
+ 	#proxy_set_header Host $host;	
+	client_max_body_size 0;
+    }
+    #no heroics. Since frontend is a virtual server, use http
+    #I believe there is an https redirect as deep as the uiwsg web-ui engine, hence SSL must be maintained
+
+}
+

+ 3 - 0
config/conf.d/log.conf

@@ -0,0 +1,3 @@
+#log_format  custom '[$time_local] C remote=$remote_addr request:"$request" status:$status headers [origin=$http_origin, host=$http_host, x_request_id=$http_x_request_id,referrer=$http_referrer] ';
+log_format  custom '[$time_local] C remote=$remote_addr scheme: $scheme request:"$request" status:$status headers [origin=$http_origin, host=$http_host, referrer=$http_referrer] proxy [host=$proxy_host] sent [location=$sent_http_location]';
+access_log /var/log/nginx/access.log custom;

+ 56 - 0
config/conf.d/orthanc.conf.off

@@ -0,0 +1,56 @@
+#Copy invenio stuff directly to rproxy to avoid multiple forwarding and associated confusion
+#In essence, rproxy replaces invenion frontend
+
+upstream orthanc {
+  server orthanc-tps:8042;
+#could add more servers for load balancing
+}
+
+#HTTP -> redirect
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name orthanc-klimt-local.fmf.uni-lj.si;
+    return 301 https://$host$request_uri;
+}
+
+
+#HTTPS
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl; 
+    server_name orthanc-klimt-local.fmf.uni-lj.si;
+
+    charset utf-8;
+    keepalive_timeout 5;
+    
+    #SSL
+    ssl_certificate /var/www/orthanc-klimt-localBundle.crt;
+    ssl_certificate_key /var/www/orthanc-klimt-local.key;
+    ssl_session_timeout 1d;
+    ssl_session_cache shared:SSL:50m;
+    ssl_session_tickets off;
+
+    #Hardening
+    # Accepted protocols and ciphers
+    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
+    ssl_prefer_server_ciphers on;
+
+    add_header Strict-Transport-Security "max-age=15768000"; # 6 months
+  
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+
+    location /{
+	proxy_ssl_trusted_certificate /var/www/NIXLJU-CA_chainOld.crt;
+	proxy_pass http://orthanc/;
+	proxy_redirect http://orthanc/ https://orthanc-klimt-local.fmf.uni-lj.si/;
+	client_max_body_size 0;
+    }
+    #no heroics. Since frontend is a virtual server, use http
+
+}
+

BIN
config/logo.png


+ 16 - 0
config/rproxy-compose.yaml

@@ -0,0 +1,16 @@
+
+services:
+  nginxrp:
+    image: nginx
+    container_name: rproxy
+    ports:
+      - "80:80"
+      - "443:443"
+    volumes:
+      - ./conf.d:/etc/nginx/conf.d
+      - /home/rproxy/rproxyDocker/www:/var/www
+
+networks:
+  default:
+    name: docker_network
+    external: true

+ 8 - 0
www/landing/index.html

@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+	<body>
+		<h3> This is a [new landing] test page</h3>
+
+		<p>Some text</p>
+	</body>
+</html>