From 585c82c576c46da26276cc2e9dbe75fcfd2609b3 Mon Sep 17 00:00:00 2001 From: prajnar123123213 Date: Thu, 5 Jun 2025 11:27:27 -0700 Subject: [PATCH 1/8] https://open-coding-society.github.io/ --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 9d80c99..33c98c2 100644 --- a/__init__.py +++ b/__init__.py @@ -17,7 +17,7 @@ login_manager.init_app(app) # Allowed servers for cross-origin resource sharing (CORS), these are GitHub Pages and localhost for GitHub Pages testing -cors = CORS(app, supports_credentials=True, origins=['http://localhost:8214', 'http://127.0.0.1:8214', 'https://nighthawkcoders.github.io']) +cors = CORS(app, supports_credentials=True, origins=['http://localhost:8214', 'http://127.0.0.1:8214', 'https://open-coding-society.github.io.com']) # System Defaults app.config['ADMIN_USER'] = os.environ.get('ADMIN_USER') or 'admin' From f47ba81a17c6c3314b999e01bed670f299f7dfc1 Mon Sep 17 00:00:00 2001 From: prajnar123123213 Date: Thu, 5 Jun 2025 11:42:42 -0700 Subject: [PATCH 2/8] changing file name and file --- datascience.stu | 28 ++++++++++++++++++++++++++++ nginx_file | 20 -------------------- 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 datascience.stu delete mode 100644 nginx_file diff --git a/datascience.stu b/datascience.stu new file mode 100644 index 0000000..5651049 --- /dev/null +++ b/datascience.stu @@ -0,0 +1,28 @@ +GNU nano 7.2 optivize.stu +server { + listen 80; + listen [::]:80; + server_name datascience.opencodingsociety.com; + + location / { + proxy_pass http://localhost:8214; + + # Make sure preflight OPTIONS requests are handled correctly + if ($request_method = OPTIONS) { + # Handle CORS preflight request by returning 204 (No Content) response + add_header "Access-Control-Allow-Origin" "https://open-coding-society.github.io" always; + add_header "Access-Control-Allow-Credentials" "true" always; + add_header "Access-Control-Allow-Methods" "GET, POST, PUT, DELETE, OPTIONS, HEAD" always; + add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept, x-origin" al> + return 204; + } + } +} + + + + + + + + diff --git a/nginx_file b/nginx_file deleted file mode 100644 index ebd0857..0000000 --- a/nginx_file +++ /dev/null @@ -1,20 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name datascience.opencodingsociety.com ; # Change server name to the one on R53 - # Configure CORS Headers - location / { - proxy_pass http://localhost:8214; # 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; - } - } -} \ No newline at end of file From 9d6546d318bb89f6eed10c7909a9f2acd17d3919 Mon Sep 17 00:00:00 2001 From: prajnar123123213 Date: Thu, 5 Jun 2025 11:43:23 -0700 Subject: [PATCH 3/8] dont need .com --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 33c98c2..66676dc 100644 --- a/__init__.py +++ b/__init__.py @@ -17,7 +17,7 @@ login_manager.init_app(app) # Allowed servers for cross-origin resource sharing (CORS), these are GitHub Pages and localhost for GitHub Pages testing -cors = CORS(app, supports_credentials=True, origins=['http://localhost:8214', 'http://127.0.0.1:8214', 'https://open-coding-society.github.io.com']) +cors = CORS(app, supports_credentials=True, origins=['http://localhost:8214', 'http://127.0.0.1:8214', 'https://open-coding-society.github.io']) # System Defaults app.config['ADMIN_USER'] = os.environ.get('ADMIN_USER') or 'admin' From 85fb8a828def420a0ffa6789bfb96529ce2decd2 Mon Sep 17 00:00:00 2001 From: prajnar123123213 Date: Thu, 5 Jun 2025 11:46:01 -0700 Subject: [PATCH 4/8] datascience stu --- datascience.stu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datascience.stu b/datascience.stu index 5651049..da67c4e 100644 --- a/datascience.stu +++ b/datascience.stu @@ -1,4 +1,4 @@ -GNU nano 7.2 optivize.stu +GNU nano 7.2 datascience.stu server { listen 80; listen [::]:80; From 16c0680ede3115a83a04da9eaae3a05516f8f947 Mon Sep 17 00:00:00 2001 From: prajnar123123213 Date: Thu, 5 Jun 2025 12:08:16 -0700 Subject: [PATCH 5/8] changing wroing datasciecne --- datascience.stu | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/datascience.stu b/datascience.stu index da67c4e..976ce90 100644 --- a/datascience.stu +++ b/datascience.stu @@ -1,19 +1,18 @@ -GNU nano 7.2 datascience.stu server { listen 80; listen [::]:80; - server_name datascience.opencodingsociety.com; + server_name flask.opencodingsociety.com; location / { proxy_pass http://localhost:8214; - # Make sure preflight OPTIONS requests are handled correctly + # Preflighted requests if ($request_method = OPTIONS) { - # Handle CORS preflight request by returning 204 (No Content) response - add_header "Access-Control-Allow-Origin" "https://open-coding-society.github.io" always; add_header "Access-Control-Allow-Credentials" "true" always; + add_header "Access-Control-Allow-Origin" "https://open-coding-society.github.io" always; add_header "Access-Control-Allow-Methods" "GET, POST, PUT, DELETE, OPTIONS, HEAD" always; - add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept, x-origin" al> + add_header "Access-Control-Allow-MaxAge" 600 always; + add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Origin, X-Requested-With, Content-Type, Accept" always; return 204; } } @@ -24,5 +23,3 @@ server { - - From 2796a6ef897ab3e5fc792cee282bd1101c3d5af1 Mon Sep 17 00:00:00 2001 From: prajnar123123213 Date: Thu, 5 Jun 2025 17:49:22 -0700 Subject: [PATCH 6/8] datascience.tstu --- datascience.stu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datascience.stu b/datascience.stu index 976ce90..da0f369 100644 --- a/datascience.stu +++ b/datascience.stu @@ -1,17 +1,17 @@ server { listen 80; listen [::]:80; - server_name flask.opencodingsociety.com; + server_name datascience.opencodingsociety.com; location / { proxy_pass http://localhost:8214; # Preflighted requests if ($request_method = OPTIONS) { - add_header "Access-Control-Allow-Credentials" "true" always; + # Handle CORS preflight request by returning 204 (No Content) response add_header "Access-Control-Allow-Origin" "https://open-coding-society.github.io" always; + add_header "Access-Control-Allow-Credentials" "true" always; add_header "Access-Control-Allow-Methods" "GET, POST, PUT, DELETE, OPTIONS, HEAD" always; - add_header "Access-Control-Allow-MaxAge" 600 always; add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Origin, X-Requested-With, Content-Type, Accept" always; return 204; } From 3fad714697243c66d34377b36c91a88ceec8167e Mon Sep 17 00:00:00 2001 From: Alex Rubio <150724751+AlexRubio1@users.noreply.github.com> Date: Fri, 6 Jun 2025 10:46:28 -0700 Subject: [PATCH 7/8] Update __init__.py --- __init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 66676dc..096e6bb 100644 --- a/__init__.py +++ b/__init__.py @@ -17,7 +17,12 @@ login_manager.init_app(app) # Allowed servers for cross-origin resource sharing (CORS), these are GitHub Pages and localhost for GitHub Pages testing -cors = CORS(app, supports_credentials=True, origins=['http://localhost:8214', 'http://127.0.0.1:8214', 'https://open-coding-society.github.io']) + +CORS(app, supports_credentials=True, origins=[ + 'http://localhost:8214', + 'http://127.0.0.1:8214', + 'https://open-coding-society.github.io' +]) # System Defaults app.config['ADMIN_USER'] = os.environ.get('ADMIN_USER') or 'admin' From a5241606b74dc572b5f71911c25d712877fbbf63 Mon Sep 17 00:00:00 2001 From: Alex Rubio <150724751+AlexRubio1@users.noreply.github.com> Date: Wed, 11 Jun 2025 13:19:34 -0700 Subject: [PATCH 8/8] Update datascience.stu --- datascience.stu | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/datascience.stu b/datascience.stu index c30cb8f..8edc00a 100644 --- a/datascience.stu +++ b/datascience.stu @@ -8,7 +8,12 @@ server { # Preflighted requests if ($request_method = OPTIONS) { - # Handle CORS preflight request by returning 204 (No Content) response - add_header "Access-Control-Allow-Origin" "https://open-coding-society.github.io" always; add_header "Access-Control-Allow-Credentials" "true" always; + add_header "Access-Control-Allow-Origin" "https://open-coding-society.github.io" always; add_header "Access-Control-Allow-Methods" "GET, POST, PUT, DELETE, OPTIONS, HEAD" always; + add_header "Access-Control-Allow-MaxAge" 600 always; + add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Origin, X-Requested-With, Content-Type, Accept" always; + return 204; + } + } +}