aidenhuynh / Epic_CSA

MIT License
0 stars 0 forks source link

1/30 - Deployment Pop Quiz #1

Open aidenhuynh opened 7 months ago

aidenhuynh commented 7 months ago

Total Score: 3.55/4

aidenhuynh commented 7 months ago

Reverse proxy:

Describe the server name definition and the proxy paths definition in our reverse proxy configuration file

These terms can be found in this code example

server {
   listen 80;
    listen [::]:80;
    server_name -----.stu.nighthawkcodingsociety.com ; # Change server name to the one on R53
    # Configure CORS Headers
    location / { 
        proxy_pass http://localhost:8---; # Change port to port on docker
        # Simple requests
        if ($request_method ~* "(GET|POST|PUT|DELETE)") { # Customize Request methods based on your needs
                add_header "Access-Control-Allow-Origin"  *;
        }
        # Preflighted requests 
        if ($request_method = OPTIONS ) {
                add_header "Access-Control-Allow-Origin"  
                add_header "Access-Control-Allow-Methods" "GET, POST, PUT, DELETE, OPTIONS, HEAD"; # Make sure the request methods above match here
                add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept";
                return 200;
        }
    }
}

Server name defines the domain we want to use

Proxy pass forwards the request, in this case to the local backend on the aws machine, which is where the backend is being run.

Score: 0.9

aidenhuynh commented 7 months ago

JWT

Show a JWT login process, split browser screen to show a page with authentication and shows a cookie

Screen Shot 2024-01-30 at 11 53 35 AM

Update: JWT.io

Screen Shot 2024-01-31 at 12 22 24 PM

Score: 0.85

aidenhuynh commented 7 months ago

Security Configuration Rules

Request matchers that shows a permit and one that shows authentication required.

Screen Shot 2024-01-31 at 12 23 47 PM

Permissions for Admin include deleting other users

Score 0.9

aidenhuynh commented 7 months ago

POJO

Show POJO changes in VSCode and with Postman

Screen Shot 2024-01-31 at 12 24 31 PM

You can change parts of the init to see changes in the sqlite database Screen Shot 2024-01-30 at 12 09 07 PM

Score: 0.85

aidenhuynh commented 7 months ago

Docker Process

Sequence of commands required for an application update

  1. Open your repo with cd repo_name (assuming you're already in deployments)
  2. Stop running old container with docker-compose down
  3. Pull your updated repository with git pull
  4. Rebuild container with docker-compose up -d --build
  5. docker ps to check

Screen Shot 2024-01-30 at 12 21 17 PM

Score: 0.9