From 596663724a27db829c6b88267d4fb96b739475f7 Mon Sep 17 00:00:00 2001 From: joseph Date: Mon, 18 Dec 2023 00:18:04 +0000 Subject: [PATCH] added config file for auth on nginx --- auth/Gemfile | 2 +- auth/Gemfile.lock | 2 ++ auth/initialize_database.rb | 6 +++--- nginx/conf.d/auth.roysathome.net.conf | 9 +++++++++ 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 nginx/conf.d/auth.roysathome.net.conf diff --git a/auth/Gemfile b/auth/Gemfile index a500af4..73dc180 100644 --- a/auth/Gemfile +++ b/auth/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby '3.0.2' +ruby '3.2.2' #ruby '2.6.10' gem 'sinatra' diff --git a/auth/Gemfile.lock b/auth/Gemfile.lock index 6ecbd40..bc124c3 100644 --- a/auth/Gemfile.lock +++ b/auth/Gemfile.lock @@ -19,11 +19,13 @@ GEM rack-protection (= 3.1.0) tilt (~> 2.0) sqlite3 (1.6.9-x64-mingw-ucrt) + sqlite3 (1.6.9-x86_64-linux) tilt (2.3.0) webrick (1.8.1) PLATFORMS x64-mingw-ucrt + x86_64-linux DEPENDENCIES bcrypt diff --git a/auth/initialize_database.rb b/auth/initialize_database.rb index 6ded23b..cc40deb 100644 --- a/auth/initialize_database.rb +++ b/auth/initialize_database.rb @@ -9,21 +9,21 @@ def initialize_database file_path = DATA_LOCATION + FILE_STORAGE_LOCATION puts "Checking if directory '#{DATA_LOCATION}' exists." - unless Dir.exist(DATA_LOCATION) + unless Dir.exist?(DATA_LOCATION) puts "Directory '#{DATA_LOCATION}' does not exist." Dir.mkdir(DATA_LOCATION) puts "Directory '#{DATA_LOCATION}' created successfully." end puts "Checking if directory '#{database_path}' exists." - unless Dir.exist(database_path) + unless Dir.exist?(database_path) puts "Directory '#{database_path}' does not exist." Dir.mkdir(database_path) puts "Directory '#{database_path}' created successfully." end puts "Checking if directory '#{file_path}' exists." - unless Dir.exist(file_path) + unless Dir.exist?(file_path) puts "Directory '#{file_path}' does not exist." Dir.mkdir(file_path) puts "Directory '#{file_path}' created successfully." diff --git a/nginx/conf.d/auth.roysathome.net.conf b/nginx/conf.d/auth.roysathome.net.conf new file mode 100644 index 0000000..5fd6b8e --- /dev/null +++ b/nginx/conf.d/auth.roysathome.net.conf @@ -0,0 +1,9 @@ +server { + server_name auth.roysathome.net; + location / { + set $backend http://127.0.0.1:47706; + proxy_pass $backend; + proxy_set_header Host git.roysathome.net; #$host; + proxy_set_header X-Forwarded-Proto https; + } +}