From 48b310c076eb28c2a4b76b702e9ae3c549041949 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 3 Jun 2025 21:56:45 +0200 Subject: [PATCH] first deploy --- compose.yaml | 4 -- nginx/nginx.conf | 26 +++-------- nginx/site/config.js | 2 +- nginx/site/html/minirt.html | 26 ++++++----- nginx/site/index.html | 87 ++----------------------------------- nginx/site/js/minirt.js | 27 +----------- 6 files changed, 26 insertions(+), 146 deletions(-) diff --git a/compose.yaml b/compose.yaml index bf0116f..1454c11 100644 --- a/compose.yaml +++ b/compose.yaml @@ -52,10 +52,6 @@ services: environment: - DISPLAY=:1 - ports: - - 6080:6080 - - 5901:5901 - networks: website_net: diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 082a1dc..077d60f 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -26,34 +26,17 @@ http { server { listen 80; listen [::]:80; + charset utf-8; - server_name localhost; - server_tokens off; - return 301 https://$host:5443$request_uri; - } - - server { - listen 443 ssl; - server_name localhost; - + server_name victorvobis.org www.victorvobis.org; root /var/www/html; - ssl_certificate /certs/localhost.pem; - ssl_certificate_key /certs/localhost-key.pem; - - # Apply connection limits limit_conn conn_limit_per_ip 2; location / { - root /var/www/html; index index.html index.htm; } - location /minirt/password { - add_header Content-Type application/json; - try_files /json/password.json =404; - } - location /minishell/vnc { proxy_pass http://minishell:8006/; proxy_http_version 1.1; @@ -64,6 +47,11 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } + location /minirt/password { + add_header Content-Type application/json; + try_files /json/password.json =404; + } + location /minirt/vnc { index vnc.html; try_files $uri $uri/ /vnc.html; diff --git a/nginx/site/config.js b/nginx/site/config.js index 2d54ba2..ad7a1c0 100644 --- a/nginx/site/config.js +++ b/nginx/site/config.js @@ -1,3 +1,3 @@ export const config = { - BASE_URL: 'https://localhost:5443/' + BASE_URL: 'https://victorvobis.org/' }; diff --git a/nginx/site/html/minirt.html b/nginx/site/html/minirt.html index fef7438..42dc699 100644 --- a/nginx/site/html/minirt.html +++ b/nginx/site/html/minirt.html @@ -27,6 +27,9 @@ Like the shell, this was part of the 42 curriculum, and was achieved within the same rules and constraints as the previous project.

+

+ Again, the source code for this project is availiable here +

This time, the assignment was to create a simple raytracer from scratch, using a custom wrapper around the linux X11 API, for simple window creation and I/O. @@ -34,12 +37,13 @@

A raytracer is a program that uses a technique called "raytracing", - which essentially means that we simulate looking at a scene from our "eye-position", and use the computer screen like a window through which we + which is a technique used to create realistic images digitaly. + Raytracing essentially means that we simulate looking at a scene from our "eye-position", and use the computer screen like a window through which we look at this scene.

Now, we imagine shooting a perfectly straight "ray" from our "eye" through each pixel of the screen, and trace that ray's path to see if it will - intersect with an object. If yes, we know that this specific pixel can display the color of the object that it hit. + intersect with an object. If yes, we know that this specific pixel should display the color of the object that it hit. We repeat this process for each pixel. Using some math to check for lighting, shadows from other objects, distance and more, we can determine a final color for each pixel, and with that create a remarkably realistic image from our scene.

@@ -59,17 +63,18 @@
  • Skybox
  • - This project was again a team effort, my teammate + This project was again a team effort, and my teammate Benjámin Szilas - was very effective at implementing a lot of the math formulas. - He is responsible for a lot of the tracing functions, he implemented shadows, reflection, light-dispersion, anti-aliasing and much more, - whereas I prefered to work on the I/O focused parts like the menus, scene manipulation, file explorer and so on.
    - I had a lot of fun with this project, and learned a lot about working as a team, graphical programming and (some) maths! + implemented a lot of functionality and features which where essential to the project. + He is responsible for a lot of the tracing functions, and implemented features like shadows, mirrors, phong-reflection, multiple lights, anti-aliasing and much more.

    - As a final note: since we finished the project, and I was planning on showcasing it here, I have reimplemented the graphical part to use + I had a lot of fun with this project, and learned a lot about graphical programming, working as a team and (some) maths! +

    +

    + As a final note: since we finished the project, I was planning on showcasing it here, and so I have reimplemented the graphical part to use Raylib - since it seemed more future proof to use. + since it seemed more appropriate to use.

    Again, I have provided a live version below, feel free to play around in it! @@ -95,9 +100,6 @@

    diff --git a/nginx/site/index.html b/nginx/site/index.html index 0e9a94b..f7631dc 100644 --- a/nginx/site/index.html +++ b/nginx/site/index.html @@ -19,90 +19,9 @@
    -

    The Shell

    -
    -

    - The minishell project is part of the common core curriculum at ecole42 and - is seen as a milestone and one of the biggest jumps in complexity on the way to completing the cursus. -

    -

    - The rules are simple: Create a program that will replicate basic shell behaviour like typically found on posix systems. -

    -

    - Some of the requirements are: -

    -
      -
    • Command line parsing
    • -
    • I/O loop to accept continuous commands
    • -
    • Command execution
    • -
    • File Descriptor redirection
    • -
    • Pipe Operators
    • -
    • Heredoc
    • -
    • Logical AND ( && )
    • -
    • Logical OR ( || )
    • -
    • and more...
    • -
    -

    - The program has to be written in C, we are working on GNU/Linux machines. -

    -

    - We are also required to follow a very strict norm on which you can read more - here. -

    -

    - What makes the 42 projects stand out in my opinon is that the tools we use are very restricted, essentially only allowing - syscalls to interface with the kernel, some utility functions and memory functions, and in this case we were allowed to use - printf, which is normally forbidden. - This means that all utilty has to be implemented by hand, and all relevant code will be written by the projects authors. -

    -

    - We also could use the readline function used in bash to handle the input of the user.
    - Since memory leaks of any kind are considered an unrecoverable mistake when validating a project, and the readline function would - inevitably leak memory, those leaks were explicitly tolerated by the projects requirements. -

    -

    - But, out of cursiousity, we decided to recreate the readline function, removing the dependecy and leaks from our project, - and learing a lot on the way.
    - In my opinion, this is arguably the most interesting part of our implementation, and I very much enjoyed it! -

    -

    - This project was a team effort, and big thanks go out to my team partner
    and good friend, - Andrej Arama! -

    - -

    - The source code for the project can be seen on my - git server and - I have also provided a live version of the shell found below. -

    -
    - -
    -
    -
    -

    - After trying out the shell, feel free to check out my other projects! -

    - Next Project... -
    +

    + Welcome to my Website! Get Started... +

    - - diff --git a/nginx/site/js/minirt.js b/nginx/site/js/minirt.js index ec29157..874a371 100644 --- a/nginx/site/js/minirt.js +++ b/nginx/site/js/minirt.js @@ -36,7 +36,7 @@ get_passwd.addEventListener('click', function() { const passwd_display = document.getElementById('minirt-password-display'); passwd_display.textContent = `Password: ${data.password}`; }); - } catch (c) { + } catch (e) { console.error(e); } }) @@ -55,25 +55,9 @@ minirt_button.addEventListener('click', function() { screen.id = 'screen'; canvas_background.appendChild(screen); - let rfb; let desktopName; - // When this function is called we have - // successfully connected to a server - function connectedToServer(e) { - status("Connected to " + desktopName); - } - - // This function is called when we are disconnected - function disconnectedFromServer(e) { - if (e.detail.clean) { - status("Disconnected"); - } else { - status("Something went wrong, connection is closed"); - } - } - // When this function is called, the server requires // credentials to authenticate function credentialsAreRequired(e) { @@ -88,11 +72,6 @@ minirt_button.addEventListener('click', function() { desktopName = e.detail.name; } - // Show a status text in the top bar - function status(text) { - document.getElementById('status').textContent = text; - } - // This function extracts the value of one variable from the // query string. If the variable isn't defined in the URL // it returns the default value instead. @@ -124,8 +103,6 @@ minirt_button.addEventListener('click', function() { // | | | Connect | | | // v v v v v v - status("Connecting"); - // Build the websocket URL used to connect let url; if (window.location.protocol === "https:") { @@ -144,8 +121,6 @@ minirt_button.addEventListener('click', function() { { credentials: { password: password } }); // Add listeners to important events from the RFB module - rfb.addEventListener("connect", connectedToServer); - rfb.addEventListener("disconnect", disconnectedFromServer); rfb.addEventListener("credentialsrequired", credentialsAreRequired); rfb.addEventListener("desktopname", updateDesktopName);