diff --git a/content/_meta.js b/content/_meta.js index 3210cc9..adbdd38 100644 --- a/content/_meta.js +++ b/content/_meta.js @@ -24,97 +24,182 @@ export default { } }, }, + /* Load link with relative path */ + Math3200_link: { + title: 'Math 3200', + href: '/Math3200' + }, + Math429_link: { + title: 'Math 429', + href: '/Math429' + }, + Math4111_link: { + title: 'Math 4111', + href: '/Math4111' + }, + Math4121_link: { + title: 'Math 4121', + href: '/Math4121' + }, + Math4201_link: { + title: 'Math 4201', + href: '/Math4201' + }, + Math416_link: { + title: 'Math 416', + href: '/Math416' + }, + Math401_link: { + title: 'Math 401', + href: '/Math401' + }, + CSE332S_link: { + title: 'CSE 332S', + href: '/CSE332S' + }, + CSE347_link: { + title: 'CSE 347', + href: '/CSE347' + }, + CSE442T_link: { + title: 'CSE 442T', + href: '/CSE442T' + }, + CSE5313_link: { + title: 'CSE 5313', + href: '/CSE5313' + }, + CSE510_link: { + title: 'CSE 510', + href: '/CSE510' + }, + CSE559A_link: { + title: 'CSE 559A', + href: '/CSE559A' + }, + CSE5519_link: { + title: 'CSE 5519', + href: '/CSE5519' + }, /* Math Courses Start */ Math3200: { + display: 'hidden', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, Math429:{ + display: 'hidden', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, Math4111: { + display: 'hidden', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, Math4121: { + display: 'hidden', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, Math4201: { + display: 'hidden', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, Math416: { + display: 'hidden', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, Math401: { + display: 'hidden', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, /* Math Courses End */ /* CSE Courses Start */ CSE332S: { + display: 'hidden', title: 'CSE332S', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, CSE347: { + display: 'hidden', title: 'CSE347', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, CSE442T: { + display: 'hidden', title: 'CSE442T', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, CSE5313: { + display: 'hidden', title: 'CSE5313', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, CSE510: { + display: 'hidden', title: 'CSE510', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, CSE559A: { + display: 'hidden', title: 'CSE559A', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, CSE5519: { + display: 'hidden', title: 'CSE5519', type: 'page', theme:{ + sidebar: false, timestamp: true, } }, diff --git a/docker/cse/Dockerfile b/docker/cse/Dockerfile index a39da3d..b448e08 100644 --- a/docker/cse/Dockerfile +++ b/docker/cse/Dockerfile @@ -66,8 +66,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static USER nextjs -EXPOSE 4201 +EXPOSE 4200 -ENV PORT=4201 +ENV PORT=4200 CMD HOSTNAME="0.0.0.0" node server.js \ No newline at end of file diff --git a/docker/docker-compose-rebuild.sh b/docker/docker-compose-rebuild.sh new file mode 100644 index 0000000..9c43271 --- /dev/null +++ b/docker/docker-compose-rebuild.sh @@ -0,0 +1 @@ +docker compose -f docker/docker-compose.yaml up -d --build notenextra-math notenextra-cse \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index a2ad87e..80f35b9 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -1,3 +1,5 @@ +name: notenextra + services: # you may need to update relative directories if you move this file # default created directories is /docker/docker-compose.yaml @@ -9,7 +11,7 @@ services: - trance0/notenextra-math:latest restart: on-failure:5 ports: - - 13001:4201 + - 13001:4200 notenextra-cse: build: context: ../ @@ -18,11 +20,11 @@ services: - trance0/notenextra-cse:latest restart: on-failure:5 ports: - - 13002:4202 + - 13002:4200 nginx: image: nginx:latest ports: - - 13000:80 + - 13003:80 volumes: - ./nginx.conf:/etc/nginx/nginx.conf depends_on: diff --git a/docker/math/Dockerfile b/docker/math/Dockerfile index 9c4e37c..f6e4177 100644 --- a/docker/math/Dockerfile +++ b/docker/math/Dockerfile @@ -66,8 +66,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static USER nextjs -EXPOSE 4201 +EXPOSE 4200 -ENV PORT=4201 +ENV PORT=4200 CMD HOSTNAME="0.0.0.0" node server.js \ No newline at end of file diff --git a/docker/nginx.conf b/docker/nginx.conf index 7240c14..3ba3421 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -1,23 +1,84 @@ # Example for conf.d/default.conf +user www-data; +worker_processes 1; + +error_log /var/log/nginx/error.log; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + + upstream notenextra-math { + server notenextra-math:4200; + } + + upstream notenextra-cse { + server notenextra-cse:4200; + } + + include /etc/nginx/mime.types; + + # add extra types + + types { + text/javascript mjs; + } + + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + server { listen 80; server_name localhost; - location /Math* { - proxy_pass http://notenextra-math:4201; + rewrite ^/.well-known/carddav /remote.php/dav/ permanent; + rewrite ^/.well-known/caldav /remote.php/dav/ permanent; + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + location ~ ^/(build|tests|config|lib|3rdparty|templates|data)/ { + deny all; + } + + location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { + deny all; + } + + location ~ ^/Math(.*)$ { + proxy_pass http://notenextra-math/$1; proxy_set_header Host $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; } - location /CSE* { - proxy_pass http://notenextra-cse:4202; + location ~ ^/CSE(.*)$ { + proxy_pass http://notenextra-cse/$1; proxy_set_header Host $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; } + location / { + proxy_pass http://notenextra-cse; + proxy_set_header Host $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; + } - } \ No newline at end of file + } +} \ No newline at end of file diff --git a/next.config.mjs b/next.config.mjs index 23dbd85..641b162 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -24,11 +24,11 @@ export default bundleAnalyzer(withNextra({ eslint: { ignoreDuringBuilds: true, }, - experimental: { - webpackMemoryOptimizations: true, - staticGenerationMaxConcurrency: 2, // try 1–3, default is 8 - staticGenerationMinPagesPerWorker: 1 // keep small, default is 25 - } + // experimental: { + // webpackMemoryOptimizations: true, + // staticGenerationMaxConcurrency: 2, // try 1–3, default is 8 + // staticGenerationMinPagesPerWorker: 1 // keep small, default is 25 + // } })) // If you have other Next.js configurations, you can pass them as the parameter: